Package com.isode.dsapi.syntax
Class FailoverContext
java.lang.Object
com.isode.dsapi.syntax.IsodeSyntax<FailoverSyntax.FailoverContext>
com.isode.dsapi.syntax.FailoverContext
- All Implemented Interfaces:
Comparable<FailoverContext>
public class FailoverContext
extends IsodeSyntax<FailoverSyntax.FailoverContext>
implements Comparable<FailoverContext>
Class representation of a FailoverContext value.
This is an immutable class (no setters in this implementation)
This class works by holding an
FailoverSyntax.FailoverContext
object, and providing a slightly more user-friendly set of methods which
access and manipulate fields inside that object.
The ASN for a FailoverContext is:
FailoverContext ::= SEQUENCE {
id INTEGER,
prefix DN
- Since:
- 15.0
-
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
ConstructorsConstructorDescriptionFailoverContext(byte[] ber) Construct a new object based on a byte array containing the BER representation of a FailoverContext.FailoverContext(int id, DN prefix) Create a new FailoverContext from a set of fieldsCreate a new FailoverContext object from a suitable AttributeValue.FailoverContext(String str) Create a new FailoverContext object from a String representation -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(FailoverContext other) Compares with another FailoverContext.intgetId()Return the idReturn the prefixprotected IsodeSyntax.SyntaxInfoSubclasses must implement a method which returns a SyntaxInfo object that can be used by the IsodeSyntax class.protected voidparse(byte[] berRepresentation) Decode the specifed byte array into ASN representationvoidreset()Clear all fields in the object.Methods inherited from class com.isode.dsapi.syntax.IsodeSyntax
equals, getAsnVal, getAttributeValue, getAttributeValue, getStringRepresentation, hashCode, isNumeric, isValid, isValidStringValue, set, toString
-
Constructor Details
-
FailoverContext
Create a new FailoverContext from a set of fields- Parameters:
id- the idprefix- the prefix
-
FailoverContext
Create a new FailoverContext object from a String representation- Parameters:
str- String representation; must not be null- Throws:
BadValueException- if str is not a valid FailoverContextBadSyntaxException- if it is not possible to parse FailoverContext values
-
FailoverContext
Create a new FailoverContext object from a suitable AttributeValue.- Parameters:
av- AttributeValue. Must not be null.- Throws:
BadValueException- if av is not a valid FailoverContextBadSyntaxException- it is not possible to parse FailoverContext values
-
FailoverContext
Construct a new object based on a byte array containing the BER representation of a FailoverContext.- Parameters:
ber- BER representation of a FailoverContext value- Throws:
BadValueException- if ber doesn't hold a valid FailoverContext value
-
-
Method Details
-
getSyntaxInfo
Description copied from class:IsodeSyntaxSubclasses must implement a method which returns a SyntaxInfo object that can be used by the IsodeSyntax class.- Specified by:
getSyntaxInfoin classIsodeSyntax<FailoverSyntax.FailoverContext>- Returns:
- a SyntaxInfo describing the syntax represented by the subclass.
- Throws:
BadSyntaxException- if no SyntaxInfo is available for this syntax.
-
parse
Decode the specifed byte array into ASN representation- Specified by:
parsein classIsodeSyntax<FailoverSyntax.FailoverContext>- Parameters:
berRepresentation- putative value in BER- Throws:
BadValueException
-
reset
public void reset()Description copied from class:IsodeSyntaxClear all fields in the object. Following this operation, the object may not be a valid value, so may need to have fields set in it to become one.Subclasses should implement a method which clears all the asn fields, e.g.
asnVal = new MHSR.GlobalDomainIdentifier(); asnVal.setAdministration_domain_name(new AdministrationDomainName()); asnVal.setCountry_name(new CountryName());
Note that this method is called by theIsodeSyntax()constructor.- Specified by:
resetin classIsodeSyntax<FailoverSyntax.FailoverContext>
-
getId
public int getId()Return the id- Returns:
- the id
-
getPrefix
Return the prefix- Returns:
- the prefix
-
compareTo
Compares with another FailoverContext. Prefix DNs are compared first; if they're the same, then ids are compared.- Specified by:
compareToin interfaceComparable<FailoverContext>- Returns:
- -1 if this object is "less" than the other, 0 if they're "the same", and 1 if this object is "greater"
-