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 voidcheckFieldsSet()Checks that all mandatory fields are present.CAPIPSSPCapabilitiesclone()Constructs a copy of this object and everything reachable from it.static CAPIPSSPCapabilitiescopyOf(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 voiddecode()Computes the decoded form from the encoded form.protected voidencode()Computes the encoded form from the decoded form.protected booleanencodedIsInvalid()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.booleangetIPRoutingAddressSupported()Gets the value of whether IP routing address is supported.booleangetVoiceBackSupported()Gets the value of whether voice back is supported.booleangetVoiceGenerationFromTextSupported()Gets the value of whether voice generation from text is supported.booleangetVoiceInformationViaSpeechSupported()Gets the value of whether voice information via speech is supported.booleangetVoiceInformationViaVoiceSupported()Gets the value of whether voice information via voice is supported.booleanhasBilateralPart()Tests whether the field BilateralPart has a value.booleanhasIPRoutingAddressSupported()Tests whether the field IPRoutingAddressSupported has a value.booleanhasVoiceBackSupported()Tests whether the field VoiceBackSupported has a value.booleanhasVoiceGenerationFromTextSupported()Tests whether the field VoiceGenerationFromTextSupported has a value.booleanhasVoiceInformationViaSpeechSupported()Tests whether the field VoiceInformationViaSpeechSupported has a value.booleanhasVoiceInformationViaVoiceSupported()Tests whether the field VoiceInformationViaVoiceSupported has a value.CAPIPSSPCapabilitiessetBilateralPart(byte[] value)Sets the value of the bilateral part.CAPIPSSPCapabilitiessetIPRoutingAddressSupported(boolean value)Sets the value of whether IP routing address is supported.CAPIPSSPCapabilitiessetIPRoutingAddressSupportedPresent(boolean flag)Sets the presence or absence of the field IPRoutingAddressSupported.CAPIPSSPCapabilitiessetVoiceBackSupported(boolean value)Sets the value of whether voice back is supported.CAPIPSSPCapabilitiessetVoiceBackSupportedPresent(boolean flag)Sets the presence or absence of the field VoiceBackSupported.CAPIPSSPCapabilitiessetVoiceGenerationFromTextSupported(boolean value)Sets the value of whether voice generation from text is supported.CAPIPSSPCapabilitiessetVoiceGenerationFromTextSupportedPresent(boolean flag)Sets the presence or absence of the field VoiceGenerationFromTextSupported.CAPIPSSPCapabilitiessetVoiceInformationViaSpeechSupported(boolean value)Sets the value of whether voice information via speech is supported.CAPIPSSPCapabilitiessetVoiceInformationViaSpeechSupportedPresent(boolean flag)Sets the presence or absence of the field VoiceInformationViaSpeechSupported.CAPIPSSPCapabilitiessetVoiceInformationViaVoiceSupported(boolean value)Sets the value of whether voice information via voice is supported.CAPIPSSPCapabilitiessetVoiceInformationViaVoiceSupportedPresent(boolean flag)Sets the presence or absence of the field VoiceInformationViaVoiceSupported.voidtoStream(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 indexstartand islenbytes 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:
toStreamin interfaceFastSerializable- Parameters:
out- the stream to write to- Throws:
IOException- if an I/O error occurs
-
hasIPRoutingAddressSupported
public boolean hasIPRoutingAddressSupported() throws DecodeExceptionTests 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 DecodeExceptionTests 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 DecodeExceptionTests 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 DecodeExceptionTests 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 DecodeExceptionTests 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 DecodeExceptionTests 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 EncodeExceptionChecks that all mandatory fields are present. Should be called immediately before all calls to encode().- Specified by:
checkFieldsSetin classAbstractLazyEncodedDataObject<byte[]>- Throws:
EncodeException- if any mandatory field is not present
-
getIPRoutingAddressSupported
public boolean getIPRoutingAddressSupported() throws DecodeExceptionGets 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 DecodeExceptionGets 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 DecodeExceptionGets 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 DecodeExceptionGets 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 DecodeExceptionGets 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 DecodeExceptionGets 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:
clonein interfaceDataObject- Specified by:
clonein 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:
getFieldsMapin 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 EncodeExceptionGets 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:
encodein classAbstractLazyEncodedDataObject<byte[]>
-
decode
protected void decode()
Computes the decoded form from the encoded form.- Specified by:
decodein classAbstractLazyEncodedDataObject<byte[]>
-
-