Class RTSCredentials

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

public class RTSCredentials extends IsodeSyntax<MHSR.RTSCredentials>
Class representation of an RTSCredentials value. Users may create values from Strings, BER, or AttributeValue objects.

This class works by holding an MHSR.RTSCredentials object, and providing a slightly more user-friendly set of methods which access and manipulate fields inside that object. See RFC 1801 for description of MTAInfo, which says it looks like this:

 RTSCredentials ::= SEQUENCE {
       request [0] MTAandPassword OPTIONAL,
       response [1] MTAandPassword OPTIONAL }
       
 MTAandPassword ::= SEQUENCE {
       MTAName,
       Password }              -- MTAName and Password
                               -- from X.411
 
and from X.411:
 MTAName ::= IA5String (SIZE (1..ub-mta-name-length)) 
 
This class supports access (via set and get methods) to all of the above fields.
Author:
nh
  • Constructor Details

    • RTSCredentials

      public RTSCredentials(MHSR.RTSCredentials val)
      Create a new RTSCredentials 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
    • RTSCredentials

      public RTSCredentials(String str) throws BadValueException, BadSyntaxException
      Create a new RTSCredentials object from a string representation.
      Parameters:
      str - String representation. Must not be null.
      Throws:
      BadValueException - if str is not a valid RTSCredentials
      BadSyntaxException - it is not possible to parse RTSCredentials values
    • RTSCredentials

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

      public RTSCredentials(byte[] ber) throws BadValueException
      Construct a new object based on a byte array containing the BER representation of an RTSCredentials.
      Parameters:
      ber - BER representation of an RTSCredentials value
      Throws:
      BadValueException - if ber doesn't hold a valid RTSCredentials value
      Since:
      14.4
    • RTSCredentials

      public RTSCredentials(String reqMtaName, String reqMtaPassword, String respMtaName, String respMtaPassword)
      Construct a new object based on a set of fields.
      Parameters:
      reqMtaName - Requesting MTA's name.
      reqMtaPassword - Requesting MTA's password.
      respMtaName - Responding MTA's name.
      respMtaPassword - Responding MTA's password.
  • 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.RTSCredentials>
      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.RTSCredentials>
      Parameters:
      berRepresentation - putative value in BER
      Throws:
      BadValueException
    • getMhsrRtsCredentials

      public MHSR.RTSCredentials getMhsrRtsCredentials()
      Return a reference to the underlying asn representation of this object
      Returns:
      the MHSR.RTSCredentials object.
      Since:
      14.4
    • getReqMtaName

      public String getReqMtaName()
      Determine the Requesting MTA's name.
      Returns:
      a String containing the Requesting MTA's name, or null if none is available.
    • getReqMtaPassword

      public String getReqMtaPassword()
      Determine the Requesting MTA's password.
      Returns:
      a String containing the Requesting MTA's password, or null if none is available.
    • getRespMtaName

      public String getRespMtaName()
      Determine the Responding MTA's name.
      Returns:
      a String containing the Respnding MTA's name, or null if none is available.
    • getRespMtaPassword

      public String getRespMtaPassword()
      Determine the Responding MTA's password.
      Returns:
      a String containing the Responding MTA's password, or null if none is available.
    • setReqMtaName

      public void setReqMtaName(String newVal)
      Set the requesting MTA's name. Other fields remain unchanged.
      Parameters:
      newVal - the new name to be used. Must not be null.
    • setReqMtaPassword

      public void setReqMtaPassword(String newVal)
      Set the requesting MTA's password. Other fields remain unchanged.
      Parameters:
      newVal - the new name to be used. Must not be null.
    • setRespMtaName

      public void setRespMtaName(String newVal)
      Set the responding MTA's name. Other fields remain unchanged.
      Parameters:
      newVal - the new name to be used. Must not be null.
    • setRespMtaPassword

      public void setRespMtaPassword(String newVal)
      Set the responding MTA's password. Other fields remain unchanged.
      Parameters:
      newVal - the new name to be used. Must not be null.
    • reset

      public void reset()
      Clear all fields in the object. The object will not be a valid RTSCredentials, but may become one if fields inside it are set appropriately.
      Specified by:
      reset in class IsodeSyntax<MHSR.RTSCredentials>
      Since:
      14.6