Package com.isode.dsapi.syntax.mhs
Class 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.411and 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
-
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
ConstructorsConstructorDescriptionRTSCredentials
(byte[] ber) Construct a new object based on a byte array containing the BER representation of an RTSCredentials.Create a new RTSCredentials object from an existing ASN representation.Create a new RTSCredentials object from a suitable AttributeValue.RTSCredentials
(String str) Create a new RTSCredentials object from a string representation.RTSCredentials
(String reqMtaName, String reqMtaPassword, String respMtaName, String respMtaPassword) Construct a new object based on a set of fields. -
Method Summary
Modifier and TypeMethodDescriptionReturn a reference to the underlying asn representation of this objectDetermine the Requesting MTA's name.Determine the Requesting MTA's password.Determine the Responding MTA's name.Determine the Responding MTA's password.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) Parse the specified byte array into asn representationvoid
reset()
Clear all fields in the object.void
setReqMtaName
(String newVal) Set the requesting MTA's name.void
setReqMtaPassword
(String newVal) Set the requesting MTA's password.void
setRespMtaName
(String newVal) Set the responding MTA's name.void
setRespMtaPassword
(String newVal) Set the responding MTA's password.Methods inherited from class com.isode.dsapi.syntax.IsodeSyntax
equals, getAsnVal, getAttributeValue, getAttributeValue, getStringRepresentation, hashCode, isNumeric, isValid, isValidStringValue, set, toString
-
Constructor Details
-
RTSCredentials
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
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 RTSCredentialsBadSyntaxException
- it is not possible to parse RTSCredentials values
-
RTSCredentials
Create a new RTSCredentials object from a suitable AttributeValue.- Parameters:
av
- AttributeValue. Must not be null.- Throws:
BadValueException
- if av is not a valid RTSCredentialsBadSyntaxException
- it is not possible to parse RTSCredentials valuesNativeLibraryException
- if an unrecoverable error was detected by the native library
-
RTSCredentials
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
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.RTSCredentials>
- Returns:
- a SyntaxInfo describing the syntax represented by the subclass.
- Throws:
BadSyntaxException
- if no SyntaxInfo is available for this syntax.
-
parse
Parse the specified byte array into asn representation- Specified by:
parse
in classIsodeSyntax<MHSR.RTSCredentials>
- Parameters:
berRepresentation
- putative value in BER- Throws:
BadValueException
-
getMhsrRtsCredentials
Return a reference to the underlying asn representation of this object- Returns:
- the MHSR.RTSCredentials object.
- Since:
- 14.4
-
getReqMtaName
Determine the Requesting MTA's name.- Returns:
- a String containing the Requesting MTA's name, or null if none is available.
-
getReqMtaPassword
Determine the Requesting MTA's password.- Returns:
- a String containing the Requesting MTA's password, or null if none is available.
-
getRespMtaName
Determine the Responding MTA's name.- Returns:
- a String containing the Respnding MTA's name, or null if none is available.
-
getRespMtaPassword
Determine the Responding MTA's password.- Returns:
- a String containing the Responding MTA's password, or null if none is available.
-
setReqMtaName
Set the requesting MTA's name. Other fields remain unchanged.- Parameters:
newVal
- the new name to be used. Must not be null.
-
setReqMtaPassword
Set the requesting MTA's password. Other fields remain unchanged.- Parameters:
newVal
- the new name to be used. Must not be null.
-
setRespMtaName
Set the responding MTA's name. Other fields remain unchanged.- Parameters:
newVal
- the new name to be used. Must not be null.
-
setRespMtaPassword
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 classIsodeSyntax<MHSR.RTSCredentials>
- Since:
- 14.6
-