Class Entries

    • Method Detail

      • processVirtualAttributes

        public static Entry processVirtualAttributes​(Entry e,
                                                     ServerContext serverContext)
        Performs any necessary virtual attribute processing for this entry. This should only be called at the time the entry is decoded or created within the backend.
        Parameters:
        e - the entry where to add virtual attributes
        serverContext - the server context
        Returns:
        the provided entry
      • shallowCopyOfEntryWithoutVirtualAttributes

        public static Entry shallowCopyOfEntryWithoutVirtualAttributes​(Entry e)
        Returns a shallow copy of this entry, the attributes are shared between this entry and the returned entry.

        Note: this method does not copy the virtual attributes. To obtain the virtual attributes, use processVirtualAttributes(Entry, ServerContext) after calling the current method.

        Parameters:
        e - the entry to copy
        Returns:
        a shallow copy of this entry
      • getRealAttributeOrNull

        public static Attribute getRealAttributeOrNull​(Attribute attribute)
        Returns the provided attribute if it is real or null if it is virtual.
        Parameters:
        attribute - The real or virtual attribute.
        Returns:
        The real attribute or null if it is virtual.
      • newAttributeFilter

        public static AttributeFilter newAttributeFilter​(Collection<String> attrNames,
                                                         boolean omitValues,
                                                         boolean omitReal,
                                                         boolean omitVirtual)
        Returns an attribute filter which will keep only the attributes which match the provided criteria.
        Parameters:
        attrNames - The attributes to include, may include wild cards.
        omitValues - Indicates whether to omit attribute values when processing.
        omitReal - Indicates whether to exclude real attributes.
        omitVirtual - Indicates whether to exclude virtual attributes.
        Returns:
        An attribute filter which will keep only the attributes which match the provided criteria.
      • findMatchedDn

        public static Dn findMatchedDn​(Dn dn,
                                       Predicate<Dn> backendContains)
        Returns the matched DN that is available in the backend for the provided DN.
        Parameters:
        dn - the dn for which to find the matched DN
        backendContains - a predicate which returns whether the backend contains a provided DN
        Returns:
        the matched DN that is available in the backend for the provided DN
      • findMatchedDN

        public static Dn findMatchedDN​(Dn entryDN,
                                       ServerContext serverContext)
        Finds the matched DN associated with the provided entry DN. This method looks for an ancestor of the provided entry DN. It only looks for the ancestor into a single public naming context, or returns null if none can be found.
        Parameters:
        entryDN - the entry DN for which to find the closest matched DN
        serverContext - the server context
        Returns:
        The matched DN, or null if none can be found.
      • findMatchedDn

        public static Dn findMatchedDn​(Dn dn,
                                       Predicate<Dn> backendContains,
                                       BackendConfigManager backendConfigManager)
        Returns the matched DN that is available in the backend for the provided DN.
        Parameters:
        dn - the dn for which to find the matched DN
        backendContains - a predicate which returns whether the backend contains a provided DN
        backendConfigManager - the backend config manager
        Returns:
        the matched DN that is available in the backend for the provided DN