AppPattern

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.ocap.application
Class AppPattern

    java.lang.Object
      org.ocap.application.AppPattern

    public class AppPattern

extends Object

AppPattern is an element that constitutes an `AppFilter`. An AppPattern has the following attributes:

- idPattern - a group of AppIDs.
- action - an action (ALLOW, DENY, or ASK) for matching applications.
- priority - a priority that determines the search order position in an AppFilter. The highest priority is 255, the lowest is 0.
- expirationTime - An expiration time. Optional.
- info - an MSO-private data. Optional. Could be a String. `AppFilterHandler` may use it for making a decision.

`idPattern` specifies an AppID group with a String: a pair of ranges for Organization IDs and Application IDs. The syntax is:

> `"oid1[-oid2][:aid1[-aid2]]"`

- `oid1` and `oid2` specify a range of Organization IDs inclusive. Each of them must be a 32-bit value.
- `aid1` and `aid2` specify a range of Application IDs inclusive. Each of them must be a 16-bit value.
- `oid2` and `aid2` must be greater than `oid1` and `aid1`, respectively.
- The encoding of these IDs follows 14.5 Text encoding of application identifiers of DVB-MHP 1.0.2 [11]; hexadecimal, lower case, no leading zeros.
- Symbols in brackets are optional.
- When `oid2` is omitted, only `oid1` is in the range.
- When `aid2` is omitted, only `aid1` is in the range.
- When both `aid1` and `aid2` are omitted, all Application IDs are in the range.

See `AppFilter` for the examples.

See Also:
  `AppFilter`, `AppFilterHandler`

Field Summary
`static int` | `ALLOW` When `AppFilter.accept` finds a matching `AppPattern` with this action, it returns `true`.
`static int` | `ASK` When `AppFilter.accept` finds a matching `AppPattern` with this action, it asks `AppFilterHandler.accept` for the decision.
`static int` | `DENY` When `AppFilter.accept` finds a matching `AppPattern` with this action, it returns `false`.

Constructor Summary
`AppPattern(String idPattern, int action, int priority)` Constructs a new AppPattern with no expiration.
`AppPattern(String idPattern, int action, int priority, Date expirationTime, Object info)` Constructs a new AppPattern with an expiration time and MSO private information.

Method Summary
`boolean` | `equals(Object that)` Indicates whether some other object is "equal to" this one.
`int` | `getAction()` Returns the action associated with this AppPattern.
`String` | `getAppIDPattern()` Returns the pattern string that specifies a group of AppIDs.
`Date` | `getExpirationTime()` Returns the time for this AppPattern to expire or `null` if it never expires.
`int` | `getPriority()` Returns the search order priority of this AppPattern.
`Object` | `getPrivateInfo()` Returns MSO-private information of this AppPattern.
`int` | `hashCode()` Returns a hash code value for the object.

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ALLOW

    public static final int ALLOW

  When `AppFilter.accept` finds a matching `AppPattern` with this action, it returns `true`.

  See Also:
    `AppFilter.accept(org.dvb.application.AppID)`, Constant Field Values

### DENY

    public static final int DENY

  When `AppFilter.accept` finds a matching `AppPattern` with this action, it returns `false`.

  See Also:
    `AppFilter.accept(org.dvb.application.AppID)`, Constant Field Values

### ASK

    public static final int ASK

  When `AppFilter.accept` finds a matching `AppPattern` with this action, it asks `AppFilterHandler.accept` for the decision.

  See Also:
    `AppFilter.accept(org.dvb.application.AppID)`, `AppFilterHandler.accept(org.dvb.application.AppID, org.ocap.application.AppPattern)`, Constant Field Values

Constructor Detail

### AppPattern

    public AppPattern(String idPattern,
                      int action,
                      int priority)

  Constructs a new AppPattern with no expiration.

  Parameters:
    `idPattern` - a String to specify an AppID group.
    `action` - an action.
    `priority` - a search order priority.
  Throws:
    `IllegalArgumentException` - `idPattern` has a bad format, `action` or `priority` is out of range.

### AppPattern

    public AppPattern(String idPattern,
                      int action,
                      int priority,
                      Date expirationTime,
                      Object info)

  Constructs a new AppPattern with an expiration time and MSO private information.

  Parameters:
    `idPattern` - a String to specify an AppID group.
    `action` - an action.
    `priority` - a search order priority.
    `expirationTime` - time for this AppPattern to expire. `null` it never expires.
    `info` - MSO specific information. Can be `null`.
  Throws:
    `IllegalArgumentException` - `idPattern` has a bad format, `action` or `priority` is out of range.

Method Detail

### getAppIDPattern

    public String getAppIDPattern()

  Returns the pattern string that specifies a group of AppIDs.

  Returns:
    the pattern string.

### getAction

    public int getAction()

  Returns the action associated with this AppPattern.

  Returns:
    the action.

### getPriority

    public int getPriority()

  Returns the search order priority of this AppPattern.

  Returns:
    the search order priority.

### getExpirationTime

    public Date getExpirationTime()

  Returns the time for this AppPattern to expire or `null` if it never expires.

  Returns:
    the expiration time or `null`.

### getPrivateInfo

    public Object getPrivateInfo()

  Returns MSO-private information of this AppPattern.

  Returns:
    the MSO private information.

### equals

    public boolean equals(Object that)

  Indicates whether some other object is "equal to" this one.

  This method does not factor in `expirationTime` or `info` attributes, but does compare `idPattern`, `action`, and `priority` attributes.

  Overrides:
    `equals` in class `Object`
  Parameters:
    `that` - the reference object with which to compare.
  Returns:
    `true` if this object is the same as the obj argument; `false` otherwise.
  See Also:
    `Object.hashCode()`, `Hashtable`

### hashCode

    public int hashCode()

  Description copied from class: `Object`
  Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by `java.util.Hashtable`.

  The general contract of `hashCode` is:

  - Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  - If two objects are equal according to the `equals(Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
  - It is not required that if two objects are unequal according to the `Object.equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.

  As much as is reasonably practical, the hashCode method defined by class `Object` does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

  Overrides:
    `hashCode` in class `Object`
  Returns:
    a hash code value for this object.
  See Also:
    `Object.equals(java.lang.Object)`, `Hashtable`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD