Class ManagedObject
- Direct Known Subclasses:
ConfigEntry
,FailoverAgreement
,FailoverEntry
,GDAMEntry
,IndexEntry
,LDAPChangelogEntry
,LogConfigObject
,MESHAgreementReport
,MESHEntry
,MESHServerReport
,OAuthEntry
,OCSPService
,PeerEntry
,ShadowAgreement
- Since:
- 15.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ManagedObject
(Entry entry, IsodeDirectorySession ds) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAttribute
(MapEntry mapEntry, AttributeType at, Boolean val) Modify attribute by adding boolean value.static void
addAttribute
(MapEntry mapEntry, AttributeType at, Integer val) Modify attribute by adding integer value.static void
addAttribute
(MapEntry mapEntry, AttributeType at, String val) Modify attribute by adding string value.static void
addAttributeValue
(Attribute attr, AttributeValue value) Add attribute value to the list of values for this Attribute.void
addAttributeValue
(AttributeType at, String val) Add a value to the given attribute type.protected static Entry
addEntry
(IsodeDirectorySession ds, MapEntry entryMap) Utility method which applies a set of changes to the directory, and then reads the directory to return the updated version of the entry.static void
Add an object class attribute with the given values in a new entry.static void
checkMandatory
(AttributeType attrType, DN value) Checks that DN value is not null (null implies attribute is absent).static void
checkMandatory
(AttributeType attrType, Integer value) Checks that integer value is not null (null implies attribute is absent).static void
checkMandatory
(AttributeType attrType, String str) Checks if a String is not null, and throws an exception if it is.static void
checkMandatory
(AttributeType attrType, List<?> list) Checks that list is not null or empty (null or empty implies attribute is absent).void
commit()
Commit stored changes to the directory, and then refresh the stored entry by reading it back from the directory.void
Commit stored changes to the directory.static AccessPoint
This method is invoked to create an access point from a string that is bound to be of valid format, like data read from the DB.static AttributeType
createAttributeType
(String attrName) Construct a new AttributeType using the specified attribute name or OID string, allowing only types that are recognised by the local schema.static DN
This method is invoked to create a DN from a string that is bound to be of valid format, like data read from the DB.static PresentationAddress
This method is invoked to create a presentation address from a string that is bound to be of valid format, like data read from the DB.static RDN
This method is invoked to create an RDN from an attribute array that is bound to be of valid format, like data read from the DB.static RDN
This method is invoked to create an RDN from a string that is bound to be of valid format, like data read from the DB.Return a specific attribute from this Entry's list of attributes.Get the default attribute object for the given attribute type.getDN()
Get the DN of the managed object.Return a reference to the IsodeDirectorySession associated with this object.List<byte[]>
Returns values for a multi-valued attribute from the entryReturns an integer representation of the specified attribute.getMultiValuedInteger
(Entry fromEntry, AttributeType at) Returns an integer representation of the specified attribute.Returns values for a multi-valued attribute.getMultiValuedString
(Entry fromEntry, AttributeType at) Returns values for a multi-valued attribute from the entrygetPA
(AttributeType type) Get a presentation address attribute value..Returns the value of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.Return an AttributeType representing the contents of a single-valued OID attribute.byte[]
Get the ASN1 representation of the attribute.Returns a Boolean representation of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.Return the value of the specified single-valued attribute whose String representation contains a generalized time.getValueDate
(Entry fromEntry, AttributeType at) Return the value of the specified single-valued attribute whose String representation contains a generalized time.Return the value of the specified single-valued DN attribute.Returns an integer representation of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.static Integer
getValueInteger
(Entry fromEntry, AttributeType at) Returns an integer representation of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.Returns the String representation of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.static String
getValueString
(Entry entry, AttributeType at) Returns the String representation of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.static String
getValueStringFromAttribute
(Entry entry, AttributeType at) Returns the String representation of the specified attribute, provided that the entry contains such an attribute.boolean
Indicates if the attribute of the given type has changed from it values when last loaded.boolean
Determines if there are any changes pending to be committed to the directory for the managed object for an existing entry.abstract void
Load values from an entry.void
remove()
Remove the managed object.void
Remove an existing attribute.void
removeStringValue
(AttributeType at, String value) Remove an attribute value of type string of given attribute typevoid
reset()
Create new MapEntry object based on the current Entry.void
Sets the Entry contained in this object to the specified entry, and creates new MapEntry object.void
updateAttr
(Attribute attr) Replace an attribute.void
updateAttr
(AttributeType at, byte[] val) Modify the attribute by setting BER value for a given single valued attribute.void
updateAttr
(AttributeType at, AttributeValue val) Modify the attribute by setting BER value for a given single valued attribute.updateBoolean
(AttributeType at, Boolean newValue) Updates the single-valued boolean attribute to the given value.updateDN
(AttributeType at, DN newValue) Updates the single-valued DN attribute to the given value.updateInteger
(AttributeType at, Integer newValue) Updates the single-valued integer attribute to the given value.List<byte[]>
updateMultiValuedBER
(AttributeType at, List<byte[]> values) Updates the multi-valued BER attribute to the specified values, or deletes the values altogetherupdateMultiValuedInteger
(AttributeType at, Set<Integer> values) Updates the multi-valued integer attribute to the specified values, or deletes the values altogetherupdateMultiValuedString
(AttributeType at, List<String> values) Updates the multi-valued string attribute to the specified values, or deletes the values altogetherupdatePA
(AttributeType type, PresentationAddress newValue) Updates a single-valued presentation address attribute to the given value.updatePA
(PresentationAddress newValue) Updates the single-valued presentation address attribute to the given value.updateString
(AttributeType at, String newValueStr) Updates the single-valued attribute to the given value.
-
Field Details
-
logger
protected static final com.isode.util.Logger logger
-
-
Constructor Details
-
ManagedObject
Constructor.- Parameters:
entry
- Entry representing the object. Must not be nullds
- IsodeDirectory session. Must not be null.
-
-
Method Details
-
getIsodeDirectorySession
Return a reference to the IsodeDirectorySession associated with this object.- Returns:
- an IsodeDirectorySession. This will never be null.
-
getDN
Get the DN of the managed object.- Returns:
- distinguished name - will never be null.
-
reset
public void reset()Create new MapEntry object based on the current Entry. -
reset
Sets the Entry contained in this object to the specified entry, and creates new MapEntry object. If e is null, then the effect of this method is identical toreset()
.- Parameters:
e
- Entry representing the external copy; this may be null.
-
commitNoRefresh
Commit stored changes to the directory. Unlike commit() there is no read of the updated entry after the modification.- Throws:
ConfigOpFailedException
- if there is a problem on applying the changes to the directory.
-
commit
Commit stored changes to the directory, and then refresh the stored entry by reading it back from the directory. If there are any problems when reading the entry back, the entry stored in the managed object needs to be reset.- Throws:
ReadFailedException
- if the changes were successfully written, but an error occurred when attempting to re-read the entry from the directory.ConfigOpFailedException
- if there is a problem on applying the changes to the directory.- See Also:
-
addOC
Add an object class attribute with the given values in a new entry.It is assumed that the calling method has ensured that the values are valid for an object class attribute.
- Parameters:
mapEntry
- entry map that that will be modified to add object classesvals
- Array of object class RDN.
-
addEntry
protected static Entry addEntry(IsodeDirectorySession ds, MapEntry entryMap) throws ReadFailedException, ConfigOpFailedException Utility method which applies a set of changes to the directory, and then reads the directory to return the updated version of the entry.- Parameters:
ds
- Directory session.entryMap
- entry map holding modified attributes from which an entry to be added will created and added to the DSA.- Returns:
- The entry read from the directory.
- Throws:
ReadFailedException
- if there is a problem on reading the committed entry back.ConfigOpFailedException
- if there is a problem on applying the changes to the directory.
-
addAttributeValue
Add a value to the given attribute type.- Parameters:
at
- attribute typeval
- value,if null or an empty String (""), no modification will be performed.- Throws:
BadValueException
- if val is not a valid LDAP string representation of the given attribute type
-
updateAttr
Modify the attribute by setting BER value for a given single valued attribute.- Parameters:
at
- attribute typeval
- ASN1 value to set, if null the attribute will be removed- Throws:
BadValueException
- if the value specified is illegal for the given attribute type
-
updateAttr
Modify the attribute by setting BER value for a given single valued attribute.- Parameters:
at
- attribute typeval
- ASN1 value to set, if null the attribute will be removed- Throws:
BadValueException
- if the value specified is illegal for the given attribute type
-
updateAttr
Replace an attribute.- Parameters:
attr
- Attribute (must contain necessary values). Must not be null.- Since:
- 16.3
-
removeAttr
Remove an existing attribute.- Parameters:
at
- attribute type to remove. Must not be null.
-
removeStringValue
Remove an attribute value of type string of given attribute typeIt is assumed that the value given to delete would have previously been read from the DB and is bound to be correct.
- Parameters:
at
- attribute type of the value to removevalue
- value to be removed
-
getAttribute
Return a specific attribute from this Entry's list of attributes.- Parameters:
at
- the AttributeType required- Returns:
- the specified Attribute from the entry, or null if no such attribute exists or its value is null. It will also return null if DSA db returns 0 values or multiple values for a single-valued attribute.
- See Also:
-
getValueString
Returns the String representation of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.If no such attribute exists, then null is returned.
- Parameters:
at
- AttributeType (not null)- Returns:
- String representation of the specified attribute's value.
If the attribute does not exist in the entry, the default
string representation for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be null.
-
getMultiValuedString
Returns values for a multi-valued attribute from the entry- Parameters:
fromEntry
- the entry of interestat
- the attribute type of interest- Returns:
- a list of String values from the entry for this attribute.
If the attribute does not exist in the entry, the default
value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be an empty list and will never be null.
-
getMultiValueBer
Returns values for a multi-valued attribute from the entry- Parameters:
at
- the attribute type of interest- Returns:
- a list of ber values from the entry for this attribute.
If the attribute does not exist in the entry, the default
value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be an empty list and will never be null. - Since:
- 16.3
-
getMultiValuedString
Returns values for a multi-valued attribute.- Parameters:
at
- the attribute type of interest- Returns:
- a list of String values from the entry for this attribute.
If the attribute does not exist in the entry, the default
value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be an empty list and will never be null.
-
updateMultiValuedString
public List<String> updateMultiValuedString(AttributeType at, List<String> values) throws BadValueException Updates the multi-valued string attribute to the specified values, or deletes the values altogether- Parameters:
at
- the attribute typevalues
- a list of values, or null/empty list to remove all values- Returns:
- a list of String values from the entry for this attribute.
If the attribute does not exist in the entry, the default
value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be an empty list and will never be null. - Throws:
BadValueException
- if any of the values in values is not a valid string representation for a value of this object's AttributeType.
-
updateMultiValuedBER
public List<byte[]> updateMultiValuedBER(AttributeType at, List<byte[]> values) throws BadValueException Updates the multi-valued BER attribute to the specified values, or deletes the values altogether- Parameters:
at
- the attribute typevalues
- a list of values, or null/empty list to remove all values- Returns:
- a list of BER values from the entry for this attribute.
If the attribute does not exist in the entry, the default
value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be an empty list and will never be null. - Throws:
BadValueException
- if any of the values in values is not a valid BER representation for a value of this object's AttributeType.- Since:
- 16.3
-
getValueString
Returns the String representation of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.If no such attribute exists, then null is returned.
- Parameters:
entry
- entry objectat
- AttributeType (not null)- Returns:
- String representation of the specified attribute from the entry.
If the attribute does not exist in the entry, the default
string representation for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be null
-
getValueStringFromAttribute
Returns the String representation of the specified attribute, provided that the entry contains such an attribute. If there are more than one values, then one value is returned.If no such attribute exists, then null is returned.
- Parameters:
entry
- entry objectat
- AttributeType (not null)- Returns:
- String representation of the specified attribute from the entry.
If the attribute does not exist in the entry, the default
string representation for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be null
-
getValue
Returns the value of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.If no such attribute exists, then null is returned.
- Parameters:
at
- AttributeType (not null)- Returns:
- AttributeValue object or null (if no such attribute in the entry.
-
getValueInteger
Returns an integer representation of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.If no such attribute exists, or if the attribute does exist but has a String representation which does not correspond to an integer, or has a String representation of zero length, then null is returned.
- Parameters:
at
- AttributeType (not null)- Returns:
- Integer value of the specified attribute from the entry.
If the attribute does not exist in the entry, the default
integer value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be null
-
getValueInteger
Returns an integer representation of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.If no such attribute exists, or if the attribute does exist but has a String representation which does not correspond to an integer, or has a String representation of zero length, then null is returned.
- Parameters:
fromEntry
- entry objectat
- AttributeType (not null)- Returns:
- Integer value of the specified attribute from the entry.
If the attribute does not exist in the entry, the default
integer value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be null
-
getMultiValuedInteger
Returns an integer representation of the specified attribute. Values are returned in a list in order to accommodate multi-valued attributes.If no such attribute exists, or if the attribute does exist but has a String representation which does not correspond to an integer, or has a String representation of zero length, then null is returned.
- Parameters:
at
- AttributeType (not null)- Returns:
- Set of Integer values of the specified attribute from the entry. If the attribute does not exist in the entry, then null is returned.
-
getMultiValuedInteger
Returns an integer representation of the specified attribute. Values are returned in a list in order to accommodate multi-valued attributes.If no such attribute exists, or if the attribute does exist but has a String representation which does not correspond to an integer, or has a String representation of zero length, then null is returned.
- Parameters:
fromEntry
- entry objectat
- AttributeType (not null)- Returns:
- set of Integer values of the specified attribute from the entry. If the attribute does not exist in the entry, then null is returned.
-
updateMultiValuedInteger
public Set<Integer> updateMultiValuedInteger(AttributeType at, Set<Integer> values) throws BadValueException Updates the multi-valued integer attribute to the specified values, or deletes the values altogether- Parameters:
at
- the attribute typevalues
- a list of values, or null/empty list to remove all values- Returns:
- a list of Integer values from the entry for this attribute. If the attribute does not exist in the entry. The returned value could be an empty list and will never be null.
- Throws:
BadValueException
-
getValueDN
Return the value of the specified single-valued DN attribute. This was initially implemented to cope with SASL related attributes that contain DNs, for example "isodeSASLGSSAPIBase".Note that it is assumed that this method may only be used for AttributeTypes which have DN syntax and single-valued, otherwise null is returned.
- Parameters:
at
- the AttributeType, which must be of syntax DN- Returns:
- DN value of the specified attribute from the entry.
If the attribute does not exist in the entry, the default
DN value for this attribute is returned which is
defined in
SchemaObjects
(which can be null). It will also return null if the DSA db returns an invalid DN value for the given attribute
-
getValueDate
Return the value of the specified single-valued attribute whose String representation contains a generalized time.- Parameters:
at
- the AttributeType of interest, for example the Attribute for "isodeLastUpdateTime". Must not be null.- Returns:
- a Date object representing the value from the specified attribute. If no such attribute exists, or if its value cannot be parsed as a GeneralizedTime, then null will be returned.
-
getValueDate
Return the value of the specified single-valued attribute whose String representation contains a generalized time.- Parameters:
fromEntry
- entry object, must not be null.at
- the AttributeType of interest, for example the Attribute for "isodeLastUpdateTime". Must not be null.- Returns:
- a Date object representing the value from the specified attribute. If no such attribute exists, or if its value cannot be parsed as a GeneralizedTime, then null will be returned.
-
getValueAttrTypeFromOID
Return an AttributeType representing the contents of a single-valued OID attribute. This was initially implemented to cope with SASL related attributes that contain AttributeTypes, stored as OIDs, for example "isodeSASLGenericNamingAttr".Note that it is assumed that this method may only be used for AttributeTypes which have OID syntax and single-valued and map to an attribute type in the loaded schema, otherwise null is returned.
- Parameters:
at
- the AttributeType, which must be of syntax oid- Returns:
- an AttributeType representing the value of the specified
attribute when converted from an OID.If the attribute does not
exist in the entry, the default value for this attribute is
returned which is defined in
SchemaObjects
(can be null). It will also return null if the value returned by the DSA is not a valid string representation of an attribute type.
-
getValueBer
Get the ASN1 representation of the attribute. This function should be used for single valued attributes.- Parameters:
at
- attribute type- Returns:
- ASN1 value of the attribute; If the attribute does not exist in the entry,
the default BER value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be null
-
getValueBoolean
Returns a Boolean representation of the specified attribute, provided that the entry contains such an attribute and that the attribute has a single value.If no such attribute exists, or if the attribute does exist but has a String representation which does not correspond to a boolean (allowed string values are case insensitive "true" or "false" only), then false is returned.
- Parameters:
at
- AttributeType (not null)- Returns:
- Boolean value for the attribute; If the attribute does not exist
in the entry, the default boolean value for this attribute is returned
which is defined in
SchemaObjects
. The returned value will never be null but will default to FALSE.
-
updateInteger
Updates the single-valued integer attribute to the given value. Attribute will be deleted if value is set to null- Parameters:
at
- Attribute IDnewValue
- New value, if null the attribute will be deleted- Returns:
- New value, if value used to set was null, the default
integer value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be null
-
updateBoolean
Updates the single-valued boolean attribute to the given value.Note that it is assumed that this method may only be used for AttributeTypes which have boolean syntax.
- Parameters:
at
- Attribute IDnewValue
- New value this may be null, which will cause any value in the entry to be removed.- Returns:
- New value, If parameter to set new value is null , the default
boolean value for this attribute is returned which is defined in
SchemaObjects
. The returned value will never be null but will default to FALSE.
-
updateDN
Updates the single-valued DN attribute to the given value.Note that it is assumed that this method may only be used for AttributeTypes which have DN syntax.
- Parameters:
at
- Attribute ID; must be a type that has DN syntax, and must not be null.newValue
- New value, or null to delete any existing value- Returns:
- New value, if value used to set was null, the default
string value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be null
-
updatePA
Updates the single-valued presentation address attribute to the given value.Note that it is assumed that this method may only be used for AttributeTypes which have PA syntax.
- Parameters:
newValue
- New value, if null the presentation address attribute will be removed- Returns:
- New value, if value used to set was null, the default
presentation address value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be null
-
updatePA
Updates a single-valued presentation address attribute to the given value.Note that this method may only be used for AttributeTypes which have PA syntax.
- Parameters:
attr
- Attribute to be updated.newValue
- New value, if null the presentation address attribute will be removed.- Returns:
- New value, if value used to set was null, the default
presentation address value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be null.
-
getPA
Get a presentation address attribute value..- Returns:
- Presentation address value, or null if attribute is not present or does not contain a presentation address value.
-
updateString
Updates the single-valued attribute to the given value. The values are in string form.- Parameters:
at
- AttributeType; must not be null.newValueStr
- New value in string form. If newValueStr is null or an empty String ("") then the attribute will be deleted.- Returns:
- New value, if value used to set was null, the default
string value for this attribute is returned which is
defined in
SchemaObjects
. The returned value could be null - Throws:
BadValueException
- if newValueStr is not a valid LDAP string representation of the given attribute type
-
addAttribute
public static void addAttribute(MapEntry mapEntry, AttributeType at, String val) throws BadValueException Modify attribute by adding string value.For a single valued attribute calling this function multiple times will retain the value of the last call throwing value from previous calls. For a multi-valued attribute, calling this function multiple times will add all the values to the attribute.
- Parameters:
mapEntry
- entry map to which modified attributes would be addedat
- attribute type (not null)val
- value to set (if null or empty string - then no modification will be performed)- Throws:
BadValueException
- if the syntax of val is not valid for this attribute.
-
addAttribute
Modify attribute by adding integer value.For a single valued attribute calling this function multiple times will retain the value of the last call throwing value from previous calls. For a multi-valued attribute, calling this function multiple times will add all the values to the attribute.
Note that it is assumed that this method may only be used for AttributeTypes which have integer syntax.
- Parameters:
mapEntry
- entry map to hold modified attributesat
- attribute type (not null)val
- value to set (may be null - then no modification will be performed)
-
addAttribute
Modify attribute by adding boolean value.For a single valued attribute calling this function multiple times will retain the value of the last call throwing value from previous calls. For a multi-valued attribute, calling this function multiple times will add all the values to the attribute.
Note that it is assumed that this method may only be used for AttributeTypes which have boolean syntax.
- Parameters:
mapEntry
- entry map to hold modified attributesat
- attribute type (not null)val
- value to set (may be null - then no modification will be performed)
-
remove
Remove the managed object.- Throws:
ConfigOpFailedException
- if there is an error during the delete.
-
checkMandatory
public static void checkMandatory(AttributeType attrType, String str) throws ConfigOpFailedException Checks if a String is not null, and throws an exception if it is.- Parameters:
attrType
- the attribute type, for error messages; should not be nullstr
- the String representation of the attribute value. If null, an exception will be thrown- Throws:
ConfigOpFailedException
- if str is null.
-
checkMandatory
public static void checkMandatory(AttributeType attrType, Integer value) throws ConfigOpFailedException Checks that integer value is not null (null implies attribute is absent).- Parameters:
attrType
- the attribute type, for error messagesvalue
- the integer value of the attribute; null indicates no value- Throws:
ConfigOpFailedException
- if value is null
-
checkMandatory
Checks that DN value is not null (null implies attribute is absent).- Parameters:
attrType
- the type of the attribute, for error messagesvalue
- the DN value of the attribute; null indicates no value- Throws:
ConfigOpFailedException
- if DN value is null.
-
checkMandatory
public static void checkMandatory(AttributeType attrType, List<?> list) throws ConfigOpFailedException Checks that list is not null or empty (null or empty implies attribute is absent).- Parameters:
attrType
- the type of the attribute, for error messageslist
- the list containing values of the attribute; null or empty indicates no value- Throws:
ConfigOpFailedException
- if list is null or empty.
-
createDN
This method is invoked to create a DN from a string that is bound to be of valid format, like data read from the DB.Calling this is exactly equivalent to calling the
DN constructor
directly, except that this method throws anyBadDNException
as aConfigOpFailedException
.- Parameters:
dnStr
- String format of DN- Returns:
- formed DN
- Throws:
ConfigOpFailedException
- if dnStr does not represent a valid DN.
-
createRDN
This method is invoked to create an RDN from a string that is bound to be of valid format, like data read from the DB.Calling this is exactly equivalent to calling the
RDN constructor
directly, except that this method throws anyBadDNException
as aConfigOpFailedException
.- Parameters:
dnStr
- String format of RDN- Returns:
- formed RDN
- Throws:
ConfigOpFailedException
- if dnStr does not represent a valid RDN.
-
createRDN
This method is invoked to create an RDN from an attribute array that is bound to be of valid format, like data read from the DB.- Parameters:
attrs
- list of Attributes- Returns:
- formed RDN
-
createPA
This method is invoked to create a presentation address from a string that is bound to be of valid format, like data read from the DB.- Parameters:
paStr
- String format of PA- Returns:
- formed PA
- Throws:
ConfigOpFailedException
- if the input is not a valid or if it is not possible to parse the presentation address.
-
createAP
This method is invoked to create an access point from a string that is bound to be of valid format, like data read from the DB.- Parameters:
apStr
- String format of AP- Returns:
- formed AP
- Throws:
ConfigOpFailedException
- if the input is not a valid or if it is not possible to parse the presentation address or access point.
-
addAttributeValue
public static void addAttributeValue(Attribute attr, AttributeValue value) throws ConfigOpFailedException Add attribute value to the list of values for this Attribute.- Parameters:
attr
- Attribute to add to.value
- AttributeValue to add- Throws:
ConfigOpFailedException
- if the syntax of value is not valid for this attribute.
-
createAttributeType
Construct a new AttributeType using the specified attribute name or OID string, allowing only types that are recognised by the local schema. Note that either the short or long attribute-type name may be used to construct the object (e.g. "cn" and "commonname" would be equivalent).It is assumed that the calling method is certain that attrName is valid.
- Parameters:
attrName
- Attribute type name or OID- Returns:
- the created attribute type
-
hasChanges
public boolean hasChanges()Determines if there are any changes pending to be committed to the directory for the managed object for an existing entry.This must not be invoked for create entry or rename entry or relocate operations.
- Returns:
- TRUE if there are pending changes in any attribute type in the given list, FALSE if there are no changes in any
-
hasAttributeChanged
Indicates if the attribute of the given type has changed from it values when last loaded.- Parameters:
at
- TheAttributeType
of the attribute to check. Should not benull
- Returns:
true
if the attribute has changed,false
otherwise.- Throws:
NoSuchAttributeException
- If an attribute of the given type can not be found.
-
getAttributeDefaultWhenNull
Get the default attribute object for the given attribute type.- Parameters:
at
- attribute type- Returns:
- default attribute for attribute type from
SchemaObjects
, if the attribute does not exist, a default value as defined inSchemaObjects
for the attribute will be returned, which can be null if there is no explicit default value or if the attribute type is not defined inSchemaObjects
- See Also:
-
load
Load values from an entry. No directory operation should be done in this method.Mandatory variables are assigned only after everything is ok. This is done so during re-loading, if there are exceptions and even then the object is used, there is no crash by using mandatory variables that are assumed to have non-null values.
- Parameters:
givenEntry
- Entry representing the object, could be null if the existing entry has to be reloaded- Throws:
ConfigOpFailedException
- if mandatory attributes are not loaded
-