ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.beans
Class AbleExport

java.lang.Object
  |
  +--com.ibm.able.AbleObject
        |
        +--com.ibm.able.beans.AbleExport
All Implemented Interfaces:
AbleBean, AbleDataBufferManager, AbleDataSink, AbleEventListener, AbleEventListenerManager, AbleEventQueueManager, AbleEventQueueProcessor, AblePropertyChangeManager, AbleSerializable, java.io.Serializable

public class AbleExport
extends AbleObject
implements AbleDataSink, java.io.Serializable

This class writes data out to external text files.

See Also:
Serialized Form

Field Summary
static java.lang.String defaultName
           
 
Fields inherited from class com.ibm.able.AbleObject
changed, chgSupport, comment, dataFlowEnabled, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace
 
Constructor Summary
AbleExport()
          Construct a default AbleExport object
AbleExport(java.lang.String name)
          Construct an AbleExport object with specified name.
AbleExport(java.lang.String name, java.lang.String dataFileName)
          Construct an AbleExport object with specified name and file.
 
Method Summary
 void close()
          Close the output file, disable data flow, and set its state to Unititiated.
static java.lang.String Copyright()
          Determine the copyright of this class.
 void erase()
          Erase the current file and close the current writer.
 void flush()
          Flush the output buffer.
 java.lang.String getDataFileName()
          Get the current output file name.
 java.lang.String getDelimiter()
          Return the current delimiter String.
 int getNumberOfInputFields()
          Returns the number of inputs provided to this output device.
 void init()
          Open the output datafile.
 boolean isReady()
          Indicate whether the export is ready to write data.
 void process()
          Write out the contents of inputBuffer to file using specified delimiter.
 java.lang.Object process(java.lang.Object theArg)
          Write out the contents of the parameter to the data file.
 void processAbleEvent(AbleEvent theEvent)
          Extract the argument object from an AbleEvent and output it to the data file.
 void quitAll()
          Close any open file.
 void reset()
          re-initialize the bean close and reopen the output file
 void setDataFileName(java.lang.String newName)
          Set the current output file name.
 void setDelimiter(java.lang.String newDelims)
          Set the current delimiter.
 void setNumberOfInputs(int inputs)
          Sets the number of inputs to be provided to this output device.
 
Methods inherited from class com.ibm.able.AbleObject
addAbleEventListener, addDestBufferConnection, addPropertyChangeListener, addPropertyConnection, addSourceBufferConnection, addStateChangeListener, dataChanged, firePropertyChange, flushAbleEventQueue, getAbleEventListeners, getAbleEventProcessingEnabled, getAbleEventQueueSize, getComment, getDestBufferConnections, getFileName, getInputBuffer, getInputBuffer, getInputBufferAsStringArray, getInputBufferContents, getLogger, getName, getOutputBuffer, getOutputBuffer, getOutputBufferAsStringArray, getOutputBufferContents, getParent, getPropertyConnectionManager, getSleepTime, getSourceBufferConnections, getState, getTraceLogger, handleAbleEvent, hasInputBuffer, hasOutputBuffer, init, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isChanged, isConnectable, isDataFlowEnabled, isTimerEventProcessingEnabled, notifyAbleEventListeners, processBufferConnections, processNoEventProcessingEnabledSituation, processTimerEvent, quitEnabledEventProcessing, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllConnections, removeAllPropertyConnections, removeDestBufferConnection, removePropertyChangeListener, removePropertyConnection, removeSourceBufferConnection, removeStateChangeListener, restartEnabledEventProcessing, restoreFromFile, restoreFromFile, restoreFromSerializedFile, restoreFromStream, resumeAll, resumeEnabledEventProcessing, saveToFile, saveToFile, setAbleEventProcessingEnabled, setChanged, setComment, setDataFlowEnabled, setFileName, setInputBuffer, setInputBuffer, setLogger, setName, setOutputBuffer, setOutputBuffer, setParent, setSleepTime, setState, setTimerEventProcessingEnabled, setTraceLogger, sourceConnectionsOK, startEnabledEventProcessing, suspendAll, suspendEnabledEventProcessing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.able.AbleBean
getComment, getLogger, getName, getParent, getState, getTraceLogger, init, isChanged, removeAllConnections, resumeAll, setChanged, setComment, setLogger, setName, setParent, setState, setTraceLogger, suspendAll
 
Methods inherited from interface com.ibm.able.AbleDataBufferManager
addDestBufferConnection, addSourceBufferConnection, getDestBufferConnections, getInputBuffer, getInputBuffer, getInputBufferAsStringArray, getInputBufferContents, getOutputBuffer, getOutputBuffer, getOutputBufferAsStringArray, getOutputBufferContents, getSourceBufferConnections, hasInputBuffer, hasOutputBuffer, isConnectable, isDataFlowEnabled, processBufferConnections, removeAllBufferConnections, removeDestBufferConnection, removeSourceBufferConnection, setDataFlowEnabled, setInputBuffer, setInputBuffer, setOutputBuffer, setOutputBuffer
 
Methods inherited from interface com.ibm.able.AbleEventListener
handleAbleEvent
 
Methods inherited from interface com.ibm.able.AbleEventListenerManager
addAbleEventListener, dataChanged, getAbleEventListeners, notifyAbleEventListeners, removeAbleEventListener
 
Methods inherited from interface com.ibm.able.AbleEventQueueManager
flushAbleEventQueue, getAbleEventProcessingEnabled, getAbleEventQueueSize, getSleepTime, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isTimerEventProcessingEnabled, quitEnabledEventProcessing, restartEnabledEventProcessing, resumeEnabledEventProcessing, setAbleEventProcessingEnabled, setSleepTime, setTimerEventProcessingEnabled, startEnabledEventProcessing, suspendEnabledEventProcessing
 
Methods inherited from interface com.ibm.able.AbleEventQueueProcessor
processNoEventProcessingEnabledSituation, processTimerEvent
 
Methods inherited from interface com.ibm.able.AblePropertyChangeManager
addPropertyChangeListener, addPropertyConnection, getPropertyConnectionManager, removeAllPropertyConnections, removePropertyChangeListener, removePropertyConnection
 
Methods inherited from interface com.ibm.able.AbleSerializable
getFileName, restoreFromFile, restoreFromFile, saveToFile, saveToFile, setFileName
 

Field Detail

defaultName

public static final java.lang.String defaultName
Constructor Detail

AbleExport

public AbleExport()
           throws AbleException
Construct a default AbleExport object

AbleExport

public AbleExport(java.lang.String name)
           throws AbleException
Construct an AbleExport object with specified name.

AbleExport

public AbleExport(java.lang.String name,
                  java.lang.String dataFileName)
           throws AbleException
Construct an AbleExport object with specified name and file. A convenience method to avoid a separate call to setDataFileName.
Parameters:
name - A String containing the name used to identify this bean.
dataFileName - A String containing the name of the file with no file extension.
Method Detail

init

public void init()
          throws AbleException
Open the output datafile. If event posting or processing is enabled, start event processing. This enables events to be exported to a file.
Specified by:
init in interface AbleBean
Overrides:
init in class AbleObject
Following copied from interface: com.ibm.able.AbleBean
Throws:
AbleException - If an error occurs.

setDataFileName

public void setDataFileName(java.lang.String newName)
Set the current output file name.

getDataFileName

public java.lang.String getDataFileName()
Get the current output file name.

setDelimiter

public void setDelimiter(java.lang.String newDelims)
Set the current delimiter. Only the first character in the String is used to delimit fields in a record.

getDelimiter

public java.lang.String getDelimiter()
Return the current delimiter String.

setNumberOfInputs

public void setNumberOfInputs(int inputs)
Description copied from interface: AbleDataSink
Sets the number of inputs to be provided to this output device. Note that the number of inputs may also be derived from other methods.
Specified by:
setNumberOfInputs in interface AbleDataSink
Following copied from interface: com.ibm.able.AbleDataSink
Parameters:
count - The number of inputs required by this output device.

getNumberOfInputFields

public int getNumberOfInputFields()
Description copied from interface: AbleDataSink
Returns the number of inputs provided to this output device. Zero may indicate that the bean is not initialized or that the input is not an indexable Object such as a Hashtable.
Specified by:
getNumberOfInputFields in interface AbleDataSink
Following copied from interface: com.ibm.able.AbleDataSink
Returns:
The number of inputs provided to this output device.

process

public void process()
             throws AbleException
Write out the contents of inputBuffer to file using specified delimiter.
Specified by:
process in interface AbleBean
Overrides:
process in class AbleObject
Following copied from interface: com.ibm.able.AbleBean
Throws:
AbleException - If an error occurs.

process

public java.lang.Object process(java.lang.Object theArg)
                         throws AbleException
Write out the contents of the parameter to the data file.
Specified by:
process in interface AbleBean
Overrides:
process in class AbleObject
Following copied from interface: com.ibm.able.AbleBean
Parameters:
theArg - An Object used to provide data for the bean derive a result.
Returns:
The results of the process() computation, usually a clone of the bean's OutputBuffer.
Throws:
AbleException - If an error occurs.

quitAll

public void quitAll()
             throws AbleException
Close any open file.
Specified by:
quitAll in interface AbleBean
Overrides:
quitAll in class AbleObject
See Also:
close()

close

public void close()
Close the output file, disable data flow, and set its state to Unititiated.

flush

public void flush()
           throws AbleException
Flush the output buffer.

erase

public void erase()
           throws AbleException
Erase the current file and close the current writer.

reset

public void reset()
           throws AbleException
re-initialize the bean close and reopen the output file
Specified by:
reset in interface AbleBean
Overrides:
reset in class AbleObject
Following copied from interface: com.ibm.able.AbleBean
Throws:
AbleException - If an error occurs.

isReady

public boolean isReady()
                throws AbleException
Indicate whether the export is ready to write data. This means the file is open.
Specified by:
isReady in interface AbleDataSink

processAbleEvent

public void processAbleEvent(AbleEvent theEvent)
                      throws AbleException
Extract the argument object from an AbleEvent and output it to the data file.
Specified by:
processAbleEvent in interface AbleEventQueueProcessor
Overrides:
processAbleEvent in class AbleObject
Parameters:
theEvent - An AbleEvent containing the data to be written to file.

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.


ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003