The <object> element can be used to construct a general object type value.

Note

This element requires the fully qualified class name of the datatype be specified; either values for individual sub-fields of the datatype or a byte array value representing the encoded form of the value can be provided. The set of datatypes that may be constructed is limited to the subset of COMPOUND and BIT_STRING variables of the supported arbitrary datatypes.

If using the encoded byte array form, the specified datatype class must implement a public constructor that takes a single byte[] argument. Otherwise, the specified datatype class must implement a public constructor that takes no arguments. See the CGIN API Javadoc for details on the constructors implemented by each datatype.

The <object> element can also be used to create a new object that is a copy of another object of the same or a related Java type. Extendable types within the CGIN API generally implement a static copyOf method that allows type narrowing. For example the CGIN type CAP4ConnectArg implements a copyOf method that takes an argument of the superclass type CCConnectArg. The method returns a CAP4ConnectArg object populated with the same field values as were set in the input argument. In all respects the returned value is a copy of the input argument; but because the returned value is (potentially) a more specific type than the input argument, it supports all the fields allowed by the CAPv4 protocol. Non-extendable types can also be copied, but for these types the clone() method is used instead, and the class specified in the <object> element must be the same as (or a superclass of) the class of the value copied.

The encoded byte array form and the copy-of form are mutually exclusive and cannot be used together in the same <object> element.

Variables may be used to specify the encoded value, the copied value, or individual field values. Field values can be specified either as element attributes or as nested elements. Nested elements may also be compound datatypes.

General guidelines

Below are general guidelines that apply to all object construction, with examples of how you can construct:

Calling Party Number

There are three possible ways to create a CallingPartyNumber value:

Using an encoded value

Encoded values are a byte array. Encoded byte array values are specified as a comma-separated list of hexadecimal byte values, for example:

<object
    class="com.opencloud.slee.resources.in.datatypes.cc.CallingPartyNumber"
    encoded-value="03,13,1b,32,54,76,98,c0"/>

The encoded byte array value can also be provided from some other variable, for example:

<object
    class="com.opencloud.slee.resources.in.datatypes.cc.CallingPartyNumber"
    encoded-value="${user.some-encoded-value}"/>
Warning If the specified variable does not exist or its value is not a byte array, then the object construction will fail and produce no result.

Specifying individual field values

A CallingPartyNumber value can be constructed by specifying values for its individual fields, for example:

<object class="com.opencloud.slee.resources.in.datatypes.cc.CallingPartyNumber">
    <field name="nature" value="NATIONAL"/>
    <field name="number-incomplete" value="false"/>
    <field name="numbering-plan" value="ISDN"/>
    <field name="presentation" value="ALLOWED"/>
    <field name="screening" value="NETWORK_PROVIDED"/>
    <field name="address" value="*1234567890#"/>
</object>

Variables may also be used to specify the value for any field, for example:

<object class="com.opencloud.slee.resources.in.datatypes.cc.CallingPartyNumber">
    ...
    <field name="address" value="${initial-dp.arg.calling-party-number.address}"/>
</object>
Warning The value provided for each field must be a suitable value for that field, otherwise the object construction will fail and produce no result. If a particular field value is obtained from a variable and that variable is determined to have no value, then assignment of that field will be skipped.

Using a pre-defined datatype constructor

SIS includes pre-defined datatype constructors for certain datatypes. The CallingPartyNumber type is one of these datatypes, and such a value can be constructed as shown in the following example:

<calling-party-number
    nature="NATIONAL"
    number-incomplete="false"
    numbering-plan="ISDN"
    presentation="ALLOWED"
    screening="NETWORK_PROVIDED"
    address="*1234567890#"/>
Warning In contrast to specifying individual field values, the pre-defined datatype constructors require that values for all fields be specified. However, the value provided for each field must again be a suitable value for that field, otherwise the object construction will fail and produce no result. When using the pre-defined datatype constructors, if a particular field value is obtained from a variable and that variable is determined to have no value, then object construction will also fail.

CAPv2 IP-SSP Capabilities

The CAP2IPSSPCapabilities class defines IP-SSP capabilities for the CAPv2 protocol. This value may be included in an InitialDP or AssistRequestInstructions operation. The CAP2IPSSPCapabilities class extends ExtendibleOctetString by adding a containedValue field of type CAPIPSSPCapabilities. The CAPIPSSPCapabilities datatype contains the actual structured view of the IP-SSP capabilities.

The following example illustrates how to construct a CAP2IPSSPCapabilities datatype value with a contained value:

<object class="com.opencloud.slee.resources.cgin.cap_v2.CAP2IPSSPCapabilities">
    <field name="contained-value">
        <object class="com.opencloud.slee.resources.in.datatypes.cc.CAPIPSSPCapabilities">
            <field name="ip-routing-address-supported" value="true"/>
            <field name="voice-back-supported" value="false"/>
            <field name="voice-information-via-speech-supported" value="true"/>
            <field name="voice-information-via-voice-supported" value="true"/>
            <field name="voice-generation-from-text-supported" value="false"/>
            <field name="bilateral-part">
                <bytes bytes="55,66,77"/>
            </field>
        </object>
    </field>
</object>

Copying an object

A new object can be created as a copy of another object, possibly with a different type than the original object. This is useful for narrowing type conversions; for example to change the type of an object from a CAPv2 type to a CAPv4 type, and consequently also provide access to all the fields supported by the CAPv4 type that previously weren’t available.

The following example illustrates how to construct a CAP4ConnectArg object from another object and set the CAPv4-specific legToBeConnected field in the new object to indicate leg 3:

<object class="com.opencloud.slee.resources.cgin.cap_v4.CAP4ConnectArg" copy-of="${connect.arg}">
    <field name="leg-to-be-connected">
        <object class="com.opencloud.slee.resources.cgin.callcontrol.CCLegID">
            <field name="sending-side-id">
                <object class="com.opencloud.slee.resources.in.datatypes.cc.LegType">
                    <field name="encoded-value" value="3"/>
                </object>
            </field>
        </object>
    </field>
</object>
Warning If the specified variable to copy does not exist or its value is not compatible with the specified class, then the object construction will fail and produce no result.
Previous page Next page