Oracle Reports
Java API Reference
11g Release 1 (11.1.1)
E10775-01

oracle.reports.server
Class Destination

java.lang.Object
  extended by oracle.reports.server.Destination

public abstract class Destination
extends java.lang.Object

Abstract base class for reports server destinations When create customized destination plugin, the subclass needs to implement several abstract methods defined here, and can optionally override methods implemented here. By default, reports has implemented DesMail, DesFile, DesCache, DesPrint, and DesOraclePortal


Field Summary
protected  CacheItem m_cacheItem
          The cache item associated with the destination.
protected  Job m_job
          The job object to which the destination object attaches.
protected  java.util.Properties mProps
           
 
Constructor Summary
Destination()
           
 
Method Summary
protected  CacheItem getCacheItem()
          Returns the cache item associated with the destination.
protected  java.io.InputStream getContent(java.lang.String fileName)
          Returns the contents of a file from the cache.
protected  java.lang.String getDesname()
          Returns the destination name (DESNAME) of the object.
 java.lang.String getDestinationId()
           
 java.lang.String getDestKey()
           
protected  java.lang.String getDestype()
          Returns the destination type (DESTYPE) of the object.
protected  Job getJob()
          Returns the job object to which the destination object attaches.
protected  java.lang.String getPluginParam(java.lang.String name)
          Returns the plugin parameter value given the parameter name.
protected  java.util.Properties getProperties()
          Returns the properties for the destination.
static java.util.Properties getStaticProperties()
           
protected static void init(java.util.Properties destProps)
          Initializes the destination class.
protected  void send()
          Sends the output to a specified DESTYPE and DESNAME.
protected abstract  void sendFile(boolean main, java.lang.String fileName, short fileFormat, long fileSize)
          Sends a file to the destination.
protected  void setCacheItem(CacheItem item)
          Sets a cache item associated with the destination.
protected  void setDesname(java.lang.String desname)
          Sets the destination name.
 void setDestinationId(java.lang.String id)
           
 void setDestKey(java.lang.String key)
           
protected  void setJob(Job job)
          Sets the job object to which the Destination object attaches.
protected  void setProperties(java.util.Properties props)
          Sets the properties for the subclass object.
static void setStaticProperties(java.util.Properties props)
           
protected static void shutdown()
          Shuts down the destination class.
protected abstract  boolean start(java.util.Properties props, java.lang.String desname, int totalFile, long totalSize, short mainFormat)
          Invoked before sending the first file to the destination.
protected  void stop()
          Invoked after all the files are sent to the destination.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_cacheItem

protected CacheItem m_cacheItem
The cache item associated with the destination.


m_job

protected Job m_job
The job object to which the destination object attaches.


mProps

protected java.util.Properties mProps
Constructor Detail

Destination

public Destination()
Method Detail

init

protected static void init(java.util.Properties destProps)
                    throws RWException
Initializes the destination class. A subclass could override this method to initialize the specific plugin destination.

Parameters:
destProps - The properties set in the server configuration file for the specified plugin destination.
Throws:
RWException

shutdown

protected static void shutdown()
Shuts down the destination class. A subclass could override this method to shut down the specific plugin destination.


getDestype

protected java.lang.String getDestype()
Returns the destination type (DESTYPE) of the object.


setDesname

protected void setDesname(java.lang.String desname)
Sets the destination name.

This can be the value from the command line argument DESNAME, or it can come from a distribution file (.dist), or an .XML file.

Parameters:
desname - The DESNAME command line argument for the job.

getDesname

protected java.lang.String getDesname()
Returns the destination name (DESNAME) of the object.


setProperties

protected void setProperties(java.util.Properties props)
                      throws RWException
Sets the properties for the subclass object. For example, you use setProperties to set the subject, body, cc for mail, copies, and orientation for printer.

Parameters:
props - Any properties passed in from command line or distribution file.
Throws:
RWException

getProperties

protected java.util.Properties getProperties()
Returns the properties for the destination.


getPluginParam

protected java.lang.String getPluginParam(java.lang.String name)
                                   throws RWException
Returns the plugin parameter value given the parameter name.

Parameters:
name - The plugin parameter name.
Throws:
RWException

setCacheItem

protected void setCacheItem(CacheItem item)
Sets a cache item associated with the destination.

Parameters:
item - The cache item associated with the destination.

getCacheItem

protected CacheItem getCacheItem()
Returns the cache item associated with the destination.


setJob

protected void setJob(Job job)
Sets the job object to which the Destination object attaches.

Parameters:
job - The job object to which the Destination object attaches.

getJob

protected Job getJob()
Returns the job object to which the destination object attaches.


send

protected void send()
             throws RWException
Sends the output to a specified DESTYPE and DESNAME.

Throws:
RWException

getContent

protected java.io.InputStream getContent(java.lang.String fileName)
                                  throws RWException
Returns the contents of a file from the cache.

Parameters:
fileName - Name of the file under which the content is stored.
Throws:
RWException

start

protected abstract boolean start(java.util.Properties props,
                                 java.lang.String desname,
                                 int totalFile,
                                 long totalSize,
                                 short mainFormat)
                          throws RWException
Invoked before sending the first file to the destination. Should be implemented by a subclass.

Parameters:
props - Properties for sending output to the destination.
desname - Destination name.
totalFile - Total number of files in the output.
totalSize - Total size of the output.
mainFormat - Format for the main output file.
Returns:
true - Continue to send. false - Do not send.
Throws:
RWException

stop

protected void stop()
             throws RWException
Invoked after all the files are sent to the destination. Can be overridden by a subclass, if necessary.

Throws:
RWException

sendFile

protected abstract void sendFile(boolean main,
                                 java.lang.String fileName,
                                 short fileFormat,
                                 long fileSize)
                          throws RWException
Sends a file to the destination. Should be implemented as a subclass.

Parameters:
main - Main part of the output.
fileName - File name including path.
fileFormat - File format.
fileSize - File size.
Throws:
RWException

setDestKey

public void setDestKey(java.lang.String key)

getDestKey

public java.lang.String getDestKey()

setDestinationId

public void setDestinationId(java.lang.String id)

getDestinationId

public java.lang.String getDestinationId()

setStaticProperties

public static void setStaticProperties(java.util.Properties props)

getStaticProperties

public static java.util.Properties getStaticProperties()

Oracle Reports
Java API Reference

Copyright © 1994, 2009 Oracle Corporation. All Rights Reserved.