Oracle9i Business Components for Java InterMedia API Reference
Oracle9i JDeveloper (9.0.4)
B10394-01

oracle.ord.im
Class OrdVideoDomain

java.lang.Object
  |
  +--oracle.ord.im.OrdVideoBase
        |
        +--oracle.ord.im.OrdVideo
              |
              +--oracle.ord.im.OrdVideoDomain
All Implemented Interfaces:
oracle.jbo.AttributeList, oracle.jbo.domain.BlobDomainInterface, oracle.sql.CustomDatum, oracle.sql.CustomDatumFactory, oracle.jbo.domain.DomainInterface, oracle.jbo.domain.DomainOwnerInterface, java.util.EventListener, oracle.jbo.domain.LobInterface, oracle.jbo.domain.MarshalledDomain, oracle.jbo.domain.MutableDomainInterface, oracle.jdbc.internal.ObjectData, oracle.jdbc.internal.ObjectDataFactory, OrdDomainIOInterface, OrdDomainState, OrdDomainSupportInterface, java.io.Serializable, oracle.jbo.TransactionStateListener, oracle.jbo.domain.XMLDomainInterface, oracle.jbo.domain.XMLDomainReaderFactory, oracle.jbo.domain.XMLDomainWriter, oracle.jbo.domain.XMLValueFactory

public class OrdVideoDomain
extends OrdVideo
implements OrdDomainIOInterface, OrdDomainState, OrdDomainSupportInterface, oracle.jbo.AttributeList, oracle.jbo.domain.LobInterface, oracle.jbo.domain.DomainOwnerInterface, oracle.jbo.domain.XMLDomainReaderFactory, oracle.jbo.domain.XMLDomainWriter, java.io.Serializable, oracle.jbo.TransactionStateListener, oracle.jbo.domain.MarshalledDomain

Represents interMedia ORDSYS.ORDVideo database type as a domain class in the Business Components for Java (BC4J) framework. Most methods in this class are BC4J tier independent. They can work on either the client tier or the middle tier, which allows the application which uses these methods to work in a tier independent fashion. There are some exceptions which are marked as local mode only:

The BC4J tier-independent counterparts of the first three methods are the following:

There are no corresponding BC4J tier-independent methods for setComments, getAllAttributes and getContentInLob.

The term client tier refers to the machine on which the application client is running. Middle tier refers to the server on which the BC4J business components are deployed. The user can use "local mode only" methods when he deploys BC4J and the client application to the same machine. Whereas, the user should use tier independent methods when the application client and BC4J reside on separate machines.

The constructor for this class will create an instance of an OrdVideoDomain. The user should either manually obtain a valid BLOB locator and a JDBC connection for this instance, or rely on the BC4J framework to obtain a BLOB locator and a JDBC connection for it. See OrdContentSource for discussion about how to load media content to the database by using the interMedia BC4J domain classes.

Since:
JDev3.2
See Also:
OrdVideo, Serialized Form

Field Summary

 

Fields inherited from class oracle.ord.im.OrdVideoBase
_SQL_NAME, _SQL_TYPECODE

 

Constructor Summary
OrdVideoDomain()
          Constructs a new OrdVideoDomain instance.
OrdVideoDomain(byte[] bytes)
          Constructs a new OrdVideoDomain instance.
OrdVideoDomain(OrdHttpUploadFile ohuf)
          Constructs a new OrdVideoDomain instance.
OrdVideoDomain(java.lang.String fileName)
          Constructs a new OrdVideoDomain instance.

 

Method Summary
 boolean checkProperties(byte[][] ctx)
          Checks if the properties of the video data are consistent with the attributes of the OrdVideo Java object.
 void clearContentSource()
          Internal: Applications should not use this method.
 void clearLocal()
          Clears the attribute called local to indicate that the content data is stored externally.
 int closeSource(byte[][] ctx)
          Closes a data source.
 oracle.sql.CustomDatum create(oracle.sql.Datum d, int sqlType)
          Internal: Applications should not use this method.
 java.lang.Object createDomainFromSerializedXML(org.w3c.dom.Element element)
          Create a domain instance by reading the xml-data out of the given xml-node.
 void deleteContent()
          Deletes any data stored in the database BLOB specified by the localData attribute.
 void domainToBeModified(oracle.jbo.domain.DomainInterface d)
          Internal: Applications should not use this method.
 void doneCommit(oracle.jbo.TransactionStateEvent event)
          Internal: Applications should not use this method.
 void doneRollback(oracle.jbo.TransactionStateEvent event)
          Internal: Applications should not use this method.
 boolean equals(java.lang.Object obj)
          Compares two OrdVideoDomain objects by their last update time and content length.
 void export(byte[][] ctx, java.lang.String sourceType, java.lang.String sourceLocation, java.lang.String sourceName)
          Exports the data from the BLOB specified by the localData attribute.
 oracle.sql.CLOB getAllAttributes(byte[][] ctx)
          Returns the video properties in a temporary CLOB in a form defined by the format plug-in.
 java.lang.String getAttribute(byte[][] ctx, java.lang.String name)
          Returns the value of the requested video property.
 java.lang.Object getAttribute(int index)
          Internal: Applications should not use this method.
 java.lang.Object getAttribute(java.lang.String name)
          Internal: Applications should not use this method.
 int getAttributeCount()
          Internal: Applications should not use this method.
 int getAttributeIndexOf(java.lang.String name)
          Internal: Applications should not use this method.
 java.lang.String[] getAttributeNames()
           
 java.lang.Object[] getAttributeValues()
           
 oracle.sql.BFILE getBFILE()
          Returns a BFILE locator from the database when the srcType attribute is "FILE".
 oracle.jbo.domain.BFileDomain getBFileDomain()
          Returns a BFileDomain object which wraps the BFILE locator obtained from the getBFILE method.
 int getBitRate()
          Returns the bitRate attribute.
 oracle.sql.CLOB getComments()
          Returns the CLOB locator from the comments attribute.
 oracle.jbo.domain.ClobDomain getCommentsAsClobDomain()
          Returns a ClobDomain object which wraps the CLOB locator obtained from the getComments() method.
 java.lang.String getCompressionType()
          Returns the compressionType attribute.
 oracle.sql.BLOB getContent()
          Returns the BLOB locator from the localData attribute.
 oracle.jbo.domain.BlobDomain getContentAsBlobDomain()
          Returns a BlobDomain object which wraps the BLOB locator from the localData attribute.
 oracle.sql.BLOB getContentInLob(byte[][] ctx, java.lang.String[] mimetype, java.lang.String[] format)
          Returns the data from the BLOB specified by the localData attribute in a temporary BLOB in the database.
 int getContentLength()
          Returns the length of the video data.
 int getContentLength(byte[][] ctx)
          Returns the length of the video data using source plug-in context information.
 OrdContentSource getContentSource()
          Gets the content source which was previously set by the setContentSource method.
 java.lang.Object getCTPassivationHandle()
          Internal: Applications should not use this method.
static oracle.sql.CustomDatumFactory getCustomDatumFactory()
          Internal: Applications should not use this method.
 java.lang.Object getData()
          Internal: Applications should not use this method.
 byte[] getDataInByteArray()
          Returns a byte array containing the data from the database BLOB specified by the localData attribute.
 boolean getDataInFile(java.lang.String filename)
          Writes the data from the database BLOB specified by the localData attribute to a local file.
 java.io.InputStream getDataInStream()
          Returns an InputStream from which the data in the database BLOB specified by the localData attribute can be read.
 java.lang.String getDescription()
          Returns the description attribute.
static oracle.sql.CustomDatumFactory getFactory()
          Returns the OrdVideoDomain CustomDatumFactory for use by the getCustomDatum method.
 java.lang.String getFormat()
          Returns the format attribute.
 int getFrameRate()
          Returns the frameRate attribute.
 int getFrameResolution()
          Returns the frameResolution attribute.
 int getHeight()
          Returns the height attribute.
 java.lang.String getMimeType()
          Returns the mimeType attribute.
 int getNumberOfColors()
          Returns the numberOfColors attribute.
 int getNumberOfFrames()
          Returns the numberOfFrames attribute.
 oracle.jbo.domain.DomainOwnerInterface getOwner()
          Internal: Applications should not use this method.
 int getOwnerAttributeIndex()
          Internal: Applications should not use this method.
 java.lang.String getRemoteIdString()
          Internal: Applications should not use this method.
 org.w3c.dom.Node getSerializedDomainXML(org.w3c.dom.Document xmlDoc)
          Creates the XML node in the given XML document for this domain's data.
 long getSize()
          Internal: Applications should not use this method.
 java.lang.String getSource()
          Returns the source information in the form srcType://srcLocation/srcName.
 java.lang.String getSourceLocation()
          Returns the srcLocation attribute.
 java.lang.String getSourceName()
          Returns the srcName attribute.
 java.lang.String getSourceType()
          Returns the srcType attribute.
 int getTierInfo()
          Gets the tier number information that this object lives in.
 java.sql.Timestamp getUpdateTime()
          Returns the updateTime attribute.
 int getVideoDuration()
          Returns the videoDuration attribute.
 int getWidth()
          Returns the width attribute.
 org.w3c.dom.Node getXMLContentNode(org.w3c.dom.Document xmlDoc)
          Internal: Applications should not use this method.
static oracle.jbo.domain.XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)
          Internal: Applications should not use this method.
 int hashCode()
          Returns the hash code as a int
 void importData(byte[][] ctx)
          Imports data from an external source into the database BLOB specified by the localData attribute.
 void importFrom(byte[][] ctx, java.lang.String sourceType, java.lang.String sourceLocation, java.lang.String sourceName)
          Imports data from an external source into the database BLOB specified by the localData attribute.
 boolean isConnected()
          Determines whether the domain object has an internal JDBC connection to the database.
 boolean isLocal()
          Determines whether the content data is stored locally in the database in a BLOB specified by the localData attribute.
 boolean loadDataFromByteArray(byte[] byteArr)
          Loads data from a byte array into the database BLOB specified by the localData attribute.
 boolean loadDataFromFile(java.lang.String filename)
          Loads data from a file into the database BLOB specified by the localData attribute.
 boolean loadDataFromInputStream(java.io.InputStream inpStream)
          Loads data from an InputStream into the database BLOB specified by the localData attribute.
 void loadFromDatabase(oracle.jbo.Transaction xAct)
          Internal: Applications should not use this method.
 oracle.svcmsg.ResponseValues marshal()
           
 int openSource(byte[] userarg, byte[][] ctx)
          Opens a data source.
 void prepareCTPassivation()
          Internal: Applications should not use this method.
 void prepareForDML(java.lang.Object context)
          Internal: Applications should not use this method.
 java.lang.String printXMLDefinition(java.util.Hashtable allDefs, java.io.PrintWriter pw, boolean bContainees)
          Internal: Applications should not use this method.
 byte[] processSourceCommand(byte[][] ctx, java.lang.String cmd, java.lang.String args, byte[][] result)
          Calls the source plug-in in the database to execute a command.
 byte[] processVideoCommand(byte[][] ctx, java.lang.String cmd, java.lang.String args, byte[][] result)
          Calls the format plug-in in the database to execute a command.
 int readFromSource(byte[][] ctx, int startpos, int numbytes, byte[][] buffer)
          Reads data from the data source.
 void removeListenerFromTransaction()
          Internal: Applications should not use this method.
 void saveToDatabase(oracle.jbo.Transaction xAct)
          Internal: Applications should not use this method.
 void saveToDatabase(oracle.jbo.Transaction xAct, java.lang.Object emptySQLObject)
          Internal: Applications should not use this method.
 void setAttribute(int index, java.lang.Object value)
          Internal: Applications should not use this method.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Internal: Applications should not use this method.
 void setBitRate(int bitRate)
          Sets the bitRate attribute.
 void setComments(oracle.sql.CLOB comments)
          Sets the comments attribute.
 void setCompressionType(java.lang.String compressionType)
          Sets the compressionType attribute.
 void setContentLength(int contentLength)
          Does nothing for OrdVideoDomain objects.
 void setContentSource(OrdContentSource source)
          Sets the content source for deferred loading.
 void setContentSourceOnly(OrdContentSource source)
          Internal: Applications should not use this method.
 void setContext(oracle.jbo.domain.DomainOwnerInterface owner, oracle.jbo.Transaction trans, java.lang.Object ctx)
          Internal: Applications should not use this method.
 void setCTPassivationHandle(java.lang.Object handle)
          Internal: Applications should not use this method.
 void setDescription(java.lang.String description)
          Sets the description attribute.
 void setFormat(java.lang.String format)
          Sets the format attribute.
 void setFrameRate(int frameRate)
          Sets the frameRate attribute.
 void setFrameResolution(int frameResolution)
          Sets the frameResolution attribute.
 void setHeight(int height)
          Sets the height attribute.
 void setKnownAttributes(java.lang.String knownformat, int knownwidth, int knownheight, int knownframeresolution, int knownframerate, int knownvideoduration, int knownnumberofframes, java.lang.String knowncompressiontype, int knownnumberofcolors, int knownbitrate)
          Sets the known attributes of the OrdVideo Java object.
 void setLocal()
          Sets the attribute called local to indicate that the content data is stored locally in the database in a BLOB > specified by the localData attribute.
 void setMimeType(java.lang.String MimeType)
          Sets the mimeType attribute.
 void setNumberOfColors(int numberOfColors)
          Sets the numberOfColors attribute.
 void setNumberOfFrames(int numberOfFrames)
          Sets the numberOfFrames attribute.
 void setProperties()
          Parses the video data properties and sets the attributes in the OrdVideoDomain Java object.
 void setProperties(byte[][] ctx)
          Parses the video data properties and sets the attributes in the OrdVideo Java object.
 void setProperties(byte[][] ctx, boolean setComments)
          Parses the video data properties, sets the attributes in the OrdVideo Java object, and optionally populates the CLOB specified by the comments attribute.
 void setSource(java.lang.String sourceType, java.lang.String sourceLocation, java.lang.String sourceName)
          Sets the srcType, srcLocation, and srcName attributes.
 void setUpdateTime(java.sql.Timestamp currentTime)
          Sets the updateTime attribute.
 void setVideoDuration(int videoDuration)
          Sets the videoDuration attribute.
 void setWidth(int width)
          Sets the width attribute.
 void syncClientLob(oracle.jbo.domain.LobInterface newArrival)
          Internal: Applications should not use this method.
 void syncServerLob(oracle.jbo.domain.LobInterface oldObj)
          Internal: Applications should not use this method.
 java.lang.String toString()
          Returns a String object describing this object.
 int trimSource(byte[][] ctx, int newLen)
          Trims the data to the specified length.
 int writeToSource(byte[][] ctx, int startpos, int numbytes, byte[] buffer)
          Writes data to the data source.

 

Methods inherited from class oracle.ord.im.OrdVideoBase
toDatum

 

Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait

 

Constructor Detail

OrdVideoDomain

public OrdVideoDomain()
Constructs a new OrdVideoDomain instance. Before it's been inserted into the database table and selected back, this new instance doesn't have a JDBC connection to the database. It also doesn't have a corresponding existing database ORDSYS.ORDVideo object.

OrdVideoDomain

public OrdVideoDomain(byte[] bytes)
Constructs a new OrdVideoDomain instance. Before it has been inserted into the database table and selected back; this new instance doesn't have a JDBC connection to the database. It also doesn't have a corresponding existing database ORDSYS.ORDVideo object. Users should use deferred loading to load the video content into the database.

Calling this constructor has the same effect of calling the following two statements.

     OrdVideoDomain video = new OrdVideoDomain();
     video.setContentSource(new OrdByteArraySource(bytes));
Parameters:
bytes - the byte array that contains the video content
See Also:
OrdContentSource, OrdByteArraySource

OrdVideoDomain

public OrdVideoDomain(java.lang.String fileName)
Constructs a new OrdVideoDomain instance. Before it has been inserted into the database table and selected back; this new instance doesn't have a JDBC connection to the database. It also doesn't have a corresponding existing database ORDSYS.ORDVideo object. Users should use deferred loading to load the video content into the database.

Calling this constructor has the same effect of calling the following two statements.

     OrdVideoDomain video = new OrdVideoDomain();
     video.setContentSource(new OrdFileSource(fileName));
Parameters:
fileName - the video file name
See Also:
OrdContentSource, OrdFileSource

OrdVideoDomain

public OrdVideoDomain(OrdHttpUploadFile ohuf)
Constructs a new OrdVideoDomain instance. Before it has been inserted into the database table and selected back; this new instance doesn't have a JDBC connection to the database. It also doesn't have a corresponding existing database ORDSYS.ORDVideo object. Users should use deferred loading to load the video content into the database.

Calling this constructor has the same effect of calling the following two statements.

     OrdVideoDomain video = new OrdVideoDomain();
     video.setContentSource(new OrdHttpUploadFileSource(ohuf));
Parameters:
ohuf - the video content wrapped as an OrdHttpUploadFile object
See Also:
OrdContentSource, OrdHttpUploadFileSource
Method Detail

getFactory

public static oracle.sql.CustomDatumFactory getFactory()
Returns the OrdVideoDomain CustomDatumFactory for use by the getCustomDatum method. Specify this method as the factory parameter of the getCustomDatum method when retrieving an OrdVideoDomain object from an OracleResultSet or OracleCallableStatement. For example:
  OrdVideoDomain video = (OrdVideoDomain)rset.
                           getCustomDatum( 1, OrdVideoDomain.getFactory() );
Returns:
the OrdVideoDomain implementation of the CustomDatumFactory interface

getCustomDatumFactory

public static oracle.sql.CustomDatumFactory getCustomDatumFactory()
Internal: Applications should not use this method.

toString

public java.lang.String toString()
Returns a String object describing this object. The format of the description is "OrdVideoDomain: <mimetype>:<length>".
Overrides:
toString in class java.lang.Object
Returns:
a String object describing this object

hashCode

public int hashCode()
Returns the hash code as a int
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Compares two OrdVideoDomain objects by their last update time and content length. For performance reasons, bit by bit comparison of binary content is not done.
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to be compared with this object
Returns:
true if the two OrdVideoDomain objects have the same last update time and content length; otherwise, returns false

getContent

public oracle.sql.BLOB getContent()
                           throws java.sql.SQLException
Returns the BLOB locator from the localData attribute.
Note
local mode only
Overrides:
getContent in class OrdVideo
Returns:
an oracle.sql.BLOB
Throws:
java.sql.SQLException - if an error occurs when accessing the localData attribute

getBFILE

public oracle.sql.BFILE getBFILE()
                          throws java.sql.SQLException
Returns a BFILE locator from the database when the srcType attribute is "FILE". This method calls the corresponding getBFILE method in the database, which creates the BFILE using the srcLocation and srcName attributes.
Note
local mode only
Overrides:
getBFILE in class OrdVideo
Returns:
an oracle.sql.BFILE
Throws:
java.sql.SQLException - if an error occurs while executing the corresponding getBFILE method in the database

isLocal

public boolean isLocal()
                throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Determines whether the content data is stored locally in the database in a BLOB specified by the localData attribute.
Specified by:
isLocal in interface OrdDomainIOInterface
Overrides:
isLocal in class OrdVideo
Returns:
true if the data is stored locally in the database in a BLOB; otherwise, returns false
Throws:
java.sql.SQLException - if an error occurs when accessing the attribute called local.

clearLocal

public void clearLocal()
                throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Clears the attribute called local to indicate that the content data is stored externally.
Specified by:
clearLocal in interface OrdDomainIOInterface
Overrides:
clearLocal in class OrdVideo
Throws:
java.sql.SQLException - if an error occurs when accessing the attribute called local.

setLocal

public void setLocal()
              throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Sets the attribute called local to indicate that the content data is stored locally in the database in a BLOB > specified by the localData attribute.
Specified by:
setLocal in interface OrdDomainIOInterface
Overrides:
setLocal in class OrdVideo
Throws:
java.sql.SQLException - if an error occurs when accessing the attribute called local.

deleteContent

public void deleteContent()
                   throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Deletes any data stored in the database BLOB specified by the localData attribute.
Specified by:
deleteContent in interface OrdDomainIOInterface
Overrides:
deleteContent in class OrdVideo
Throws:
java.sql.SQLException - if an error occurs when executing the corresponding deleteContent method in the database.

importData

public void importData(byte[][] ctx)
                throws java.sql.SQLException
Description copied from class: OrdVideo
Imports data from an external source into the database BLOB specified by the localData attribute. The external data source is specified by the srcType, srcLocation, and srcName attributes.
Overrides:
importData in class OrdVideo
Parameters:
ctx - the source plug-in context information.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding import method in the database.

importFrom

public void importFrom(byte[][] ctx,
                       java.lang.String sourceType,
                       java.lang.String sourceLocation,
                       java.lang.String sourceName)
                throws java.sql.SQLException
Description copied from class: OrdVideo
Imports data from an external source into the database BLOB specified by the localData attribute. The external data source is specified by the srcType, srcLocation, and srcName parameters. The srcType, srcLocation, and srcName attributes are updated with values of the srcType, srcLocation, and srcName parameters passed to the importFrom method.
Overrides:
importFrom in class OrdVideo
Parameters:
ctx - the source plug-in context information.
sourceType - the source type, for example, "FILE", "HTTP".
sourceLocation - the source location, for example, VIDEOS_DIR, www.xyzcovideos.com/movies.
sourceName - the source name, for example, movie1.mov.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding importFrom method in the database.

loadDataFromFile

public boolean loadDataFromFile(java.lang.String filename)
                         throws java.sql.SQLException,
                                java.io.IOException
Description copied from interface: OrdDomainIOInterface
Loads data from a file into the database BLOB specified by the localData attribute. Before loading the data, this method calls the following methods:
Specified by:
loadDataFromFile in interface OrdDomainIOInterface
Overrides:
loadDataFromFile in class OrdVideo
Parameters:
filename - name of the file from which to load data
Returns:
true if the data is loaded successfully; otherwise, an exception is raised if an error occurs. This method never returns false.
Throws:
java.sql.SQLException - if an error occurs when accessing an object attribute or when executing a method in the database.
java.io.IOException - if an error occurs when reading the data file.

loadDataFromInputStream

public boolean loadDataFromInputStream(java.io.InputStream inpStream)
                                throws java.sql.SQLException,
                                       java.io.IOException
Description copied from interface: OrdDomainIOInterface
Loads data from an InputStream into the database BLOB specified by the localData attribute. Before loading the data, this method calls the following methods:
Specified by:
loadDataFromInputStream in interface OrdDomainIOInterface
Overrides:
loadDataFromInputStream in class OrdVideo
Parameters:
inpStream - the InputStream from which to load data
Returns:
true if the data is loaded successfully; otherwise, an exception is raised if an error occurs. This method never returns false.
Throws:
java.sql.SQLException - if an error occurs when accessing an object attribute or when executing a method in the database.
java.io.IOException - if an error occurs when reading the InputStream.

loadDataFromByteArray

public boolean loadDataFromByteArray(byte[] byteArr)
                              throws java.sql.SQLException,
                                     java.io.IOException
Description copied from interface: OrdDomainIOInterface
Loads data from a byte array into the database BLOB specified by the localData attribute. Before loading the data, this method calls the following methods:
Specified by:
loadDataFromByteArray in interface OrdDomainIOInterface
Overrides:
loadDataFromByteArray in class OrdVideo
Returns:
true if the data is loaded successfully; otherwise, an exception is raised if an error occurs. This method never returns false.
Throws:
java.io.IOException - if an error occurs reading the byte array.
java.sql.SQLException - if an error occurs when accessing an object attribute or when executing a method in the database.

getContentLength

public int getContentLength()
                     throws java.sql.SQLException
Returns the length of the video data. This method calls the corresponding getContentLength method in the database.
Note
This method is not supported for all source types. For example, the "HTTP" source type does not support this method.
Specified by:
getContentLength in interface OrdDomainIOInterface
Overrides:
getContentLength in class OrdVideo
Returns:
the content length as an int
Throws:
java.sql.SQLException - if an error occurs executing the corresponding getContentLength method in the database
See Also:
OrdImage.getContentLength(), OrdDoc.getContentLength(), OrdAudio.getContentLength(), OrdVideo.getContentLength()

getContentLength

public int getContentLength(byte[][] ctx)
                     throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the length of the video data using source plug-in context information. This method calls the corresponding getContentLength method in the database.
Note
This method is not supported for all source types. For example, the "HTTP" source type does not support this method.
Overrides:
getContentLength in class OrdVideo
Parameters:
ctx - the source plug-in context information.
Returns:
the content length as an int.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding getContentLength method in the database.

setMimeType

public void setMimeType(java.lang.String MimeType)
                 throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Sets the mimeType attribute.
Specified by:
setMimeType in interface OrdDomainIOInterface
Overrides:
setMimeType in class OrdVideo
Throws:
java.sql.SQLException - if an error occurs when accessing the mimeType attribute.

getMimeType

public java.lang.String getMimeType()
                             throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Returns the mimeType attribute.
Specified by:
getMimeType in interface OrdDomainIOInterface
Overrides:
getMimeType in class OrdVideo
Returns:
the mimeType attribute as a String.
Throws:
java.sql.SQLException - if an error occurs when accessing the mimeType attribute.

getWidth

public int getWidth()
             throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the width attribute.
Overrides:
getWidth in class OrdVideo
Returns:
the width attribute as an int.
Throws:
java.sql.SQLException - if an error occurs accessing the width attribute.

setWidth

public void setWidth(int width)
              throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the width attribute.
Note
setProperties sets this attribute automatically for certain video formats; use this method only if you are not using setProperties. This method sets the attribute value only; it does not modify the video data itself.
Overrides:
setWidth in class OrdVideo
Parameters:
width - the new attribute value.
Throws:
java.sql.SQLException - if an error occurs accessing the width attribute.

getHeight

public int getHeight()
              throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the height attribute.
Overrides:
getHeight in class OrdVideo
Returns:
the height attribute as an int.
Throws:
java.sql.SQLException - if an error occurs accessing the height attribute.

setHeight

public void setHeight(int height)
               throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the height attribute.
Note
setProperties sets this attribute automatically for certain video formats; use this method only if you are not using setProperties. This method sets the attribute value only; it does not modify the video data itself.
Overrides:
setHeight in class OrdVideo
Parameters:
height - the new attribute value.
Throws:
java.sql.SQLException - if an error occurs accessing the height attribute.

getFrameResolution

public int getFrameResolution()
                       throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the frameResolution attribute.
Overrides:
getFrameResolution in class OrdVideo
Returns:
the frameResolution attribute as an int.
Throws:
java.sql.SQLException - if an error occurs accessing the frameResolution attribute.

setFrameResolution

public void setFrameResolution(int frameResolution)
                        throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the frameResolution attribute.
Note
setProperties sets this attribute automatically for certain video formats; use this method only if you are not using setProperties. This method sets the attribute value only; it does not modify the video data itself.
Overrides:
setFrameResolution in class OrdVideo
Parameters:
frameResolution - the new attribute value.
Throws:
java.sql.SQLException - if an error occurs accessing the frameResolution attribute.

getFrameRate

public int getFrameRate()
                 throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the frameRate attribute.
Overrides:
getFrameRate in class OrdVideo
Returns:
the frameRate attribute as an int.
Throws:
java.sql.SQLException - if an error occurs accessing the frameRate attribute.

setFrameRate

public void setFrameRate(int frameRate)
                  throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the frameRate attribute.
Note
setProperties sets this attribute automatically for certain video formats; use this method only if you are not using setProperties. This method sets the attribute value only; it does not modify the video data itself.
Overrides:
setFrameRate in class OrdVideo
Parameters:
frameRate - the new attribute value.
Throws:
java.sql.SQLException - if an error occurs accessing the frameRate attribute.

getNumberOfFrames

public int getNumberOfFrames()
                      throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the numberOfFrames attribute.
Overrides:
getNumberOfFrames in class OrdVideo
Returns:
the numberOfFrames attribute as an int.
Throws:
java.sql.SQLException - if an error occurs accessing the numberOfFrames attribute.

setNumberOfFrames

public void setNumberOfFrames(int numberOfFrames)
                       throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the numberOfFrames attribute.
Note
setProperties sets this attribute automatically for certain video formats; use this method only if you are not using setProperties. This method sets the attribute value only; it does not modify the video data itself.
Overrides:
setNumberOfFrames in class OrdVideo
Parameters:
numberOfFrames - the new attribute value.
Throws:
java.sql.SQLException - if an error occurs accessing the numberOfFrames attribute.

getNumberOfColors

public int getNumberOfColors()
                      throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the numberOfColors attribute.
Overrides:
getNumberOfColors in class OrdVideo
Returns:
the numberOfColors attribute as an int.
Throws:
java.sql.SQLException - if an error occurs accessing the numberOfColors attribute.

setNumberOfColors

public void setNumberOfColors(int numberOfColors)
                       throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the numberOfColors attribute.
Note
setProperties sets this attribute automatically for certain video formats; use this method only if you are not using setProperties. This method sets the attribute value only; it does not modify the video data itself.
Overrides:
setNumberOfColors in class OrdVideo
Parameters:
numberOfColors - the new attribute value.
Throws:
java.sql.SQLException - if an error occurs accessing the numberOfColors attribute.

getBitRate

public int getBitRate()
               throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the bitRate attribute.
Overrides:
getBitRate in class OrdVideo
Returns:
the bitRate attribute as an int.
Throws:
java.sql.SQLException - if an error occurs accessing the bitRate attribute.

setBitRate

public void setBitRate(int bitRate)
                throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the bitRate attribute.
Note
setProperties sets this attribute automatically for certain video formats; use this method only if you are not using setProperties. This method sets the attribute value only; it does not modify the video data itself.
Overrides:
setBitRate in class OrdVideo
Parameters:
bitRate - the new attribute value.
Throws:
java.sql.SQLException - if an error occurs accessing the bitRate attribute.

setSource

public void setSource(java.lang.String sourceType,
                      java.lang.String sourceLocation,
                      java.lang.String sourceName)
               throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Sets the srcType, srcLocation, and srcName attributes.
Specified by:
setSource in interface OrdDomainIOInterface
Overrides:
setSource in class OrdVideo
Parameters:
sourceType - the source type, for example, "FILE", "HTTP".
sourceLocation - the source location, for example, MEDIA_DIR, www.xyzcoimages.com/public.
sourceName - the source name, for example, media_content.dat
Throws:
java.sql.SQLException - if an error occurs when accessing the srcType, srcLocation, or srcName attributes.

getSourceType

public java.lang.String getSourceType()
                               throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Returns the srcType attribute. For example, "FILE" or "HTTP".
Specified by:
getSourceType in interface OrdDomainIOInterface
Overrides:
getSourceType in class OrdVideo
Returns:
the srcType attribute as a String.
Throws:
java.sql.SQLException - if an error occurs when accessing the srcType attribute.

getSourceLocation

public java.lang.String getSourceLocation()
                                   throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Returns the srcLocation attribute. For example, IMAGES_DIR or www.xyzcoimages.com/public.
Specified by:
getSourceLocation in interface OrdDomainIOInterface
Overrides:
getSourceLocation in class OrdVideo
Returns:
the srcLocation attribute as a String.
Throws:
java.sql.SQLException - if an error occurs when accessing the srcLocation attribute.

getSourceName

public java.lang.String getSourceName()
                               throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Returns the srcName attribute. For example, scenery1.jpg.
Specified by:
getSourceName in interface OrdDomainIOInterface
Overrides:
getSourceName in class OrdVideo
Returns:
the srcName attribute as a String.
Throws:
java.sql.SQLException - if an error occurs when accessing the srcName attribute.

getSource

public java.lang.String getSource()
                           throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the source information in the form srcType://srcLocation/srcName.
Overrides:
getSource in class OrdVideo
Returns:
the source information as a String.
Throws:
java.sql.SQLException - if an error occurs executing the correspoding getSource method in the database.

getDescription

public java.lang.String getDescription()
                                throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the description attribute.
Overrides:
getDescription in class OrdVideo
Returns:
the description attribute as a String.
Throws:
java.sql.SQLException - if an error occurs accessing the description attribute.

setDescription

public void setDescription(java.lang.String description)
                    throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the description attribute.
Overrides:
setDescription in class OrdVideo
Parameters:
description - the new attribute value.
Throws:
java.sql.SQLException - if an error occurs accessing the description attribute.

getComments

public oracle.sql.CLOB getComments()
                            throws java.sql.SQLException
Returns the CLOB locator from the comments attribute.
Note
local mode only
Overrides:
getComments in class OrdVideo
Returns:
the comments attribute as an oracle.sql.CLOB
Throws:
java.sql.SQLException - if an error occurs when accessing the comments attribute

setComments

public void setComments(oracle.sql.CLOB comments)
                 throws java.sql.SQLException
Sets the comments attribute.
Note
The comments attribute is reserved for use by interMedia. You can set your own value, but it could be overwritten by interMedia Annotator or by the setProperties method.
Note
local mode only
Overrides:
setComments in class OrdVideo
Parameters:
comments - the new attribute value
Throws:
java.sql.SQLException - if an error occurs when accessing the comments attribute

getCompressionType

public java.lang.String getCompressionType()
                                    throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the compressionType attribute.
Overrides:
getCompressionType in class OrdVideo
Returns:
the compressionType attribute as a String.
Throws:
java.sql.SQLException - if an error occurs accessing the compressionType attribute.

setCompressionType

public void setCompressionType(java.lang.String compressionType)
                        throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the compressionType attribute.
Note
setProperties sets this attribute automatically for certain video formats; use this method only if you are not using setProperties. This method sets the attribute value only; it does not modify the video data itself.
Overrides:
setCompressionType in class OrdVideo
Parameters:
compressionType - the new attribute value.
Throws:
java.sql.SQLException - if an error occurs accessing the compressionType attribute.

getVideoDuration

public int getVideoDuration()
                     throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the videoDuration attribute.
Overrides:
getVideoDuration in class OrdVideo
Returns:
the videoDuration attribute as an int.
Throws:
java.sql.SQLException - if an error occurs accessing the videoDuration attribute.

setVideoDuration

public void setVideoDuration(int videoDuration)
                      throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the videoDuration attribute.
Note
setProperties sets this attribute automatically for certain video formats; use this method only if you are not using setProperties. This method sets the attribute value only; it does not modify the video data itself.
Overrides:
setVideoDuration in class OrdVideo
Parameters:
videoDuration - the new attribute value.
Throws:
java.sql.SQLException - if an error occurs accessing the videoDuration attribute.

getFormat

public java.lang.String getFormat()
                           throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the format attribute.
Overrides:
getFormat in class OrdVideo
Returns:
the format attribute as a String.
Throws:
java.sql.SQLException - if an error occurs accessing the format attribute.

setFormat

public void setFormat(java.lang.String format)
               throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the format attribute.
Note
The format attribute determines which format plug-in is used to handle calls to methods that operate on the video data. In particular, the setProperties method uses the format attribute to determine which format plug-in to call to parse the video data properties. See the setProperties method for more information on how to initialize the format attribute before calling the setProperties method, and for information on how the setProperties method in the default, Oracle-supplied plug-in, sets the format attribute. Note that calling the setFormat method sets the attribute value only; it does not modify the video data itself.
Overrides:
setFormat in class OrdVideo
Parameters:
format - the new attribute value.
Throws:
java.sql.SQLException - if an error occurs accessing the format attribute.

checkProperties

public boolean checkProperties(byte[][] ctx)
                        throws java.sql.SQLException
Description copied from class: OrdVideo
Checks if the properties of the video data are consistent with the attributes of the OrdVideo Java object.
Overrides:
checkProperties in class OrdVideo
Parameters:
ctx - the format plug-in context information.
Returns:
true if the properties of the video data are consistent with the attributes of the OrdVideo Java object; false otherwise.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding checkProperties method in the database.

setProperties

public void setProperties()
                   throws java.sql.SQLException
Parses the video data properties and sets the attributes in the OrdVideoDomain Java object. This method sets the format, mimeType, width, height, frameResolution, frameRate, videoDuration, numberOfFrames, compressionType, numberOfColors, and bitRate attributes. An attribute is set to null if the corresponding property cannot be extracted for a specific video format. This method throws a SQLException if the video format is not recognized.
Note
The format attribute determines which format plug-in is used to parse the video data properties. If the format attribute is null when setProperties is called, then the default, Oracle-supplied, format plug-in is used to parse the video data properties and fill in various attributes, including the actual video data format, for supported video formats. See Oracle interMedia User's Guide and Reference for information on the video formats supported by the Oracle-supplied format plug-ins. Note that the ORDVideo.init methods in the database always set the format attribute to null. If the format attribute is not null, then the format plug-in specified by the format attribute will be called when setProperties is called.
Note
If the user supplied format plug-in requires a context, the user should use setProperties(byte[][]) or setProperties(byte[][], boolean) instead of this method. Otherwise, this method may fail.
Specified by:
setProperties in interface OrdDomainIOInterface
Throws:
java.sql.SQLException - if an error occurs while executing the corresponding setProperties method in the database
See Also:
OrdImageDomain.setProperties(), OrdAudioDomain.setProperties(), setProperties(), OrdDocDomain.setProperties()

setProperties

public void setProperties(byte[][] ctx)
                   throws java.sql.SQLException
Description copied from class: OrdVideo
Parses the video data properties and sets the attributes in the OrdVideo Java object. This method sets the format, mimeType, width, height, frameResolution, frameRate, videoDuration, numberOfFrames, compressionType, numberOfColors, and bitRate attributes. An attribute is set to null if the corresponding property cannot be extracted for a specific video format. This method throws a SQLException if the video format is not recognized.
Note
The format attribute determines which format plug-in is used to parse the video data properties. If the format attribute is null when setProperties is called, then the default, Oracle-supplied, format plug-in is used to parse the video data properties and fill in various attributes, including the actual video data format, for supported video formats. See Oracle interMedia User's Guide and Reference for information on the video formats supported by the Oracle-supplied format plug-ins. Note that the ORDVideo.init methods in the database always set the format attribute to null. If the format attribute is not null, then the format plug-in specified by the format attribute will be called when setProperties is called.
Overrides:
setProperties in class OrdVideo
Parameters:
ctx - the format plug-in context information.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding setProperties method in the database.

setProperties

public void setProperties(byte[][] ctx,
                          boolean setComments)
                   throws java.sql.SQLException
Description copied from class: OrdVideo
Parses the video data properties, sets the attributes in the OrdVideo Java object, and optionally populates the CLOB specified by the comments attribute. This method sets the format, mimeType, width, height, frameResolution, frameRate, videoDuration, numberOfFrames, compressionType, numberOfColors, and bitRate attributes. An attribute is set to null if the corresponding property cannot be extracted for a specific video format. If setComments is true, this method also populates the CLOB specified by the comments attribute with all extracted properties in XML form. If setComments is false, the comments attribute is not modified. This method throws a SQLException if the video format is not recognized.
Note
The format attribute determines which format plug-in is used to parse the video data properties. If the format attribute is null when setProperties is called, then the default, Oracle-supplied, format plug-in is used to parse the video data properties and fill in various attributes, including the actual video data format, for supported video formats. See Oracle interMedia User's Guide and Reference for information on the video formats supported by the Oracle-supplied format plug-ins. Note that the ORDVideo.init methods in the database always set the format attribute to null. If the format attribute is not null, then the format plug-in specified by the format attribute will be called when setProperties is called.
Overrides:
setProperties in class OrdVideo
Parameters:
ctx - the format plug-in context information.
setComments - a boolean that specifies whether or not to populate the CLOB specified by the comments attribute.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding setProperties method in the database.

setContentLength

public void setContentLength(int contentLength)
                      throws java.sql.SQLException
Does nothing for OrdVideoDomain objects. This method exists only for the OrdDomainIOInterface.
Specified by:
setContentLength in interface OrdDomainIOInterface
Throws:
java.sql.SQLException - if an error occurs when accessing the contentLength attribute.
See Also:
OrdImage.setContentLength(int), OrdDoc.setContentLength(int)

trimSource

public int trimSource(byte[][] ctx,
                      int newLen)
               throws java.sql.SQLException
Description copied from class: OrdVideo
Trims the data to the specified length.

Not all source plug-ins support trim operations. For example, applications can trim the data stored in a BLOB specified by the localData attribute; however, the "FILE" and "HTTP" source types do not support writable data sources and so do not support this method. Furthermore, those source plug-ins that do support write access may not support the trim operation.

Not all source plug-ins require that the data source be opened before it can be modified. However, if you call the openSource method before calling trimSource, your application should work with any current or future source plug-ins.

Overrides:
trimSource in class OrdVideo
Parameters:
ctx - the source plug-in context information.
Returns:
the status as an int, where 0 indicates success and a non-0 value indicates a failure code specific to the source plug-in.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding trimSource method in the database.

openSource

public int openSource(byte[] userarg,
                      byte[][] ctx)
               throws java.sql.SQLException
Description copied from class: OrdVideo
Opens a data source.
Overrides:
openSource in class OrdVideo
Parameters:
userarg - additional source plug-in information that may be required by user-defined source plug-ins.
ctx - the source plug-in context information.
Returns:
the status as an int, where 0 indicates success and a non-0 value indicates a failure code specific to the source plug-in.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding openSource method in the database.

closeSource

public int closeSource(byte[][] ctx)
                throws java.sql.SQLException
Description copied from class: OrdVideo
Closes a data source.
Overrides:
closeSource in class OrdVideo
Parameters:
ctx - the source plug-in context information.
Returns:
the status as an int, where 0 indicates success and a non-0 value indicates a failure code specific to the source plug-in.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding closeSource method in the database.

processSourceCommand

public byte[] processSourceCommand(byte[][] ctx,
                                   java.lang.String cmd,
                                   java.lang.String args,
                                   byte[][] result)
                            throws java.sql.SQLException
Description copied from class: OrdVideo
Calls the source plug-in in the database to execute a command. This method is for use with user-written plug-ins only; this method raises an exception if used with the source plug-ins supplied by Oracle.
Overrides:
processSourceCommand in class OrdVideo
Parameters:
ctx - the source plug-in context information.
cmd - the command to be executed by the source plug-in.
args - the command arguments.
result - a byte[][] array of the form [1][n] into which the result of the command execution is written.
Returns:
the result of the command execution
Throws:
java.sql.SQLException - if an error occurs executing the corresponding processSourceCommand method in the database.

processVideoCommand

public byte[] processVideoCommand(byte[][] ctx,
                                  java.lang.String cmd,
                                  java.lang.String args,
                                  byte[][] result)
                           throws java.sql.SQLException
Description copied from class: OrdVideo
Calls the format plug-in in the database to execute a command. This method is for use with user-written format plug-ins only; this method raises an exception if used with the format plug-ins supplied by Oracle.
Overrides:
processVideoCommand in class OrdVideo
Parameters:
ctx - the format plug-in context information.
cmd - the command to be executed by the format plug-in.
args - the command arguments.
result - a byte[][] array of the form [1][n] into which the result of the command execution is written.
Returns:
the result of the command execution
Throws:
java.sql.SQLException - if an error occurs executing the corresponding processVideoCommand method in the database.

setUpdateTime

public void setUpdateTime(java.sql.Timestamp currentTime)
                   throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Sets the updateTime attribute. This method sets the updateTime attribute to the specified time, or to the database server's current SYSDATE time if currentTime is specified as null.
Specified by:
setUpdateTime in interface OrdDomainIOInterface
Overrides:
setUpdateTime in class OrdVideo
Parameters:
currentTime - the update time in a java.sql.Timestamp, or null to set the update time to the database server's current SYSDATE time.
Throws:
java.sql.SQLException - if an error occurs when executing the corresponding setUpdateTime method in the database.

getUpdateTime

public java.sql.Timestamp getUpdateTime()
                                 throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Returns the updateTime attribute.
Specified by:
getUpdateTime in interface OrdDomainIOInterface
Overrides:
getUpdateTime in class OrdVideo
Returns:
the lastUpdate attribute as a java.sql.Timestamp.
Throws:
java.sql.SQLException - if an error occurs when accessing the updateTime attribute.

getAttribute

public java.lang.String getAttribute(byte[][] ctx,
                                     java.lang.String name)
                              throws java.sql.SQLException
Description copied from class: OrdVideo
Returns the value of the requested video property. This method is used by user-defined format plug-ins to return the value of an video property that is not available as an attribute of the OrdVideo Java object. This method is not implemented by any Oracle-supplied format plug-ins.
Overrides:
getAttribute in class OrdVideo
Parameters:
ctx - the format plug-in context information.
name - the property or attribute name.
Returns:
the attribute value as a String.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding getAttribute method in the database.

getAllAttributes

public oracle.sql.CLOB getAllAttributes(byte[][] ctx)
                                 throws java.sql.SQLException
Returns the video properties in a temporary CLOB in a form defined by the format plug-in. For natively supported formats, the information is presented as a comma-separated list of attributes in the form attributeName=attributeValue, where the list contains the following attributes: format, mimeType, width, height, frameResolution, frameRate, videoDuration, numberOfFrames, compressionType, numberOfColors, and bitRate. For user-defined formats, the information is presented in a form defined by the format plug-in.
Important
The application must free the temporary CLOB after reading the information contained therein.

Note
local mode only
Overrides:
getAllAttributes in class OrdVideo
Parameters:
ctx - the format plug-in context information
Returns:
the attributes as a temporary oracle.sql.CLOB
Throws:
java.sql.SQLException - if an error occurs executing the corresponding getAllAttributes method in the database

getContentInLob

public oracle.sql.BLOB getContentInLob(byte[][] ctx,
                                       java.lang.String[] mimetype,
                                       java.lang.String[] format)
                                throws java.sql.SQLException
Returns the data from the BLOB specified by the localData attribute in a temporary BLOB in the database. This method creates a temporary BLOB in the database, reads the data from the BLOB specified by the localData attribute, writes the data to the temporary BLOB, then returns the temporary BLOB locator to the caller.
Important
The application must free the temporary BLOB after accessing the data contained therein.
Note
local mode only
Overrides:
getContentInLob in class OrdVideo
Parameters:
ctx - the format plug-in context information
mimetype - a String[] array, 1 element in length, into which the mimeType attribute is written as element 0
format - a String[] array, 1 element in length, into which the format attribute is written as element 0
Returns:
the video data in a temporary oracle.sql.BLOB
Throws:
java.sql.SQLException - if an error occurs while creating the temporary BLOB or executing the corresponding getContentInLob method in the database

setKnownAttributes

public void setKnownAttributes(java.lang.String knownformat,
                               int knownwidth,
                               int knownheight,
                               int knownframeresolution,
                               int knownframerate,
                               int knownvideoduration,
                               int knownnumberofframes,
                               java.lang.String knowncompressiontype,
                               int knownnumberofcolors,
                               int knownbitrate)
                        throws java.sql.SQLException
Description copied from class: OrdVideo
Sets the known attributes of the OrdVideo Java object.
Note
setProperties sets the following attributes automatically for certain video formats: format, width, height, frameResolution, frameRate, videoDuration, numberOfFrames, compressionType, numberOfColors, and bitRate; use this method only if you are not using setProperties. This method sets the specified attribute values only; it does not modify the video data itself.
Overrides:
setKnownAttributes in class OrdVideo
Parameters:
knownformat - the new attribute value as a String.
knownwidth - the new attribute value as an int.
knownheight - the new attribute value as an int.
knownframeresolution - the new attribute value as an int.
knownframerate - the new attribute value as an int.
knownvideoduration - the new attribute value as an int.
knownnumberofframes - the new attribute value as an int.
knowncompressiontype - the new attribute value as a String.
knownnumberofcolors - the new attribute value as an int.
knownbitrate - the new attribute value as an int.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding setKnownAttributes method in the database.

readFromSource

public int readFromSource(byte[][] ctx,
                          int startpos,
                          int numbytes,
                          byte[][] buffer)
                   throws java.sql.SQLException
Description copied from class: OrdVideo
Reads data from the data source. This method reads the specified number of bytes into the application buffer from the data source starting at the specified position in the data source.

Not all source plug-ins require that the data source be opened before it can be read. However, if you call the openSource method before calling readFromSource, your application should work with any current or future source plug-ins.

Overrides:
readFromSource in class OrdVideo
Parameters:
ctx - the source plug-in context information.
startpos - the start position in the data source.
numbytes - the number of bytes to read from the data source.
buffer - a byte[][] array of the form [1][n], where n >= numbytes
Returns:
number of bytes read as an int.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding readFromSource method in the database.

writeToSource

public int writeToSource(byte[][] ctx,
                         int startpos,
                         int numbytes,
                         byte[] buffer)
                  throws java.sql.SQLException
Description copied from class: OrdVideo
Writes data to the data source. This method writes the specified number of bytes from the application buffer to the data source starting at the specified position in the data source.

Not all source plug-ins support write operations. For example, applications can write to a BLOB specified by the localData attribute; however, the "FILE" and "HTTP" source types do not support writable data sources and so do not support this method. Furthermore, those source plug-ins that do support write access may support only sequential write access and may not support write access to arbitrary starting positions within the data source.

Not all source plug-ins require that the data source be opened before it can be written. However, if you call the openSource method before calling writeToSource, your application should work with any current or future source plug-ins.

Overrides:
writeToSource in class OrdVideo
Parameters:
ctx - the source plug-in context information.
startpos - the start position in the data source.
numbytes - the number of bytes to write to the data source.
buffer - a byte[] array containing the data to be written.
Returns:
number of bytes written as an int.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding writeToSource method in the database.

export

public void export(byte[][] ctx,
                   java.lang.String sourceType,
                   java.lang.String sourceLocation,
                   java.lang.String sourceName)
            throws java.sql.SQLException
Description copied from class: OrdVideo
Exports the data from the BLOB specified by the localData attribute. This method calls the corresponding export method in the database to export the video data to a location specified by the srcType, srcLocation, and srcName parameters.

Not all source plug-ins support the export method. For example, the "FILE" source type is the only Oracle-supplied source type that supports the export method. In addition, this method is supported only by Oracle database server release 8.1.7 or later.

The remainder of this description illustrates the use of the export method and the Oracle-supplied "FILE" source plug-in. User-written plug-ins will have different behaviors.

The export method implemented by the Oracle-supplied "FILE" source plug-in copies the video data from the BLOB specified by the localData attribute, but does not modify the video data stored in the database BLOB in any way.

After exporting the video data, all the video property attributes remain unchanged, however, the srcType, srcLocation, and srcName attributes are updated with values of the srcType, srcLocation, and srcName parameters passed to the export method. After calling the export method, if you no longer intend to manage the video data within the database, call the OrdVideo.clearLocal() method to indicate the video data is stored outside the database and call the OrdVideo.deleteContent() method to delete the video data stored in the database BLOB.

The export method in the database writes only to a database directory object that the user has privilege to access. That is, you can access a directory that you have created using the SQL CREATE DIRECTORY statement, or one to which you have been granted READ access. To execute the CREATE DIRECTORY statement, you must have the CREATE ANY DIRECTORY privilege. In addition, you must use the DBMS_JAVA.GRANT_PERMISSION method to specify which files can be written.

For example, the following SQL*Plus command grants the user, MEDIAUSER, the permission to write to the file named movie1.mov.

 CALL DBMS_JAVA.GRANT_PERMISSION(
     'MEDIAUSER',
     'java.io.FilePermission',
     '/videos/filmclips/movie1.mov',
     'write');

The previous example illustrates how to authorize access to write to a single file. In addition, there are various wildcard path specifications that authorize write access to multiple directories and file names. For example, a path specification that ends in "/*" (where "/" is the operating-system dependent file separator character) indicates all the files contained in the specified directory. A path specification that ends with "/-" indicates all files contained in the specified directory and all its subdirectories. A pathname consisting of the special token "<<ALL FILES>>" authorizes access to any file.

See the security and performance section in Oracle Java Developer's Guide and the java.io.FilePermission class in the Java API for more information.

Overrides:
export in class OrdVideo
Parameters:
ctx - the source plug-in context information.
sourceType - the source type, for example, "FILE".
sourceLocation - the source location, for example, VIDEOS_DIR.
sourceName - the source name, for example, movie1.mov.
Throws:
java.sql.SQLException - if an error occurs executing the corresponding export method in the database.

getDataInFile

public boolean getDataInFile(java.lang.String filename)
                      throws java.sql.SQLException,
                             java.io.IOException
Description copied from interface: OrdDomainIOInterface
Writes the data from the database BLOB specified by the localData attribute to a local file.
Specified by:
getDataInFile in interface OrdDomainIOInterface
Overrides:
getDataInFile in class OrdVideo
Parameters:
filename - name of the file to which the data is to be written.
Returns:
true if the data is written to the file successfully; otherwise, an exception is raised if an error occurs. This method never returns false.
Throws:
java.io.IOException - if an error occurs when reading the data from the BLOB or when writing the data to the output file.
java.sql.SQLException - if an error occurs when accessing an object attribute.

getDataInStream

public java.io.InputStream getDataInStream()
                                    throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Returns an InputStream from which the data in the database BLOB specified by the localData attribute can be read.
Specified by:
getDataInStream in interface OrdDomainIOInterface
Overrides:
getDataInStream in class OrdVideo
Returns:
an InputStream from which the data can be read.
Throws:
java.sql.SQLException - if an error occurs when accessing an object attribute.

getDataInByteArray

public byte[] getDataInByteArray()
                          throws java.sql.SQLException,
                                 java.io.IOException,
                                 java.lang.OutOfMemoryError
Description copied from interface: OrdDomainIOInterface
Returns a byte array containing the data from the database BLOB specified by the localData attribute.
Specified by:
getDataInByteArray in interface OrdDomainIOInterface
Overrides:
getDataInByteArray in class OrdVideo
Returns:
a byte[] array containing the data.
Throws:
java.lang.OutOfMemoryError - if sufficient memory cannot be allocated to hold the data.
java.sql.SQLException - if an error occurs when accessing an object attribute.
java.io.IOException - if an error occurs when reading the data from the BLOB.

getContentAsBlobDomain

public oracle.jbo.domain.BlobDomain getContentAsBlobDomain()
                                                    throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Returns a BlobDomain object which wraps the BLOB locator from the localData attribute.
Specified by:
getContentAsBlobDomain in interface OrdDomainIOInterface
Returns:
a BlobDomain object
Throws:
java.sql.SQLException - if an error occurs in calling getContent method.
See Also:
OrdImage.getContent(), OrdAudio.getContent(), OrdVideo.getContent(), OrdDoc.getContent()

getBFileDomain

public oracle.jbo.domain.BFileDomain getBFileDomain()
                                             throws java.sql.SQLException
Description copied from interface: OrdDomainIOInterface
Returns a BFileDomain object which wraps the BFILE locator obtained from the getBFILE method.
Specified by:
getBFileDomain in interface OrdDomainIOInterface
Returns:
a BFileDomain object
Throws:
java.sql.SQLException - if an error occurs in calling getBFILE method.
See Also:
OrdImage.getBFILE(), OrdAudio.getBFILE(), OrdVideo.getBFILE(), OrdDoc.getBFILE()

getCommentsAsClobDomain

public oracle.jbo.domain.ClobDomain getCommentsAsClobDomain()
                                                     throws java.sql.SQLException
Returns a ClobDomain object which wraps the CLOB locator obtained from the getComments() method.
Returns:
a ClobDomain object
Throws:
java.sql.SQLException - if an error occurs while calling the getComments method

setContentSource

public void setContentSource(OrdContentSource source)
Description copied from interface: OrdDomainIOInterface
Sets the content source for deferred loading. Three predefined content source implementations support loading content from a file, a byte array, or a OrdHttpUploadFile object. The loading of content from the client into the database doesn't happen inside this method. It's deferred to the next postChanges method call.

If the source parameter is null, this method just resets the previously set content source.

In 3Tier environment, this method registers the domain object in the client post listener list so the content won't be replicated from CT to MT. The content will be streamed to the database directly after the postChanges.

Specified by:
setContentSource in interface OrdDomainIOInterface
Parameters:
source - the content source for the deferred loading
See Also:
OrdContentSource

getContentSource

public OrdContentSource getContentSource()
Description copied from interface: OrdDomainIOInterface
Gets the content source which was previously set by the setContentSource method.
Specified by:
getContentSource in interface OrdDomainIOInterface
Returns:
the content source object

create

public oracle.sql.CustomDatum create(oracle.sql.Datum d,
                                     int sqlType)
                              throws java.sql.SQLException
Internal: Applications should not use this method.
Specified by:
create in interface oracle.sql.CustomDatumFactory
Overrides:
create in class OrdVideo
java.sql.SQLException

getXMLDomainFactory

public static oracle.jbo.domain.XMLDomainFactory getXMLDomainFactory(java.lang.Class attrClass)
Internal: Applications should not use this method.

getXMLContentNode

public org.w3c.dom.Node getXMLContentNode(org.w3c.dom.Document xmlDoc)
Internal: Applications should not use this method.
Specified by:
getXMLContentNode in interface oracle.jbo.domain.XMLDomainInterface

createDomainFromSerializedXML

public java.lang.Object createDomainFromSerializedXML(org.w3c.dom.Element element)
Create a domain instance by reading the xml-data out of the given xml-node.
Specified by:
createDomainFromSerializedXML in interface oracle.jbo.domain.XMLDomainReaderFactory

getSerializedDomainXML

public org.w3c.dom.Node getSerializedDomainXML(org.w3c.dom.Document xmlDoc)
Creates the XML node in the given XML document for this domain's data.
Specified by:
getSerializedDomainXML in interface oracle.jbo.domain.XMLDomainWriter
Parameters:
xmlDoc - name of the XML document in which the node should be created.

printXMLDefinition

public java.lang.String printXMLDefinition(java.util.Hashtable allDefs,
                                           java.io.PrintWriter pw,
                                           boolean bContainees)
Internal: Applications should not use this method.
Specified by:
printXMLDefinition in interface oracle.jbo.domain.XMLDomainInterface

domainToBeModified

public void domainToBeModified(oracle.jbo.domain.DomainInterface d)
Internal: Applications should not use this method.
Specified by:
domainToBeModified in interface oracle.jbo.domain.DomainOwnerInterface

getAttribute

public java.lang.Object getAttribute(int index)
Internal: Applications should not use this method.
Specified by:
getAttribute in interface oracle.jbo.AttributeList

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Internal: Applications should not use this method.
Specified by:
getAttribute in interface oracle.jbo.AttributeList

setAttribute

public void setAttribute(int index,
                         java.lang.Object value)
Internal: Applications should not use this method.
Specified by:
setAttribute in interface oracle.jbo.AttributeList

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Internal: Applications should not use this method.
Specified by:
setAttribute in interface oracle.jbo.AttributeList

getAttributeCount

public int getAttributeCount()
Internal: Applications should not use this method.
Specified by:
getAttributeCount in interface oracle.jbo.AttributeList

getAttributeIndexOf

public int getAttributeIndexOf(java.lang.String name)
Internal: Applications should not use this method.
Specified by:
getAttributeIndexOf in interface oracle.jbo.AttributeList

getAttributeNames

public java.lang.String[] getAttributeNames()
Specified by:
getAttributeNames in interface oracle.jbo.AttributeList

getAttributeValues

public java.lang.Object[] getAttributeValues()
Specified by:
getAttributeValues in interface oracle.jbo.AttributeList

syncServerLob

public void syncServerLob(oracle.jbo.domain.LobInterface oldObj)
Internal: Applications should not use this method.
Specified by:
syncServerLob in interface oracle.jbo.domain.LobInterface

syncClientLob

public void syncClientLob(oracle.jbo.domain.LobInterface newArrival)
Internal: Applications should not use this method.
Specified by:
syncClientLob in interface oracle.jbo.domain.LobInterface

getSize

public long getSize()
Internal: Applications should not use this method.
Specified by:
getSize in interface oracle.jbo.domain.LobInterface

getRemoteIdString

public java.lang.String getRemoteIdString()
Internal: Applications should not use this method.
Specified by:
getRemoteIdString in interface oracle.jbo.domain.LobInterface

saveToDatabase

public void saveToDatabase(oracle.jbo.Transaction xAct)
                    throws java.sql.SQLException
Internal: Applications should not use this method.
Specified by:
saveToDatabase in interface oracle.jbo.domain.BlobDomainInterface
java.sql.SQLException

saveToDatabase

public void saveToDatabase(oracle.jbo.Transaction xAct,
                           java.lang.Object emptySQLObject)
                    throws java.sql.SQLException,
                           java.io.IOException
Internal: Applications should not use this method.
Specified by:
saveToDatabase in interface oracle.jbo.domain.BlobDomainInterface
java.sql.SQLException
java.io.IOException

prepareForDML

public void prepareForDML(java.lang.Object context)
Internal: Applications should not use this method.
Specified by:
prepareForDML in interface oracle.jbo.domain.BlobDomainInterface

loadFromDatabase

public void loadFromDatabase(oracle.jbo.Transaction xAct)
                      throws java.lang.Exception
Internal: Applications should not use this method.
Specified by:
loadFromDatabase in interface oracle.jbo.domain.BlobDomainInterface
java.lang.Exception

getOwner

public oracle.jbo.domain.DomainOwnerInterface getOwner()
Internal: Applications should not use this method.
Specified by:
getOwner in interface oracle.jbo.domain.LobInterface

getOwnerAttributeIndex

public int getOwnerAttributeIndex()
Internal: Applications should not use this method.
Specified by:
getOwnerAttributeIndex in interface oracle.jbo.domain.LobInterface

getData

public java.lang.Object getData()
Internal: Applications should not use this method.
Specified by:
getData in interface oracle.jbo.domain.DomainInterface

setContext

public void setContext(oracle.jbo.domain.DomainOwnerInterface owner,
                       oracle.jbo.Transaction trans,
                       java.lang.Object ctx)
Internal: Applications should not use this method.
Specified by:
setContext in interface oracle.jbo.domain.DomainInterface

marshal

public oracle.svcmsg.ResponseValues marshal()
Specified by:
marshal in interface oracle.jbo.domain.MarshalledDomain

isConnected

public boolean isConnected()
Description copied from interface: OrdDomainState
Determines whether the domain object has an internal JDBC connection to the database.
Specified by:
isConnected in interface OrdDomainState
Returns:
true if the there exists an internal JDBC connection; otherwise, returns false

getTierInfo

public int getTierInfo()
Description copied from interface: OrdDomainState
Gets the tier number information that this object lives in.

The returned value indicates the tier information.

Specified by:
getTierInfo in interface OrdDomainState

removeListenerFromTransaction

public void removeListenerFromTransaction()
Description copied from interface: OrdDomainState
Internal: Applications should not use this method.
Specified by:
removeListenerFromTransaction in interface OrdDomainState

doneCommit

public void doneCommit(oracle.jbo.TransactionStateEvent event)
Internal: Applications should not use this method.
Specified by:
doneCommit in interface oracle.jbo.TransactionStateListener

doneRollback

public void doneRollback(oracle.jbo.TransactionStateEvent event)
Internal: Applications should not use this method.
Specified by:
doneRollback in interface oracle.jbo.TransactionStateListener

setContentSourceOnly

public void setContentSourceOnly(OrdContentSource source)
Description copied from interface: OrdDomainIOInterface
Internal: Applications should not use this method.
Specified by:
setContentSourceOnly in interface OrdDomainIOInterface

setCTPassivationHandle

public void setCTPassivationHandle(java.lang.Object handle)
Internal: Applications should not use this method.
Specified by:
setCTPassivationHandle in interface OrdDomainSupportInterface

getCTPassivationHandle

public java.lang.Object getCTPassivationHandle()
Internal: Applications should not use this method.
Specified by:
getCTPassivationHandle in interface OrdDomainSupportInterface

prepareCTPassivation

public void prepareCTPassivation()
Internal: Applications should not use this method.
Specified by:
prepareCTPassivation in interface OrdDomainSupportInterface

clearContentSource

public void clearContentSource()
Description copied from interface: OrdDomainIOInterface
Internal: Applications should not use this method.
Specified by:
clearContentSource in interface OrdDomainIOInterface

Oracle9i Business Components for Java InterMedia API Reference
Oracle9i JDeveloper (9.0.4)
B10394-01

Copyright © 2001,2003, Oracle. All Rights Reserved.