Class DitContentRule.Builder

  • Enclosing class:
    DitContentRule

    public static final class DitContentRule.Builder
    extends Object
    A fluent API for incrementally constructing DIT content rule.
    • Method Detail

      • addToSchema

        public SchemaBuilder addToSchema()
        Adds this DIT content rule to the schema, throwing a ConflictingSchemaElementException if there is an existing DIT content rule with the same structural object class OID.
        Returns:
        The parent schema builder.
        Throws:
        ConflictingSchemaElementException - If there is an existing DIT content rule with the same structural object class OID.
      • addToSchemaOverwrite

        public SchemaBuilder addToSchemaOverwrite()
        Adds this DIT content rule to the schema overwriting any existing content rule with the same structural class OID.
        Returns:
        The parent schema builder.
      • auxiliaryObjectClasses

        public DitContentRule.Builder auxiliaryObjectClasses​(Collection<String> objectClassNamesOrOids)
        Adds the provided auxiliary classes to the list of auxiliary object classes that entries subject to this DIT content rule may belong to.
        Parameters:
        objectClassNamesOrOids - The list of auxiliary class names or OIDs.
        Returns:
        This builder.
      • auxiliaryObjectClasses

        public DitContentRule.Builder auxiliaryObjectClasses​(String... objectClassNamesOrOids)
        Adds the provided auxiliary classes to the list of auxiliary object classes that entries subject to this DIT content rule may belong to.
        Parameters:
        objectClassNamesOrOids - The list of auxiliary class names or OIDs.
        Returns:
        This builder.
      • description

        public DitContentRule.Builder description​(String description)
        Sets the description.
        Parameters:
        description - The description, which may be null in which case the empty string will be used.
        Returns:
        This builder.
      • extraProperties

        public DitContentRule.Builder extraProperties​(Map<String,​List<String>> extraProperties)
        Adds the provided collection of extended properties.
        Parameters:
        extraProperties - The collection of extended properties.
        Returns:
        This builder.
      • extraProperties

        public DitContentRule.Builder extraProperties​(String extensionName,
                                                      String... extensionValues)
        Adds the provided extended property.
        Parameters:
        extensionName - The name of the extended property.
        extensionValues - The optional list of values for the extended property.
        Returns:
        This builder.
      • names

        public DitContentRule.Builder names​(String... names)
        Adds the provided user friendly names.
        Parameters:
        names - The user friendly names.
        Returns:
        This builder.
      • obsolete

        public DitContentRule.Builder obsolete​(boolean isObsolete)
        Specifies whether this schema element is obsolete.
        Parameters:
        isObsolete - true if this schema element is obsolete (default is false).
        Returns:
        This builder.
      • optionalAttributes

        public DitContentRule.Builder optionalAttributes​(Collection<String> attributeNamesOrOids)
        Adds the provided optional attributes to the list of attribute types that entries subject to this DIT content rule may contain.
        Parameters:
        attributeNamesOrOids - The list of optional attribute names or OIDs.
        Returns:
        This builder.
      • optionalAttributes

        public DitContentRule.Builder optionalAttributes​(String... attributeNamesOrOids)
        Adds the provided optional attributes to the list of attribute types that entries subject to this DIT content rule may contain.
        Parameters:
        attributeNamesOrOids - The list of optional attribute names or OIDs.
        Returns:
        This builder.
      • prohibitedAttributes

        public DitContentRule.Builder prohibitedAttributes​(Collection<String> attributeNamesOrOids)
        Adds the provided prohibited attributes to the list of attribute types that entries subject to this DIT content rule must not contain.
        Parameters:
        attributeNamesOrOids - The list of prohibited attribute names or OIDs.
        Returns:
        This builder.
      • prohibitedAttributes

        public DitContentRule.Builder prohibitedAttributes​(String... attributeNamesOrOids)
        Adds the provided prohibited attributes to the list of attribute types that entries subject to this DIT content rule must not contain.
        Parameters:
        attributeNamesOrOids - The list of prohibited attribute names or OIDs.
        Returns:
        This builder.
      • removeAllAuxiliaryObjectClasses

        public DitContentRule.Builder removeAllAuxiliaryObjectClasses()
        Clears the list of auxiliary object classes that entries subject to this DIT content rule may belong to.
        Returns:
        This builder.
      • removeAllExtraProperties

        public DitContentRule.Builder removeAllExtraProperties()
        Removes all extra properties.
        Returns:
        This builder.
      • removeAllNames

        public DitContentRule.Builder removeAllNames()
        Removes all user defined names.
        Returns:
        This builder.
      • removeAllOptionalAttributes

        public DitContentRule.Builder removeAllOptionalAttributes()
        Clears the list of attribute types that entries subject to this DIT content rule may contain.
        Returns:
        This builder.
      • removeAllProhibitedAttributes

        public DitContentRule.Builder removeAllProhibitedAttributes()
        Clears the list of attribute types that entries subject to this DIT content rule must not contain.
        Returns:
        This builder.
      • removeAllRequiredAttributes

        public DitContentRule.Builder removeAllRequiredAttributes()
        Clears the list of attribute types that entries subject to this DIT content rule must contain.
        Returns:
        This builder.
      • removeAuxiliaryObjectClass

        public DitContentRule.Builder removeAuxiliaryObjectClass​(String objectClassNameOrOid)
        Removes the provided object class in the list of auxiliary object classes that entries subject to this DIT content rule may belong to.
        Parameters:
        objectClassNameOrOid - The auxiliary object class name or OID to be removed.
        Returns:
        This builder.
      • removeExtraProperty

        public DitContentRule.Builder removeExtraProperty​(String extensionName,
                                                          String... extensionValues)
        Removes the specified extended property.
        Parameters:
        extensionName - The name of the extended property.
        extensionValues - The optional list of values for the extended property, which may be empty indicating that the entire property should be removed.
        Returns:
        This builder.
      • removeName

        public DitContentRule.Builder removeName​(String name)
        Removes the provided user defined name.
        Parameters:
        name - The user defined name to be removed.
        Returns:
        This builder.
      • removeOptionalAttribute

        public DitContentRule.Builder removeOptionalAttribute​(String attributeNameOrOid)
        Removes the provided optional attribute in the list of attribute types that entries subject to this DIT content rule may contain.
        Parameters:
        attributeNameOrOid - The optional attribute name or OID to be removed.
        Returns:
        This builder.
      • removeProhibitedAttribute

        public DitContentRule.Builder removeProhibitedAttribute​(String attributeNameOrOid)
        Removes the provided prohibited attribute in the list of attribute types that entries subject to this DIT content rule must not contain.
        Parameters:
        attributeNameOrOid - The prohibited attribute name or OID to be removed.
        Returns:
        This builder.
      • removeRequiredAttribute

        public DitContentRule.Builder removeRequiredAttribute​(String attributeNameOrOid)
        Removes the provided required attribute in the list of attribute types that entries subject to this DIT content rule must contain.
        Parameters:
        attributeNameOrOid - The provided required attribute name or OID to be removed.
        Returns:
        This builder.
      • requiredAttributes

        public DitContentRule.Builder requiredAttributes​(Collection<String> attributeNamesOrOids)
        Adds the provided attribute to the list of attribute types that entries subject to this DIT content rule must contain.
        Parameters:
        attributeNamesOrOids - The list of required attribute names or OIDs.
        Returns:
        This builder.
      • requiredAttributes

        public DitContentRule.Builder requiredAttributes​(String... attributeNamesOrOids)
        Adds the provided attribute to the list of attribute types that entries subject to this DIT content rule must contain.
        Parameters:
        attributeNamesOrOids - The list of required attribute names or OIDs.
        Returns:
        This builder.
      • structuralClassOid

        public DitContentRule.Builder structuralClassOid​(String structuralClassOid)
        Sets the structural class OID which uniquely identifies this DIT content rule.
        Parameters:
        structuralClassOid - The numeric OID.
        Returns:
        This builder.
      • extraProperties

        public T extraProperties​(String extensionName,
                                 List<String> extensionValues)
        Adds the provided extended property.
        Parameters:
        extensionName - The name of the extended property.
        extensionValues - The optional list of values for the extended property.
        Returns:
        This builder.