Class EncodedExternal

  • All Implemented Interfaces:
    DataObject, Immutable, Serializable

    public final class EncodedExternal
    extends ImmutableDataObject
    Represents an undecoded EXTERNAL ASN.1 type.

    This class is used to pass EXTERNALs in UserInformation to services when there is no specific codec available, and can also be used by services to send UserInformation blobs without involving a codec.

    Additionally, this class is used if a specific codec is available, but decoding of a network message fails. In that case, an instance of EncodedExternal is built containing the undecoded message content and an exception object describing the decoding error that occurred.

    See Also:
    Serialized Form
    • Constructor Detail

      • EncodedExternal

        public EncodedExternal​(ObjectID directReference,
                               byte[] encodedSingleASN1Type)
        Construct a representation of an EXTERNAL, identified by a direct-reference only, with a single-ASN1-type encoding. This is a shortcut constructor for the common case.
        Parameters:
        directReference - the direct reference identifying the EXTERNAL
        encodedSingleASN1Type - the BER encoding of a single ASN.1 type's value
      • EncodedExternal

        public EncodedExternal​(ObjectID directReference,
                               Long indirectReference,
                               String dataValueDescriptor,
                               EncodedExternal.ExternalEncoding encoding,
                               byte[] encodedValue,
                               Throwable decodingError)
        Construct a representation of an EXTERNAL.
        Parameters:
        directReference - the direct-reference identifying the EXTERNAL, or null if not present
        indirectReference - the indirect-reference identifying the EXTERNAL, or null if not present
        dataValueDescriptor - the data-value-descriptor describing the EXTERNAL, or null if not present
        encoding - the encoding to use for the EXTERNAL
        encodedValue - the encoded value of the EXTERNAL's contents
        decodingError - any exception associated with decoding this EXTERNAL.
    • Method Detail

      • getDirectReference

        public ObjectID getDirectReference()
        Get the EXTERNAL's direct-reference, if present
        Returns:
        the direct-reference, or null if not present
      • getIndirectReference

        public Long getIndirectReference()
        Get the EXTERNAL's indirect-reference, if present
        Returns:
        the indirect-reference, or null if not present
      • getDataValueDescriptor

        public String getDataValueDescriptor()
        Get the EXTERNAL's data-value-descriptor, if present
        Returns:
        the data-value-descriptor, or null if not present
      • getEncodedValue

        public byte[] getEncodedValue()
        Get the encoded value of this EXTERNAL, as a byte array
        Returns:
        the encoded value
      • getDecodingError

        public Throwable getDecodingError()
        Get the decoding error associated with this EXTERNAL. This is only non-null if this instance was built due to a decoding error when attempting to decode an EXTERNAL to a type-specific object.
        Returns:
        the decoding error if present, or null if this instance did not result from a decoding error
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object