org.apache.directory.mitosis.operation
Class AttributeOperation

java.lang.Object
  extended by org.apache.directory.mitosis.operation.Operation
      extended by org.apache.directory.mitosis.operation.AttributeOperation
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable
Direct Known Subclasses:
AddAttributeOperation, DeleteAttributeOperation, ReplaceAttributeOperation

public abstract class AttributeOperation
extends Operation

An Operation that adds an attribute to an entry.

Author:
Apache Directory Project
See Also:
Serialized Form

Field Summary
protected  org.apache.directory.shared.ldap.entry.EntryAttribute attribute
          The attribute
protected  org.apache.directory.shared.ldap.name.LdapDN dn
          The attribute's DN
 
Fields inherited from class org.apache.directory.mitosis.operation.Operation
csn, operationType, registries
 
Constructor Summary
AttributeOperation(Registries registries, OperationType operationType, CSN csn, org.apache.directory.shared.ldap.name.LdapDN dn, org.apache.directory.shared.ldap.entry.EntryAttribute attribute)
          Create a new operation that affects an entry with the specified name.
 
Method Summary
protected  void execute0(PartitionNexus nexus, ReplicationStore store, CoreSession coreSession)
          Check that we can apply the modification, and create the associated entry, if it does not exists locally.
protected abstract  void execute1(PartitionNexus nexus, CoreSession coreSession)
          Apply the requested modification locally
 org.apache.directory.shared.ldap.entry.EntryAttribute getAttribute()
           
 org.apache.directory.shared.ldap.name.LdapDN getDn()
           
 java.lang.String toString()
           
 
Methods inherited from class org.apache.directory.mitosis.operation.Operation
deserialize, execute, getCSN, readExternal, serialize, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dn

protected org.apache.directory.shared.ldap.name.LdapDN dn
The attribute's DN


attribute

protected org.apache.directory.shared.ldap.entry.EntryAttribute attribute
The attribute

Constructor Detail

AttributeOperation

public AttributeOperation(Registries registries,
                          OperationType operationType,
                          CSN csn,
                          org.apache.directory.shared.ldap.name.LdapDN dn,
                          org.apache.directory.shared.ldap.entry.EntryAttribute attribute)
Create a new operation that affects an entry with the specified name.

Parameters:
registries - the server registries
operationType - The operation's type
csn - the operation's CSN
dn - the normalized name of an entry
attribute - an attribute to modify
Method Detail

getDn

public org.apache.directory.shared.ldap.name.LdapDN getDn()
Returns:
the name of an entry this operation will affect.

execute0

protected final void execute0(PartitionNexus nexus,
                              ReplicationStore store,
                              CoreSession coreSession)
                       throws java.lang.Exception
Check that we can apply the modification, and create the associated entry, if it does not exists locally.

Overrides:
execute0 in class Operation
Parameters:
nexus - The partition to update
store - the replication storage
coreSession - the current session
Throws:
java.lang.Exception

execute1

protected abstract void execute1(PartitionNexus nexus,
                                 CoreSession coreSession)
                          throws java.lang.Exception
Apply the requested modification locally

Parameters:
nexus - The partition on which the operation is applied
coreSession - the current session
Throws:
java.lang.Exception

getAttribute

public org.apache.directory.shared.ldap.entry.EntryAttribute getAttribute()
Returns:
Returns the attribute to modify

toString

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


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