Use of JCP site is subject to the
JCP Terms of Use and the
Oracle Privacy Policy
|
JSR 82 maintenance review 4$Id: changes.html 407 2010-03-31 11:14:34Z tpr $ JSR 82: Java APIs for Bluetooth Wireless Technology
The maintenance lead is Tim Renouf of Aplix Corp, This maintenance review proposes changes to update JSR 82 1.1.1 to JSR 82 1.2. Comments received by maintenance lead
Changelog for maintenance review 4These are the proposed changes from JSR 82 Java APIs for Bluetooth Wireless Technology version 1.1.1 to version 1.2.
Full list of changes for class-based permissions9: Change title to "MIDP 2 and CLDC 1.1.1 Security" 9.1 Introduction: Add mention of CLDC 1.1.1 as follows (splitting the single paragraph, and adding the text that is here emphasized for clarity):
9.2 Bluetooth Permissions: Rename "Permission" column to "Permission Name (MIDP 2)", and insert a new column "Permission Class (CLDC 1.1.1)". Also add new MIDP2 permissions javax.microedition.io.Connector.bluetooth.client.reserved and javax.microedition.io.Connector.bluetooth.server.reserved. This is for the “allow Java application programmers to implement other protocols on top of L2CAP that use a PSM value in the ‘reserved’ range” change.
Add new classes to Javadoc as follows. javax.obex.BtgoepProtocolPermissionpackage javax.obex; import javax.microedition.io.GCFPermission; /** * This class represents access * rights to connections via the "btgoep" * protocol. A <code>BtgoepProtocolPermission</code> consists of a URI string * but no actions list. * <p> * The class must be present if the platform has <code>GCFPermission</code>, * and must be not present otherwise. * <p> * The URI string specifies a Bluetooth Generic Object Exchange Protocol * connection, as described in JSR 82 1.2 section 12.4.1 <em>OBEX Over RFCOMM</em>, with * additional changes to allow wildcard matching: the part of the * <code>{target}</code> * before the ':' character, or the part of the <code>{target}</code> after the ':' * character, or both, may each be replaced by a '*' wildcard character. The * semantics of wildcard matching are specified below in the * <code>implies</code> method. * <p> * Examples: * </p> * <table> * <tr><td> * <code>btgoep://0050C000321B:12</code> * <td>matches a client URI with that Bluetooth * address and channel identifier, ignoring params * <tr><td> * <code>btgoep://0050C000321B:12;encrypt=true</code> * <td>matches a client URI with that * Bluetooth address and channel identifier, and with encrypt=true, ignoring * other params * <tr><td> * <code>btgoep://*:*</code> * <td>matches any client URI * <tr><td> * <code>btgoep://*:*;encrypt=true</code> * <td>matches any client URI with encrypt=true, ignoring * other params * <tr><td> * <code>btgoep://*:12</code> * <td>matches any client URI with a channel identifier of 12 * <tr><td> * <code>btgoep://localhost:*</code> * <td>matches any server URI * </table> */ public final class BtgoepProtocolPermission extends GCFPermission { /** * Creates a new <code>BtgoepProtocolPermission</code> with the specified URI as * name. The URI string must conform to the specification given * above, and is normalized (per the rules of * <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>) * to facilitate subsequent comparisons. * * @param uri the URI string * @throws IllegalArgumentException if uri is malformed * @throws NullPointerException if uri is null. */ public BtgoepProtocolPermission(String uri) { } /** * Checks if this <code>BtgoepProtocolPermission</code> object * "implies" the specified permission. * <p> * The method acts as if it follows these steps to determine whether * this object implies p: * </p> * <ul> * <li> * If p is not an instanceof BtgoepProtocolPermission, return false. * <li> * If this object has any <code>{params}</code>, and any one of * the params does not * match the setting in p (using the default value if the param is not * specified in p), then return false. * <li> * If this object's <code>{target}</code> matches p's <code>{target}</code>, * return true. * <li> * If this object's <code>{target}</code> is "*:*", and p is a client URI, * return true. * <li> * If this object's <code>{target}</code> consists of "*:" followed by * a channel identifier, and p is a client URI with a matching channel * identifier, return true. * <li> * If this object's <code>{target}</code> consists of "localhost:*", * and p is a server URI, return true. * <li> * Otherwise return false. * </ul> * * @param p the permission to check against. * * @return true if the specified permission is implied by this * object, false if not. */ public boolean implies(Permission p) { return false; } /** * Checks two <code>BtgoepProtocolPermission</code> objects for equality. * * @param obj the object we are testing for equality with this object. * * @return true if obj is a <code>BtgoepProtocolPermission</code> * and has the same URI string as this object. */ public boolean equals(Object obj) { return false; } /** * Returns the hash code value for this object. * * @return a hash value for this object. */ public int hashCode() { return 0; } /** * Returns the canonical string representation of the actions, which * currently is the empty string "", since there are no actions defined for * <code>BtgoepProtocolPermission</code>. * * @return the empty string "". */ public String getActions() { return null; } /** * Returns a new <code>PermissionCollection</code> for storing * <code>BtgoepProtocolPermission</code> objects. * * <code>BtgoepProtocolPermission</code> objects must be stored in a manner that allows * them to be inserted into the collection in any order, but that also * enables the <code>PermissionCollection</code> implies method to be implemented in an * efficient (and consistent) manner. * * @return a new <code>PermissionCollection</code> suitable for storing * <code>BtgoepProtocolPermission</code> objects. */ public PermissionCollection newPermissionCollection() { return null; } } javax.bluetooth.Btl2capProtocolPermissionpackage javax.bluetooth; import javax.microedition.io.GCFPermission; /** * This class represents access rights to connections via the "btl2cap" * protocol. <code>A Btl2capProtocolPermission</code> consists of a URI string * but no actions list. * <p> * The class must be present if the platform has <code>GCFPermission</code>, * and must be not present otherwise. * <p> * The URI string specifies a Bluetooth L2CAP connection, as described in JSR * 82 1.2 section 11.3 <em>L2CAP Connection Interface</em>, * with additional changes to * allow wildcard matching: the part of the <code>{target}</code> * before the ':' character, or the part of the <code>{target}</code> after the ':' * character, or both, may each be replaced by a '*' wildcard character. * The part of the <code>{target}</code> after the ':' character in a client connection * string may be replaced by a range, consisting of two hexadecimal numbers * separated by a hyphen. If a <code>psm</code> parameter is included * in a server connection * string, its value may be replaced by a range, consisting of two hexadecimal * numbers separated by a hyphen. * The semantics of wildcard matching are specified below in the * <code>implies</code> method. * <p> * Examples: * </p><table> * <tr><td> * <code>btl2cap://0050C000321B:10B3</code> * <td>matches a client URI with that Bluetooth * address and PSM value, ignoring params * * <tr><td> * <code>btl2cap://0050C000321B:*</code> * <td>matches a client URI with that Bluetooth * address and any PSM value, ignoring params * * <tr><td> * <code>btl2cap://0050C000321B:1001-FFFF</code> * <td>matches a client URI with that Bluetooth * address and a PSM value in the range 1001-FFFF, ignoring params * * <tr><td> * <code>btl2cap://*:10B3</code> * <td>matches a client URI with any Bluetooth * address and a PSM value of 10B3, ignoring params * * <tr><td> * <code>btl2cap://0050C000321B:10B3;encrypt=true</code> * <td>matches a client URI with that * Bluetooth address and PSM value, and with encrypt=true, ignoring * other params * * <tr><td> * <code>btl2cap://*:*</code> * <td>matches any client URI * * <tr><td> * <code>btl2cap://*:*;encrypt=true</code> * <td>matches any client URI with encrypt=true, * ignoring other params * * <tr><td> * <code>btl2cap://*:1001-FFFF</code> * <td>matches any client URI with a PSM value in the range * 1001-FFFF * * <tr><td> * <code>btl2cap://localhost:3B9FA89520078C303355AAA694238F08</code> * <td>matches a server URI * with the stated UUID, ignoring params * * <tr><td> * <code>btl2cap://localhost:*</code> * <td>matches any server URI that does not have a psm * param, or has one that specifies a PSM value in the range 1001-FFFF * (so not including the reserved PSM range) * * <tr><td> * <code>btl2cap://localhost:*;name=L2CAPEx</code> * <td>matches a server URI with any UUID and * with the stated name value, ignoring other params, except that there must be * no psm param, or one that specifies a PSM value in the range 1001-FFFF * (so not including the reserved PSM range) * * <tr><td> * <code>btl2cap://localhost:*;psm=5-FFFF</code> * <td>matches any server URI that specifies a * PSM value, even in the PSM reserved range * * <tr><td> * <code>btl2cap://localhost:*;psm=1021-102F</code> * <td>matches any server URI with a * specified PSM value in the range 1021-102F * </table> */ public final class Btl2capProtocolPermission extends GCFPermission { /** * Creates a new <code>Btl2capProtocolPermission</code> with the specified URI as * name. The URI string must conform to the specification given * above, and is normalized (per the rules of * <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>) * to facilitate subsequent comparisons. * * @param uri the URI string * @throws IllegalArgumentException if uri is malformed * @throws NullPointerException if uri is null. */ public Btl2capProtocolPermission(String uri) {} /** * Checks if this <code>Btl2capProtocolPermission</code> object "implies" the * specified permission. * <p> * The method acts as if it follows these steps to determine whether * this object implies p: * </p> * <ul> * <li> * If p is not an instanceof Btl2capProtocolPermission, return false. * <li> * If this object's <code>{target}</code> and p's <code>{target}</code> both start with * "localhost:" (they are both server URIs), and this object has a * 'psm' param that is a range (two hexadecimal numbers separated by * a hyphen), and either p does not have a "psm" param, or it does * but its value is not in the range, then return false. * <li> * If this object's <code>{target}</code> and p's <code>{target}</code> both start with * "localhost:" (they are both server URIs), and this object has a * 'psm' param that is not a range, and p does not have a matching * 'psm' param, then return false. * <li> * If this object's <code>{target}</code> and p's <code>{target}</code> both start with * "localhost:" (they are both server URIs), and this object has no * 'psm' param, and p does have a "psm" param whose value is not * in the range 1001-FFFF, then return false. * <li> * If this object has any <code>{params}</code>, and any one of the params other * than "psm" does not match the setting in p (using the default value * if the param is not specified in p), then return false. * <li> * If this object's <code>{target}</code> matches p's <code>{target}</code>, return true. * <li> * If this object's <code>{target}</code> is "*:*", and p is a client URI, return * true. * <li> * If this object's <code>{target}</code> consists of "*:" followed by a PSM * value, and p is a client URI with a matching PSM value, return true. * <li> * If this object's <code>{target}</code> consists of a Bluetooth address followed * by ":*", and p is a client URI with a matching Bluetooth address, * return true. * <li> * If this object's <code>{target}</code> consists of "*:" followed by a PSM * range (two PSM values separated by a hyphen), and p is a client * URI with a PSM value in that range, return true. * <li> * If this object's <code>{target}</code> consists of "localhost:*", and p is a * server URI, return true. * <li> * Otherwise return false. * </ul> * * @param p the permission to check against. * * @return true if the specified permission is implied by this * object, false if not. */ public boolean implies(Permission p) { return false; } /** * Checks two <code>Btl2capProtocolPermission</code> objects for equality. * * @param obj the object we are testing for equality with this object. * * @returns true if obj is a <code>Btl2capProtocolPermission</code> and has the same * URI string as this object. */ public boolean equals(Object obj) { return false; } /** * Returns the hash code value for this object. * * @return a hash value for this object. */ public int hashCode() { return 0; } /** * Returns the canonical string representation of the actions, which * currently is the empty string "", since there are no actions defined for * <code>Btl2capProtocolPermission</code>. * * @return the empty string "". */ public String getActions() { return null; } /** * Returns a new <code>PermissionCollection</code> for storing * <code>Btl2capProtocolPermission</code> objects. * <p> * <code>Btl2capProtocolPermission</code> objects must be stored in a * manner that allows them to be inserted into the collection in any order, * but that also enables the <code>PermissionCollection</code> implies * method to be implemented in an efficient (and consistent) manner. * * @return a new <code>PermissionCollection</code> suitable for storing * <code>Btl2capProtocolPermission</code> objects. */ public PermissionCollection newPermissionCollection() { return null; } } javax.bluetooth.BtsppProtocolPermissionpackage javax.bluetooth; import javax.microedition.io.GCFPermission; /** * This class represents access rights to connections via the "btspp" * protocol. A <code>BtsppProtocolPermission</code> consists of a URI string * but no actions list. * <p> * The class must be present if the platform has <code>GCFPermission</code>, * and must be not present otherwise. * <p> * The URI string specifies a Bluetooth L2CAP connection, as described in JSR * 82 1.2 section 10.3 <em>L2CAP Connection Interface</em>, with additional changes to * allow wildcard matching: the part of the <code>{target}</code> * before the ':' character, or the part of the <code>{target}</code> after the ':' * character, or both, may each be replaced by a '*' wildcard character. The * semantics of wildcard matching are specified below in the implies method. * <p> * Examples: * </p> * <table> * <tr><td> * <code>btspp://0050C000321B:12</code> * <td>matches a client URI with that Bluetooth * address and channel identifier, ignoring params * * <tr><td> * <code>btspp://0050C000321B:12;encrypt=true</code> * <td>matches a client URI with that * Bluetooth address and channel identifier, and with encrypt=true, ignoring * other params * * <tr><td> * <code>btspp://*:*</code> * <td>matches any client URI * * <tr><td> * <code>btspp://*:*;encrypt=true</code> * <td>matches any client URI with encrypt=true, ignoring * other params * * <tr><td> * <code>btspp://*:12</code> * <td>matches any client URI with a channel identifier of 12 * * <tr><td> * <code>btspp://localhost:*</code> * <td>matches any server URI * </table> */ public final class BtsppProtocolPermission extends GCFPermission { /** * Creates a new <code>BtsppProtocolPermission</code> with the specified URI as * name. The URI string must conform to the specification given * above, and is normalized (per the rules of * <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>) * to facilitate subsequent comparisons. * * @param uri the URI string * @throws IllegalArgumentException if uri is malformed * @throws NullPointerException if uri is null. */ public BtsppProtocolPermission(String uri) {} /** * Checks if this <code>BtsppProtocolPermission</code> object "implies" the * specified permission. * <p> * The method acts as if it follows these steps to determine whether * this object implies p: * <p> * <ul> * <li>If p is not an instanceof BtsppProtocolPermission, return false. * * <li>If this object has any <code>{params}</code>, and any one of the params does not * match the setting in p (using the default value if the param is not * specified in p), then return false. * * <li>If this object's <code>{target}</code> matches p's <code>{target}</code>, return true. * * <li>If this object's <code>{target}</code> is "*:*", and p is a client URI, return * true. * * <li>If this object's <code>{target}</code> consists of "*:" followed by a channel * identifier, and p is a client URI with a matching channel identifier, * return true. * * <li>If this object's <code>{target}</code> consists of "localhost:*", and p is a * server URI, return true. * * <li>Otherwise return false. * </ul> * * @param p the permission to check against. * * @return true if the specified permission is implied by this * object, false if not. */ public boolean implies(Permission p) { return false; } /** * Checks two <code>BtsppProtocolPermission</code> objects for equality. * * @param obj the object we are testing for equality with this object. * @returns true if obj is a <code>BtsppProtocolPermission</code> and has the same * URI string as this object. */ public boolean equals(Object obj) { return false; } /** * Returns the hash code value for this object. * * @return a hash value for this object. */ public int hashCode() { return 0; } /** * Returns the canonical string representation of the actions, which * currently is the empty string "", since there are no actions defined for * <code>BtsppProtocolPermission</code>. * * @return the empty string "". */ public String getActions() { return null; } /** * Returns a new <code>PermissionCollection</code> for storing * <code>BtsppProtocolPermission</code> objects. * <p> * <code>BtsppProtocolPermission</code> objects must be stored in a manner that allows * them to be inserted into the collection in any order, but that also * enables the <code>PermissionCollection</code> implies method to be implemented in an * efficient (and consistent) manner. * * @return a new PermissionCollection suitable for storing * <code>BtsppProtocolPermission</code> objects. */ public PermissionCollection newPermissionCollection() { return null; } } javax.obex.IrdaobexProtocolPermissionpackage javax.obex; import javax.microedition.io.GCFPermission; /** * This class represents access rights to connections via the "irdaobex" * protocol. An <code>IrdaobexProtocolPermission</code> consists of a URI string * but no actions list. * <p> * The class must be present if the platform has <code>GCFPermission</code>, * and must be not present otherwise. * <p> * The URI string specifies an OBEX over IRDA connection, as described in JSR * 82 1.2 section 12.4.3 <em>OBEX Over IrDA</em>, with an additional change to allow wildcard matching: * the whole <code>{target}</code> may be replaced by a '*' wildcard character. The * semantics of wildcard matching are specified below in the implies method. * <p> * Examples: * </p><table> * <tr><td> * <code>irdaobex://discover</code> * <td>matches any client discover URI, ignoring params * * <tr><td> * <code>irdaobex://discover;ias=MyAppOBEX,OBEX,OBEX:IrXfer</code> * <td>matches any client * discover URI with that value of the <code>ias</code> param, ignoring other params * * <tr><td> * <code>irdaobex://*</code> * <td>matches any client URI, ignoring params * * <tr><td> * <code>irdaobex://localhost</code> * <td>matches any server URI, ignoring params * </table> */ public final class IrdaobexProtocolPermission extends GCFPermission { /** * Creates a new <code>IrdaobexProtocolPermission</code> with the specified URI as * name. The URI string must conform to the specification given * above, and is normalized (per the rules of * <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>) * to facilitate subsequent comparisons. * <p> * @param uri the URI string * @throws IllegalArgumentException if uri is malformed * @throws NullPointerException if uri is null. */ public IrdaobexProtocolPermission(String uri) {} /** * Checks if this <code>IrdaobexProtocolPermission</code> object "implies" the * specified permission. * <p> * The method acts as if it follows these steps to determine whether * this object implies p: * <ul> * <li>If p is not an instanceof IrdaobexProtocolPermission, return false. * * <li>If this object has any <code>{params}</code>, and any one of the params does not * match the setting in p (using the default value if the param is not * specified in p), then return false. * * <li>If this object's <code>{target}</code> matches p's <code>{target}</code>, ignoring hint bits in * either, then return true. * * <li>If this object's <code>{target}</code> is "*", and p is a client URI, return * true. * * <li>Otherwise return false. * </ul> * * @param p the permission to check against. * * @return true if the specified permission is implied by this * object, false if not. */ public boolean implies(Permission p) { return false; } /** * Checks two <code>IrdaobexProtocolPermission</code> objects for equality. * * @param obj the object we are testing for equality with this object. * @return true if obj is a <code>IrdaobexProtocolPermission</code> and has the same * URI string as this object. */ public boolean equals(Object obj) { return false; } /** * Returns the hash code value for this object. * * @returns a hash value for this object. */ public int hashCode() { return 0; } /** * Returns the canonical string representation of the actions, which * currently is the empty string "", since there are no actions defined for * IrdaobexProtocolPermission. * * @return the empty string "". */ public String getActions() { return null; } /** * Returns a new <code>PermissionCollection</code> for storing * <code>IrdaobexProtocolPermission</code> objects. * <p> * <code>IrdaobexProtocolPermission</code> objects must be stored in a manner that allows * them to be inserted into the collection in any order, but that also * enables the <code>PermissionCollection</code> implies method to be implemented in an * efficient (and consistent) manner. * * @returns a new <code>PermissionCollection</code> suitable for storing * <code>IrdaobexProtocolPermission</code> objects. */ public PermissionCollection newPermissionCollection() { return null; } } javax.obex.TcpobexProtocolPermissionpackage javax.obex; import javax.microedition.io.GCFPermission; /** * This class represents access rights to connections via the "tcpobex" * protocol. A <code>TcpobexProtocolPermission</code> consists of a URI string * but no actions list. * <p> * The class must be present if the platform has <code>GCFPermission</code>, * and must be not present otherwise. * <p> * The URI string specifies an OBEX over TCP connection, as described in JSR 82 * 1.2 section 12.4.2 <em>OBEX Over TCP/IP</em>, with additional changes to allow wildcard matching: * <ul> * <li>the IP address part of the {target} may be replaced by a '*' wildcard * character; * * <li>the port number part of the {target} may be specified as '*', or * have the form 'M-' or '-N' or 'M-N' (where M and N are port numbers). * </ul> * The semantics of wildcard matching are specified below in the implies * method. * <p> * Examples: * </p><table> * <tr><td> * <code>tcpobex://132.53.12.154:5005</code> * <td>matches that client URI, ignoring params * * <tr><td> * <code>tcpobex://132.53.12.154</code> * <td>matches that client URI, with implied or explicit port number 650, * ignoring params * * <tr><td> * <code>tcpobex://*</code> * <td>matches any client URI with implied or explicit port number 650, * ignoring params * * <tr><td> * <code>tcpobex://*:500-999</code> * <td>matches any client URI with a port number in the range * 500-999, including one with an implied port number of 650, ignoring params * * <tr><td> * <code>tcpobex://*:*</code> * <td>matches any client URI ignoring params * * <tr><td> * <code>tcpobex://:5005</code> * <td>matches that server URI, ignoring params * * <tr><td> * <code>tcpobex://:*</code> * <td>matches any server URI, ignoring params * </table> */ public final class TcpobexProtocolPermission extends GCFPermission { /** * Creates a new <code>TcpobexProtocolPermission</code> with the specified URI as * name. The URI string must conform to the specification given * above, and is normalized to facilitate subsequent comparisons in a way * that follows the rules of * <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC 3986</a>, * plus the additional procedures described in the JSR 139 (CLDC 1.1.1) * document <em>URI Normalization</em> (where the implied port number * is 650 if none is specified). * * @param uri the URI string * @throws IllegalArgumentException if uri is malformed * @throws NullPointerException if uri is null. */ public TcpobexProtocolPermission(String uri) {} /** * Checks if this <code>TcpobexProtocolPermission</code> object "implies" the * specified permission. * <p> * The method acts as if it follows these steps to determine whether * this object implies p: * <ul> * <li>If p is not an instanceof <code>TcpobexProtocolPermission</code>, return false. * * <li>If this object has any <code>{params}</code>, and any one of the params does not * match the setting in p (using the default value if the param is not * specified in p), then return false. * * <li>If this object's <code>{target}</code> matches p's <code>{target}</code> return true. * * <li>If this object's port number is a range that does not include * p's port number, then return false. * * <li>If this object's port number is a single port number that does not * match p's port number, then return false. * * <li>If this * object's IP address is '*' and p is a client URI, then return true. * * <li>If this object's IP address matches p's IP address (including the case * of neither having an IP address due to being server URIs), * then return true. * * <li>Otherwise return false. * </ul> * * @param p the permission to check against. * * @return true if the specified permission is implied by this * object, false if not. */ public boolean implies(Permission p) { return false; } /** * Checks two <code>TcpobexProtocolPermission</code> objects for equality. * * @param obj the object we are testing for equality with this object. * @return true if obj is a <code>TcpobexProtocolPermission</code> and has the same * URI string as this object. */ public boolean equals(Object obj); /** * Returns the hash code value for this object. * * @return a hash value for this object. */ public int hashCode() { return 0; } /** * Returns the canonical string representation of the actions, which * currently is the empty string "", since there are no actions defined for * <code>TcpobexProtocolPermission</code>. * * @return the empty string "". */ public String getActions() { return null; } /** * Returns a new <code>PermissionCollection</code> for storing * <code>TcpobexProtocolPermission</code> objects. * <p> * <code>TcpobexProtocolPermission</code> objects must be stored in a manner that allows * them to be inserted into the collection in any order, but that also * enables the <code>PermissionCollection</code> implies method to be implemented in an * efficient (and consistent) manner. * * @return a new <code>PermissionCollection</code> suitable for storing * <code>TcpobexProtocolPermission</code> objects. */ public PermissionCollection newPermissionCollection() { return null; } } |