Class CollectionSubResource


  • public final class CollectionSubResource
    extends SubResource
    Defines a one-to-many relationship between a parent resource and its children. Removal of the parent resource implies that the children (the sub-resources) are also removed. Collections support all CREST request types.
    • Method Detail

      • useClientDnNaming

        public CollectionSubResource useClientDnNaming​(String dnAttribute)
        Indicates that the JSON resource ID must be provided by the user, and will be used for naming the associated LDAP entry. More specifically, LDAP entry names will be derived by appending a single RDN to the collection's base DN composed of the specified attribute type and LDAP value taken from the LDAP entry once attribute mapping has been performed.

        Note that this naming policy requires that the user provides the resource name when creating new resources, which means it must be included in the resource content when not specified explicitly in the create request.

        Parameters:
        dnAttribute - The LDAP attribute which will be used for naming.
        Returns:
        A reference to this object.
      • useClientNaming

        public CollectionSubResource useClientNaming​(String dnAttribute,
                                                     String idAttribute)
        Indicates that the JSON resource ID must be provided by the user, but will not be used for naming the associated LDAP entry. Instead the JSON resource ID will be taken from the idAttribute in the LDAP entry, and the LDAP entry name will be derived by appending a single RDN to the collection's base DN composed of the dnAttribute taken from the LDAP entry once attribute mapping has been performed.

        Note that this naming policy requires that the user provides the resource name when creating new resources, which means it must be included in the resource content when not specified explicitly in the create request.

        Parameters:
        dnAttribute - The attribute which will be used for naming LDAP entries.
        idAttribute - The attribute which will be used for JSON resource IDs.
        Returns:
        A reference to this object.
      • useServerEntryUuidNaming

        public CollectionSubResource useServerEntryUuidNaming​(String dnAttribute)
        Indicates that the JSON resource ID will be derived from the server provided "entryUUID" LDAP attribute. The LDAP entry name will be derived by appending a single RDN to the collection's base DN composed of the dnAttribute taken from the LDAP entry once attribute mapping has been performed.

        Note that this naming policy requires that the server provides the resource name when creating new resources, which means it must not be specified in the create request, nor included in the resource content.

        Parameters:
        dnAttribute - The attribute which will be used for naming LDAP entries.
        Returns:
        A reference to this object.
      • useServerNaming

        public CollectionSubResource useServerNaming​(String dnAttribute,
                                                     String idAttribute)
        Indicates that the JSON resource ID must not be provided by the user, and will not be used for naming the associated LDAP entry. Instead the JSON resource ID will be taken from the idAttribute in the LDAP entry, and the LDAP entry name will be derived by appending a single RDN to the collection's base DN composed of the dnAttribute taken from the LDAP entry once attribute mapping has been performed.

        Note that this naming policy requires that the server provides the resource name when creating new resources, which means it must not be specified in the create request, nor included in the resource content.

        Parameters:
        dnAttribute - The attribute which will be used for naming LDAP entries.
        idAttribute - The attribute which will be used for JSON resource IDs.
        Returns:
        A reference to this object.
      • urlTemplate

        public CollectionSubResource urlTemplate​(String urlTemplate)
        Sets the relative URL template beneath which the sub-resources will be located. The template may be empty indicating that the sub-resources will be located directly beneath the parent resource. Any URL template variables will be substituted into the DN template.
        Parameters:
        urlTemplate - The relative URL template.
        Returns:
        A reference to this object.
      • dnTemplate

        public CollectionSubResource dnTemplate​(String dnTemplate)
        Sets the relative DN template beneath which the sub-resource LDAP entries will be located. The template may be empty indicating that the LDAP entries will be located directly beneath the parent LDAP entry. Any DN template variables will be substituted using values extracted from the URL template.
        Parameters:
        dnTemplate - The relative DN template.
        Returns:
        A reference to this object.
      • glueObjectClass

        public CollectionSubResource glueObjectClass​(String objectClass)
        Specifies an LDAP object class which is to be associated with any intermediate "glue" entries forming the DN template. Multiple object classes may be specified.
        Parameters:
        objectClass - An LDAP object class which is to be associated with any intermediate "glue" entries forming the DN template.
        Returns:
        A reference to this object.
      • glueObjectClasses

        public CollectionSubResource glueObjectClasses​(String... objectClasses)
        Specifies one or more LDAP object classes which is to be associated with any intermediate "glue" entries forming the DN template. Multiple object classes may be specified.
        Parameters:
        objectClasses - The LDAP object classes which is to be associated with any intermediate "glue" entries forming the DN template.
        Returns:
        A reference to this object.
      • isReadOnly

        public CollectionSubResource isReadOnly​(boolean readOnly)
        Indicates whether this sub-resource collection only supports read and query operations.
        Parameters:
        readOnly - true if this sub-resource collection is read-only.
        Returns:
        A reference to this object.