Class GlobalDomainIdentifier

java.lang.Object
com.isode.dsapi.syntax.IsodeSyntax<MHSR.GlobalDomainIdentifier>
com.isode.dsapi.syntax.mhs.GlobalDomainIdentifier

public class GlobalDomainIdentifier extends IsodeSyntax<MHSR.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
  • 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

      public GlobalDomainIdentifier(String str) throws BadValueException, BadSyntaxException
      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 GlobalDomainIdentifier
      BadSyntaxException - it is not possible to parse GlobalDomainIdentifier values
    • GlobalDomainIdentifier

      public GlobalDomainIdentifier(AttributeValue av) throws BadValueException, BadSyntaxException
      Create a new GlobalDomainIdentifier object from a suitable AttributeValue.
      Parameters:
      av - AttributeValue. Must not be null.
      Throws:
      BadValueException - if av is not a valid GlobalDomainIdentifier
      BadSyntaxException - it is not possible to parse GlobalDomainIdentifier values
    • GlobalDomainIdentifier

      public GlobalDomainIdentifier(byte[] ber) throws BadValueException
      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

      protected IsodeSyntax.SyntaxInfo getSyntaxInfo() throws BadSyntaxException
      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 class IsodeSyntax<MHSR.GlobalDomainIdentifier>
      Returns:
      a SyntaxInfo describing the syntax represented by the subclass.
      Throws:
      BadSyntaxException - if no SyntaxInfo is available for this syntax.
    • parse

      protected void parse(byte[] berRepresentation) throws BadValueException
      Decode the specified byte array into ASN representation
      Specified by:
      parse in class IsodeSyntax<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 class IsodeSyntax<MHSR.GlobalDomainIdentifier>
    • getCountry

      public String getCountry()
      Return the "country" component of this value
      Returns:
      the country, as a String
    • getADMD

      public String getADMD()
      Return the AdministrationDomainName component of this value
      Returns:
      the AdministrationDomainName
    • getPRMD

      public String getPRMD()
      Return the PrivateDomainIdentifier component of this value
      Returns:
      the PrivateDomainIdentifier
    • setCountry

      public void setCountry(String newval)
      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

      public void setADMD(String newval)
      Set the ADMD
      Parameters:
      newval - new ADMD, or null for no value
    • setPRMD

      public void setPRMD(String newval)
      Set the PRMD
      Parameters:
      newval - new PRMD, or null for no value
    • getMhsrGlobalDomainIdentifier

      public MHSR.GlobalDomainIdentifier getMhsrGlobalDomainIdentifier()
      Return a reference to the underlying asn representation of this object
      Returns:
      the MHSR.GlobalDomainIdentifier object.