com.hqme.cm
Interface IContentObject

All Known Implementing Classes:
IContentObject.Stub

public interface IContentObject

IContentObject defines the HQME VSD plugin's content object interface. IContentObject provides an abstract interface for an application to query and access ContentObject within VSD(Virtual Storage Device).


Nested Class Summary
static class IContentObject.Stub
          Local-side IPC implementation stub class.
 
Method Summary
 int close()
          Close the ContentObject for further reading or writing.
 java.lang.String getProperty(java.lang.String key)
          Retrieve specific metadata information, key/value pair, associated with a content object.
 java.lang.String[] getPropertyKeys()
          Retrieve the current content object property keys.
 java.lang.String getStreamingUri()
          Retrieve the ContentObject streaming URI by the Streaming Server
 int open(java.lang.String mode, boolean lock)
          Opens the ContentObject for further IO operations.
 Property[] properties()
          Retrieve all properties associated with the content object.
 int read(byte[] buf, int count)
          Retrieve data from the ContentObject.
 int remove()
          Remove the ContentObject and associated metadata/data.
 int removeProperty(java.lang.String key)
          Remove a metadata key associated with a Content Object
 long seek(long offset, int seekFrom)
          Set the current position for the ContentObject IO operation
 int setProperty(java.lang.String key, java.lang.String value)
          Set a metadata key associated with a Content Object
 long size()
          Retrieve the size of the ContentObject in bytes
 long tell()
          Retrieve the current offset used for reads and writes, related to the beginning of the ContentObject.
 int write(byte[] buf, int count)
          Update the ContentObject data.
 

Method Detail

properties

Property[] properties()
                      throws android.os.RemoteException
Retrieve all properties associated with the content object.

Returns:
All properties which are not write only.
Throws:
android.os.RemoteException

getPropertyKeys

java.lang.String[] getPropertyKeys()
                                   throws android.os.RemoteException
Retrieve the current content object property keys.

Returns:
Property keys. Note: [non-normative] Helper method for enumerating the current keys.
Throws:
android.os.RemoteException

getProperty

java.lang.String getProperty(java.lang.String key)
                             throws android.os.RemoteException
Retrieve specific metadata information, key/value pair, associated with a content object.

Parameters:
key - Property key.
     The mandatory properties must be supported by all VSDs: 
          "S_STORE_NAME"    Describes the name used to store the cached object on the 
                            physical media.
          "S_STORE_SIZE"    Describes the size of the cached object in bytes.
          "S_SOURCEURI"     Describes the source Universal Resource Identifier (URI) 
                            where this content was obtained from.
          "S_ORIGIN"        The origin (server or app) that the stream originates from.
          "S_LOCKED"        Identified if the stream or content is locked. A locked  
                            stream may only be read or written to by its calling origin, 
                            regardless of delegated permissions.
          "S_TYPE"          Describes the MIME type of the cached object.
          "S_REDOWNLOAD_URI"     Describes the MIME type of the cached object.

     ContentObjects also support the following optional properties :
                "S_POLICY"                       
                "S_METADATA"                       
                        "S_CONTENTPROFILE"                      
                        "S_VALIDITYCHECK"           
                "S_RIGHTSCHECK"                         
 
Returns:
Property value. Return NULL if not found.
Throws:
android.os.RemoteException

setProperty

int setProperty(java.lang.String key,
                java.lang.String value)
                throws android.os.RemoteException
Set a metadata key associated with a Content Object

Parameters:
key - Property key.
value - Property value.
Returns:
Error code. Possible error codes are "STATUS_SUCCESS", "ERR_PERMISSION_DENIED", "ERR_NOT_FOUND", "ERR_GENERAL".
Throws:
android.os.RemoteException

removeProperty

int removeProperty(java.lang.String key)
                   throws android.os.RemoteException
Remove a metadata key associated with a Content Object

Parameters:
key - Property key.
Returns:
Error code. Possible error codes are "STATUS_SUCCESS", "ERR_PERMISSION_DENIED", "ERR_NOT_FOUND", "ERR_GENERAL".
Throws:
android.os.RemoteException

size

long size()
          throws android.os.RemoteException
Retrieve the size of the ContentObject in bytes

Returns:
Size. Negative on error. Possible error codes are "ERR_PERMISSION_DENIED", "ERR_NOT_FOUND", "ERR_GENERAL".
Throws:
android.os.RemoteException

tell

long tell()
          throws android.os.RemoteException
Retrieve the current offset used for reads and writes, related to the beginning of the ContentObject.

Returns:
The current offset. Negative on error. Possible error codes are "ERR_PERMISSION_DENIED", "ERR_NOT_FOUND".
Throws:
android.os.RemoteException

seek

long seek(long offset,
          int seekFrom)
          throws android.os.RemoteException
Set the current position for the ContentObject IO operation

Parameters:
offset - The offset to seek to.
seekFrom - Can be one of these values: SEEK_SET(0): Beginning of object SEEK_CUR(1): Current position of object SEEK_END(2): End of object
Returns:
The new position relative to the beginning of the ContentObject. Negative on error. Possible error codes are "ERR_PERMISSION_DENIED", "ERR_NOT_FOUND", "ERR_UNSUPPORTED_METHOD", "ERR_IO". Note only writing to the object after setting offset beyond the object size can change the object size, and "ERR_IO" will return if new position is less than zero or IO error occurred.
Throws:
android.os.RemoteException

open

int open(java.lang.String mode,
         boolean lock)
         throws android.os.RemoteException
Opens the ContentObject for further IO operations.

Parameters:
mode - Indicates the desired I/O access operation: "r" - read only "rw" - read and write The behavior is undefined for invalid operation flags.
lock - If the lock argument is set to true, then another application is prohibited from opening the stream associated with a ContentObject. The lock is removed when the ContentObject is closed.
Returns:
Error code. Possible error codes are "STATUS_SUCCESS", "ERR_PERMISSION_DENIED", "ERR_NOT_FOUND", "ERR_GENERAL".
Throws:
android.os.RemoteException

close

int close()
          throws android.os.RemoteException
Close the ContentObject for further reading or writing.

Returns:
Error code. Negative on error. Possible error codes are "ERR_PERMISSION_DENIED", "ERR_NOT_FOUND", "ERR_GENERAL".
Throws:
android.os.RemoteException

read

int read(byte[] buf,
         int count)
         throws android.os.RemoteException
Retrieve data from the ContentObject. This method uses the current offset and advances the offset at the completion of the read.

Parameters:
buf - Read buffer
count - Number of bytes to read.
Returns:
Number of bytes read. Negative on error. The possible errors are "ERR_PERMISSION_DENIED", "ERR_NOT_FOUND", "ERR_UNSUPPORTED_METHOD", "ERR_IO".
Throws:
android.os.RemoteException

write

int write(byte[] buf,
          int count)
          throws android.os.RemoteException
Update the ContentObject data. This method uses the current offset and advances the offset at the completion of the write.

Parameters:
buf - Write buffer
count - Number of bytes to write.
Returns:
Number of bytes written. Negative on error. The possible errors are "ERR_PERMISSION_DENIED", "ERR_NOT_FOUND", "ERR_UNSUPPORTED_METHOD", "ERR_IO".
Throws:
android.os.RemoteException

remove

int remove()
           throws android.os.RemoteException
Remove the ContentObject and associated metadata/data.

Returns:
True if content deleted. False on error.
Throws:
android.os.RemoteException

getStreamingUri

java.lang.String getStreamingUri()
                                 throws android.os.RemoteException
Retrieve the ContentObject streaming URI by the Streaming Server

Returns:
local host URI for streaming playback. If an error occurred, NULL will be returned.
Throws:
android.os.RemoteException