| java.lang.Object com.sun.midp.io.BluetoothUrl
BluetoothUrl | public class BluetoothUrl (Code) | | Represents a bluetooth url, i.e. connection string.
There are two ways of usage. First one is constructing it giving
url string in order to parse it into a set of fields. Second one
is constructig it giving fields values in order to get string
representation. Whenever incompatible url parts are found
IllegalArgumentException is thrown.
|
Field Summary | |
final public static int | L2CAP Value to indicate L2CAP protocol. | final public static int | OBEX Value to indicate OBEX protocol. | final public static int | RFCOMM Value to indicate RFCOMM protocol. | final public static int | UNKNOWN Value to indicate unknown protocol. | final public static UUID | UUID_SDP UUID value to create a transport for Service Discovery Protocol. | public String | address Keeps server address for client url, "localhost" for server. | public boolean | authenticate Authenticate parameter. | public boolean | authorize Authorize parameter. | public String | caseSensitiveUrl Url string to parse, original case. | public boolean | encrypt Encrypt parameter. | public boolean | isServer Indicates if it is a sever connection string. | public boolean | master Master parameter, true by default for server. | public String | name Name parameter of server url, null for client's one. | public int | port PSM for L2CAP or channel id for RFCOMM. | public int | protocol Indicates protocol type. | public int | receiveMTU RecieveMTU parameter. | public int | transmitMTU TransmitMTU parameter. | public String | uuid Keeps uuid from server connection string,
null for client's one. |
Constructor Summary | |
public | BluetoothUrl(String urlString) Constructs url object by specified url string. | public | BluetoothUrl(int protocol, String urlString) Constructs url object by specified protocol and url string without
leading protocol name and colon or if protocol is unknown by s string
that contains full url. | public | BluetoothUrl(int protocol, String urlString, Object systemToken) Constructs url object with specified protocol, url and special system
token. |
Method Summary | |
public static BluetoothUrl | createClientUrl(int protocol, String btaddr, int port) Creates url that represents client connection string.
Parameters: protocol - identifies protocol. | public String | getResourceName() Creates string representation of the URL without parameters. | final public boolean | isSystem() Tests if this URL is system one. | public String | toString() Checks url parts consistency and creates string representation. |
L2CAP | final public static int L2CAP(Code) | | Value to indicate L2CAP protocol.
|
OBEX | final public static int OBEX(Code) | | Value to indicate OBEX protocol.
|
RFCOMM | final public static int RFCOMM(Code) | | Value to indicate RFCOMM protocol.
|
UNKNOWN | final public static int UNKNOWN(Code) | | Value to indicate unknown protocol.
|
UUID_SDP | final public static UUID UUID_SDP(Code) | | UUID value to create a transport for Service Discovery Protocol.
|
address | public String address(Code) | | Keeps server address for client url, "localhost" for server.
|
authenticate | public boolean authenticate(Code) | | Authenticate parameter.
|
authorize | public boolean authorize(Code) | | Authorize parameter. L2CAP specific.
|
caseSensitiveUrl | public String caseSensitiveUrl(Code) | | Url string to parse, original case.
Required for correct "name" parameter parsing for it is case-sensitive.
|
encrypt | public boolean encrypt(Code) | | Encrypt parameter.
|
isServer | public boolean isServer(Code) | | Indicates if it is a sever connection string.
|
master | public boolean master(Code) | | Master parameter, true by default for server.
|
name | public String name(Code) | | Name parameter of server url, null for client's one.
L2CAP, RFCOMM specific.
|
port | public int port(Code) | | PSM for L2CAP or channel id for RFCOMM.
|
protocol | public int protocol(Code) | | Indicates protocol type.
|
receiveMTU | public int receiveMTU(Code) | | RecieveMTU parameter. L2CAP specific.
|
transmitMTU | public int transmitMTU(Code) | | TransmitMTU parameter. L2CAP specific.
|
uuid | public String uuid(Code) | | Keeps uuid from server connection string,
null for client's one.
L2CAP, RFCOMM specific.
|
BluetoothUrl | public BluetoothUrl(String urlString)(Code) | | Constructs url object by specified url string. Constructing
BluetoothUrl in this manner is a way to parse
an url represented by string.
Parameters: urlString - url string. |
BluetoothUrl | public BluetoothUrl(int protocol, String urlString)(Code) | | Constructs url object by specified protocol and url string without
leading protocol name and colon or if protocol is unknown by s string
that contains full url.
Parameters: protocol - prootocol type, must be one ofL2CAP, RFCOMM, OBEX, UNKNOWN . Parameters: urlString - whole url if protocol value isUNKNOWN , a part of url string beyond"protocol:" otherwise. |
BluetoothUrl | public BluetoothUrl(int protocol, String urlString, Object systemToken)(Code) | | Constructs url object with specified protocol, url and special system
token.
See Also: BluetoothUrl(int, String) Parameters: protocol - prootocol type Parameters: urlString - URL Parameters: systemToken - special object that validates this URL as systemif has proper value, usually it is null |
createClientUrl | public static BluetoothUrl createClientUrl(int protocol, String btaddr, int port) throws IllegalArgumentException(Code) | | Creates url that represents client connection string.
Parameters: protocol - identifies protocol. Should be one ofBluetoothUrl.L2CAP, BluetoothUrl.RFCOMM, BluetoothUrl.OBEX Parameters: btaddr - Bluetooth address of server device. Parameters: port - PSM in case of L2CAP or channel id otherwise. BluetoothUrl instance that representsdesired connection string. exception: IllegalArgument - exception if provived parameters are invalid. |
getResourceName | public String getResourceName()(Code) | | Creates string representation of the URL without parameters.
"PROTOCOL://ADDRESS" string. |
isSystem | final public boolean isSystem()(Code) | | Tests if this URL is system one. System URL can only by created
by SDP server or client and is processed in special way.
true if this url is a system one createdby SDP routines, false otherwise |
toString | public String toString()(Code) | | Checks url parts consistency and creates string representation.
string representation of the URL. exception: IllegalArgumentException - if URL parts are inconsistent. |
|
|