Commit 4bf6618a authored by msm's avatar msm

Initial check-in.

parents
package org.ocap.application;
/**
* The AbstractService represents a non-broadcast Service which
* applications can be aggregated to and be selected as a whole
* within a given javax.tv.service.selection.ServiceContext.
*/
public interface AbstractService extends javax.tv.service.Service {
/**
* ServiceType for an abstract service
*/
public static final javax.tv.service.ServiceType
OCAP_ABSTRACT_SERVICE = javax.tv.service.ServiceType.UNKNOWN;
/**
* Returns the enumeration of the application ids that are bound
* to this abstract service
*
* @return the list of application IDs included in this
* AbstractService
*/
public java.util.Enumeration getAppIds();
/**
* Returns this service-meta data. In case of the AbstractService,
* this method should always fail with
* SIRequestFailureType.DATA_UNAVAILABLE.
*
* @overwrites javax.tv.service.Service.retriveDetails()
* @param requestor the object to be notified for the retrieval of
* javax.tv.service.navigation.ServiceDetails
*
* @return SIRequest object identifying this asynchronous retrieval request.
*
*/
public abstract javax.tv.service.SIRequest retrieveDetails(
javax.tv.service.SIRequestor requestor);
/**
* Returns the name of this service
*
* @overwrites javax.tv.service.Service.getName()
* @return the name of this AbstractService
*
*/
public String getName();
/**
* Indicates if this service has a multiple instances across various
* transport streams. In case of AbstractService, this method should
* always return false.
*
* @overwrites javax.tv.service.Service.hasMultipleInstances()
* @return false
*
*/
public boolean hasMultipleInstances();
/**
* Returns the service type of this service.
* In case of AbstractService, this method should
* always return ServiceType.OCAP_ABSTRACT_SERVICE
*
* @overwrites javax.tv.service.getServiceType()
* @return ServiceType.OCAP_ABSTRACT_SERVICE
*
*/
public javax.tv.service.ServiceType getServiceType();
/**
* Returns the locator for this service.
*
* @overwrites javax.tv.service.getLocator()
* @return the locator for this AbstractService
*
*/
public javax.tv.locator.Locator getLocator();
/**
* Returns true if the object passed in is equal to
* this AbstractService
*
* @overwrites javax.tv.service.getLocator()
* @param object the object to compare equality
* @return true if the object is an instance of AbstractService
* and contains the same application as this AbstractService,
* false otherwise.
*
*/
public boolean equals(Object object);
/**
* Returns the hashcode for this service.
*
* @return the hashcode for this AbstractService
*/
public int hashCode();
}
package org.ocap.application;
/**
* Creates an instance of Abstract Service for bounding
* non-broadcast service bound applications.
*/
public abstract class AbstractServiceCreator {
/**
* Provides an instance of AbstractServiceCreator.
*/
protected AbstractServiceCreator() {
}
/**
* Gets an instance of AbstractServiceCreator
*
* @return an instance of AbstractServiceCreator
*/
public static AbstractServiceCreator getAbstractServiceCreator() {
return null;
}
/**
* Creates an instance of AbstractService
*
* @param organizationID an id of the organization this AbstractService
* belongs to
* @param serviceID the unique id of this service
* @param serviceName the name of this service
*
* @throws SecurityException if the caller does not have
* MonitorAppPermission("createAbstractService")
*
* @return an instance of AbstractService. If there already is an instance of
* abstract service with he same orgID, servID and serviceName by the
* time the method is called, then the existing AbstractService is returned.
*/
public abstract AbstractService createAbstractService(
int organizationID,
int serviceID,
String serviceName)
throws java.lang.SecurityException;
}
/**
* @(#)AppControlCode.java
*
**/
package org.ocap.application;
/**
*
* AppControlCode
*
* This class defines the Application Control Code used
* by the Monitor Application
*/
public class AppControlCode {
/**
*
* Indicates that the application should be loaded.
*
* For DVB_J application, this code indiates that the Object Carousel
* module containing the class implementing the Xlet interface needs to be
* loaded.
* For DVB_HTML application, this code states that the Application Entry
* Point of the DVB_HTML application should be loaded.
*/
public static final AppControlCode AUTOSTART;
/**
*
* Indicates that the application should be present within the
* Service Context, but not loaded
*/
public static final AppControlCode PRESENT;
/**
*
* Indicates that the application should be destroyed.
*
* For the DVB_J application, Xlet.destoryXlet(false) is called by the
* application manager, and the application is allowed to shut down
* gracefully
* For the DVB_HTML application, DVB-HTML actor goes to the Killed state
*/
public static final AppControlCode DESTROY;
/**
*
* Indicates that the application should be killed.
*
* For the DVB_J application, Xlet.destoryXlet(true) is called by the
* application manager, forcing the application to terminate
* For the DVB_HTML application, DVB-HTML actor is terminated
*/
public static final AppControlCode KILL;
/**
*
* Indicates that the application should be prefetched.
* This code is applicable only for the HTML application
*
* Similar to AUTOSTART, except that the DVB-HTML actor holds on entry
* to the Active state and waits for the triger before completely
* transitioning to the active state
*/
public static final AppControlCode PREFETCH;
/**
*
* Indicates that this application is launchable only after tuning.
* This code is not applicable for OCAP applications that are bound
* to zero broadcast service.
*/
public static final AppControlCode REMOTE;
/**
*
* Creates an AppControlCode object.
*
* @param name The string name of this code (e.g. AUTOSTART).
*
**/
protected AppControlCode(String name){
}
/**
*
* Provides the string name of the code. For the code objects defined in
* this class, the string name will be identical to the class variable name.
*
* @overwrites toString in class java.lang.Object
*
* @return the string name of the code
*
**/
public java.lang.String toString(){
return null;
}
// Needed for compilation
static {
AUTOSTART = new AppControlCode("AUTOSTART");
DESTROY = new AppControlCode("DESTROY");
KILL = new AppControlCode("KILL");
PREFETCH = new AppControlCode("PREFETCH");
PRESENT = new AppControlCode("PRESENT");
REMOTE = new AppControlCode("REMOTE");
}
}
package org.ocap.application;
import org.dvb.application.AppID;
/**
* The AppFilter class provides a mechanism for the monitor application
* to indicate to the application whether to execute, reject, or
* notify the monitor application prior to executing an application or
* presenting it for execution.
* <p>
* When an application is announced,
* before being autostarted or presented, it is tested against the filter.
* <p>
* The filter consists of a set of AppFilterItems
* against which the incoming application
* is tested until a match is found. Then, the action (ACCEPT, REJECT
* or NOTIFY) assocated with the matching AppFilterItem is taken.
* If the application matches more than one AppFilterItem in the filter,
* then the action of the AppFilterItem with the highest priority
* is applied.
* <p>
* If no match is found, a default policy is used. If the monitor
* application does not specify a default policy, the default policy is
* set to NOTIFY.
* This behavior may be changed by using the setDefaultBehavior method.
* <p>
* If no listener is set, applications in the NOTIFY category are rejected.
* <p>
* Modifying the object has no effect on the currently active filter
* until the org.ocap.application.setAppFilter() method is called.
* <p>
* If there are multiple AppFilterItems with equal priority in the AppFilter
* that indicates the same application, then it is implementation
* dependent on which AppFilterItem's action would be applied to the
* tested application.
*
**/
public final class AppFilter {
/**
* Creates an instance of AppFilter without any AppFilterItem
*/
public AppFilter() {};
/**
* Creates an instance of AppFilter with instance of AppFilterItems
*
* @param list an array of AppFilterItem to be inserted to the list
*/
public AppFilter(AppFilterItem[] list) {};
/**
* Returns the enumaration of all AppFilterItems in this filter.
* <p>
*
* @return the enumaration of all the AppFilterItems in this list
**/
public java.util.Enumeration
getAppFilterItems() {
return null;
}
/**
* Returns an enumeration of AppFilterItems that conflict
* with the given AppFilterItem.
* <p>
* This method returns a set of AppFilterItems containing
* regular expressions that represent sets, each of which overlaps
* the set represented by the AppFilterItem passed in as a parameter,
* and whose actions conflicts with the action of the given AppFilterItem.
*
* @param item The item to find a conflict in the list
*
* @return an enumaration of all the AppFilterItems in this list
* which conflicts with the given AppFilterItem
**/
public java.util.Enumeration
getConflicts(AppFilterItem item) {
return null;
}
/**
* Gets an action this AppFilter is set to take.
* <p>
* If an AppFilterItem entry covering the application passed in as
* parameters is found in this AppFilter, then the action for the
* AppFilterItem is returned. If no entry is found, then the default
* action for this AppFilterItem is returned.
*
* @param appid the application id to search for, could be null
* @param url the url for the application to search for, could be null
*
* @return the action which this AppFilter class
* is set to take for the given AppID and URL
**/
public int
getAction(org.dvb.application.AppID appid,
java.net.URL url) {
return 0;
}
/**
* Inserts a filter item into the filter list.
* <p>
* @param item item to be inserted into the list
* <p>
* @return true when the operation succeeds, false otherwise
**/
public boolean
insertItem(AppFilterItem item) {
return true;
}
/**
* Deletes the item from the filter
* <p>
* No action is taken if the item is not found in the list
*
* @param item the AppFilterItem to delete
* @return true if the operation succeeds, false otherwise
**/
public boolean
deleteItem(AppFilterItem item) {
return true;
}
/**
* Changes the priority of the AppFilterItem in this list
* <p>
* No action is taken if the item is not found in the list
*
* @param item the AppFilterItem to change the priority
* @param priority the new priority to set
**/
public void
changePriority(AppFilterItem item, int priority) {
}
/**
* Sets the default action for applications not listed in the filter.
* If not invoked, the default action is NOTIFY.
*
* @param action the action to set
**/
public void
setDefaultAction(int action) {
}
/**
* Sets the listener which receives callbacks for applications in
* the NOTIFY category.
* <p>
* If there is a listener already registered for this AppFilter, then
* the new listener will overwrite the original listener.
*
* @param listener the listener to register
**/
public void
setListener(AppFilterListener listener) {
}
/**
* Remove the listener which receives callbacks for
* applications in the NOTIFY category.
*
* @param listener the listener to remove. No opearation is taken
* if this listener is not registered to the list.
**/
public void
removeListener(AppFilterListener listener) {
return;
}
}
package org.ocap.application;
import org.dvb.application.*;
/**
* The AppFilterItem class specifies individual items that are to be
* included in AppFilter class instance.
* <p>
* AppFilterItem consists of the following data objects.
* <p>
* A regular expression pattern for matching the
* Application Identifier.
* <p>
* A regular expression pattern for matching the URL. This data can be
* null if URL pattern match does not apply to this AppFilterItem, for
* example, to filter EE apps.
* <p>
* The action (one of ACCEPT, REJECT, or NOTIFY) to be taken by
* the application
* manager when asked to execute or present a program whose identification
* matches the regular expression
* <p>
* the priority of this AppFilterItem object within AppFilter object
* <p>
* an expiration time of this AppFilterItem, optional,
* <p>
* an MSO-private field, optional, could be a String.
**/
public
class AppFilterItem {
/**
* Constructs a new AppFilterItem without an expiration time and
* MSO private information
* <p>
*
* @param id an application id to specify, regular expression
* @param url the url for the application to match, regular expression
* can be null to indicates that url is not applicable to
* this AppFilterItem
* @param action an action (ACCEPT, REJECT or NOTIFY) for this application
* @param priority the priority for this AppFilterItem. Smaller
* number indicates higher priority. Priority does not have to
* be a consequtive number.
*
* @throws IllegalArgumentException if both id and url are null, or
* if action is not one of the integer fields specified in this class.
*
**/
public
AppFilterItem(String id,
String url,
int action,
int priority) {
}
/**
* Constructs a new AppFilterItem with the expiration time and
* MSO private information
* <p>
* @param id an application id to specify, regular expression
* @param url the url for the application to match, regular expression
* can be null to indicates that url is not applicable to
* this AppFilterItem
* @param action an action (ACCEPT, REJECT or NOTIFY) for this application
* @param priority the priority for this AppFilterItem. Smaller
* number indicates higher priority. Priority does not have to
* be a consequtive number.
* @param expirationTime the time which the entry will expire, can be null
* @param info MSO specific information, can be null
*
* @throws IllegalArgumentException if both id and url are null/emtpy, or
* if action is not one of the integer fields specified in this class.
*
**/
public
AppFilterItem(String id,
String url,
int action,
int priority,
java.util.Date expirationTime,
Object info) {
}
/**
* Indicates the application should be accepted for execution or
* presentation
*
**/
public static final int ACCEPT = 1;
/**
* Indicates the application should not be accepted for execution or
* presentation
*
**/
public static final int REJECT = 2;
/**
* Indicates that the registered listener should be contacted prior to
* executing or presenting the application using the notify function
* which is defined in the AppFilterListener interface.
**/
public static final int NOTIFY = 3;
/**
* Gets an applicaiton ID for this AppFilterItem
*
* @return The AppID String for this AppFilterItem
*
**/
public String
getAppIdString() {
return null;
}
/**
* Gets an URL for this AppFilterItem
*
* @return The URL for this AppFilterItem, or null if
* there is none.
*
**/
public String
getURLString() {
return null;
}
/**
* Gets the action (one of ACCEPT, REJECT, NOTIFY) to be
* performed if the pattern matches the URL or org/app id as appropriate
*
* @return The action of this AppFilterItem
*
**/
public int
getAction() {
return 0;
}
/**
* Gets the priority for this AppFilterItem
*
* @return The priority of this AppFilterItem
*
**/
public int