Package com.isode.dsapi.syntax
Class IdentifiedDN
- All Implemented Interfaces:
Comparable<IdentifiedDN>
public class IdentifiedDN
extends IsodeSyntax<MESHSyntax.IdentifiedDN>
implements Comparable<IdentifiedDN>
Class representation of a IdentifiedDN value.
This is an immutable class (no setters in this implementation)
This class works by holding an
MESHSyntax.IdentifiedDN
object, and providing a slightly more user-friendly set of methods which
access and manipulate fields inside that object.
The ASN for a IdentifiedDN is:
IdentifiedDN ::= SEQUENCE { id INTEGER, prefix DN
- Since:
- 15.0
-
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
ConstructorsConstructorDescriptionIdentifiedDN
(byte[] ber) Construct a new object based on a byte array containing the BER representation of a IdentifiedDN.IdentifiedDN
(int id, DN dn) Create a new IdentifiedDN from a set of fieldsCreate a new IdentifiedDN object from a suitable AttributeValue.IdentifiedDN
(String str) Create a new IdentifiedDN object from a String representation -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(IdentifiedDN other) Compares with another IdentifiedDN.getDN()
Return the DN.int
getID()
Return the ID.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) Decode the specifed byte array into ASN representationvoid
reset()
Clear all fields in the object.Methods inherited from class com.isode.dsapi.syntax.IsodeSyntax
equals, getAsnVal, getAttributeValue, getAttributeValue, getStringRepresentation, hashCode, isNumeric, isValid, isValidStringValue, set, toString
-
Constructor Details
-
IdentifiedDN
Create a new IdentifiedDN from a set of fields- Parameters:
id
- The ID.dn
- The DN.
-
IdentifiedDN
Create a new IdentifiedDN object from a String representation- Parameters:
str
- String representation; must not be null- Throws:
BadValueException
- if str is not a valid IdentifiedDNBadSyntaxException
- if it is not possible to parse IdentifiedDN values
-
IdentifiedDN
Create a new IdentifiedDN object from a suitable AttributeValue.- Parameters:
av
- AttributeValue. Must not be null.- Throws:
BadValueException
- if av is not a valid IdentifiedDNBadSyntaxException
- it is not possible to parse IdentifiedDN values
-
IdentifiedDN
Construct a new object based on a byte array containing the BER representation of a IdentifiedDN.- Parameters:
ber
- BER representation of a IdentifiedDN value- Throws:
BadValueException
- if ber doesn't hold a valid IdentifiedDN value
-
-
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<MESHSyntax.IdentifiedDN>
- Returns:
- a SyntaxInfo describing the syntax represented by the subclass.
- Throws:
BadSyntaxException
- if no SyntaxInfo is available for this syntax.
-
parse
Decode the specifed byte array into ASN representation- Specified by:
parse
in classIsodeSyntax<MESHSyntax.IdentifiedDN>
- Parameters:
berRepresentation
- putative value in BER- Throws:
BadValueException
-
reset
public void reset()Description copied from class:IsodeSyntax
Clear all fields in the object. Following this operation, the object may not be a valid value, so may need to have fields set in it to become one.Subclasses should implement a method which clears all the asn fields, e.g.
asnVal = new MHSR.GlobalDomainIdentifier(); asnVal.setAdministration_domain_name(new AdministrationDomainName()); asnVal.setCountry_name(new CountryName());
Note that this method is called by theIsodeSyntax()
constructor.- Specified by:
reset
in classIsodeSyntax<MESHSyntax.IdentifiedDN>
-
getID
public int getID()Return the ID.- Returns:
- the ID.
-
getDN
Return the DN.- Returns:
- the DN.
-
compareTo
Compares with another IdentifiedDN. Prefix DNs are compared first; if they're the same, then ids are compared.- Specified by:
compareTo
in interfaceComparable<IdentifiedDN>
- Returns:
- -1 if this object is "less" than the other, 0 if they're "the same", and 1 if this object is "greater"
-