Package org.opends.server.types
Class Entries
- java.lang.Object
-
- org.opends.server.types.Entries
-
public final class Entries extends Object
Contains server-specific methods that deal with entries.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DnfindMatchedDn(Dn dn, Predicate<Dn> backendContains)Returns the matched DN that is available in the backend for the provided DN.static DnfindMatchedDn(Dn dn, Predicate<Dn> backendContains, BackendConfigManager backendConfigManager)Returns the matched DN that is available in the backend for the provided DN.static DnfindMatchedDN(Dn entryDN, ServerContext serverContext)Finds the matched DN associated with the provided entry DN.static AttributegetRealAttributeOrNull(Attribute attribute)Returns the provided attribute if it is real ornullif it is virtual.static AttributeFilternewAttributeFilter(Collection<String> attrNames, boolean omitValues, boolean omitReal, boolean omitVirtual)Returns an attribute filter which will keep only the attributes which match the provided criteria.static EntryprocessVirtualAttributes(Entry e, ServerContext serverContext)Performs any necessary virtual attribute processing for this entry.static EntryshallowCopyOfEntryWithoutVirtualAttributes(Entry e)Returns a shallow copy of this entry, the attributes are shared between this entry and the returned entry.
-
-
-
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 attributesserverContext- 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 ornullif it is virtual.- Parameters:
attribute- The real or virtual attribute.- Returns:
- The real attribute or
nullif 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 DNbackendContains- 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 returnsnullif none can be found.- Parameters:
entryDN- the entry DN for which to find the closest matched DNserverContext- the server context- Returns:
- The matched DN, or
nullif 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 DNbackendContains- a predicate which returns whether the backend contains a provided DNbackendConfigManager- the backend config manager- Returns:
- the matched DN that is available in the backend for the provided DN
-
-