org.ocap.dvr
Class BufferingRequest

java.lang.Object
  extended by org.ocap.dvr.BufferingRequest

public abstract class BufferingRequest
extends java.lang.Object

This class represents an application request for buffering. An application can call the createInstance method to create a request.


Constructor Summary
protected BufferingRequest()
          Protected constructor, not to be used by applications.
 
Method Summary
static BufferingRequest createInstance(javax.tv.service.Service service, long minDuration, long maxDuration, ExtendedFileAccessPermissions efap)
          Creates a BufferingRequest object.
abstract  AppID getAppID()
          Gets the AppID of the application that created the request.
abstract  ExtendedFileAccessPermissions getExtendedFileAccessPermissions()
          Gets the ExtendedFileAccessPermissions for this request.
abstract  long getMaxDuration()
          Gets the maximum duration to buffer for this request.
abstract  long getMinimumDuration()
          Gets the minimum content buffering duration for this request.
abstract  javax.tv.service.Service getService()
          Gets the Service this request is attempting to buffer.
abstract  void setExtendedFileAccessPermissions(ExtendedFileAccessPermissions efap)
          Sets the ExtendedFileAccessPermissions for this request.
abstract  void setMaxDuration(long duration)
          Sets the maximum duration of content that MAY be buffered for this BufferingRequest.
abstract  void setMinimumDuration(long minDuration)
          Sets the minimum duration of content that SHALL be buffered for this request.
abstract  void setService(javax.tv.service.Service service)
          Sets the Service this request is attempting to buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferingRequest

protected BufferingRequest()
Protected constructor, not to be used by applications.

Method Detail

createInstance

public static BufferingRequest createInstance(javax.tv.service.Service service,
                                              long minDuration,
                                              long maxDuration,
                                              ExtendedFileAccessPermissions efap)
Creates a BufferingRequest object.

Parameters:
service - The service to buffer.
minDuration - Minimum duration in seconds to buffer.
maxDuration - Maximum duration in seconds to buffer.
efap - Extended file access permissions for this request. If this parameter is null, no write permissions are given to this request. Read permissions for BufferingRequest instances are always world regardless of read permissions set by this parameter.
Throws:
java.lang.IllegalArgumentException - if the service parameter is not a valid Service, or if minDuration is less than OcapRecordingManager.getSmallestTimeShiftDuration(), or if maxDuration is less than minDuration.

getService

public abstract javax.tv.service.Service getService()
Gets the Service this request is attempting to buffer.

Returns:
Service being buffered for this request.

setService

public abstract void setService(javax.tv.service.Service service)
Sets the Service this request is attempting to buffer.

Parameters:
service - The Service to buffer for this request.
Throws:
java.lang.IllegalArgumentException - if the parameter is not a valid Service.
java.lang.SecurityException - if the calling applications does not have one of the write ExtendedFileAccessPermissions set by the createInstance or setExtendedFileAccessPermissions methods.

getMinimumDuration

public abstract long getMinimumDuration()
Gets the minimum content buffering duration for this request.

Returns:
The minimum content buffering duration in seconds.

setMinimumDuration

public abstract void setMinimumDuration(long minDuration)
Sets the minimum duration of content that SHALL be buffered for this request. If this method necessitates a buffer re-size the implementation MAY flush the contents of the buffer.

Parameters:
minDuration - Minimum duration in seconds.
Throws:
java.lang.IllegalArgumentException - If the parameter is greater than the current value and Host device does not have enough space to meet the request, or if the parameter is greater than the maximum duration set by the createInstance or setMaximumDuration methods, or if the parameter is less than the duration returned by OcapRecordingManager.getSmallestTimeShiftDuration().
java.lang.SecurityException - if the calling application does not have one of the write ExtendedFileAccessPermissions set by the createInstance or setExtendedFileAccessPermissions methods.

getMaxDuration

public abstract long getMaxDuration()
Gets the maximum duration to buffer for this request. Returns the value set by the createInstance or setMaximumDuration methods.

Returns:
Maximum duration in seconds.

setMaxDuration

public abstract void setMaxDuration(long duration)
Sets the maximum duration of content that MAY be buffered for this BufferingRequest. Informs the implementation that storing more content than this is not needed by the application owning this BufferingRequest.

Parameters:
duration - The maximum duration in seconds.
Throws:
java.lang.IllegalArgumentException - if the duration parameter is negative or if the parameter is less than the minimum duration set by the createInstance or setMaximumDuration methods, or if the parameter is less than the duration returned by OcapRecordingManager.getSmallestTimeShiftDuration().
java.lang.SecurityException - if the calling application does not have one of the write ExtendedFileAccessPermissions set by the createInstance or setExtendedFileAccessPermissions methods.

getExtendedFileAccessPermissions

public abstract ExtendedFileAccessPermissions getExtendedFileAccessPermissions()
Gets the ExtendedFileAccessPermissions for this request.

Returns:
The ExtendedFileAccessPermissions.

setExtendedFileAccessPermissions

public abstract void setExtendedFileAccessPermissions(ExtendedFileAccessPermissions efap)
Sets the ExtendedFileAccessPermissions for this request.

Parameters:
efap - The ExtendedFileAccessPermissions for this request.
Throws:
java.lang.IllegalArgumentException - if the parameter is null;
java.lang.SecurityException - if the calling application is not the creator of this request.

getAppID

public abstract AppID getAppID()
Gets the AppID of the application that created the request. If null is returned the implementation created the request.

Returns:
AppID of the owning application.