MIDP3.0

javax.microedition.io
Class PushRegistryPermission

java.lang.Object
  extended by java.security.Permission
      extended by javax.microedition.io.PushRegistryPermission

public class PushRegistryPermission
extends java.security.Permission

The PushRegistryPermission class is used to check the static and dynamic registration of push connections and for registration of an alarm. The permission covers static registration via application attributes, and dynamic registration via PushRegistry.registerConnection and alarm registration with PushRegistry.registerAlarm.

For the purposes of Push Registration permission, the URI MUST consist only of the scheme and delimiter (":") as defined by [RFC3986]. The scheme may contain the wildcard character "*", which allows registration of all schemes. For alarm registration, the uri is "*" and the action is alarm. Push registration and alarm registration can be combined in a single permission. For example, uri="file:" and actions="static,dynamic,alarm".

The permissible actions and descriptions are listed in the Actions Table:

Action Description
static Allows registration of a Push Connection in the packaging of the MIDlet Suite
dynamic Allows registration of a Push Connection using PushRegistry.registerConnection
alarm Allows registration of an alarm using PushRegistry.registerAlarm

Since:
MIDP 3.0
See Also:
PushRegistry.registerConnection, PushRegistry.registerAlarm

Constructor Summary
PushRegistryPermission(java.lang.String uri, java.lang.String actions)
          Creates a new instance of PushRegistryPermission.
 
Method Summary
 boolean equals(java.lang.Object object)
          Checks if another object is equal to this one.
 java.lang.String getActions()
          Returns the canonical string representation of the actions.
 int hashCode()
          Gets the hash code value for this object.
 boolean implies(java.security.Permission p)
          Checks if the specified permission is "implied" by this object.
 
Methods inherited from class java.security.Permission
getName, newPermissionCollection, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PushRegistryPermission

public PushRegistryPermission(java.lang.String uri,
                              java.lang.String actions)
Creates a new instance of PushRegistryPermission. The URI MUST include only the scheme and delimiter (":") as defined by [RFC3986] or the wildcard character "*" and actions as listed above. The URI must be valid regardless of the actions supplied. For example, a URI of "*" would be used with the "alarm" action.

Parameters:
uri - The resource name is the URI of the incoming connection; the URI MUST contain only the scheme and the delimiter ":" or wildcard "*".
actions - one or more of the actions listed in the Actions Table, separated by "," if more than 1.
Throws:
java.lang.IllegalArgumentException - If the URI contains anything other than the non-empty scheme and the delimiter ":" or the wildcard "*" .
java.lang.IllegalArgumentException - if actions contains actions that are not listed in the Actions Table.
Method Detail

implies

public boolean implies(java.security.Permission p)
Checks if the specified permission is "implied" by this object. Returns true iff:

Specified by:
implies in class java.security.Permission
Parameters:
p - the permission to check against.
Returns:
true if the specified permission is implied by this object, otherwise false.

getActions

public java.lang.String getActions()
Returns the canonical string representation of the actions. This method always returns actions in the following order: static, dynamic, alarm. For example, if this permission object allows static, dynamic, and alarm actions, a call to getActions must return the string "static,dynamic,alarm".

Specified by:
getActions in class java.security.Permission
Returns:
the canonical form of the actions.

hashCode

public int hashCode()
Gets the hash code value for this object.

Specified by:
hashCode in class java.security.Permission
Returns:
the sum of the hashcode of getName + the hashcode of getActions.

equals

public boolean equals(java.lang.Object object)
Checks if another object is equal to this one.

Specified by:
equals in class java.security.Permission
Parameters:
object - an object to compare
Returns:
true if the objects are of the same type and the respective names and actions are equal.

MIDP3.0

Send a comment or suggestionVersion 3.0 of Mobile Information Device Profile Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-2009 Motorola Inc. Portions copyright 1993-2002 Sun Microsystems, Inc. and Motorola, Inc. All Rights Reserved.