org.ocap.dvr.storage
Interface MediaStorageOption

All Superinterfaces:
StorageOption

public interface MediaStorageOption
extends StorageOption

This interface represents an option object provided by a StorageProxy that supports media volumes (MediaStorageVolume) that are used by the DVR recording and playback APIs for storing media content.

The interface distinguishes between content accessible through the DVR APIs and as general purpose files. Implementations may store these different type of content in one or more filesystems. This is transparent to an application. Only the general purpose files are visible through the normal file and directory classes in java.io.

The interface can be used to query the amount of storage the storage proxy has for storing all types of application-visible content. (Some of the capacity may be reserved for internal system use.)

The interface also supports the initialization of the storage proxy with a specified allocation between the two types. However, on some implementations, changing the allocations may require filesystems to be destroyed and recreated which may result in the deletion of all application-visible content associated with the storage proxy, including any storage volumes. On other implementations, a change in allocations may require some or all content of the type being reduced to be destroyed. Initialization should be done with extreme caution.


Method Summary
 MediaStorageVolume allocateMediaVolume(java.lang.String name, ExtendedFileAccessPermissions fap)
          Allocates a MediaStorageVolume.
 long getAllocatableMediaStorage()
          Gets total allocatable media storage available for all MediaStorageVolume instances.
 MediaStorageVolume getDefaultRecordingVolume()
          Gets the default volume that the implementation setup as the default recording volume for the containing StorageProxy.
 long getPlaybackBandwidth()
          Gets the playback bandwidth in bits-per-second when only one playback stream and no record streams are open on the entire storage device.
 long getRecordBandwidth()
          Gets the record bandwidth in bits-per-second when only one record stream and no playback streams are open on the entire storage device.
 long getTotalGeneralStorageCapacity()
          Gets the total capacity of the GPFS available for application use in the storage device.
 long getTotalMediaStorageCapacity()
          Gets the total capacity of the MEDIAFS available for application use in the storage device.
 void initialize(long mediafsSize)
          Initializes the storage device so that the there are at least mediafsSize bytes available for MEDIAFS use.
 boolean simultaneousPlayAndRecord()
          Indicates if the storage device supports simultaneous play and record.
 

Method Detail

allocateMediaVolume

MediaStorageVolume allocateMediaVolume(java.lang.String name,
                                       ExtendedFileAccessPermissions fap)
Allocates a MediaStorageVolume. A media volume can contain multi-media content that may impose I/O bandwidth criteria upon the storage device. The new volume will be owned by the application that allocated it.

Parameters:
name - Name of the new MediaStorageVolume.
fap - Access permissions of the new MediaStorageVolume.
Returns:
Allocated volume storage.
Throws:
java.lang.IllegalArgumentException - if the name does not meet Java 1.1.8 directory naming conventions, or if the type is not supported by the storage device.
java.lang.SecurityException - if the calling application is unsigned.

getDefaultRecordingVolume

MediaStorageVolume getDefaultRecordingVolume()
Gets the default volume that the implementation setup as the default recording volume for the containing StorageProxy.

Returns:
Default recording volume for the storage device.

getPlaybackBandwidth

long getPlaybackBandwidth()
Gets the playback bandwidth in bits-per-second when only one playback stream and no record streams are open on the entire storage device.

Returns:
Playback bandwidth in bits-per-second.

getRecordBandwidth

long getRecordBandwidth()
Gets the record bandwidth in bits-per-second when only one record stream and no playback streams are open on the entire storage device.

Returns:
Record bandwidth in bits-per-second.

getTotalMediaStorageCapacity

long getTotalMediaStorageCapacity()
Gets the total capacity of the MEDIAFS available for application use in the storage device.

Returns:
Total audio/video capacity of the storage device.

getAllocatableMediaStorage

long getAllocatableMediaStorage()
Gets total allocatable media storage available for all MediaStorageVolume instances.

Returns:
Size of allocatable media storage in bytes.

getTotalGeneralStorageCapacity

long getTotalGeneralStorageCapacity()
Gets the total capacity of the GPFS available for application use in the storage device.

Returns:
Total general purpose capacity of the storage device.

initialize

void initialize(long mediafsSize)
Initializes the storage device so that the there are at least mediafsSize bytes available for MEDIAFS use. The effects of initialization may include the deletion of all application visible content associated with the storage proxy. Calling this method may remove application access to storage on the device for the duration of the call. It may cause the abnormal termination of applications with open files associated with the storage proxy. This method will block until the storage proxy is again ready for use.

Parameters:
mediafsSize - New size of the total MEDIAFS capacity in bytes.
Throws:
java.lang.IllegalArgumentException - if the mediafsSize passed is greater than the sum of what is returned by getTotalGeneralStorageCapacity() and getTotalMediaStorageCapacity().
java.lang.IllegalStateException - if the sizes cannot be changed by the implementation for any reason.

simultaneousPlayAndRecord

boolean simultaneousPlayAndRecord()
Indicates if the storage device supports simultaneous play and record.

Returns:
True if simultaneous play and record is supported, otherwise returns false.