org.odata4j.producer
Interface OMediaLinkExtension

All Superinterfaces:
OExtension<ODataProducer>

public interface OMediaLinkExtension
extends OExtension<ODataProducer>

An optional extension that a producer can expose to work with Media Link Entries.


Method Summary
 OEntity createMediaLinkEntry(EdmEntitySet entitySet, HttpHeaders httpHeaders)
          Creates an OEntity for a new media link entry request just received.
 void deleteStream(OEntity mle, QueryInfo query)
          Deletes the media resource defined by the given media link entry entity.
 InputStream getInputStreamForMediaLinkEntry(OEntity mle, String etag, EntityQueryInfo query)
          Gets an InputStream that streams the bytes of the media resource associated with the given media link entry entity.
 String getMediaLinkContentDisposition(OEntity mle)
          Gets the mime content disposition for the given media link entry entity.
 String getMediaLinkContentType(OEntity mle)
          Gets the mime content type for the given media link entry entity.
 OEntity getMediaLinkEntryForUpdateOrDelete(EdmEntitySet entitySet, OEntityKey key, HttpHeaders httpHeaders)
          Gets an OEntity for an existing media link entry with the given key.
 OutputStream getOutputStreamForMediaLinkEntryCreate(OEntity mle, String etag, QueryInfo query)
          Gets an OutputStream for the purpose of creating a media resource.
 OutputStream getOutputStreamForMediaLinkEntryUpdate(OEntity mle, String etag, QueryInfo query)
          Gets an OutputStream for the purpose of updating an existing media resource.
 OEntity updateMediaLinkEntry(OEntity mle, OutputStream outStream)
          Updates an OEntity for an existing media link entry.
 

Method Detail

createMediaLinkEntry

OEntity createMediaLinkEntry(EdmEntitySet entitySet,
                             HttpHeaders httpHeaders)
Creates an OEntity for a new media link entry request just received.

Parameters:
entitySet - entity-set
httpHeaders - Atom protocol says the Slug header can contain additional create info.
Returns:
the new entity

deleteStream

void deleteStream(OEntity mle,
                  QueryInfo query)
Deletes the media resource defined by the given media link entry entity.

Parameters:
mle - an existing media link entry
query - additional request information

getInputStreamForMediaLinkEntry

InputStream getInputStreamForMediaLinkEntry(OEntity mle,
                                            String etag,
                                            EntityQueryInfo query)
Gets an InputStream that streams the bytes of the media resource associated with the given media link entry entity.

Parameters:
mle - the media link entry entity
etag - for future extension
query - additional request information
Returns:
InputStream for the media resource

getMediaLinkContentDisposition

String getMediaLinkContentDisposition(OEntity mle)
Gets the mime content disposition for the given media link entry entity.

Parameters:
mle - an existing media link entry
Returns:
the mime content disposition

getMediaLinkContentType

String getMediaLinkContentType(OEntity mle)
Gets the mime content type for the given media link entry entity.

Parameters:
mle - an existing media link entry
Returns:
the mime content type

getMediaLinkEntryForUpdateOrDelete

OEntity getMediaLinkEntryForUpdateOrDelete(EdmEntitySet entitySet,
                                           OEntityKey key,
                                           HttpHeaders httpHeaders)
Gets an OEntity for an existing media link entry with the given key.

Parameters:
entitySet - entity-set
key - entity key
httpHeaders - Atom protocol says the Slug header can contain additional create info.
Returns:
the entity

getOutputStreamForMediaLinkEntryCreate

OutputStream getOutputStreamForMediaLinkEntryCreate(OEntity mle,
                                                    String etag,
                                                    QueryInfo query)
Gets an OutputStream for the purpose of creating a media resource.

Parameters:
mle - the media link entry entity
etag - for future extension
query - additional request information
Returns:
stream to write the resource

getOutputStreamForMediaLinkEntryUpdate

OutputStream getOutputStreamForMediaLinkEntryUpdate(OEntity mle,
                                                    String etag,
                                                    QueryInfo query)
Gets an OutputStream for the purpose of updating an existing media resource.

Parameters:
mle - the media link entry entity
etag - for future extension
query - additional request information
Returns:
stream to update the resource

updateMediaLinkEntry

OEntity updateMediaLinkEntry(OEntity mle,
                             OutputStream outStream)
Updates an OEntity for an existing media link entry. After a create or update of a media resource, more information may be available about the media link entity that was created before the media resource bits were processed. updateMediaLinkEntry will be called after the media resource bits have been written to outStream and outStream has been closed. Note: this is only necessary because OEntity is immutable

Parameters:
mle - an existing media link entry
outStream - media stream
Returns:
an updated Media Link Entity


http://odata4j.org