Class ExtForwOptions
- java.lang.Object
-
- com.opencloud.util.AbstractDataObject
-
- com.opencloud.util.AbstractFieldsObject
-
- AbstractEncodedDataObject<T>
-
- AbstractLazyEncodedDataObject<byte[]>
-
- AbstractLazyEncodedByteArray
-
- com.opencloud.slee.resources.in.datatypes.map.ForwardingOptions
-
- com.opencloud.slee.resources.in.datatypes.map.ExtForwOptions
-
- All Implemented Interfaces:
DataObject
,FastSerializable
,Serializable
public final class ExtForwOptions extends ForwardingOptions implements FastSerializable
Class ExtForwOptions represents the ASN.1 OCTET STRING type MAP-MS-DataTypes.Ext-ForwOptions. That ASN.1 type was added in R96.The API offered by this class is as if the type were specified in ASN.1 as follows.
Ext-ForwOptions ::= SEQUENCE { notificationToForwardingParty BOOLEAN, redirectingPresentation BOOLEAN, notificationToCallingParty BOOLEAN, forwardingReason ForwardingReason }
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 MAP-MS-DataTypes in 3GPP TS 29.002 V10.0.0 (2010-09) p369 8 7 6 5 4 3 2 1 Octet 1 Notification to forwarding party? Redirecting presentation? Notification to calling party? 0 Forwarding reason 0 0 0 to 4 more octets Reserved for future use
Field names ending in ? are booleans: 1 for true, 0 for false.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.opencloud.slee.resources.in.datatypes.map.ForwardingOptions
ForwardingOptions.ForwardingReason
-
-
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 ExtForwOptions()
Constructs a new ExtForwOptions object with no fields set.ExtForwOptions(boolean notificationToForwardingParty, boolean redirectingPresentation, boolean notificationToCallingParty, ForwardingOptions.ForwardingReason forwardingReason)
Constructs a new ExtForwOptions object from given values for all fields.ExtForwOptions(byte[] data)
Constructs a new ExtForwOptions object from network-encoded data.ExtForwOptions(byte[] data, int start, int len)
Constructs a new ExtForwOptions object from part of network-encoded data.ExtForwOptions(DataInput in)
Constructs a new ExtForwOptions 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.ExtForwOptions
clone()
Constructs a copy of this object and everything reachable from it.static ExtForwOptions
copyOf(ExtForwOptions 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.static int
getContainedLength(byte[] data, int start, int len)
Determines the length of the encoded value that commences at offsetstart
in the givendata
.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.ForwardingOptions.ForwardingReason
getForwardingReason()
Gets the value of Forwarding reason.boolean
getNotificationToCallingParty()
Gets the value of Notification to calling party.boolean
getNotificationToForwardingParty()
Gets the value of Notification to forwarding party.boolean
getRedirectingPresentation()
Gets the value of Redirecting presentation.boolean
hasForwardingReason()
Tests whether the field ForwardingReason has a value.boolean
hasNotificationToCallingParty()
Tests whether the field NotificationToCallingParty has a value.boolean
hasNotificationToForwardingParty()
Tests whether the field NotificationToForwardingParty has a value.boolean
hasRedirectingPresentation()
Tests whether the field RedirectingPresentation has a value.ExtForwOptions
setForwardingReason(ForwardingOptions.ForwardingReason value)
Sets the value of Forwarding reason.ExtForwOptions
setNotificationToCallingParty(boolean value)
Sets the value of Notification to calling party.ExtForwOptions
setNotificationToCallingPartyPresent(boolean flag)
Sets the presence or absence of the field NotificationToCallingParty.ExtForwOptions
setNotificationToForwardingParty(boolean value)
Sets the value of Notification to forwarding party.ExtForwOptions
setNotificationToForwardingPartyPresent(boolean flag)
Sets the presence or absence of the field NotificationToForwardingParty.ExtForwOptions
setRedirectingPresentation(boolean value)
Sets the value of Redirecting presentation.ExtForwOptions
setRedirectingPresentationPresent(boolean flag)
Sets the presence or absence of the field RedirectingPresentation.void
toStream(DataOutput out)
Serializes this object to a stream in a form suitable for reading byExtForwOptions(DataInput)
.-
Methods inherited from class com.opencloud.slee.resources.in.datatypes.map.ForwardingOptions
copyOf
-
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
-
ExtForwOptions
public ExtForwOptions()
Constructs a new ExtForwOptions object with no fields set.
-
ExtForwOptions
public ExtForwOptions(byte[] data)
Constructs a new ExtForwOptions 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
-
ExtForwOptions
public ExtForwOptions(byte[] data, int start, int len)
Constructs a new ExtForwOptions 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
-
ExtForwOptions
public ExtForwOptions(boolean notificationToForwardingParty, boolean redirectingPresentation, boolean notificationToCallingParty, ForwardingOptions.ForwardingReason forwardingReason)
Constructs a new ExtForwOptions object from given values for all fields.- Parameters:
notificationToForwardingParty
- Notification to forwarding partyredirectingPresentation
- Redirecting presentationnotificationToCallingParty
- Notification to calling partyforwardingReason
- Forwarding reason
-
ExtForwOptions
public ExtForwOptions(DataInput in) throws IOException
Constructs a new ExtForwOptions 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 byExtForwOptions(DataInput)
.- Specified by:
toStream
in interfaceFastSerializable
- Overrides:
toStream
in classForwardingOptions
- Parameters:
out
- the stream to write to- Throws:
IOException
- if an I/O error occurs
-
hasNotificationToForwardingParty
public boolean hasNotificationToForwardingParty() throws DecodeException
Tests whether the field NotificationToForwardingParty has a value.- Overrides:
hasNotificationToForwardingParty
in classForwardingOptions
- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setNotificationToForwardingPartyPresent
public ExtForwOptions setNotificationToForwardingPartyPresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field NotificationToForwardingParty.- Overrides:
setNotificationToForwardingPartyPresent
in classForwardingOptions
- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
hasRedirectingPresentation
public boolean hasRedirectingPresentation() throws DecodeException
Tests whether the field RedirectingPresentation has a value.- Overrides:
hasRedirectingPresentation
in classForwardingOptions
- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setRedirectingPresentationPresent
public ExtForwOptions setRedirectingPresentationPresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field RedirectingPresentation.- Overrides:
setRedirectingPresentationPresent
in classForwardingOptions
- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
hasNotificationToCallingParty
public boolean hasNotificationToCallingParty() throws DecodeException
Tests whether the field NotificationToCallingParty has a value.- Overrides:
hasNotificationToCallingParty
in classForwardingOptions
- Returns:
- whether the field has a value
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setNotificationToCallingPartyPresent
public ExtForwOptions setNotificationToCallingPartyPresent(boolean flag) throws IllegalStateException
Sets the presence or absence of the field NotificationToCallingParty.- Overrides:
setNotificationToCallingPartyPresent
in classForwardingOptions
- Parameters:
flag
- whether the field should be marked as present- Returns:
- this
- Throws:
IllegalStateException
- if this instance has been marked as read-only
-
hasForwardingReason
public boolean hasForwardingReason() throws DecodeException
Tests whether the field ForwardingReason has a value.- Overrides:
hasForwardingReason
in classForwardingOptions
- 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().- Overrides:
checkFieldsSet
in classForwardingOptions
- Throws:
EncodeException
- if any mandatory field is not present
-
getNotificationToForwardingParty
public boolean getNotificationToForwardingParty() throws DecodeException
Gets the value of Notification to forwarding party.- Overrides:
getNotificationToForwardingParty
in classForwardingOptions
- Returns:
- boolean representation of Notification to forwarding party
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getRedirectingPresentation
public boolean getRedirectingPresentation() throws DecodeException
Gets the value of Redirecting presentation.- Overrides:
getRedirectingPresentation
in classForwardingOptions
- Returns:
- boolean representation of Redirecting presentation
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getNotificationToCallingParty
public boolean getNotificationToCallingParty() throws DecodeException
Gets the value of Notification to calling party.- Overrides:
getNotificationToCallingParty
in classForwardingOptions
- Returns:
- boolean representation of Notification to calling party
- Throws:
DecodeException
- if encoded state cannot be decoded
-
getForwardingReason
public ForwardingOptions.ForwardingReason getForwardingReason() throws DecodeException
Gets the value of Forwarding reason.- Overrides:
getForwardingReason
in classForwardingOptions
- Returns:
- ForwardingReason representation of Forwarding reason
- Throws:
DecodeException
- if encoded state cannot be decoded
-
setNotificationToForwardingParty
public ExtForwOptions setNotificationToForwardingParty(boolean value) throws IllegalStateException
Sets the value of Notification to forwarding party.- Overrides:
setNotificationToForwardingParty
in classForwardingOptions
- Parameters:
value
- boolean representation of Notification to forwarding party- Returns:
- this
- Throws:
IllegalStateException
-
setRedirectingPresentation
public ExtForwOptions setRedirectingPresentation(boolean value) throws IllegalStateException
Sets the value of Redirecting presentation.- Overrides:
setRedirectingPresentation
in classForwardingOptions
- Parameters:
value
- boolean representation of Redirecting presentation- Returns:
- this
- Throws:
IllegalStateException
-
setNotificationToCallingParty
public ExtForwOptions setNotificationToCallingParty(boolean value) throws IllegalStateException
Sets the value of Notification to calling party.- Overrides:
setNotificationToCallingParty
in classForwardingOptions
- Parameters:
value
- boolean representation of Notification to calling party- Returns:
- this
- Throws:
IllegalStateException
-
setForwardingReason
public ExtForwOptions setForwardingReason(ForwardingOptions.ForwardingReason value) throws IllegalStateException
Sets the value of Forwarding reason.- Overrides:
setForwardingReason
in classForwardingOptions
- Parameters:
value
- ForwardingReason representation of Forwarding reason- Returns:
- this
- Throws:
IllegalStateException
-
copyOf
public static ExtForwOptions copyOf(ExtForwOptions 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:
- ExtForwOptions
-
clone
public ExtForwOptions clone()
Constructs a copy of this object and everything reachable from it.- Specified by:
clone
in interfaceDataObject
- Overrides:
clone
in classForwardingOptions
- 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.- Overrides:
getFieldsMap
in classForwardingOptions
- 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.- Overrides:
encodedIsInvalid
in classForwardingOptions
- Returns:
- boolean
-
getEncodedForm
public byte[] getEncodedForm() throws EncodeException
Gets the encoded form.- Overrides:
getEncodedForm
in classForwardingOptions
- Returns:
- encoded form
- Throws:
EncodeException
- if encoding fails
-
getContainedLength
public static int getContainedLength(byte[] data, int start, int len)
Determines the length of the encoded value that commences at offsetstart
in the givendata
. The value is not fully decoded and might not be decodable. If the encoded value ends with a filling field, then the givenlen
is returned. If the encoded value is so currupt that its length cannot be determined, then0
is returned.- Parameters:
data
- network-encoded datastart
- index into data where value commenceslen
- length in data to be considered- Returns:
- length of encoded value, or 0 if not decodable
- Throws:
NullPointerException
- if data is null
-
encode
protected void encode()
Computes the encoded form from the decoded form.- Overrides:
encode
in classForwardingOptions
-
decode
protected void decode() throws DecodeException
Computes the decoded form from the encoded form.- Overrides:
decode
in classForwardingOptions
- Throws:
DecodeException
- if not between 1 and 5 octets to be decoded
-
-