Package com.isode.dsapi.syntax.mhs
Class GlobalDomainIdentifier
java.lang.Object
com.isode.dsapi.syntax.IsodeSyntax<MHSR.GlobalDomainIdentifier>
com.isode.dsapi.syntax.mhs.GlobalDomainIdentifier
Class representation of an GlobalDomainIdentifier. Users may create
values from Strings, BER, or AttributeValue objects.
This class works by holding an
MHSR.GlobalDomainIdentifier
object, and providing a slightly more user-friendly set of methods which
access and manipulate fields inside that object.
GlobalDomainIdentifier looks like this:
GlobalDomainIdentifier ::= [APPLICATION 3] SEQUENCE { country-name CountryName, administration-domain-name AdministrationDomainName, private-domain-identifier PrivateDomainIdentifier OPTIONAL }
The various set()
methods may be used to set individual
fields in an GlobalDomainIdentifier, but note that doing this can result
in an "invalid" value. For example, it is not legal to have an
value with no ADMD field. Since it can be useful to set fields in an arbitrary
order, the set()
methods do not throw exceptions in such
cases, although calling IsodeSyntax.getAttributeValue(AttributeType)
will
do so. The IsodeSyntax.isValid()
method may be used to determine
whether an object contains a valid value.
- Since:
- 14.6
- Author:
- nh
-
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
ConstructorsConstructorDescriptionCreate an empty object, which my itself not be a valid GlobalDomainIdentifier, but can become one if fields in it are set appropriately.GlobalDomainIdentifier
(byte[] ber) Construct a new object based on a byte array containing the BER representation of an GlobalDomainIdentifier.Create a new GlobalDomainIdentifier object from a suitable AttributeValue.Create a new GlobalDomainIdentifier object from a string representation. -
Method Summary
Modifier and TypeMethodDescriptiongetADMD()
Return the AdministrationDomainName component of this valueReturn the "country" component of this valueReturn a reference to the underlying asn representation of this objectgetPRMD()
Return the PrivateDomainIdentifier component of this valueprotected 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 specified byte array into ASN representationvoid
reset()
Clear all fields in the object.void
Set the ADMDvoid
setCountry
(String newval) Set the country name.void
Set the PRMDMethods inherited from class com.isode.dsapi.syntax.IsodeSyntax
equals, getAsnVal, getAttributeValue, getAttributeValue, getStringRepresentation, hashCode, isNumeric, isValid, isValidStringValue, set, toString
-
Constructor Details
-
GlobalDomainIdentifier
public GlobalDomainIdentifier()Create an empty object, which my itself not be a valid GlobalDomainIdentifier, but can become one if fields in it are set appropriately. -
GlobalDomainIdentifier
Create a new GlobalDomainIdentifier object from a string representation.- Parameters:
str
- String representation. Must not be null.- Throws:
BadValueException
- if str is not a valid GlobalDomainIdentifierBadSyntaxException
- it is not possible to parse GlobalDomainIdentifier values
-
GlobalDomainIdentifier
Create a new GlobalDomainIdentifier object from a suitable AttributeValue.- Parameters:
av
- AttributeValue. Must not be null.- Throws:
BadValueException
- if av is not a valid GlobalDomainIdentifierBadSyntaxException
- it is not possible to parse GlobalDomainIdentifier values
-
GlobalDomainIdentifier
Construct a new object based on a byte array containing the BER representation of an GlobalDomainIdentifier.- Parameters:
ber
- BER representation of an GlobalDomainIdentifier value- Throws:
BadValueException
- if ber doesn't hold a valid GlobalDomainIdentifier 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<MHSR.GlobalDomainIdentifier>
- Returns:
- a SyntaxInfo describing the syntax represented by the subclass.
- Throws:
BadSyntaxException
- if no SyntaxInfo is available for this syntax.
-
parse
Decode the specified byte array into ASN representation- Specified by:
parse
in classIsodeSyntax<MHSR.GlobalDomainIdentifier>
- Parameters:
berRepresentation
- putative value in BER- Throws:
BadValueException
-
reset
public void reset()Clear all fields in the object. The object will not be a valid GlobalDomainIdentifier, but may become one if fields inside it are set appropriately.- Specified by:
reset
in classIsodeSyntax<MHSR.GlobalDomainIdentifier>
-
getCountry
Return the "country" component of this value- Returns:
- the country, as a String
-
getADMD
Return the AdministrationDomainName component of this value- Returns:
- the AdministrationDomainName
-
getPRMD
Return the PrivateDomainIdentifier component of this value- Returns:
- the PrivateDomainIdentifier
-
setCountry
Set the country name. Note that no validation is performed on the value supplied (i.e. it won't be checked for being a legitimate two-character country name)- Parameters:
newval
- new country name, or null for no value
-
setADMD
Set the ADMD- Parameters:
newval
- new ADMD, or null for no value
-
setPRMD
Set the PRMD- Parameters:
newval
- new PRMD, or null for no value
-
getMhsrGlobalDomainIdentifier
Return a reference to the underlying asn representation of this object- Returns:
- the MHSR.GlobalDomainIdentifier object.
-