public final class SchemaUtils extends Object
Modifier and Type | Method and Description |
---|---|
static Set<String> |
getOptions(String attributeId)
Get the options from the attributeType.
|
static Entry |
getTargetEntry(List<? extends Modification> mods,
Entry entry)
Gets the target entry as it would look after a modification operation
were performed on it.
|
static boolean |
isAttributeNameValid(String attributeName)
Tells if an AttributeType name is valid or not.
|
static StringBuilder |
render(AttributeType[] ats)
Renders a list of attributeTypes for things like the must or may list of
objectClasses using the ( oid $ oid ) format.
|
static String |
render(LoadableSchemaObject description)
Returns a String description of a schema.
|
static StringBuilder |
render(Map<String,List<String>> extensions)
Renders the schema extensions into a new StringBuffer.
|
static StringBuilder |
render(ObjectClass[] ocs)
Renders a list of object classes for things like a list of superior
objectClasses using the ( oid $ oid ) format.
|
static StringBuilder |
render(StringBuilder buf,
AttributeType[] ats)
Renders a list of attributeTypes for things like the must or may list of
objectClasses using the ( oid $ oid ) format into an existing buffer.
|
static StringBuilder |
render(StringBuilder buf,
List<String> qdescrs)
Renders qdescrs into an existing buffer.
|
static StringBuilder |
render(StringBuilder buf,
ObjectClass[] ocs)
Renders a list of object classes for things like a list of superior
objectClasses using the ( oid $ oid ) format into an existing buffer.
|
static String |
stripOptions(String attributeId)
Remove the options from the attributeType, and returns the ID.
|
static byte[] |
uuidToBytes(UUID uuid)
Transform an UUID in a byte array
|
public static Entry getTargetEntry(List<? extends Modification> mods, Entry entry) throws LdapException
mods
- the modifications performed on the entryentry
- the source entry that is modifiedLdapException
- if there are problems accessing attributespublic static StringBuilder render(StringBuilder buf, List<String> qdescrs)
buf
- the string buffer to render the quoted description strs intoqdescrs
- the quoted description strings to renderpublic static StringBuilder render(ObjectClass[] ocs)
ocs
- the objectClasses to listpublic static StringBuilder render(StringBuilder buf, ObjectClass[] ocs)
buf
- the string buffer to render the list of objectClasses intoocs
- the objectClasses to listpublic static StringBuilder render(AttributeType[] ats)
ats
- the attributeTypes to listpublic static StringBuilder render(StringBuilder buf, AttributeType[] ats)
buf
- the string buffer to render the list of attributeTypes intoats
- the attributeTypes to listpublic static StringBuilder render(Map<String,List<String>> extensions)
extensions
- the schema extensions map with key and valuespublic static String render(LoadableSchemaObject description)
description
- The description to transform to a Stringpublic static String stripOptions(String attributeId)
attributedescription = attributetype options attributetype = oid options = *( SEMI option ) option = 1*keychar
attributeId
- The AttributeType to parsepublic static Set<String> getOptions(String attributeId)
attributeId
- The AttributeType to parsepublic static byte[] uuidToBytes(UUID uuid)
uuid
- The UUID to transformpublic static boolean isAttributeNameValid(String attributeName)
name = descr / numericOid descr = keystring keystring = leadkeychar *keychar leadkeychar = ALPHA keychar = ALPHA / DIGIT / HYPHEN / USCORE numericoid = number 1*( DOT number ) number = DIGIT / ( LDIGIT 1*DIGIT ) ALPHA = %x41-5A / %x61-7A ; "A"-"Z" / "a"-"z" DIGIT = %x30 / LDIGIT ; "0"-"9" HYPHEN = %x2D ; hyphen ("-") LDIGIT = %x31-39 ; "1"-"9" DOT = %x2E ; period (".") USCORE = %x5F ; underscore ("_")Note that we have extended this grammar to accept the '_' char, which is widely used in teh LDAP world.
attributeName
- The AttributeType name to checkCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.