Commit 2dd4dda0 authored by nshah's avatar nshah

Tagging ocap_hn for the 1.2.3 bundle release

parent 8fd4999e
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>stubs-parent</artifactId>
<groupId>com.cablelabs.ocap</groupId>
<version>1.2.3-SNAPSHOT</version>
</parent>
<artifactId>ocap_hn</artifactId>
<packaging>jar</packaging>
<name>OCAP RI HN Stubs</name>
<dependencies>
<dependency>
<groupId>com.cablelabs.ocap</groupId>
<artifactId>ocap_api</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>srcpkg</id>
<goals>
<goal>single</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
/*
* Created on 07-Oct-2004
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package org.ocap.hn;
import org.ocap.hn.content.ContentContainer;
import org.ocap.hn.content.navigation.ContentList;
/**
* Event which will be sent to registered ContentServerListeners when
* ContentEntrys have been added, changed or removed.
*/
public class ContentServerEvent extends java.util.EventObject{
/**
* Event ID indicating that content got added to a ContentServerNetModule.
* This event SHALL NOT guarantee that any content items or
* associated metadata have been communicated to the local device.
* Applications should utilize the content browsing and searching
* APIs to retrieve any added content items.
*
* @see org.ocap.hn.ContentServerNetModule
*/
public static final int CONTENT_ADDED = 0;
/**
* Event ID indicating that content got removed from a ContentServerNetModule
*/
public static final int CONTENT_REMOVED = 1;
/**
* Event ID indicating that metadata associated with content has
* been updated. This event SHALL NOT guarantee that and changes
* to content items or associated metadata have been communicated
* to the local device. Applications should utilize the content
* browsing and searching APIs to retrieve any updated metadata.
*
* @see org.ocap.hn.ContentServerNetModule
*/
public static final int CONTENT_CHANGED = 2;
/**
* Creates a new ContentServerEvent with the given source object, the ContentItem involved and
* an event ID indicating whether the content got added or removed.
* @param source The source of this event. This must be a ContentServerNetModule.
* @param content the IDs of the ContentEntrys involved.
* @param evt the Event ID, either CONTENT_ADDED,CONTENT_REMOVED or CONTENT_CHANGED.
*/
public ContentServerEvent(Object source, String content[],int evt){
super(source);
}
/**
* Returns the IDs associated with the ContentEntrys involved in this event.
* @return the string IDs of the entries involved.
*/
public String[] getContent(){
return null;
}
/**
* Returns the ContentServerNetModule. This is the source object of the event.
*
* @return the ContentServerNetModule containing the ContentItem that was
* added/removed/changed
*/
public ContentServerNetModule getContentServerNetModule(){
return null;
}
/**
* Gets the event ID for this event. Valid values are
* CONTENT_ADDED, CONTENT_CHANGED and CONTENT_REMOVED
*
* @return the ID for this event
*/
public int getEventID()
{
return 0;
}
}
package org.ocap.hn;
import java.util.EventListener;
import org.ocap.hn.content.ContentContainer;
import org.ocap.hn.content.ContentEntry;
/**
* Listener interface for classes which are interested in changes to a ContentServerNetModule.
*/
public interface ContentServerListener extends EventListener{
/**
* Called when a {@link ContentEntry} has been added, changed or removed
* from the {@link org.ocap.hn.ContentServerNetModule}
* @param evt the {@link ContentServerEvent}
*/
public void contentUpdated(ContentServerEvent evt);
}
This diff is collapsed.
This diff is collapsed.
package org.ocap.hn;
/**
* Represents a Device Event. There are two types of Device events:
* one that is generated by the NetManager when a Device is added or removed
* from the home network. Application may register as a listener to NetManager
* to receive such events. The other DeviceEvent is generated by the
* Device itself when its internal state changes. Application should register
* as a listener with a particular Device for such events. In both scenarios,
* the Device that was the source of the event is returned.
*/
public class DeviceEvent extends java.util.EventObject {
/**
* A constant indicating new device is registered to home network.
*/
public static final int DEVICE_ADDED = 100;
/**
* A constant indicating a device is removed from home network.
*/
public static final int DEVICE_REMOVED = 101;
/**
* A constant indicating a device is updated from home network.
*/
public static final int DEVICE_UPDATED = 102;
/**
* A constant indicating a device's internal state has changed.
*/
public static final int STATE_CHANGE = 201;
/**
* Constructs a DeviceEvent by specifying type and source.
*
* @param type
* Device change type, allowed type are defined in
* <code>DeviceEvent</code>
* @param source
* Device where the change happens.
*/
public DeviceEvent(int type, Object source) {
super(source);
}
/**
* Returns device event type, as defined in <code>DeviceEvent</code>.
*
* @return device event type
*/
public int getType() {
return 0;
}
/**
* Returns device event source, which is always a Device.
*
* @return device event source
*/
public Object getSource() {
return null;
}
}
\ No newline at end of file
package org.ocap.hn;
/**
* DeviceEvent callback interface. When a Device is registered or removed from
* NetManager, or if the internal status of a Device changes, then system will
* notify all registered listeners.
*/
public interface DeviceEventListener extends java.util.EventListener {
/**
* Callback function for Device events.
*
* @param event
* Device event
*/
public void notify(DeviceEvent event);
}
\ No newline at end of file
package org.ocap.hn;
/**
* The HomeNetPermission class represents permission to execute privileged
* home networking operations only signed applications MAY be granted.
* <p>
* A HomeNetPermission consists of a permission name, representing
* a single privileged operation.
* The name given in the constructor may end in "*" to represent
* all permissions beginning with the given string, such as <code>"*"</code>
* to allow all HomeNetPermission operations.
* <p>
* The following table lists all HomeNetPermission permission names.
* <table border=1 cellpadding=5>
* <tr>
* <th>Permission Name</th>
* <th>What the Permission Allows</th>
* <th>Description</th>
* </tr>
*
* <tr>
* <td>contentmanagement</td>
* <td>Provides management of local or remote content</td>
* <td>Applications with this permission can copy, move, delete content
* as well as allocate and delete logical volumes on a local network
* device.</td>
* </tr>
*
* <tr>
* <td>contentlisting</td>
* <td>Provides listing of content on remote devices</td>
* <td>Applications with this permission can discover and query lists of
* content stored on or streamable from remote devices.</td>
* </tr>
*
* <tr>
* <td>recording</td>
* <td>Provides recording operations on remote devices</td>
* <td>Applications with this permission can request that recordings
* be scheduled, prioritized, and deleted on remote devices.</td>
* </tr>
*
* <tr>
* <td>recordinghandler</td>
* <td>Provides recording request handler functionality on the local device</td>
* <td>Applications with this permission can manage network recording
* requests for the local device.</td>
* </tr>
*
* </table>
*
* Other permissions may be added as necessary.
*/
public final class HomeNetPermission extends java.security.BasicPermission
{
/**
* Constructor for the HomeNetPermission
*
* @param name The name of this permission (see table in class
* description).
*/
public HomeNetPermission (String name)
{
super(name);
}
}
package org.ocap.hn;
/**
* This class represents an event generated in response to an action.
* NetActionEvent instances can only be created by the implementation.
*/
public class NetActionEvent extends java.util.EventObject
{
/**
* Action status for a completed action
* @see #getActionStatus()
*/
public static final int ACTION_COMPLETED = 0;
/**
* <code>ACTION_CANCELED</code> is returned by {@link #getActionStatus()}
* when the action has been canceled.
* @see #getActionStatus()
*/
public static final int ACTION_CANCELED = ACTION_COMPLETED + 1;
/**
* <code>ACTION_FAILED</code> is returned by {@link #getActionStatus()}
* when the action has failed.
* @see #getActionStatus()
*/
public static final int ACTION_FAILED = ACTION_CANCELED + 1;
/**
* <code>ACTION_STATUS_NOT_AVAILABLE</code> is returned by
* {@link #getActionStatus()} when the transaction has completed
* successfully or failed sometime before this method was called and the
* implementation is no longer maintaining a status for it.
*/
public static final int ACTION_STATUS_NOT_AVAILABLE = ACTION_FAILED + 1;
/**
* <code>ACTION_IN_PROGRESS</code> is returned by {@link #getActionStatus()}
* when the action is currently on going.
* @see #getActionStatus()
*/
public static final int ACTION_IN_PROGRESS = ACTION_STATUS_NOT_AVAILABLE + 1;
/**
* Two argument constructor.
*
* @param request - NetActionRequest that instigated the response.
* @param response - An object representing the response to the action and
* which is specific to the action.
* @param error - error code for this event if action failed
* @param status - status of the associated net action
*
*/
protected NetActionEvent(java.lang.Object request,
java.lang.Object response,
int error,
int status)
{
super(request);
}
/**
* Returns the response of the Action. Object is dependent on the Action.
*
* @return The response to an asynchronous action.
*/
public Object getResponse()
{
return null;
}
/**
* Returns the ActionRequest which identifies the action instance.
*
* @return the ActionRequest
*/
public NetActionRequest getActionRequest()
{
return null;
}
/**
* Returns the status of the requested action.
*
* @return the status of the action; for possible return values see
* ACTION_* constants in this class.
*
*/
public int getActionStatus()
{
return 0;
}
/**
* Gets the error value when getActionStatus returns
* <code>NetActionEvent.ACTION_FAILED</code>. If the action is not in
* error this method SHALL return -1. Error code values are dependent
* on the underlying network protocol error code values.
*
* @return The error value; -1 if no error.
*/
public int getError()
{
return -1;
}
}
package org.ocap.hn;
/**
*
* This interface represents a handler passed to asynchronous methods
* @author Patrick Ladd, Vidiom
*
*/
public interface NetActionHandler
{
/**
* Notifies the application of an action event. This method is called
* by the implementation when a response to an action or a failure for
* the action is detected.
*/
public void notify(NetActionEvent event);
}
package org.ocap.hn;
/**
* All asynchronous actions in the Home networking API return an NetActionRequest.
* The NetActionRequest can be used a) to cancel any pending action or b) to identify
* which Action got completed.
*
* @see NetActionHandler
* @see NetActionEvent
*/
public interface NetActionRequest {
/**
* Cancels the Action associated with this ActionRequest. Returns false if
* the action can't be canceled.
*
* @return false if action can't be canceled, otherwise returns true.
*/
public boolean cancel();
/**
* Gets the progress of the action in percent (0.0 - 1.0).
* If the progress of an action can't be determined, -1.0 shall be returned.
*
* @return the progress of the action (0.0 - 1.0) or -1.0 if the progress can't
* be determined.
*
*/
public float getProgress();
/**
* Gets the current status of the requested action.
*
* @return the current action status; see ACTION_* constants in
* <code>NetActionEvent</code> for possible return values.
*
*/
public int getActionStatus();
/**
* Gets the error value when getActionStatus returns
* <code>NetActionEvent.ACTION_FAILED</code>. The error code returned will
* be equivalent to the error code returned by
* {@link NetActionEvent#getError()} for the NetActionEvent associated
* with the completion of this action request. If the action is not in error
* or has not completed, this method SHALL return -1.
*
* @return The error value; -1 if no error,
*/
public int getError();
}
package org.ocap.hn;
/**
* NetList
*
* @author Luyang Li (lly@research.panasonic.com)
* @version 1.0
*
*/
/**
* A list comprising of homenetwork elements such as Device or NetModule.
* The application may retrieve such a list from <code>NetManager</code>,
* <code>getNetModules</code> * or <code> getDevices</code>. The application
* may refine the list by applying a {@link PropertyFilter}.
*/
public interface NetList {
/**
* Indicates whether an element is included in this NetList.
* @param element
* the element to check whether it is in the list
* @return true if the element is in the list; otherwise false.
*/
public boolean contains(Object element);
/**
* Returns the element indexed by a number.
* @param index
* specified index of the element
* @return element indexed by the number
*/
public Object getElement(int index);
/**
* Returns all elements in this NetList in <code>Enumeration</code>.
* In Homenetwork, NetList can be used to retrieve a list of Devices
* or a list of NetModules. In either case, a corresponding type of object
* is returned.
* @return An enumeration of Device or NetModule elements
*/
public java.util.Enumeration getElements();
/**
* Applies a new <code>PropertyFilter</code> to this element list and
* returns a new list.
* @param filter new filter
* @return new element list generated by new filter
* @see PropertyFilter
*/
public NetList filterElement(PropertyFilter filter);
/**
* Returns the index of an element in this element list.
* @param element to be checked
* @return index of an element in this list. If there is no such element in
* this list, returns -1.
*/
public int indexOf(Object element);
/**
* Returns the size of this list.
* @return size of the element list
*/
public int size();
}
\ No newline at end of file
package org.ocap.hn;
/**
* The NetManager is a singleton class that registers all the
* Devices and NetModules within a home network. It maintains an implementation
* dependent database of devices and NetModules. <p>
* The NetManager may be used to retrieve list of <code>NetModule</code> and <code>
* Device</code> in the network. The application can filter the list by specifying
* a name or by applying filtering rules. For example,
* "modelNumber = h6315, location = LivingRoom". Application can monitor
* availability of NetModules by registering as a listener to NetManager
* instance.
*/
public abstract class NetManager {
/**
* Returns the singleton NetManager. This is the entry point
* for home network. If the calling application is unsigned,
* this method SHALL return null.
*
* @return Singleton instance of NetManager or null
* if the calling application is unsigned.
*/
public synchronized static NetManager getInstance() {
return null;
}
/**
* Returns NetModules that match all properties set by a given filter.
* Passing a null filter will return a NetList with all known NetModules.
* @param filter
* Filter to select out NetModules from all
* available NetModules
* @return List of NetModules satisfying filter
*/
public abstract NetList getNetModuleList(PropertyFilter filter);
/**
* Returns NetModule by device and module ID.