001    /*
002     * Copyright 2009-2016 UnboundID Corp.
003     * All Rights Reserved.
004     */
005    /*
006     * Copyright (C) 2009-2016 UnboundID Corp.
007     *
008     * This program is free software; you can redistribute it and/or modify
009     * it under the terms of the GNU General Public License (GPLv2 only)
010     * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011     * as published by the Free Software Foundation.
012     *
013     * This program is distributed in the hope that it will be useful,
014     * but WITHOUT ANY WARRANTY; without even the implied warranty of
015     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016     * GNU General Public License for more details.
017     *
018     * You should have received a copy of the GNU General Public License
019     * along with this program; if not, see <http://www.gnu.org/licenses>.
020     */
021    package com.unboundid.ldap.protocol;
022    
023    
024    
025    import com.unboundid.ldap.sdk.Control;
026    import com.unboundid.util.InternalUseOnly;
027    import com.unboundid.util.NotExtensible;
028    import com.unboundid.util.ThreadSafety;
029    import com.unboundid.util.ThreadSafetyLevel;
030    
031    
032    
033    /**
034     * This interface serves as a marker for classes in the
035     * {@code com.unboundid.ldap.sdk} package that are responses which may be
036     * received from a directory server.
037     *
038     */
039    @InternalUseOnly()
040    @NotExtensible()
041    @ThreadSafety(level=ThreadSafetyLevel.INTERFACE_NOT_THREADSAFE)
042    public interface LDAPResponse
043    {
044      /**
045       * An empty set of controls.
046       */
047      Control[] NO_CONTROLS = new Control[0];
048    
049    
050    
051      /**
052       * Retrieves the message ID for the LDAP message containing this response.
053       *
054       * @return  The message ID for the LDAP message containing this response.
055       */
056      int getMessageID();
057    
058    
059    
060      /**
061       * Appends a string representation of this LDAP response to the provided
062       * buffer.
063       *
064       * @param  buffer  The buffer to which the information should be appended.
065       */
066      void toString(final StringBuilder buffer);
067    }