Package com.isode.dsapi.syntax.mhs
Class AddressSynonym
Class representation of a Synonym value. Users may create
values from Strings, BER, or AttributeValue objects.
This class works by holding an
MHSR.AddressSynonym
object, and providing a slightly more user-friendly set of methods which
access and manipulate fields inside that object.
AddressSynonym ::= SEQUENCE OF SEQUENCE { synonym-target DistinguishedName, synonym-type SynonymType } SynonymType = ENUMERATED { non-wildcard(0), wildcard-discard-unmatched(1), wildcard-retain-unmatched(2), back-pointer(3) }This class supports access (via set and get methods) to all of the above fields.
- Author:
- tc
-
Nested Class Summary
Nested classes/interfaces inherited from class com.isode.dsapi.syntax.IsodeSyntax
IsodeSyntax.SyntaxInfo
-
Field Summary
Fields inherited from class com.isode.dsapi.syntax.IsodeSyntax
asnVal, logger
-
Constructor Summary
ConstructorsConstructorDescriptionAddressSynonym
(byte[] ber) Construct a new object based on a byte array containing the BER representation of an AddressSynonym.Create a new AddressSynonym object from an existing ASN representation.Create a new AddressSynonym object from a suitable AttributeValue.AddressSynonym
(DN target, MHSR.SynonymType type) Construct a new object based on a target DN and typeAddressSynonym
(String str) Create a new AddressSynonym object from a string representation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addElement
(DN target, MHSR.SynonymType type) int
Return a reference to the underlying asn representation of this objectgetSynonymTarget
(int index) Determine the target component of the AddressSynonym element.getSynonymType
(int index) Determine the value of the synonym-type component of this AddressSynonym.protected IsodeSyntax.SyntaxInfo
Subclasses must implement a method which returns a SyntaxInfo object that can be used by the IsodeSyntax class.protected void
parse
(byte[] berRepresentation) Parse the specified byte array into asn representationvoid
reset()
Clear all fields in the object.void
setSynonymTarget
(int index, DN newTarget) Set the synonymTarget component of an AddressSynonym.void
setSynonymType
(int index, MHSR.SynonymType newType) Set the synonymType component of an AddressSynonym.Methods inherited from class com.isode.dsapi.syntax.IsodeSyntax
equals, getAsnVal, getAttributeValue, getAttributeValue, getStringRepresentation, hashCode, isNumeric, isValid, isValidStringValue, set, toString
-
Constructor Details
-
AddressSynonym
Create a new AddressSynonym object from an existing ASN representation.- Parameters:
val
- an ASN value, which must not be null. The contents of this object will be copied.- Since:
- 14.4
-
AddressSynonym
Create a new AddressSynonym object from a string representation.- Parameters:
str
- String representation. Must not be null.- Throws:
BadValueException
- if str is not a valid AddressSynonymBadSyntaxException
- it is not possible to parse AddressSynonym values
-
AddressSynonym
Create a new AddressSynonym object from a suitable AttributeValue.- Parameters:
av
- AttributeValue. Must not be null.- Throws:
BadValueException
- if av is not a valid AddressSynonymBadSyntaxException
- it is not possible to parse AddressSynonym valuesNativeLibraryException
- if an unrecoverable error was detected by the native library
-
AddressSynonym
Construct a new object based on a target DN and type- Parameters:
target
- the target DNtype
- type synonym type- Throws:
BadValueException
- if the supplied values cannot be converted into an AddressSynonym
-
AddressSynonym
Construct a new object based on a byte array containing the BER representation of an AddressSynonym.- Parameters:
ber
- BER representation of a AddressSynonym value- Throws:
BadValueException
- if ber doesn't hold a valid AddressSynonym value- Since:
- 14.4
-
-
Method Details
-
getSyntaxInfo
Description copied from class:IsodeSyntax
Subclasses must implement a method which returns a SyntaxInfo object that can be used by the IsodeSyntax class.- Specified by:
getSyntaxInfo
in classIsodeSyntax<MHSR.AddressSynonym>
- Returns:
- a SyntaxInfo describing the syntax represented by the subclass.
- Throws:
BadSyntaxException
- if no SyntaxInfo is available for this syntax.
-
parse
Parse the specified byte array into asn representation- Specified by:
parse
in classIsodeSyntax<MHSR.AddressSynonym>
- Parameters:
berRepresentation
- putative value in BER- Throws:
BadValueException
-
addElement
- Throws:
BadValueException
BadDNException
-
getMhsrAddressSynonym
Return a reference to the underlying asn representation of this object- Returns:
- the MHSR.AddressSynonym object.
- Since:
- 14.4
-
getElementCount
public int getElementCount() -
getSynonymType
Determine the value of the synonym-type component of this AddressSynonym.- Returns:
- a SynonymType.
- Throws:
BadAttributeTypeException
- if it the AddressSynonym does not contain a valid SynonymTypeNativeLibraryException
- if an unrecoverable error was detected by the native library
-
setSynonymType
Set the synonymType component of an AddressSynonym. Other fields remain unchanged.- Parameters:
newType
- the new SynonymType to be used (must not be null).- Throws:
NullPointerException
- if newType is null.
-
getSynonymTarget
Determine the target component of the AddressSynonym element.- Returns:
- a DN containing the AddressSynonym node. This will be null in the case that the value in the object cannot be represented as a DN object.
-
setSynonymTarget
Set the synonymTarget component of an AddressSynonym. Other fields remain unchanged.- Parameters:
newTarget
- the new SynonymTarget to be used (must not be null).- Throws:
BadValueException
NullPointerException
- if newTarget is null.
-
reset
public void reset()Clear all fields in the object. The object may not be a valid RoutingFilter, but may become one if fields inside it are set appropriately.- Specified by:
reset
in classIsodeSyntax<MHSR.AddressSynonym>
- Since:
- 14.6
-