Class AddressSynonym

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

public class AddressSynonym extends IsodeSyntax<MHSR.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
  • Constructor Details

    • AddressSynonym

      public AddressSynonym(MHSR.AddressSynonym val)
      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

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

      public AddressSynonym(AttributeValue av) throws BadValueException, BadSyntaxException
      Create a new AddressSynonym object from a suitable AttributeValue.
      Parameters:
      av - AttributeValue. Must not be null.
      Throws:
      BadValueException - if av is not a valid AddressSynonym
      BadSyntaxException - it is not possible to parse AddressSynonym values
      NativeLibraryException - if an unrecoverable error was detected by the native library
    • AddressSynonym

      public AddressSynonym(DN target, MHSR.SynonymType type) throws BadValueException
      Construct a new object based on a target DN and type
      Parameters:
      target - the target DN
      type - type synonym type
      Throws:
      BadValueException - if the supplied values cannot be converted into an AddressSynonym
    • AddressSynonym

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

      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.AddressSynonym>
      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
      Parse the specified byte array into asn representation
      Specified by:
      parse in class IsodeSyntax<MHSR.AddressSynonym>
      Parameters:
      berRepresentation - putative value in BER
      Throws:
      BadValueException
    • addElement

      public void addElement(DN target, MHSR.SynonymType type) throws BadValueException, BadDNException
      Throws:
      BadValueException
      BadDNException
    • getMhsrAddressSynonym

      public MHSR.AddressSynonym 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

      public MHSR.SynonymType getSynonymType(int index)
      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 SynonymType
      NativeLibraryException - if an unrecoverable error was detected by the native library
    • setSynonymType

      public void setSynonymType(int index, MHSR.SynonymType newType)
      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

      public DN getSynonymTarget(int index)
      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

      public void setSynonymTarget(int index, DN newTarget) throws BadValueException
      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 class IsodeSyntax<MHSR.AddressSynonym>
      Since:
      14.6