org.apache.directory.shared.ldap.codec.extended.operations
Class GracefulDisconnect

java.lang.Object
  extended by org.apache.directory.shared.asn1.AbstractAsn1Object
      extended by org.apache.directory.shared.ldap.codec.extended.operations.GracefulAction
          extended by org.apache.directory.shared.ldap.codec.extended.operations.GracefulDisconnect
All Implemented Interfaces:
Asn1Object

public class GracefulDisconnect
extends GracefulAction

An extended operation to proceed a graceful disconnect

   GracefulDisconnect ::= SEQUENCE 
   {
       timeOffline           INTEGER (0..720) DEFAULT 0,
       delay             [0] INTEGER (0..86400) DEFAULT 0,
       replicatedContexts    Referral OPTIONAL
   }
 

Version:
$Rev: 687720 $, $Date: 2008-08-21 14:05:50 +0200 (Do, 21 Aug 2008) $,
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.codec.extended.operations.GracefulAction
delay, NOW, timeOffline, UNDETERMINED
 
Fields inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
parent
 
Constructor Summary
GracefulDisconnect()
          Default constructor.
GracefulDisconnect(int timeOffline, int delay)
          Create a GracefulDisconnect object, with a timeOffline and a delay
 
Method Summary
 void addReplicatedContexts(LdapURL replicatedContext)
          Add a new URL of a replicated server
 int computeLength()
          Compute the GracefulDisconnect length 0x30 L1 | +--> [ 0x02 0x0(1-4) [0..720] ] +--> [ 0x80 0x0(1-3) [0..86400] ] +--> [ 0x30 L2 | +--> (0x04 L3 value) + ]
 java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
          Encodes the gracefulDisconnect extended operation.
 java.util.List<LdapURL> getReplicatedContexts()
          Get the list of replicated servers
 java.lang.String toString()
          Return a string representation of the graceful disconnect
 
Methods inherited from class org.apache.directory.shared.ldap.codec.extended.operations.GracefulAction
getDelay, getTimeOffline, setDelay, setTimeOffline
 
Methods inherited from class org.apache.directory.shared.asn1.AbstractAsn1Object
addLength, getCurrentLength, getExpectedLength, getParent, getTlvId, setCurrentLength, setExpectedLength, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GracefulDisconnect

public GracefulDisconnect(int timeOffline,
                          int delay)
Create a GracefulDisconnect object, with a timeOffline and a delay

Parameters:
timeOffline - The time the server will be offline
delay - The delay before the disconnection

GracefulDisconnect

public GracefulDisconnect()
Default constructor.

Method Detail

getReplicatedContexts

public java.util.List<LdapURL> getReplicatedContexts()
Get the list of replicated servers

Returns:
The list of replicated servers

addReplicatedContexts

public void addReplicatedContexts(LdapURL replicatedContext)
Add a new URL of a replicated server

Parameters:
replicatedContext - The replictaed server to add.

computeLength

public int computeLength()
Compute the GracefulDisconnect length 0x30 L1 | +--> [ 0x02 0x0(1-4) [0..720] ] +--> [ 0x80 0x0(1-3) [0..86400] ] +--> [ 0x30 L2 | +--> (0x04 L3 value) + ]

Specified by:
computeLength in interface Asn1Object
Specified by:
computeLength in class AbstractAsn1Object
Returns:
The object's computed length

encode

public java.nio.ByteBuffer encode(java.nio.ByteBuffer buffer)
                           throws EncoderException
Encodes the gracefulDisconnect extended operation.

Specified by:
encode in interface Asn1Object
Overrides:
encode in class AbstractAsn1Object
Parameters:
buffer - The encoded sink
Returns:
A ByteBuffer that contains the encoded PDU
Throws:
EncoderException - If anything goes wrong.

toString

public java.lang.String toString()
Return a string representation of the graceful disconnect

Overrides:
toString in class java.lang.Object


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.