org.ocap.hn.content
Interface ContentItem

All Superinterfaces:
ContentEntry
All Known Subinterfaces:
RecordingContentItem

public interface ContentItem
extends ContentEntry

This class represents a piece of content. This can be audio, video or still image content. It is not directly linked to any file. This is done via the ContentResources. A ContentItem can have multiple ContentResources.


Field Summary
static String AUDIO_ITEM
          Represents the base audio content.
static String AUDIO_ITEM_BOOK
          In addition to being an AUDIO_ITEM content MAY be an audio book.
static String AUDIO_ITEM_BROADCAST
          In addition to being an AUDIO_ITEM content MAY be broadcast on a radio station.
static String AUDIO_ITEM_TRACK
          In addition to being an AUDIO_ITEM content MAY be a track such as a song.
static String IMAGE_ITEM
          Base image item.
static String IMAGE_ITEM_PHOTO
          In addition to being an IMAGE_ITEM content MAY be a photo.
static String ITEM
          Represents the base content item.
static String VIDEO_ITEM
          Represents the base video item.
static String VIDEO_ITEM_BROADCAST
          In addition to being a VIDEO_ITEM content MAY be a video broadcast.
static String VIDEO_ITEM_MOVIE
          In addition to being a VIDEO_ITEM content MAY be a movie.
static String VIDEO_ITEM_MUSIC_CLIP
          In addition to being a VIDEO_ITEM content MAY be a music video clip, e.g.
 
Method Summary
 boolean containsResource(ContentResource entry)
          Checks whether the given ContentResource is part of this ContentItem..
 boolean deleteEntry()
          Deletes this ContentItem.
 String getContentClass()
          Returns the content class of this content item.
 javax.tv.service.Service getItemService()
          If this ContentItem is presentable as a JavaTV Service than this method returns a javax.tv.service.Service, or derivative of a Service, e.g.
 ContentResource[] getRenderableResources()
          Gets an array copy of renderable ContentResources which are part of this ContentItem.
 ContentResource getResource(int n)
          Returns the nth ContentResource of this ContentItem.
 int getResourceCount()
          Returns the number of ContentResources which are associated with this ContentItem.
 int getResourceIndex(ContentResource r)
          Returns the index of the specified ContentResource or -1 if the ContentResource does not exist in this ContentItem.
 ContentResource[] getResources()
          Gets an array copy of ContentResources which are part of this ContentItem.
 String getTitle()
          Gets the title for this ContentItem, or null if the title is unknown.
 boolean hasAudio()
          Returns a boolean indicating if this content has audio.
 boolean hasStillImage()
          Returns a boolean indicating if the ContentItem has a still image.
 boolean hasVideo()
          Returns a boolean indicating if the ContentItem has video associated with it.
 boolean isRenderable()
          Checks whether the local device has the capabilities to render this content item.
 
Methods inherited from interface org.ocap.hn.content.ContentEntry
getContentSize, getCreationDate, getEntryParent, getExtendedFileAccessPermissions, getID, getParentID, getRootMetadataNode, getServer, isLocal
 

Field Detail

ITEM

static final String ITEM
Represents the base content item.

See Also:
Constant Field Values

AUDIO_ITEM

static final String AUDIO_ITEM
Represents the base audio content.

See Also:
Constant Field Values

AUDIO_ITEM_TRACK

static final String AUDIO_ITEM_TRACK
In addition to being an AUDIO_ITEM content MAY be a track such as a song.

See Also:
Constant Field Values

AUDIO_ITEM_BROADCAST

static final String AUDIO_ITEM_BROADCAST
In addition to being an AUDIO_ITEM content MAY be broadcast on a radio station.

See Also:
Constant Field Values

AUDIO_ITEM_BOOK

static final String AUDIO_ITEM_BOOK
In addition to being an AUDIO_ITEM content MAY be an audio book.

See Also:
Constant Field Values

VIDEO_ITEM

static final String VIDEO_ITEM
Represents the base video item.

See Also:
Constant Field Values

VIDEO_ITEM_MOVIE

static final String VIDEO_ITEM_MOVIE
In addition to being a VIDEO_ITEM content MAY be a movie.

See Also:
Constant Field Values

VIDEO_ITEM_BROADCAST

static final String VIDEO_ITEM_BROADCAST
In addition to being a VIDEO_ITEM content MAY be a video broadcast.

See Also:
Constant Field Values

VIDEO_ITEM_MUSIC_CLIP

static final String VIDEO_ITEM_MUSIC_CLIP
In addition to being a VIDEO_ITEM content MAY be a music video clip, e.g. music video.

See Also:
Constant Field Values

IMAGE_ITEM

static final String IMAGE_ITEM
Base image item.

See Also:
Constant Field Values

IMAGE_ITEM_PHOTO

static final String IMAGE_ITEM_PHOTO
In addition to being an IMAGE_ITEM content MAY be a photo.

See Also:
Constant Field Values
Method Detail

hasAudio

boolean hasAudio()
Returns a boolean indicating if this content has audio.

Returns:
True if the content type has audio, otherwise returns false.

hasVideo

boolean hasVideo()
Returns a boolean indicating if the ContentItem has video associated with it.

Returns:
True if the ContentItem contains video, otherwise returns false.

hasStillImage

boolean hasStillImage()
Returns a boolean indicating if the ContentItem has a still image.

Returns:
True if the ContentItem has a still image, otherwise returns false.

getItemService

javax.tv.service.Service getItemService()
If this ContentItem is presentable as a JavaTV Service than this method returns a javax.tv.service.Service, or derivative of a Service, e.g. RecordedService, which can be used to play this ContentItem. If the ContentItem is not local the returned Service SHALL be a RemoteService. If the content associated with item has been deleted or is no longer accessable, this method SHALL return null.

Returns:
A JavaTV service if this content is presentable as a Service, null otherwise.

getContentClass

String getContentClass()
Returns the content class of this content item.

Returns:
The content class of this item.
See Also:
AUDIO_ITEM, AUDIO_ITEM_BOOK, AUDIO_ITEM_BROADCAST, AUDIO_ITEM_TRACK, IMAGE_ITEM, VIDEO_ITEM, VIDEO_ITEM_BROADCAST, VIDEO_ITEM_MOVIE, VIDEO_ITEM_MUSIC_CLIP, IMAGE_ITEM_PHOTO

getTitle

String getTitle()
Gets the title for this ContentItem, or null if the title is unknown.

Returns:
the String title for this item, or null if unknown.

deleteEntry

boolean deleteEntry()
                    throws IOException
Deletes this ContentItem. Calls the ContentResource.delete() method on each ContentResource contained in this ContentItem. Deletes a local ContentItem only. If the #isLocal method returns false an exception is thrown.

Note: this overrides the definition of ContentEntry.deleteEntry(). If an application calls the ContentEntry.deleteEntry method on an object that is an instance of ContentItem, the implementation SHALL delete the ContentItem as defined by this method.

Specified by:
deleteEntry in interface ContentEntry
Returns:
True if the ContentItem was deleted, otherwise returns false.
Throws:
SecurityException - if the application does not have write ExtendedFileAccessPermission.
IOException - if the ContentItem is not local.

getResourceCount

int getResourceCount()
Returns the number of ContentResources which are associated with this ContentItem.

Returns:
number of ContentResources.

getResource

ContentResource getResource(int n)
Returns the nth ContentResource of this ContentItem.

Parameters:
n - the index of the ContentResource
Returns:
the nthThrows:
ArrayIndexOutOfBoundsException - if the nth value does not exist.

getResourceIndex

int getResourceIndex(ContentResource r)
Returns the index of the specified ContentResource or -1 if the ContentResource does not exist in this ContentItem.

Parameters:
r - The ContentResource to check for.
Returns:
The index of the ContentResource or -1 if it doesn't exist in this ContentItem.

containsResource

boolean containsResource(ContentResource entry)
Checks whether the given ContentResource is part of this ContentItem..

Parameters:
entry - The ContentResource to check for.
Returns:
True if the ContentResource is part of this ContentItem, otherwise returns false.

getResources

ContentResource[] getResources()
Gets an array copy of ContentResources which are part of this ContentItem.

Returns:
Array of ContentResources.

getRenderableResources

ContentResource[] getRenderableResources()
Gets an array copy of renderable ContentResources which are part of this ContentItem.

Returns:
Array of ContentResources contained in this ContentItem for for which ContentResource.isRenderable() returns true.

isRenderable

boolean isRenderable()
Checks whether the local device has the capabilities to render this content item. This includes the ability to negotiate media protocol with the host device, the ability of the local device to render this content item's media format, and sufficient access permissions for the calling application. This method will return true if any of the ContentResources contained in this ContentItem are renderable. This call does not consider immediate availability of resources required for presentation of this content.

Returns:
true if this content is renderable on the local device, false otherwise.


Copyright © 2011. All Rights Reserved.