EventRegistryPermission (Java Card API, Connected Edition)
Date: 2009-12-11

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javacardx.facilities
Class EventRegistryPermission

    java.lang.Object
      java.security.Permission
          javacardx.security.URIPermission
              javacardx.facilities.EventRegistryPermission

    @TransactionType(value=NOT_SUPPORTED)
    public final class EventRegistryPermission

extends URIPermission

This class is for event registry access permissions. The EventRegistryPermission extends the URIPermission and defines specific actions. An EventRegistryPermission consists of an event URI and a set of actions valid for that URI.

The event URI may designate:

- an event as an exact pattern hierarchical URI (one not ending with "/*"), such as `event:///transit/pos/ticketbook/overdraft` or `event:///transit/pos/ticketbook/credited`.

- a collection of events as a path-prefix pattern hierarchical URI (one ending with "/*"), such as `event:///transit/pos/ticketbook/*`.

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 "notify". Their meaning is defined as follows:

register
  register an event listener. Allows an application to register a listener which will be notified when an event occurs.
unregister
  unregister an event listener. Allows an application to unregister a listener it has previously registered to be notified when an event occurs.
notify
  notifies event listeners. Allows an application to notify listeners registered for an event that that event has occured.

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_NOTIFY` The "notify" action.
`static String` | `ACTION_REGISTER` The "register" action.
`static String` | `ACTION_UNREGISTER` The "unregister" action.

Constructor Summary
`EventRegistryPermission(String eventURI, String actions)` Creates a new EventRegistryPermission object with the specified actions.

Method Summary
`protected String[]` | `getPossibleActions()` Returns the possible actions in the following order: notify, 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_NOTIFY

    public static final String ACTION_NOTIFY

  The "notify" action.

  See Also:
    Constant Field Values

Constructor Detail

### EventRegistryPermission

    public EventRegistryPermission(String eventURI,
                                   String actions)

  Creates a new EventRegistryPermission object with the specified actions. eventURI is the URI of an event, and actions contains a comma-separated list of the desired actions granted on the designated event. Possible actions are "register", "unregister" and "notify".

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

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

  A URI consisting of a "/*" designates all events on the system.

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

Method Detail

### getPossibleActions

    protected String[] getPossibleActions()

  Returns the possible actions in the following order: notify, 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.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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