public final class ServerEntryUtils extends Object
Modifier and Type | Method and Description |
---|---|
static List<org.apache.directory.api.ldap.model.entry.Modification> |
convertToServerModification(List<ModificationItem> modificationItems,
org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
Convert a list of ModificationItemImpl to a list of LDAP API Modifications
|
static void |
filterContents(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager,
FilteringOperationContext operationContext,
org.apache.directory.api.ldap.model.entry.Entry entry)
Filters an entry accordingly to the requested Attribute list.
|
static org.apache.directory.api.ldap.model.entry.Attribute |
getAttribute(List<org.apache.directory.api.ldap.model.entry.Modification> mods,
org.apache.directory.api.ldap.model.schema.AttributeType type)
Utility method to extract an attribute from a list of modifications.
|
static org.apache.directory.api.ldap.model.entry.Modification |
getModificationItem(List<org.apache.directory.api.ldap.model.entry.Modification> mods,
org.apache.directory.api.ldap.model.schema.AttributeType type)
Utility method to extract a modification item from an array of modifications.
|
static org.apache.directory.api.ldap.model.entry.Entry |
getTargetEntry(org.apache.directory.api.ldap.model.entry.Modification mod,
org.apache.directory.api.ldap.model.entry.Entry entry,
org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
Gets the target entry as it would look after a modification operation
was performed on it.
|
static org.apache.directory.api.ldap.model.entry.Attribute |
getUnion(org.apache.directory.api.ldap.model.entry.Attribute attr0,
org.apache.directory.api.ldap.model.entry.Attribute attr1)
Creates a new attribute which contains the values representing the union
of two attributes.
|
static Attribute |
toBasicAttribute(org.apache.directory.api.ldap.model.entry.Attribute entryAttribute)
Convert a ServerAttribute into a BasicAttribute.
|
static Attributes |
toBasicAttributes(org.apache.directory.api.ldap.model.entry.Entry entry)
Convert a ServerEntry into a BasicAttributes.
|
static NamingEnumeration<SearchResult> |
toSearchResultEnum(NamingEnumeration<ServerSearchResult> result)
Encapsulate a ServerSearchResult enumeration into a SearchResult enumeration
|
static org.apache.directory.api.ldap.model.entry.Attribute |
toServerAttribute(Attribute attribute,
org.apache.directory.api.ldap.model.schema.AttributeType attributeType)
Convert a BasicAttribute or a AttributeImpl to a ServerAtribute
|
static org.apache.directory.api.ldap.model.entry.Entry |
toServerEntry(Attributes attributes,
org.apache.directory.api.ldap.model.name.Dn dn,
org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
Convert a BasicAttributes or a AttributesImpl to a ServerEntry
|
static List<org.apache.directory.api.ldap.model.entry.Modification> |
toServerModification(org.apache.directory.api.ldap.model.entry.Modification[] modifications,
org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
Convert a JNDI set of Modifications to LDAP API Modifications
|
static List<org.apache.directory.api.ldap.model.entry.Modification> |
toServerModification(ModificationItem[] modifications,
org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager)
Convert a JNDI set of ModificationItems to LDAP API Modifications
|
public static Attribute toBasicAttribute(org.apache.directory.api.ldap.model.entry.Attribute entryAttribute)
entryAttribute
- The Server entry to convertpublic static Attributes toBasicAttributes(org.apache.directory.api.ldap.model.entry.Entry entry)
entry
- The entry to convertpublic static org.apache.directory.api.ldap.model.entry.Attribute toServerAttribute(Attribute attribute, org.apache.directory.api.ldap.model.schema.AttributeType attributeType) throws org.apache.directory.api.ldap.model.exception.LdapException
attribute
- the BasicAttributes or AttributesImpl instance to convertattributeType
- The AttributeType to useorg.apache.directory.api.ldap.model.exception.LdapException
- If we had an incorrect attributepublic static org.apache.directory.api.ldap.model.entry.Entry toServerEntry(Attributes attributes, org.apache.directory.api.ldap.model.name.Dn dn, org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager) throws org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeTypeException
attributes
- the BasicAttributes or AttributesImpl instance to convertdn
- The Dn which is needed by the ServerEntryschemaManager
- The SchemaManager instanceorg.apache.directory.api.ldap.model.exception.LdapInvalidAttributeTypeException
- If we get an invalid attributepublic static org.apache.directory.api.ldap.model.entry.Entry getTargetEntry(org.apache.directory.api.ldap.model.entry.Modification mod, org.apache.directory.api.ldap.model.entry.Entry entry, org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager) throws org.apache.directory.api.ldap.model.exception.LdapException
mod
- the modificationentry
- the source entry that is modifiedschemaManager
- The SchemaManager instanceorg.apache.directory.api.ldap.model.exception.LdapException
- if there are problems accessing attributespublic static org.apache.directory.api.ldap.model.entry.Attribute getUnion(org.apache.directory.api.ldap.model.entry.Attribute attr0, org.apache.directory.api.ldap.model.entry.Attribute attr1) throws org.apache.directory.api.ldap.model.exception.LdapException
IllegalArgumentException
is raised.attr0
- the first attributeattr1
- the second attributeorg.apache.directory.api.ldap.model.exception.LdapException
- if there are problems accessing attribute valuespublic static List<org.apache.directory.api.ldap.model.entry.Modification> convertToServerModification(List<ModificationItem> modificationItems, org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager) throws org.apache.directory.api.ldap.model.exception.LdapException
modificationItems
- The modificationItems to convertschemaManager
- The SchemaManager instanceorg.apache.directory.api.ldap.model.exception.LdapException
- If the conversion failedpublic static List<org.apache.directory.api.ldap.model.entry.Modification> toServerModification(org.apache.directory.api.ldap.model.entry.Modification[] modifications, org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager) throws org.apache.directory.api.ldap.model.exception.LdapException
modifications
- The modifications to convertschemaManager
- The SchemaManager instanceorg.apache.directory.api.ldap.model.exception.LdapException
- If the conversion failedpublic static List<org.apache.directory.api.ldap.model.entry.Modification> toServerModification(ModificationItem[] modifications, org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager) throws org.apache.directory.api.ldap.model.exception.LdapException
modifications
- The modificationItems to convertschemaManager
- The SchemaManager instanceorg.apache.directory.api.ldap.model.exception.LdapException
- If the conversion failedpublic static org.apache.directory.api.ldap.model.entry.Modification getModificationItem(List<org.apache.directory.api.ldap.model.entry.Modification> mods, org.apache.directory.api.ldap.model.schema.AttributeType type)
mods
- the array of ModificationItems to extract the Attribute from.type
- the attributeType spec of the Attribute to extractpublic static org.apache.directory.api.ldap.model.entry.Attribute getAttribute(List<org.apache.directory.api.ldap.model.entry.Modification> mods, org.apache.directory.api.ldap.model.schema.AttributeType type)
mods
- the list of ModificationItems to extract the Attribute from.type
- the attributeType spec of the Attribute to extractpublic static NamingEnumeration<SearchResult> toSearchResultEnum(NamingEnumeration<ServerSearchResult> result)
result
- The ServerSearchResult enumerationpublic static void filterContents(org.apache.directory.api.ldap.model.schema.SchemaManager schemaManager, FilteringOperationContext operationContext, org.apache.directory.api.ldap.model.entry.Entry entry) throws org.apache.directory.api.ldap.model.exception.LdapException
schemaManager
- The SchemaManager instanceoperationContext
- The SearchingOperationContextentry
- The entry to filterorg.apache.directory.api.ldap.model.exception.LdapException
- If the filtering failsCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.