javacardx.facilities
Class ServiceRegistryPermission

java.lang.Object
  extended by java.security.Permission
      extended by javacardx.security.URIPermission
          extended by javacardx.facilities.ServiceRegistryPermission

@TransactionType(value=NOT_SUPPORTED)
public final class ServiceRegistryPermission
extends URIPermission

This class is for SIO-based service registry access permissions. The ServiceRegistryPermission extends the URIPermission and defines specific actions. An ServiceRegistryPermission consists of an SIO-based service URI and a set of actions valid for that URI.

The SIO-based service URI may designates:

The actions to be granted are passed to the constructor in a string containing a list of one or more comma-separated keywords. The possible keywords are "register", "unregister" and "lookup". Their meaning is defined as follows:

register
register an SIO-based service factory. Allows an application to register an SIO-based service factory which create an instance of the SIO-based service when it is looked up in the registry.
unregister
unregister an SIO-based service factory. Allows an application to unregister an SIO-based service factory it has previously registered.
lookup
lookup SIO-based services. Allows an application to lookup registered SIO-based services.

The actions string is converted to lowercase before processing.

Since:
Java Card 3.0
See Also:
URIPermission, Permission, AccessController, AccessControlException

Field Summary
static String ACTION_LOOKUP
          The "lookup" action.
static String ACTION_REGISTER
          The "register" action.
static String ACTION_UNREGISTER
          The "unregister" action.
 
Constructor Summary
ServiceRegistryPermission(String serviceURI, String actions)
          Creates a new ServiceRegistryPermission object with the specified actions.
 
Method Summary
protected  String[] getPossibleActions()
          Returns the possible actions in the following order: lookup, register, unregister.
 
Methods inherited from class javacardx.security.URIPermission
equals, getActions, hashCode, implies
 
Methods inherited from class java.security.Permission
getName, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ACTION_REGISTER

public static final String ACTION_REGISTER
The "register" action.

See Also:
Constant Field Values

ACTION_UNREGISTER

public static final String ACTION_UNREGISTER
The "unregister" action.

See Also:
Constant Field Values

ACTION_LOOKUP

public static final String ACTION_LOOKUP
The "lookup" action.

See Also:
Constant Field Values
Constructor Detail

ServiceRegistryPermission

public ServiceRegistryPermission(String serviceURI,
                                 String actions)
Creates a new ServiceRegistryPermission object with the specified actions. serviceURI is the URI of an SIO-based service, and actions contains a comma-separated list of the desired actions granted on the designated service. Possible actions are "register", "unregister" and "lookup".

An SIO-based service URI that ends in "/*" is a path-prefix pattern. It designates the root of a namespace which includes all services within its scope. If the URI is an absolute URI, it must have an "sio:" scheme, such as in sio:///transit/pos/ticketbook. If the URI is relative, it is resolved against the application's SIO-based service namespace root URI. For example, the SIO-based service namespace root URI of the application ///transit/pos is sio:///transit/pos/, and the relative URI ticketbook would be resolved to sio:///transit/pos/ticketbook.

A URI consisting of a single "*" is resolved relatively to the current application's SIO-based service namespace root URI. In the previous example, it would be resolved to sio:///transit/pos/*.

A URI consisting of a "/*" designates all SIO-based services on the system.

Parameters:
serviceURI - an exact or path-prefix service URI pattern designating a set of services.
actions - the action string.
Throws:
NullPointerException - if serviceURI or actions is null.
IllegalArgumentException -
  • if serviceURI is not a well-formed service URI
  • or, if actions is empty or contains an action other than the specified possible actions.
  • SecurityException - if serviceURI or actions is not accessible in the caller's context.
    Method Detail

    getPossibleActions

    protected String[] getPossibleActions()
    Returns the possible actions in the following order: lookup, register, unregister.

    Note: this method returns a different array (a defensive copy) upon each call in order to guarantee the immutability of this permission object.

    Overrides:
    getPossibleActions in class URIPermission
    Returns:
    an array with all possible actions.


    Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.