Interface PreOperationAddOperation
-
- All Superinterfaces:
PluginOperation
,PreOperationOperation
- All Known Implementing Classes:
AddOperation
@PublicAPI(stability=UNCOMMITTED, mayInstantiate=false, mayExtend=false, mayInvoke=true) public interface PreOperationAddOperation extends PreOperationOperation
This class defines a set of methods that are available for use by pre-operation plugins for add operations. Note that this interface is intended only to define an API for use by plugins and is not intended to be implemented by any custom classes.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addObjectClass(ObjectClass objectClass, String name)
Adds the provided objectclass to the entry to add.Iterable<Attribute>
getAllAttributes()
Retrieves the set of attributes as read from the client request.Dn
getEntryDN()
Retrieves the DN of the entry to add.Entry
getEntryToAdd()
Retrieves the entry to be added to the server.void
removeAttribute(AttributeType attributeType)
Removes the specified attribute from the entry to add.void
removeObjectClass(ObjectClass objectClass)
Removes the provided objectclass from the entry to add.void
replaceAttribute(Attribute attribute)
Adds all of the attribute values contained inattribute
to this entry, replacing any existing attribute values (optional operation).-
Methods inherited from interface org.opends.server.types.operation.PluginOperation
checkIfCanceled, disconnectClient, getAttachment, getAttachments, getClientConnection, getConnectionID, getMessageID, getOperationID, getOperationType, getRequestControl, getRequestControl, getRequestControls, getResponseControls, isInternalOperation, isSynchronizationOperation, removeAttachment, setAttachment, toString, toString
-
Methods inherited from interface org.opends.server.types.operation.PreOperationOperation
addAdditionalLogItem, addResponseControl, appendErrorMessage, getAdditionalLogItems, getAuthorizationDN, getErrorMessage, removeResponseControl, setErrorMessage
-
-
-
-
Method Detail
-
getEntryDN
Dn getEntryDN()
Retrieves the DN of the entry to add.- Returns:
- The DN of the entry to add.
-
addObjectClass
void addObjectClass(ObjectClass objectClass, String name)
Adds the provided objectclass to the entry to add. Note that pre-operation plugin processing is invoked after access control and schema validation, so plugins should be careful to only make changes that will not violate either schema or access control rules.- Parameters:
objectClass
- The objectclass to add to the entry.name
- The name to use for the objectclass.
-
removeObjectClass
void removeObjectClass(ObjectClass objectClass)
Removes the provided objectclass from the entry to add. Note that pre-operation plugin processing is invoked after access control and schema validation, so plugins should be careful to only make changes that will not violate either schema or access control rules.- Parameters:
objectClass
- The objectclass to remove from the entry.
-
getAllAttributes
Iterable<Attribute> getAllAttributes()
Retrieves the set of attributes as read from the client request. Some of these attributes may be invalid as no validation will have been performed on them.- Returns:
- The set of attributes as read from the client request.
-
replaceAttribute
void replaceAttribute(Attribute attribute)
Adds all of the attribute values contained inattribute
to this entry, replacing any existing attribute values (optional operation). Ifattribute
is empty then the entire attribute will be removed if it is present.NOTE: This method implements LDAP Modify replace semantics as described in RFC 4511 - Section 4.6. Modify Operation.
- Parameters:
attribute
- The attribute values to be added to this entry, replacing any existing attribute values, and which may be empty if the entire attribute is to be removed.- Throws:
UnsupportedOperationException
- If this entry does not permit attributes or their values to be replaced.NullPointerException
- Ifattribute
wasnull
.
-
removeAttribute
void removeAttribute(AttributeType attributeType)
Removes the specified attribute from the entry to add. Note that pre-operation processing is invoked after access control and schema validation, so plugins should be careful to only make changes that will not violate either schema or access control rules.- Parameters:
attributeType
- The attribute tyep for the attribute to remove.
-
getEntryToAdd
Entry getEntryToAdd()
Retrieves the entry to be added to the server. The contents of the returned entry must not be altered by the caller.- Returns:
- The entry to be added to the server.
-
-