Class EncodedExternal
- java.lang.Object
-
- com.opencloud.util.ImmutableDataObject
-
- 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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EncodedExternal.ExternalEncoding
Possible encoding forms.
-
Constructor Summary
Constructors Constructor Description EncodedExternal(ObjectID directReference, byte[] encodedSingleASN1Type)
Construct a representation of an EXTERNAL, identified by a direct-reference only, with a single-ASN1-type encoding.EncodedExternal(ObjectID directReference, Long indirectReference, String dataValueDescriptor, EncodedExternal.ExternalEncoding encoding, byte[] encodedValue, Throwable decodingError)
Construct a representation of an EXTERNAL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getDataValueDescriptor()
Get the EXTERNAL's data-value-descriptor, if presentThrowable
getDecodingError()
Get the decoding error associated with this EXTERNAL.ObjectID
getDirectReference()
Get the EXTERNAL's direct-reference, if presentbyte[]
getEncodedValue()
Get the encoded value of this EXTERNAL, as a byte arrayEncodedExternal.ExternalEncoding
getEncoding()
Get the type of encoding used by this EXTERNALLong
getIndirectReference()
Get the EXTERNAL's indirect-reference, if presentint
hashCode()
String
toString()
-
Methods inherited from class com.opencloud.util.ImmutableDataObject
clone, isReadOnly, setReadOnly
-
-
-
-
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 EXTERNALencodedSingleASN1Type
- 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, ornull
if not presentindirectReference
- the indirect-reference identifying the EXTERNAL, ornull
if not presentdataValueDescriptor
- the data-value-descriptor describing the EXTERNAL, ornull
if not presentencoding
- the encoding to use for the EXTERNALencodedValue
- the encoded value of the EXTERNAL's contentsdecodingError
- 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
-
getEncoding
public EncodedExternal.ExternalEncoding getEncoding()
Get the type of encoding used by this EXTERNAL- Returns:
- an enum describing the encoding
-
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
-
-