Class 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
  • Constructor Details

    • FailoverContext

      public FailoverContext(int id, DN prefix)
      Create a new FailoverContext from a set of fields
      Parameters:
      id - the id
      prefix - the prefix
    • FailoverContext

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

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

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

      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<FailoverSyntax.FailoverContext>
      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 specifed byte array into ASN representation
      Specified by:
      parse in class IsodeSyntax<FailoverSyntax.FailoverContext>
      Parameters:
      berRepresentation - putative value in BER
      Throws:
      BadValueException
    • reset

      public void reset()
      Description copied from class: IsodeSyntax
      Clear 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 the IsodeSyntax() constructor.
      Specified by:
      reset in class IsodeSyntax<FailoverSyntax.FailoverContext>
    • getId

      public int getId()
      Return the id
      Returns:
      the id
    • getPrefix

      public DN getPrefix()
      Return the prefix
      Returns:
      the prefix
    • compareTo

      public int compareTo(FailoverContext other)
      Compares with another FailoverContext. Prefix DNs are compared first; if they're the same, then ids are compared.
      Specified by:
      compareTo in interface Comparable<FailoverContext>
      Returns:
      -1 if this object is "less" than the other, 0 if they're "the same", and 1 if this object is "greater"