| java.lang.Object com.sun.midp.jsr82emul.BytePack com.sun.midp.jsr82emul.ServiceConnectionData
ServiceConnectionData | class ServiceConnectionData extends BytePack (Code) | | Utility class that keeps service connection information, packs it
into byte array and restores form it. Has methods to check if a
service represented by an instance can accept a connection represented
by another one.
|
Field Summary | |
final static int | CLIENT_DATA Packed data type that implies that the following fields are included:
transmitMTU, receiveMTU, Bluetooth address. | final static int | CLIENT_DATA_SIZE Byte array size when packed with CLIENT_DATA type. | final static int | CONNECTION_DATA Packed data type that implies that the following fields are included:
socketPort, IP address, receiveMTU, transmitMTU. | final static int | CONN_REQUEST_DATA Packed data type that implies that the following fields are included:
Bluetooth address, protocol, port, transmitMTU, receiveMTU, encrypt,
authenticate, master. | final static int | SERVER_DATA Packed data type that implies that the following fields are included:
socketPort, port, receiveMTU, transmitMTU, receiveMTU, protocol,
master, encrypt, authorize, authenticate. | final static int | SERVER_DATA_SIZE Byte array size when packed with SERVER_DATA type. | byte[] | address | boolean | authenticate Shows wither authentication required by server. | boolean | authorize Shows wither authorization required by server. | boolean | encrypt Shows wither encrypted connection required. | int | error Error type, like in BluetoothConnectionException ,
ff error occured while looking for connection, -1
if there is no error. | boolean | master Shows wither server is master. | int | port Channel ID or PSM. | int | protocol Protocol ID as in BluetoothUrl . | int | receiveMTU ReceiveMTU in server side terms. | int | socketPort TCP socket port emulated service listens on. | int | transmitMTU TransmitMTU in server side terms. |
Constructor Summary | |
| ServiceConnectionData() Constructs an instance which indicates that unknown error occured
while looking for connection. | | ServiceConnectionData(int error) Constructs an instance which indicates that a connection error occured. | | ServiceConnectionData(byte[] data, int type) Constructs an instance by given byte representation. |
Method Summary | |
void | accept(ServiceConnectionData client) Checks if client connection with given parameters can be accepted,
if it can not, sets error code. | void | setAccepting() Sets acception flag to true to identify that represented service
is currebtly accepting. | byte[] | toByteArray(int type) Retrieves bytes representation. |
CLIENT_DATA | final static int CLIENT_DATA(Code) | | Packed data type that implies that the following fields are included:
transmitMTU, receiveMTU, Bluetooth address.
|
CLIENT_DATA_SIZE | final static int CLIENT_DATA_SIZE(Code) | | Byte array size when packed with CLIENT_DATA type.
|
CONNECTION_DATA | final static int CONNECTION_DATA(Code) | | Packed data type that implies that the following fields are included:
socketPort, IP address, receiveMTU, transmitMTU.
|
CONN_REQUEST_DATA | final static int CONN_REQUEST_DATA(Code) | | Packed data type that implies that the following fields are included:
Bluetooth address, protocol, port, transmitMTU, receiveMTU, encrypt,
authenticate, master.
It is used CONNECT_TO_SERVICE request to the emulation server
|
SERVER_DATA | final static int SERVER_DATA(Code) | | Packed data type that implies that the following fields are included:
socketPort, port, receiveMTU, transmitMTU, receiveMTU, protocol,
master, encrypt, authorize, authenticate.
|
SERVER_DATA_SIZE | final static int SERVER_DATA_SIZE(Code) | | Byte array size when packed with SERVER_DATA type.
|
address | byte[] address(Code) | | IP address or host name of service in case of CONNECTION_DATA,
Bluetooth address of client in case of CLIENT_DATA
|
authenticate | boolean authenticate(Code) | | Shows wither authentication required by server.
|
authorize | boolean authorize(Code) | | Shows wither authorization required by server.
|
encrypt | boolean encrypt(Code) | | Shows wither encrypted connection required.
|
error | int error(Code) | | Error type, like in BluetoothConnectionException ,
ff error occured while looking for connection, -1
if there is no error. Only makes sense in case of CONNECTION_DATA.
|
master | boolean master(Code) | | Shows wither server is master.
|
port | int port(Code) | | Channel ID or PSM.
|
protocol | int protocol(Code) | | Protocol ID as in BluetoothUrl .
|
receiveMTU | int receiveMTU(Code) | | ReceiveMTU in server side terms.
|
socketPort | int socketPort(Code) | | TCP socket port emulated service listens on.
|
transmitMTU | int transmitMTU(Code) | | TransmitMTU in server side terms.
|
ServiceConnectionData | ServiceConnectionData()(Code) | | Constructs an instance which indicates that unknown error occured
while looking for connection.
|
ServiceConnectionData | ServiceConnectionData(int error)(Code) | | Constructs an instance which indicates that a connection error occured.
Parameters: error - error code as in BluetoothConnectionException |
ServiceConnectionData | ServiceConnectionData(byte[] data, int type)(Code) | | Constructs an instance by given byte representation.
Parameters: data - byte representation Parameters: type - type of packed data, must be one of SERVER_DATA, CONNECTION_DATA, CLIENT_DATA, CONN_REQUEST_DATA |
accept | void accept(ServiceConnectionData client)(Code) | | Checks if client connection with given parameters can be accepted,
if it can not, sets error code. If acception is possible but
requires fields alignment, makes it modifying connection data
passed as a parameter.
Parameters: client - parameters of client connection request derived from client url, the parameters can be modified by this methodif connection can be accepted. error code as in BluetoothConnectionException , ifconnection can not be accepted, -1 if it can |
setAccepting | void setAccepting()(Code) | | Sets acception flag to true to identify that represented service
is currebtly accepting. A part of the way that overcomes TCK
inconsistency.
|
toByteArray | byte[] toByteArray(int type)(Code) | | Retrieves bytes representation.
Parameters: type - type of packed data, that defines which fieldsare to be packed, must be one of SERVER_DATA, CONNECTION_DATA, CLIENT_DATA, CONN_REQUEST_DATA byte array that keeps packed properties |
|
|