org.ocap.application.AppPattern Maven / Gradle / Ivy
package org.ocap.application;
import java.util.Date;
/**
* AppPattern is an element that constitutes an {@link 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. {@link 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 {@link AppFilter} for the examples.
*
* @see AppFilter
* @see AppFilterHandler
*/
public class AppPattern {
/**
* When AppFilter.accept
finds a matching
* AppPattern
with this action, it returns
* true
.
*
* @see AppFilter#accept
*/
public static final int ALLOW = 1;
/**
* When AppFilter.accept
finds a matching
* AppPattern
with this action, it returns
* false
.
*
* @see AppFilter#accept
*/
public static final int DENY = 2;
/**
* When AppFilter.accept
finds a matching
* AppPattern
with this action, it asks
* AppFilterHandler.accept
for the decision.
*
* @see AppFilter#accept
* @see AppFilterHandler#accept
*/
public static final int ASK = 3;
/**
* Constructs a new AppPattern with no expiration.
*
* @param idPattern a String to specify an AppID group.
*
* @param action an action.
*
* @param priority a search order priority.
*
* @throws IllegalArgumentException idPattern
has a bad
* format, action
or priority
is out of
* range.
*/
public AppPattern(String idPattern, int action, int priority) {
}
/**
* Constructs a new AppPattern with an expiration time and MSO
* private information.
*
* @param idPattern a String to specify an AppID group.
*
* @param action an action.
*
* @param priority a search order priority.
*
* @param expirationTime time for this AppPattern to expire. null
* it never expires.
*
* @param info MSO specific information. Can be null
.
*
* @throws IllegalArgumentException idPattern
has a bad
* format, action
or priority
is out of
* range.
*/
public AppPattern(String idPattern, int action, int priority,
Date expirationTime, Object info) {
}
/**
* Returns the pattern string that specifies a group of AppIDs.
*
* @return the pattern string.
*/
public String getAppIDPattern() {
return null;
}
/**
* Returns the action associated with this AppPattern.
*
* @return the action.
*/
public int getAction() {
return 0;
}
/**
* Returns the search order priority of this AppPattern.
*
* @return the search order priority.
*/
public int getPriority() {
return 0;
}
/**
* Returns the time for this AppPattern to expire or
* null
if it never expires.
*
* @return the expiration time or null
.
*/
public Date getExpirationTime() {
return null;
}
/**
* Returns MSO-private information of this AppPattern.
*
* @return the MSO private information.
*/
public Object getPrivateInfo() {
return null;
}
/**
* 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.
*/
public boolean equals(Object that) {
return false;
}
public int hashCode() {
return 0;
}
}