org.apache.directory.server.core.entry
Class ServerModification

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

public class ServerModification
extends java.lang.Object
implements org.apache.directory.shared.ldap.entry.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(org.apache.directory.shared.ldap.entry.ModificationOperation operation, org.apache.directory.shared.ldap.entry.EntryAttribute attribute)
          Create a new instance of a ServerModification.
ServerModification(Registries registries, org.apache.directory.shared.ldap.entry.Modification modification)
           
 
Method Summary
 ServerModification clone()
          Create a clone instance
 void deserialize(java.io.ObjectInput in, AttributeTypeRegistry atRegistry)
          Deserialize a ServerModification
 boolean equals(java.lang.Object that)
           
 org.apache.directory.shared.ldap.entry.EntryAttribute getAttribute()
           
 org.apache.directory.shared.ldap.entry.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(org.apache.directory.shared.ldap.entry.EntryAttribute attribute)
          Set the attribute's modification
 void setOperation(int operation)
          Store the modification operation
 void setOperation(org.apache.directory.shared.ldap.entry.ModificationOperation operation)
          Store the modification operation
 org.apache.directory.shared.ldap.entry.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(org.apache.directory.shared.ldap.entry.ModificationOperation operation,
                          org.apache.directory.shared.ldap.entry.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(Registries registries,
                          org.apache.directory.shared.ldap.entry.Modification modification)
Method Detail

getOperation

public org.apache.directory.shared.ldap.entry.ModificationOperation getOperation()
Specified by:
getOperation in interface org.apache.directory.shared.ldap.entry.Modification
Returns:
the operation

setOperation

public void setOperation(int operation)
Store the modification operation

Specified by:
setOperation in interface org.apache.directory.shared.ldap.entry.Modification
Parameters:
operation - The DirContext value to assign

setOperation

public void setOperation(org.apache.directory.shared.ldap.entry.ModificationOperation operation)
Store the modification operation

Specified by:
setOperation in interface org.apache.directory.shared.ldap.entry.Modification
Parameters:
operation - The DirContext value to assign

getAttribute

public org.apache.directory.shared.ldap.entry.EntryAttribute getAttribute()
Specified by:
getAttribute in interface org.apache.directory.shared.ldap.entry.Modification
Returns:
the attribute containing the modifications

setAttribute

public void setAttribute(org.apache.directory.shared.ldap.entry.EntryAttribute attribute)
Set the attribute's modification

Specified by:
setAttribute in interface org.apache.directory.shared.ldap.entry.Modification
Parameters:
attribute - The modified attribute

toClientModification

public org.apache.directory.shared.ldap.entry.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 org.apache.directory.shared.ldap.entry.Modification
Overrides:
clone in class java.lang.Object

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,
                        AttributeTypeRegistry atRegistry)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException,
                        javax.naming.NamingException
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
javax.naming.NamingException - 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-2009 Apache Software Foundation. All Rights Reserved.