org.apache.directory.shared.ldap.entry
Class ServerModification

java.lang.Object
  extended by org.apache.directory.shared.ldap.entry.ServerModification
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, Modification

public class ServerModification
extends java.lang.Object
implements Modification

An internal implementation for a ModificationItem. The name has been chosen so that it does not conflict with @see ModificationItem

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

Field Summary
static long serialVersionUID
           
 
Constructor Summary
ServerModification()
          Create a new instance of a ServerModification.
ServerModification(ModificationOperation operation, EntryAttribute attribute)
          Create a new instance of a ServerModification.
ServerModification(SchemaManager schemaManager, Modification modification)
           
 
Method Summary
 ServerModification clone()
          Create a clone instance
 void deserialize(java.io.ObjectInput in, SchemaManager schemaManager)
          Deserialize a ServerModification
 boolean equals(java.lang.Object that)
           
 EntryAttribute getAttribute()
           
 ModificationOperation getOperation()
           
 int hashCode()
          Compute the modification @see Object#hashCode
 void readExternal(java.io.ObjectInput in)
           
 void serialize(java.io.ObjectOutput out)
          Serialize a ServerModification.
 void setAttribute(EntryAttribute attribute)
          Set the attribute's modification
 void setOperation(int operation)
          Store the modification operation
 void setOperation(ModificationOperation operation)
          Store the modification operation
 Modification toClientModification()
          Convert the current ServerModification to a ClientModification instance
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

ServerModification

public ServerModification()
Create a new instance of a ServerModification.


ServerModification

public ServerModification(ModificationOperation operation,
                          EntryAttribute attribute)
Create a new instance of a ServerModification.

Parameters:
operation - the Modification operation (one of add, replace or remove)
attribute - the modified attribute

ServerModification

public ServerModification(SchemaManager schemaManager,
                          Modification modification)
Method Detail

getOperation

public ModificationOperation getOperation()
Specified by:
getOperation in interface Modification
Returns:
the operation

setOperation

public void setOperation(int operation)
Store the modification operation

Specified by:
setOperation in interface Modification
Parameters:
operation - The DirContext value to assign

setOperation

public void setOperation(ModificationOperation operation)
Store the modification operation

Specified by:
setOperation in interface Modification
Parameters:
operation - The DirContext value to assign

getAttribute

public EntryAttribute getAttribute()
Specified by:
getAttribute in interface Modification
Returns:
the attribute containing the modifications

setAttribute

public void setAttribute(EntryAttribute attribute)
Set the attribute's modification

Specified by:
setAttribute in interface Modification
Parameters:
attribute - The modified attribute

toClientModification

public Modification toClientModification()
Convert the current ServerModification to a ClientModification instance

Returns:
a new ClientModification instance

hashCode

public int hashCode()
Compute the modification @see Object#hashCode

Overrides:
hashCode in class java.lang.Object
Returns:
the instance's hash code

equals

public boolean equals(java.lang.Object that)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(Object)

clone

public ServerModification clone()
Create a clone instance

Specified by:
clone in interface Modification
Overrides:
clone in class java.lang.Object
Returns:
a clone of the current modification

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException
See Also:
We can't use this method for a ServerModification.

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException
Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException
See Also:
We can't use this method for a ServerModification.

deserialize

public void deserialize(java.io.ObjectInput in,
                        SchemaManager schemaManager)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException,
                        LdapException
Deserialize a ServerModification

Parameters:
in - The buffer containing the serialized value
atRegistry - The AttributeType registry
Throws:
java.io.IOException - If we weren't able to deserialize the data
java.lang.ClassNotFoundException - if we weren't able to construct a Modification instance
LdapException - If we didn't found the AttributeType in the registries

serialize

public void serialize(java.io.ObjectOutput out)
               throws java.io.IOException
Serialize a ServerModification.

Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


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