Class AddOperation

    • Constructor Detail

      • AddOperation

        public AddOperation​(org.forgerock.services.context.Context context,
                            AddRequest request)
        Creates a new add operation with the provided information.
        Parameters:
        context - The context with which this operation is associated.
        request - The add request.
    • Method Detail

      • setEntryDN

        public void setEntryDN​(Dn entryDN)
        Description copied from interface: PreParseAddOperation
        Specifies the entry DN for the entry to add.
        Specified by:
        setEntryDN in interface PreParseAddOperation
        Parameters:
        entryDN - The entry DN for the entry to add.
      • addAttribute

        public void addAttribute​(Attribute attribute)
        Description copied from interface: PreParseAddOperation
        Adds the provided attribute to the set of attributes for this add operation.
        Specified by:
        addAttribute in interface PreParseAddOperation
        Parameters:
        attribute - The attribute to add to the set of attributes for this add operation.
      • addObjectClass

        public void addObjectClass​(ObjectClass objectClass,
                                   String name)
        Adds the provided objectclass to the entry to add. This should only be called from pre-operation plugins. 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.
        Specified by:
        addObjectClass in interface PreOperationAddOperation
        Parameters:
        objectClass - The objectclass to add to the entry.
        name - The name to use for the objectclass.
      • removeObjectClass

        public void removeObjectClass​(ObjectClass objectClass)
        Removes the provided objectclass from the entry to add. This should only be called from pre-operation plugins. 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.
        Specified by:
        removeObjectClass in interface PreOperationAddOperation
        Parameters:
        objectClass - The objectclass to remove from the entry.
      • replaceAttribute

        public void replaceAttribute​(Attribute attribute)
        Description copied from interface: PreOperationAddOperation
        Adds all of the attribute values contained in attribute to this entry, replacing any existing attribute values (optional operation). If attribute 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.

        Specified by:
        replaceAttribute in interface PreOperationAddOperation
        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.
      • removeAttribute

        public void removeAttribute​(AttributeType attributeType)
        Removes the specified attribute from the entry to add. This should only be called from pre-operation plugins. 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.
        Specified by:
        removeAttribute in interface PreOperationAddOperation
        Parameters:
        attributeType - The attribute type for the attribute to remove.
      • getProxiedAuthorizationDN

        public Dn getProxiedAuthorizationDN()
        Description copied from class: Operation
        Retrieves the proxied authorization DN for this operation if proxied authorization has been requested.
        Specified by:
        getProxiedAuthorizationDN in class Operation
        Returns:
        The proxied authorization DN for this operation if proxied authorization has been requested, or null if proxied authorization has not been requested.
      • getResponseControls

        public List<Control> getResponseControls()
        Description copied from interface: PluginOperation
        Retrieves the set of controls to include in the response to the client. The contents of this list must not be altered.
        Specified by:
        getResponseControls in interface PluginOperation
        Returns:
        The set of controls to include in the response to the client.
      • toString

        public void toString​(StringBuilder buffer)
        Description copied from interface: PluginOperation
        Appends a string representation of this operation to the provided buffer.
        Specified by:
        toString in interface PluginOperation
        Specified by:
        toString in class Operation
        Parameters:
        buffer - The buffer into which a string representation of this operation should be appended.
      • setProxiedAuthorizationDN

        public void setProxiedAuthorizationDN​(Dn proxiedAuthorizationDN)
        Description copied from class: Operation
        Set the proxied authorization DN for this operation if proxied authorization has been requested.
        Specified by:
        setProxiedAuthorizationDN in class Operation
        Parameters:
        proxiedAuthorizationDN - The proxied authorization DN for this operation if proxied authorization has been requested, or null if proxied authorization has not been requested.
      • run

        public void run()
        Description copied from class: Operation
        Performs the work of actually processing this operation. This should include all processing for the operation, including invoking pre-parse and post-response plugins, logging messages and any other work that might need to be done in the course of processing.
        Specified by:
        run in interface Runnable
        Specified by:
        run in class Operation