net.sourceforge.jcapi
Class JcapiMessage

java.lang.Object
  |
  +--net.sourceforge.jcapi.JcapiMessage
All Implemented Interfaces:
CapiMessage

public class JcapiMessage
extends java.lang.Object
implements CapiMessage

JcapiMessage Implementation of CapiMessage.

© 2002 Holger Gräfe

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Contact to author: holger.graefe@gmx.de

Project website: http://jcapi.sourceforge.net


Field Summary
static int ALERT_CONF
           
static int ALERT_REQ
           
static int CONNECT_ACTIVE_IND
           
static int CONNECT_ACTIVE_RESP
           
static int CONNECT_B3_ACTIVE_IND
           
static int CONNECT_B3_ACTIVE_RESP
           
static int CONNECT_B3_CONF
           
static int CONNECT_B3_IND
           
static int CONNECT_B3_REQ
           
static int CONNECT_B3_RESP
           
static int CONNECT_B3_T90_ACTIVE_IND
           
static int CONNECT_B3_T90_ACTIVE_RESP
           
static int CONNECT_CONF
           
static int CONNECT_IND
           
static int CONNECT_REQ
           
static int CONNECT_RESP
           
static int DATA_B3_CONF
           
static int DATA_B3_IND
           
static int DATA_B3_REQ
           
static int DATA_B3_RESP
           
static int DISCONNECT_B3_CONF
           
static int DISCONNECT_B3_IND
           
static int DISCONNECT_B3_REQ
           
static int DISCONNECT_B3_RESP
           
static int DISCONNECT_CONF
           
static int DISCONNECT_IND
           
static int DISCONNECT_REQ
           
static int DISCONNECT_RESP
           
static int FACILITY_CONF
           
static int FACILITY_IND
           
static int FACILITY_REQ
           
static int FACILITY_RESP
           
static int INFO_CONF
           
static int INFO_IND
           
static int INFO_REQ
           
static int INFO_RESP
           
static int LISTEN_CONF
           
static int LISTEN_REQ
           
static int MANUFACTURER_CONF
           
static int MANUFACTURER_IND
           
static int MANUFACTURER_REQ
           
static int MANUFACTURER_RESP
           
static java.lang.String NAME_ADDITIONAL_INFO
           
static java.lang.String NAME_B_PROTOCOL
           
static java.lang.String NAME_BC
           
static java.lang.String NAME_CALLED_PARTY_NUMBER
           
static java.lang.String NAME_CALLED_PARTY_SUBADDRESS
           
static java.lang.String NAME_CALLING_PARTY_NUMBER
           
static java.lang.String NAME_CALLING_PARTY_SUBADDRESS
           
static java.lang.String NAME_CIP_MASK
           
static java.lang.String NAME_CIP_MASK_2
           
static java.lang.String NAME_CIP_VALUE
           
static java.lang.String NAME_CONNECTED_NUMBER
           
static java.lang.String NAME_CONNECTED_SUBADDRESS
           
static java.lang.String NAME_CONTROLLER
           
static java.lang.String NAME_CONTROLLER_PLCI
           
static java.lang.String NAME_CONTROLLER_PLCI_NCCI
           
static java.lang.String NAME_DATA
           
static java.lang.String NAME_DATA_HANDLE
           
static java.lang.String NAME_DATA_LENGTH
           
static java.lang.String NAME_DATA64
           
static java.lang.String NAME_FACILITY_CONFIRMATION_PARAMETER
           
static java.lang.String NAME_FACILITY_INDICATION_PARAMETER
           
static java.lang.String NAME_FACILITY_REQUEST_PARAMETER
           
static java.lang.String NAME_FACILITY_RESPONSE_PARAMETERS
           
static java.lang.String NAME_FACILITY_SELECTOR
           
static java.lang.String NAME_FLAGS
           
static java.lang.String NAME_HLC
           
static java.lang.String NAME_INFO
           
static java.lang.String NAME_INFO_ELEMENT
           
static java.lang.String NAME_INFO_MASK
           
static java.lang.String NAME_INFO_NUMBER
           
static java.lang.String NAME_LLC
           
static java.lang.String NAME_MANU_ID
           
static java.lang.String NAME_MANUFACTURER_SPECIFIC
           
static java.lang.String NAME_NCCI
           
static java.lang.String NAME_NCPI
           
static java.lang.String NAME_PLCI
           
static java.lang.String NAME_REASON
           
static java.lang.String NAME_REASON_B3
           
static java.lang.String NAME_REJECT
           
static int RESET_B3_CONF
           
static int RESET_B3_IND
           
static int RESET_B3_REQ
           
static int RESET_B3_RESP
           
static int SELECT_B_PROTOCOL_CONF
           
static int SELECT_B_PROTOCOL_REQ
           
 
Method Summary
 int getAppID()
          returns the identification number of the application this messages is assigned to.
 byte[] getB3Data()
          returns the data block of a DATA_B3_IND or DATA_B3_REQ message.
 byte[] getBytes()
          calculates the encoded message as a byte array.
 byte getByteValue(java.lang.String field)
           
 int getDwordValue(java.lang.String field)
           
 java.lang.String[] getFieldNames()
           
 int[] getFieldTypes()
           
 int getMessageID()
          returns the identification number of this message.
 long getQwordValue(java.lang.String field)
           
 byte[] getStructValue(java.lang.String field)
           
 int getType()
          returns the type of this message.
 java.lang.Object getValue(java.lang.String field)
           
 byte[] getVersatileValue(java.lang.String field)
           
 short getWordValue(java.lang.String field)
           
 void setAppID(int id)
           
 void setB3Data(byte[] data)
          assigns a data block to a DATA_B3_REQ message.
 void setByteValue(java.lang.String field, int val)
           
 void setDwordValue(java.lang.String field, int val)
           
 void setMessageID(int id)
           
 void setQwordValue(java.lang.String field, long val)
           
 void setStructValue(java.lang.String field, byte[] val)
           
 void setValue(java.lang.String field, java.lang.Object value)
           
 void setVersatileValue(java.lang.String field, byte[] val)
           
 void setWordValue(java.lang.String field, int val)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALERT_REQ

public static final int ALERT_REQ

ALERT_CONF

public static final int ALERT_CONF

CONNECT_REQ

public static final int CONNECT_REQ

CONNECT_CONF

public static final int CONNECT_CONF

CONNECT_IND

public static final int CONNECT_IND

CONNECT_RESP

public static final int CONNECT_RESP

CONNECT_ACTIVE_IND

public static final int CONNECT_ACTIVE_IND

CONNECT_ACTIVE_RESP

public static final int CONNECT_ACTIVE_RESP

CONNECT_B3_ACTIVE_IND

public static final int CONNECT_B3_ACTIVE_IND

CONNECT_B3_ACTIVE_RESP

public static final int CONNECT_B3_ACTIVE_RESP

CONNECT_B3_REQ

public static final int CONNECT_B3_REQ

CONNECT_B3_CONF

public static final int CONNECT_B3_CONF

CONNECT_B3_IND

public static final int CONNECT_B3_IND

CONNECT_B3_RESP

public static final int CONNECT_B3_RESP

CONNECT_B3_T90_ACTIVE_IND

public static final int CONNECT_B3_T90_ACTIVE_IND

CONNECT_B3_T90_ACTIVE_RESP

public static final int CONNECT_B3_T90_ACTIVE_RESP

DATA_B3_REQ

public static final int DATA_B3_REQ

DATA_B3_CONF

public static final int DATA_B3_CONF

DATA_B3_IND

public static final int DATA_B3_IND

DATA_B3_RESP

public static final int DATA_B3_RESP

RESET_B3_REQ

public static final int RESET_B3_REQ

RESET_B3_CONF

public static final int RESET_B3_CONF

RESET_B3_IND

public static final int RESET_B3_IND

RESET_B3_RESP

public static final int RESET_B3_RESP

DISCONNECT_B3_REQ

public static final int DISCONNECT_B3_REQ

DISCONNECT_B3_CONF

public static final int DISCONNECT_B3_CONF

DISCONNECT_B3_IND

public static final int DISCONNECT_B3_IND

DISCONNECT_B3_RESP

public static final int DISCONNECT_B3_RESP

DISCONNECT_REQ

public static final int DISCONNECT_REQ

DISCONNECT_CONF

public static final int DISCONNECT_CONF

DISCONNECT_IND

public static final int DISCONNECT_IND

DISCONNECT_RESP

public static final int DISCONNECT_RESP

INFO_REQ

public static final int INFO_REQ

INFO_CONF

public static final int INFO_CONF

INFO_IND

public static final int INFO_IND

INFO_RESP

public static final int INFO_RESP

FACILITY_REQ

public static final int FACILITY_REQ

FACILITY_CONF

public static final int FACILITY_CONF

FACILITY_IND

public static final int FACILITY_IND

FACILITY_RESP

public static final int FACILITY_RESP

SELECT_B_PROTOCOL_REQ

public static final int SELECT_B_PROTOCOL_REQ

SELECT_B_PROTOCOL_CONF

public static final int SELECT_B_PROTOCOL_CONF

MANUFACTURER_REQ

public static final int MANUFACTURER_REQ

MANUFACTURER_CONF

public static final int MANUFACTURER_CONF

MANUFACTURER_IND

public static final int MANUFACTURER_IND

MANUFACTURER_RESP

public static final int MANUFACTURER_RESP

LISTEN_REQ

public static final int LISTEN_REQ

LISTEN_CONF

public static final int LISTEN_CONF

NAME_ADDITIONAL_INFO

public static final java.lang.String NAME_ADDITIONAL_INFO

NAME_B_PROTOCOL

public static final java.lang.String NAME_B_PROTOCOL

NAME_BC

public static final java.lang.String NAME_BC

NAME_CALLED_PARTY_NUMBER

public static final java.lang.String NAME_CALLED_PARTY_NUMBER

NAME_CALLED_PARTY_SUBADDRESS

public static final java.lang.String NAME_CALLED_PARTY_SUBADDRESS

NAME_CALLING_PARTY_NUMBER

public static final java.lang.String NAME_CALLING_PARTY_NUMBER

NAME_CALLING_PARTY_SUBADDRESS

public static final java.lang.String NAME_CALLING_PARTY_SUBADDRESS

NAME_CIP_MASK

public static final java.lang.String NAME_CIP_MASK

NAME_CIP_MASK_2

public static final java.lang.String NAME_CIP_MASK_2

NAME_CIP_VALUE

public static final java.lang.String NAME_CIP_VALUE

NAME_CONNECTED_NUMBER

public static final java.lang.String NAME_CONNECTED_NUMBER

NAME_CONNECTED_SUBADDRESS

public static final java.lang.String NAME_CONNECTED_SUBADDRESS

NAME_CONTROLLER

public static final java.lang.String NAME_CONTROLLER

NAME_CONTROLLER_PLCI

public static final java.lang.String NAME_CONTROLLER_PLCI

NAME_CONTROLLER_PLCI_NCCI

public static final java.lang.String NAME_CONTROLLER_PLCI_NCCI

NAME_DATA

public static final java.lang.String NAME_DATA

NAME_DATA_LENGTH

public static final java.lang.String NAME_DATA_LENGTH

NAME_DATA_HANDLE

public static final java.lang.String NAME_DATA_HANDLE

NAME_DATA64

public static final java.lang.String NAME_DATA64

NAME_FACILITY_CONFIRMATION_PARAMETER

public static final java.lang.String NAME_FACILITY_CONFIRMATION_PARAMETER

NAME_FACILITY_INDICATION_PARAMETER

public static final java.lang.String NAME_FACILITY_INDICATION_PARAMETER

NAME_FACILITY_REQUEST_PARAMETER

public static final java.lang.String NAME_FACILITY_REQUEST_PARAMETER

NAME_FACILITY_RESPONSE_PARAMETERS

public static final java.lang.String NAME_FACILITY_RESPONSE_PARAMETERS

NAME_FACILITY_SELECTOR

public static final java.lang.String NAME_FACILITY_SELECTOR

NAME_FLAGS

public static final java.lang.String NAME_FLAGS

NAME_HLC

public static final java.lang.String NAME_HLC

NAME_INFO

public static final java.lang.String NAME_INFO

NAME_INFO_ELEMENT

public static final java.lang.String NAME_INFO_ELEMENT

NAME_INFO_MASK

public static final java.lang.String NAME_INFO_MASK

NAME_INFO_NUMBER

public static final java.lang.String NAME_INFO_NUMBER

NAME_LLC

public static final java.lang.String NAME_LLC

NAME_MANU_ID

public static final java.lang.String NAME_MANU_ID

NAME_MANUFACTURER_SPECIFIC

public static final java.lang.String NAME_MANUFACTURER_SPECIFIC

NAME_NCCI

public static final java.lang.String NAME_NCCI

NAME_NCPI

public static final java.lang.String NAME_NCPI

NAME_PLCI

public static final java.lang.String NAME_PLCI

NAME_REASON

public static final java.lang.String NAME_REASON

NAME_REASON_B3

public static final java.lang.String NAME_REASON_B3

NAME_REJECT

public static final java.lang.String NAME_REJECT
Method Detail

getType

public int getType()
Description copied from interface: CapiMessage
returns the type of this message.
Specified by:
getType in interface CapiMessage
Following copied from interface: org.capi.capi20.CapiMessage
Returns:
the message type, which correspond with the CAPI message fields "command" and "subcommand"

getAppID

public int getAppID()
Description copied from interface: CapiMessage
returns the identification number of the application this messages is assigned to.
Specified by:
getAppID in interface CapiMessage
Following copied from interface: org.capi.capi20.CapiMessage
Returns:
the application identification number

getMessageID

public int getMessageID()
Description copied from interface: CapiMessage
returns the identification number of this message.
Specified by:
getMessageID in interface CapiMessage
Following copied from interface: org.capi.capi20.CapiMessage
Returns:
the message identification number

getB3Data

public byte[] getB3Data()
                 throws CapiException
Description copied from interface: CapiMessage
returns the data block of a DATA_B3_IND or DATA_B3_REQ message. For other messages an exception is thrown.

Actual the data block of a DATA_B3_IND is copied to prevent the Java virtual machine from memory conflicts. Nevertheless the application has to respond to every DATA_B3_IND with a DATA_B3_RESP. Otherwise the native CAPI does not reuse the original memory block and would perhaps get a "buffer overrun".

Specified by:
getB3Data in interface CapiMessage
Following copied from interface: org.capi.capi20.CapiMessage
Returns:
the data block

setB3Data

public void setB3Data(byte[] data)
               throws CapiException
Description copied from interface: CapiMessage
assigns a data block to a DATA_B3_REQ message. For other messages an exception is thrown.
Specified by:
setB3Data in interface CapiMessage
Following copied from interface: org.capi.capi20.CapiMessage
Parameters:
data - the data block

setAppID

public void setAppID(int id)

setMessageID

public void setMessageID(int id)

getValue

public java.lang.Object getValue(java.lang.String field)

getByteValue

public byte getByteValue(java.lang.String field)
                  throws CapiException

getWordValue

public short getWordValue(java.lang.String field)
                   throws CapiException

getDwordValue

public int getDwordValue(java.lang.String field)
                  throws CapiException

getQwordValue

public long getQwordValue(java.lang.String field)
                   throws CapiException

getStructValue

public byte[] getStructValue(java.lang.String field)
                      throws CapiException

getVersatileValue

public byte[] getVersatileValue(java.lang.String field)
                         throws CapiException

setValue

public void setValue(java.lang.String field,
                     java.lang.Object value)
              throws CapiException

setByteValue

public void setByteValue(java.lang.String field,
                         int val)
                  throws CapiException

setWordValue

public void setWordValue(java.lang.String field,
                         int val)
                  throws CapiException

setDwordValue

public void setDwordValue(java.lang.String field,
                          int val)
                   throws CapiException

setQwordValue

public void setQwordValue(java.lang.String field,
                          long val)
                   throws CapiException

setStructValue

public void setStructValue(java.lang.String field,
                           byte[] val)
                    throws CapiException

setVersatileValue

public void setVersatileValue(java.lang.String field,
                              byte[] val)
                       throws CapiException

getBytes

public byte[] getBytes()
Description copied from interface: CapiMessage
calculates the encoded message as a byte array.
Specified by:
getBytes in interface CapiMessage
Following copied from interface: org.capi.capi20.CapiMessage
Returns:
the binary message

getFieldTypes

public int[] getFieldTypes()

getFieldNames

public java.lang.String[] getFieldNames()