org.oipf.download
Interface ApplicationDownloadRequest

All Superinterfaces:
org.ocap.shared.dvr.LeafRecordingRequest, org.ocap.shared.dvr.RecordingRequest

public interface ApplicationDownloadRequest
extends org.ocap.shared.dvr.LeafRecordingRequest

Represents a content download to be performed by an application. Requests of this type are handled totally by an application. They are created in the PENDING_NO_CONFLICT_STATE. The application handling the request is responsible for downloading the content and all resulting state changes.

Requests of this type shall always be visible to the application specified when the corresponding ApplicationDownloadSpec was created regardless of recording request specific security attributes. The methods defined in this class shall always fail with a ApplicationDownloadException if called by any application other than the one specified when the corresponding ApplicationDownloadSpec was created.


Field Summary
 
Fields inherited from interface org.ocap.shared.dvr.LeafRecordingRequest
COMPLETED_STATE, DELETED_STATE, FAILED_STATE, IN_PROGRESS_INCOMPLETE_STATE, IN_PROGRESS_INSUFFICIENT_SPACE_STATE, IN_PROGRESS_STATE, IN_PROGRESS_WITH_ERROR_STATE, INCOMPLETE_STATE, PENDING_NO_CONFLICT_STATE, PENDING_WITH_CONFLICT_STATE
 
Method Summary
 java.io.RandomAccessFile getFile()
          Return a file to which downloaded data can be written and from which downloaded data can be read.
 void setFailedReason(int reason)
          Set the reason to use for the exception returned by getFailedException.
 void setState(int state)
          Set the state of the download.
 
Methods inherited from interface org.ocap.shared.dvr.LeafRecordingRequest
cancel, getDeletionDetails, getFailedException, getService, stop
 
Methods inherited from interface org.ocap.shared.dvr.RecordingRequest
addAppData, delete, getAppData, getAppID, getId, getKeys, getParent, getRecordingSpec, getRoot, getState, isRoot, removeAppData, reschedule, setRecordingProperties
 

Method Detail

getFile

java.io.RandomAccessFile getFile()
                                 throws ApplicationDownloadException
Return a file to which downloaded data can be written and from which downloaded data can be read.

Returns:
a File
Throws:
ApplicationDownloadException - if the caller is not permitted to call this method as defined above

setState

void setState(int state)
Set the state of the download.

Parameters:
state - the new state of the recording
Throws:
ApplicationDownloadException - if the caller is not permitted to call this method as defined above

setFailedReason

void setFailedReason(int reason)
Set the reason to use for the exception returned by getFailedException. The reason must be one valid for the constructor of RecordingFailedException.

Parameters:
reason - the reason to use when constructing a RecordingFailedException