HP-UX SNAplus2 CPI-C Programmer's Guide (June 2003)

Writing CPI-C Applications
Java CPI-C Considerations
Chapter 2102
Parameter Type Classes
Many parameters used in CPI-C functions take one of a set of two or
more defined values. In the Java CPI-C package, each of these parameter
types is defined as a class containing the valid values. For example, the
CPICSyncLevel class is used in the functions Set_Sync_Level (cmssl)
and Extract_Sync_Level (cmesl), and can take a value of either
CM_NONE or CM_CONFIRM.
The description of each CPI-C function in Chapter 3, CPI-C Calls, gives
the appropriate CPI-C parameter class type and the valid values. For
example, in Set_Sync_Level (cmssl), the
sync_level
parameter is listed
as being of type CPICSyncLevel, and the description of parameters for
this function lists the valid values as CM_NONE or CM_CONFIRM.
Because the constant values associated with a Java class are defined in
the class, you must access them by referring to the class as well as the
specific value. For example, to specify no confirm synchronization, you
must set the
sync_level
parameter of the Set_Sync_Level function to
CPICSyncLevel.CM_NONE.
Each of these classes has the following methods in addition to the
constructor:
int intValue() Returns the value stored in the object.
int intValue(
int_value
)
Sets the value stored in the object to the supplied
integer value
int_value
, and returns the same value.
You can also set the value stored in an object during
construction of the object, by passing the value in as a
parameter to the constructor.
boolean equals(
int_value
)
Symbolic Destination Name
Length
CM_SDN_SIZE
Transaction Program (TP) Name
length
CM_TPN_SIZE
Table 2-5 Java CPI-C Constants (Continued)
Parameter Length Java CPI-C Constant