Class CAPIPSSPCapabilities
- java.lang.Object
-
- com.opencloud.util.AbstractDataObject
-
- com.opencloud.util.AbstractFieldsObject
-
- AbstractEncodedDataObject<T>
-
- AbstractLazyEncodedDataObject<byte[]>
-
- AbstractLazyEncodedByteArray
-
- com.opencloud.slee.resources.in.datatypes.cc.CAPIPSSPCapabilities
-
- All Implemented Interfaces:
DataObject
,FastSerializable
,Serializable
public final class CAPIPSSPCapabilities extends AbstractLazyEncodedByteArray implements FastSerializable
Class CAPIPSSPCapabilities represents the specialised resource functions (SRFs) available using CAP on a service switching point (SSP). It represents the ASN.1 OCTET STRING type CAP-datatypes.IPSSPCapabilities.The API offered by this class is as if the type were specified in ASN.1 as follows.
CAPIPSSPCapabilities ::= SEQUENCE { iPRoutingAddressSupported BOOLEAN, voiceBackSupported BOOLEAN, voiceInformationViaSpeechSupported BOOLEAN, voiceInformationViaVoiceSupported BOOLEAN, voiceGenerationFromTextSupported BOOLEAN, bilateralPart OCTET STRING (SIZE (3)) OPTIONAL }
The class takes care of encoding the field values into a byte-array and decoding field values from a byte-array, the encoded representation being as tabulated below.Data Encoding - based on comment in ASN.1 module CAP-datatypes 8 7 6 5 4 3 2 1 Octet 1 0 Reserved Reserved Generation of voice announcements from text supported? VoiceInformation supported via voice recognition? VoiceInformation supported via speech recognition? VoiceBack supported? IPRoutingAddress supported? 0 to 3 octets Bilateral part: network operator / equipment vendor specific
In the above table, the octet numbering is that used in the cited comment, and field names ending in ? are booleans: 1 for true, 0 for false.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.opencloud.slee.resources.cgin.AbstractLazyEncodedDataObject
isDecoded
-
Fields inherited from class com.opencloud.slee.resources.cgin.AbstractEncodedDataObject
encoded
-
Fields inherited from class com.opencloud.util.AbstractFieldsObject
FIELD_ABSENT, FIELD_UNINITIALISED
-
-
Constructor Summary
Constructors Constructor Description CAPIPSSPCapabilities()
Constructs a new CAPIPSSPCapabilities object with no fields set.CAPIPSSPCapabilities(byte[] data)
Constructs a new CAPIPSSPCapabilities object from network-encoded data.CAPIPSSPCapabilities(byte[] data, int start, int len)
Constructs a new CAPIPSSPCapabilities object from part of network-encoded data.CAPIPSSPCapabilities(DataInput in)
Constructs a new CAPIPSSPCapabilities object from data deserialized from a stream that was written bytoStream(DataOutput)
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkFieldsSet()
Checks that all mandatory fields are present.CAPIPSSPCapabilities
clone()
Constructs a copy of this object and everything reachable from it.static CAPIPSSPCapabilities
copyOf(CAPIPSSPCapabilities from)
Creates a new object of this type, cloning the values of common fields from the given object of any subclass of the same base type.protected void
decode()
Computes the decoded form from the encoded form.protected void
encode()
Computes the encoded form from the decoded form.protected boolean
encodedIsInvalid()
Determines whether the encoded form is invalid.byte[]
getBilateralPart()
Gets the value of the bilateral part.byte[]
getEncodedForm()
Gets the encoded form.static FieldAccessor[]
getFieldAccessors()
Gets a new array of the accessors for fields of this type.Map<String,Object>
getFieldsMap(boolean withAbsents)
Gets a Map from field-name to field-value for the fields of a sequence.boolean
getIPRoutingAddressSupported()
Gets the value of whether IP routing address is supported.boolean
getVoiceBackSupported()
Gets the value of whether voice back is supported.boolean
getVoiceGenerationFromTextSupported()
Gets the value of whether voice generation from text is supported.boolean
getVoiceInformationViaSpeechSupported()
Gets the value of whether voice information via speech is supported.boolean
getVoiceInformationViaVoiceSupported()
Gets the value of whether voice information via voice is supported.boolean
hasBilateralPart()
Tests whether the field BilateralPart has a value.boolean
hasIPRoutingAddressSupported()
Tests whether the field IPRoutingAddressSupported has a value.boolean
hasVoiceBackSupported()
Tests whether the field VoiceBackSupported has a value.boolean
hasVoiceGenerationFromTextSupported()
Tests whether the field VoiceGenerationFromTextSupported has a value.boolean
hasVoiceInformationViaSpeechSupported()
Tests whether the field VoiceInformationViaSpeechSupported has a value.boolean
hasVoiceInformationViaVoiceSupported()
Tests whether the field VoiceInformationViaVoiceSupported has a value.CAPIPSSPCapabilities
setBilateralPart(byte[] value)
Sets the value of the bilateral part.CAPIPSSPCapabilities
setIPRoutingAddressSupported(boolean value)
Sets the value of whether IP routing address is supported.CAPIPSSPCapabilities
setIPRoutingAddressSupportedPresent(boolean flag)
Sets the presence or absence of the field IPRoutingAddressSupported.CAPIPSSPCapabilities
setVoiceBackSupported(boolean value)
Sets the value of whether voice back is supported.CAPIPSSPCapabilities
setVoiceBackSupportedPresent(boolean flag)
Sets the presence or absence of the field VoiceBackSupported.CAPIPSSPCapabilities
setVoiceGenerationFromTextSupported(boolean value)
Sets the value of whether voice generation from text is supported.CAPIPSSPCapabilities
setVoiceGenerationFromTextSupportedPresent(boolean flag)
Sets the presence or absence of the field VoiceGenerationFromTextSupported.CAPIPSSPCapabilities
setVoiceInformationViaSpeechSupported(boolean value)
Sets the value of whether voice information via speech is supported.CAPIPSSPCapabilities
setVoiceInformationViaSpeechSupportedPresent(boolean flag)
Sets the presence or absence of the field VoiceInformationViaSpeechSupported.CAPIPSSPCapabilities
setVoiceInformationViaVoiceSupported(boolean value)
Sets the value of whether voice information via voice is supported.CAPIPSSPCapabilities
setVoiceInformationViaVoiceSupportedPresent(boolean flag)
Sets the presence or absence of the field VoiceInformationViaVoiceSupported.void
toStream(DataOutput out)
Serializes this object to a stream in a form suitable for reading byCAPIPSSPCapabilities(DataInput)
.-
Methods inherited from class com.opencloud.slee.resources.cgin.AbstractLazyEncodedDataObject
checkDecode, checkModifyAndDecode
-
Methods inherited from class com.opencloud.util.AbstractFieldsObject
equals, hashCode, toString
-
Methods inherited from class com.opencloud.util.AbstractDataObject
checkModify, isReadOnly, setReadOnly
-
-
-
-
Constructor Detail
-
CAPIPSSPCapabilities
public CAPIPSSPCapabilities()
Constructs a new CAPIPSSPCapabilities object with no fields set.
-
CAPIPSSPCapabilities
public CAPIPSSPCapabilities(byte[] data)
Constructs a new CAPIPSSPCapabilities object from network-encoded data. The data is not decoded and might not be decodable.- Parameters:
data
- network-encoded data- Throws:
NullPointerException
- if data is null
-
CAPIPSSPCapabilities
public CAPIPSSPCapabilities(byte[] data, int start, int len)
Constructs a new CAPIPSSPCapabilities object from part of network-encoded data. The part starts at indexstart
and islen
bytes long. The data is not decoded and might not be decodable.- Parameters:
data
- network-encoded datastart
- starting offset of network-encoded data in byte arraylen
- default length if not predictable- Throws:
NullPointerException
- if data is nullIllegalArgumentException
- if len is negative
-
CAPIPSSPCapabilities
public CAPIPSSPCapabilities(DataInput in) throws IOException
Constructs a new CAPIPSSPCapabilities object from data deserialized from a stream that was written bytoStream(DataOutput)
.- Parameters:
in
- the stream to read from- Throws:
EOFException
- if reading is pre-empted by end-of-fileIOException
- if the data cannot be read
-
-
Method Detail
-
toStream
public void toStream(DataOutput out) throws IOException
Serializes this object to a stream in a form suitable for reading byCAPIPSSPCapabilities(DataInput)
.- Specified by:
toStream
in interfaceFastSerializable
- Parameters:
out
- the stream to write to- Throws:
IOException
- if an I/O error occurs
-
hasIPRoutingAddressSupported
public boolean hasIPRoutingAddressSupported() throws DecodeException
Tests whether the field IPRoutingAddressSupported has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setIPRoutingAddressSupportedPresent
public CAPIPSSPCapabilities setIPRoutingAddressSupportedPresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field IPRoutingAddressSupported.- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
hasVoiceBackSupported
public boolean hasVoiceBackSupported() throws DecodeException
Tests whether the field VoiceBackSupported has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setVoiceBackSupportedPresent
public CAPIPSSPCapabilities setVoiceBackSupportedPresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field VoiceBackSupported.- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
hasVoiceInformationViaSpeechSupported
public boolean hasVoiceInformationViaSpeechSupported() throws DecodeException
Tests whether the field VoiceInformationViaSpeechSupported has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setVoiceInformationViaSpeechSupportedPresent
public CAPIPSSPCapabilities setVoiceInformationViaSpeechSupportedPresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field VoiceInformationViaSpeechSupported.- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
hasVoiceInformationViaVoiceSupported
public boolean hasVoiceInformationViaVoiceSupported() throws DecodeException
Tests whether the field VoiceInformationViaVoiceSupported has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setVoiceInformationViaVoiceSupportedPresent
public CAPIPSSPCapabilities setVoiceInformationViaVoiceSupportedPresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field VoiceInformationViaVoiceSupported.- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
hasVoiceGenerationFromTextSupported
public boolean hasVoiceGenerationFromTextSupported() throws DecodeException
Tests whether the field VoiceGenerationFromTextSupported has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setVoiceGenerationFromTextSupportedPresent
public CAPIPSSPCapabilities setVoiceGenerationFromTextSupportedPresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field VoiceGenerationFromTextSupported.- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
hasBilateralPart
public boolean hasBilateralPart() throws DecodeException
Tests whether the field BilateralPart has a value.- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
checkFieldsSet
public void checkFieldsSet() throws EncodeException
Checks that all mandatory fields are present. Should be called immediately before all calls to encode().- Specified by:
checkFieldsSet
in classAbstractLazyEncodedDataObject<byte[]>
- Throws:
EncodeException
- if any mandatory field is not present
-
getIPRoutingAddressSupported
public boolean getIPRoutingAddressSupported() throws DecodeException
Gets the value of whether IP routing address is supported.- Returns:
- boolean representation of whether IP routing address is supported
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getVoiceBackSupported
public boolean getVoiceBackSupported() throws DecodeException
Gets the value of whether voice back is supported.- Returns:
- boolean representation of whether voice back is supported
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getVoiceInformationViaSpeechSupported
public boolean getVoiceInformationViaSpeechSupported() throws DecodeException
Gets the value of whether voice information via speech is supported.- Returns:
- boolean representation of whether voice information via speech is supported
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getVoiceInformationViaVoiceSupported
public boolean getVoiceInformationViaVoiceSupported() throws DecodeException
Gets the value of whether voice information via voice is supported.- Returns:
- boolean representation of whether voice information via voice is supported
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getVoiceGenerationFromTextSupported
public boolean getVoiceGenerationFromTextSupported() throws DecodeException
Gets the value of whether voice generation from text is supported.- Returns:
- boolean representation of whether voice generation from text is supported
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getBilateralPart
public byte[] getBilateralPart() throws DecodeException
Gets the value of the bilateral part.- Returns:
- byte[] representation of the bilateral part
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setIPRoutingAddressSupported
public CAPIPSSPCapabilities setIPRoutingAddressSupported(boolean value) throws IllegalStateException
Sets the value of whether IP routing address is supported.- Parameters:
value
- boolean representation of whether IP routing address is supported- Returns:
- this
- Throws:
IllegalStateException
-
setVoiceBackSupported
public CAPIPSSPCapabilities setVoiceBackSupported(boolean value) throws IllegalStateException
Sets the value of whether voice back is supported.- Parameters:
value
- boolean representation of whether voice back is supported- Returns:
- this
- Throws:
IllegalStateException
-
setVoiceInformationViaSpeechSupported
public CAPIPSSPCapabilities setVoiceInformationViaSpeechSupported(boolean value) throws IllegalStateException
Sets the value of whether voice information via speech is supported.- Parameters:
value
- boolean representation of whether voice information via speech is supported- Returns:
- this
- Throws:
IllegalStateException
-
setVoiceInformationViaVoiceSupported
public CAPIPSSPCapabilities setVoiceInformationViaVoiceSupported(boolean value) throws IllegalStateException
Sets the value of whether voice information via voice is supported.- Parameters:
value
- boolean representation of whether voice information via voice is supported- Returns:
- this
- Throws:
IllegalStateException
-
setVoiceGenerationFromTextSupported
public CAPIPSSPCapabilities setVoiceGenerationFromTextSupported(boolean value) throws IllegalStateException
Sets the value of whether voice generation from text is supported.- Parameters:
value
- boolean representation of whether voice generation from text is supported- Returns:
- this
- Throws:
IllegalStateException
-
setBilateralPart
public CAPIPSSPCapabilities setBilateralPart(byte[] value) throws IllegalStateException
Sets the value of the bilateral part.- Parameters:
value
- byte[] representation of the bilateral part- Returns:
- this
- Throws:
IllegalStateException
-
copyOf
public static CAPIPSSPCapabilities copyOf(CAPIPSSPCapabilities from)
Creates a new object of this type, cloning the values of common fields from the given object of any subclass of the same base type.- Parameters:
from
- the object from which to copy- Returns:
- CAPIPSSPCapabilities
-
clone
public CAPIPSSPCapabilities clone()
Constructs a copy of this object and everything reachable from it.- Specified by:
clone
in interfaceDataObject
- Specified by:
clone
in classAbstractDataObject
- Returns:
- copy of object
-
getFieldAccessors
public static FieldAccessor[] getFieldAccessors()
Gets a new array of the accessors for fields of this type.- Returns:
- FieldAccessor[]
-
getFieldsMap
public Map<String,Object> getFieldsMap(boolean withAbsents)
Gets a Map from field-name to field-value for the fields of a sequence. For a field of primitive type, the field-value is boxed. For an absent optional field, the field-value is AbstractFieldsObject.FIELD_ABSENT. For an uninitialised mandatory field, the field-value is AbstractFieldsObject.FIELD_UNINITIALISED. For a field of String type, the encoded form is used if the String cannot be decoded. For a type that represents an OCTET STRING that cannot be decoded, a map from "encodedValue" to the byte array value is returned.- Specified by:
getFieldsMap
in classAbstractFieldsObject
- Parameters:
withAbsents
- whether to put absent optional fields into Map- Returns:
- Map from field-name to field-value
-
encodedIsInvalid
protected boolean encodedIsInvalid()
Determines whether the encoded form is invalid.- Returns:
- boolean
-
getEncodedForm
public byte[] getEncodedForm() throws EncodeException
Gets the encoded form.- Returns:
- encoded form
- Throws:
EncodeException
- if encoding fails
-
encode
protected void encode()
Computes the encoded form from the decoded form.- Specified by:
encode
in classAbstractLazyEncodedDataObject<byte[]>
-
decode
protected void decode()
Computes the decoded form from the encoded form.- Specified by:
decode
in classAbstractLazyEncodedDataObject<byte[]>
-
-