org.apache.directory.shared.ldap.message.extended
Class NoticeOfDisconnect

java.lang.Object
  extended byorg.apache.directory.shared.ldap.message.AbstractMessage
      extended byorg.apache.directory.shared.ldap.message.AbstractResponse
          extended byorg.apache.directory.shared.ldap.message.AbstractResultResponse
              extended byorg.apache.directory.shared.ldap.message.ExtendedResponseImpl
                  extended byorg.apache.directory.shared.ldap.message.extended.NoticeOfDisconnect
All Implemented Interfaces:
ExtendedResponse, javax.naming.ldap.ExtendedResponse, Message, Response, ResultResponse, java.io.Serializable

public class NoticeOfDisconnect
extends ExtendedResponseImpl

An extended operation intended for notifying clients of upcoming disconnection. Here's what RFC 2251 has to say about it:

  Section 4.1.1 (Small snippet on sending NoD)
  
     If the server receives a PDU from the client in which the LDAPMessage
     SEQUENCE tag cannot be recognized, the messageID cannot be parsed,
     the tag of the protocolOp is not recognized as a request, or the
     encoding structures or lengths of data fields are found to be
     incorrect, then the server MUST return the notice of disconnection
     described in section 4.4.1, with resultCode protocolError, and
     immediately close the connection. In other cases that the server
     cannot parse the request received by the client, the server MUST
     return an appropriate response to the request, with the resultCode
     set to protocolError.
     
  ...   
     
  4.4. Unsolicited Notification
  
     An unsolicited notification is an LDAPMessage sent from the server to
     the client which is not in response to any LDAPMessage received by
     the server. It is used to signal an extraordinary condition in the
     server or in the connection between the client and the server.  The
     notification is of an advisory nature, and the server will not expect
     any response to be returned from the client.
  
     The unsolicited notification is structured as an LDAPMessage in which
     the messageID is 0 and protocolOp is of the extendedResp form.  The
     responseName field of the ExtendedResponse is present. The LDAPOID
     value MUST be unique for this notification, and not be used in any
     other situation.
  
     One unsolicited notification is defined in this document.
  
  4.4.1. Notice of Disconnection
  
     This notification may be used by the server to advise the client that
     the server is about to close the connection due to an error
     condition. Note that this notification is NOT a response to an
     unbind requested by the client: the server MUST follow the procedures
     of section 4.3. This notification is intended to assist clients in
     distinguishing between an error condition and a transient network
     failure. As with a connection close due to network failure, the
     client MUST NOT assume that any outstanding requests which modified
     the directory have succeeded or failed.
  
     The responseName is 1.3.6.1.4.1.1466.20036, the response field is
     absent, and the resultCode is used to indicate the reason for the
     disconnection.
  
     The following resultCode values are to be used in this notification:
  
     - protocolError: The server has received data from the client in
       which the LDAPMessage structure could not be parsed.
  
     - strongAuthRequired: The server has detected that an established
       underlying security association protecting communication between
       the client and server has unexpectedly failed or been compromised.
  
     - unavailable: This server will stop accepting new connections and
       operations on all existing connections, and be unavailable for an
       extended period of time. The client may make use of an alternative
       server.
  
     After sending this notice, the server MUST close the connection.
     After receiving this notice, the client MUST NOT transmit any further
     on the connection, and may abruptly close the connection.
 

Version:
$Rev: 379008 $
Author:
Apache Directory Project
See Also:
Serialized Form

Field Summary
static java.lang.String EXTENSION_OID
           
static NoticeOfDisconnect PROTOCOLERROR
           
static NoticeOfDisconnect STRONGAUTHREQUIRED
           
static NoticeOfDisconnect UNAVAILABLE
           
 
Fields inherited from class org.apache.directory.shared.ldap.message.ExtendedResponseImpl
oid, value
 
Fields inherited from interface org.apache.directory.shared.ldap.message.ExtendedResponse
TYPE
 
Method Summary
 boolean equals(java.lang.Object obj)
          Checks to see if an object equals this ExtendedRequest.
 byte[] getResponse()
          Gets the reponse OID specific encoded response values.
 java.lang.String getResponseName()
          Gets the OID uniquely identifying this extended response (a.k.a.
 void setResponse(byte[] value)
          Sets the reponse OID specific encoded response values.
 void setResponseName(java.lang.String oid)
          Sets the OID uniquely identifying this extended response (a.k.a.
 
Methods inherited from class org.apache.directory.shared.ldap.message.ExtendedResponseImpl
getEncodedValue, getID
 
Methods inherited from class org.apache.directory.shared.ldap.message.AbstractResultResponse
getLdapResult, toString
 
Methods inherited from class org.apache.directory.shared.ldap.message.AbstractMessage
add, get, getControls, getMessageId, getType, put, remove
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.directory.shared.ldap.message.ResultResponse
getLdapResult
 
Methods inherited from interface org.apache.directory.shared.ldap.message.Message
add, get, getControls, getMessageId, getType, put, remove
 

Field Detail

EXTENSION_OID

public static final java.lang.String EXTENSION_OID
See Also:
Constant Field Values

UNAVAILABLE

public static NoticeOfDisconnect UNAVAILABLE

PROTOCOLERROR

public static NoticeOfDisconnect PROTOCOLERROR

STRONGAUTHREQUIRED

public static NoticeOfDisconnect STRONGAUTHREQUIRED
Method Detail

getResponse

public byte[] getResponse()
Gets the reponse OID specific encoded response values.

Specified by:
getResponse in interface ExtendedResponse
Overrides:
getResponse in class ExtendedResponseImpl
Returns:
the response specific encoded response values.

setResponse

public void setResponse(byte[] value)
Sets the reponse OID specific encoded response values.

Specified by:
setResponse in interface ExtendedResponse
Overrides:
setResponse in class ExtendedResponseImpl
Parameters:
value - the response specific encoded response values.

getResponseName

public java.lang.String getResponseName()
Gets the OID uniquely identifying this extended response (a.k.a. its name).

Specified by:
getResponseName in interface ExtendedResponse
Overrides:
getResponseName in class ExtendedResponseImpl
Returns:
the OID of the extended response type.

setResponseName

public void setResponseName(java.lang.String oid)
Sets the OID uniquely identifying this extended response (a.k.a. its name).

Specified by:
setResponseName in interface ExtendedResponse
Overrides:
setResponseName in class ExtendedResponseImpl
Parameters:
oid - the OID of the extended response type.

equals

public boolean equals(java.lang.Object obj)
Description copied from class: ExtendedResponseImpl
Checks to see if an object equals this ExtendedRequest.

Overrides:
equals in class ExtendedResponseImpl
Parameters:
obj - the object to be checked for equality
Returns:
true if the obj equals this ExtendedRequest, false otherwise


Copyright © 2003-2006 . All Rights Reserved.