org.ocap.hn
Interface ContentServerNetModule

All Superinterfaces:
NetModule

public interface ContentServerNetModule
extends NetModule

Class representing a NetModule which serves content.

NetModules which implement this interface SHALL have a NetModule.PROP_NETMODULE_TYPE property value of NetModule.CONTENT_SERVER.


Field Summary
 
Fields inherited from interface org.ocap.hn.NetModule
CONTENT_LIST, CONTENT_MANAGER, CONTENT_RECORDER, CONTENT_RENDERER, CONTENT_SERVER, PROP_CONTROL_URL, PROP_DESCRIPTION_URL, PROP_EventSub_URL, PROP_NETMODULE_ID, PROP_NETMODULE_TYPE
 
Method Summary
 void addContentServerListener(ContentServerListener listener)
          Adds a ContentServerListener to this ContentContainer.
 void removeContentServerListener(ContentServerListener listener)
          Removes the specified ContentServerListener.
 NetActionRequest requestBrowseEntries(String startingEntryID, String propertyFilter, boolean browseChildren, int startingIndex, int requestedCount, String sortCriteria, NetActionHandler handler)
          Requests a browse of this ContentServer which results in the creation of a ContentList.
 NetActionRequest requestRootContainer(NetActionHandler handler)
          returns the root ContentContainer for this ContentServerNetModule.
 NetActionRequest requestSearchCapabilities(NetActionHandler handler)
          Returns the list of property keys which applications can search against on this ContentServer using the requestSearchEntries(java.lang.String, java.lang.String, int, int, java.lang.String, java.lang.String, org.ocap.hn.NetActionHandler) method.
 NetActionRequest requestSearchEntries(String parentID, String propertyFilter, int startingIndex, int requestedCount, String searchCriteria, String sortCriteria, NetActionHandler handler)
          Requests a search of this ContentServer which results in the creation of a ContentList.
 
Methods inherited from interface org.ocap.hn.NetModule
addNetModuleEventListener, getDevice, getKeys, getNetModuleId, getNetModuleType, getProperty, isLocal, removeNetModuleEventListener
 

Method Detail

requestRootContainer

NetActionRequest requestRootContainer(NetActionHandler handler)
returns the root ContentContainer for this ContentServerNetModule. This is an asynchronous method. The caller gets informed via NetActionHandler.notify(NetActionEvent) of the process. On success, an NetActionEvent is created where the NetActionEvent.getResponse() method will return a ContentContainer object representing the root container for this ContentServerNetModule.

Parameters:
handler - NetActionHandler which gets informed once this asynchronous request completes
Returns:
NetActionRequest See NetActionRequest
Throws:
SecurityException - if the caller does not have HomeNetPermission("contentlisting")

requestSearchCapabilities

NetActionRequest requestSearchCapabilities(NetActionHandler handler)
Returns the list of property keys which applications can search against on this ContentServer using the requestSearchEntries(java.lang.String, java.lang.String, int, int, java.lang.String, java.lang.String, org.ocap.hn.NetActionHandler) method. This is an asynchronous method. The caller gets informed via NetActionHandler.notify(NetActionEvent) of the process. On success an NetActionEvent is created where the NetActionEvent.getResponse() method will return an array of String objects containing the valid property keys. A return of an array with zero length indicates that this server supports no searching functionality. A return containing "*" indicates that any key associated with any content entry on this server may be used.

Parameters:
handler - NetActionHandler which gets informed once this asynchronous request completes
Returns:
NetActionRequest See NetActionRequest

requestBrowseEntries

NetActionRequest requestBrowseEntries(String startingEntryID,
                                      String propertyFilter,
                                      boolean browseChildren,
                                      int startingIndex,
                                      int requestedCount,
                                      String sortCriteria,
                                      NetActionHandler handler)
Requests a browse of this ContentServer which results in the creation of a ContentList.

ContentEntry objects hosted on the remote server will be browsed starting at the ContentEntry specified. The propertFilter parameter of this method SHALL contain a comma separated list of properties indicating which metadata fields should be returned in the ContentEntry objects contained in the resulting ContentList. A filter value of "*" indicates all available metadata be returned. The sortCriteria parameter of this method is a string containing the properties and sort modifiers to be used to sort the resulting ContentList. The format of the string containing the sort criteria shall follow the format defined in UPnP Content Directory Service 3.0 specification section 2.3.16: A_ARG_TYPE_SortCriteria.

This is an asynchronous method. The caller gets informed via NetActionHandler.notify(NetActionEvent) of the process. On success an NetActionEvent is created where the NetActionEvent.getResponse() method will return a ContentList containing the search results. If no matches are found, this value SHALL be a ContentList with zero entries. A return from NetActionEvent.getActionStatus() of NetActionEvent.ACTION_COMPLETED SHALL indicate that a valid ContentList will be returned from NetActionEvent.getResponse().

Parameters:
startingEntryID - the ID of the ContentEntry on the server to start the browse from. A value of "0" SHALL indicate the root container on this server.
propertyFilter - the set of property values to return from this browse operation
browseChildren - if set to true, this operation will browse all of the direct children of the startingEntryID parameter. If false, this operation will return a content list containing the entry identified by startingEntryID only.
startingIndex - starting zero-based offset to enumerate children under the container specified by parent.
requestedCount - requested number of entries under the ContentContainer specified by parent. Setting this parameter to 0 indicates request all entries.
sortCriteria - properties and sort modifiers to be used to sort the resulting ContentList
handler - NetActionHandler which gets informed once the results ContentList is created or an error occurs. calling getResponse() on handler will return a ContentList containing the requested entries, or if the call was unsuccessful will return an error message supplied by the server.
Returns:
NetActionRequest See NetActionRequest.
Throws:
IllegalArgumentException - if the startingEntryID is not available on this ContentServerNetModule, or if the handler parameter is null.
SecurityException - if the caller does not have HomeNetPermission("contentlisting")

requestSearchEntries

NetActionRequest requestSearchEntries(String parentID,
                                      String propertyFilter,
                                      int startingIndex,
                                      int requestedCount,
                                      String searchCriteria,
                                      String sortCriteria,
                                      NetActionHandler handler)
Requests a search of this ContentServer which results in the creation of a ContentList.

ContentEntry objects hosted on the remote server will be searched for using the specified search criteria. The format of the string containing the search criteria SHALL follow the format defined by the UPnP Content Directory Service 3.0 specification section 2.3.13.1: Search Criteria String Syntax. The propertFilter parameter of this method SHALL contain a comma separated list of properties indicating which metadata fields should be returned in the ContentEntry objects contained in the resulting ContentList. A filter value of "*" indicates all available metadata be returned. The sortCriteria parameter of this method is a string containing the properties and sort modifiers to be used to sort the resulting ContentList. The format of the string containing the sort criteria shall follow the format defined in UPnP Content Directory Service 3.0 specification section 2.3.16: A_ARG_TYPE_SortCriteria.

This is an asynchronous method. The caller gets informed via NetActionHandler.notify(NetActionEvent) of the process. On success an NetActionEvent is created where the NetActionEvent.getResponse() method will return a ContentList containing the search results. If no matches are found, this value SHALL be a ContentList with zero entries. A return from NetActionEvent.getActionStatus() of NetActionEvent.ACTION_COMPLETED SHALL indicate that a valid ContentList will be returned from NetActionEvent.getResponse().

Parameters:
parentID - the ID of the ContentContainer on the server to start the search from. A value of "0" SHALL indicate the root container on this server.
propertyFilter - the set of property values to return from this browse operation
startingIndex - starting zero-based offset to enumerate children under the container specified by parent.
requestedCount - requested number of entries under the ContentContainer specified by parent. Setting this parameter to 0 indicates request all entries.
searchCriteria - contains the criteria string to search for. If this parameter is null, the implementation SHALL consider all entries in the parent container as matching the search criteria.
sortCriteria - properties and sort modifiers to be used to sort the resulting ContentList
handler - NetActionHandler which gets informed once the results ContentList is created or an error occurs. calling getResponse() on handler will return a ContentList containing the requested entries, or if the call was unsuccessful will return an error message supplied by the server.
Returns:
NetActionRequest See NetActionRequest.
Throws:
IllegalArgumentException - if the startingEntryID is not available on this ContentServerNetModule, or if the handler parameter is null.
SecurityException - if the caller does not have HomeNetPermission("contentlisting")

addContentServerListener

void addContentServerListener(ContentServerListener listener)
Adds a ContentServerListener to this ContentContainer. This ContentServerListener will be notified of additions, removals, or changes to any objects contained within this server

Parameters:
listener - the Listener that will receive ContentServerEvents.

removeContentServerListener

void removeContentServerListener(ContentServerListener listener)
Removes the specified ContentServerListener.

Parameters:
listener - the Listener to remove


Copyright © 2011. All Rights Reserved.