Skip navigation links


com.essbase.eas.framework.defs.transfer
Class RAFTransferObject

java.lang.Object
  extended by com.essbase.eas.framework.defs.transfer.RAFTransferObject


public class RAFTransferObject
extends java.lang.Object

Title: Description: Copyright: Copyright (c) 2001 Company: Hyperion Solutions Corporation

Version:
1.0
Author:
Sree Menon

Field Summary
protected  java.util.ArrayList data
          contains the objects to be transported or that have been parsed after transport
protected  java.util.List messages
          contains the set of messages that were parsed after transport
protected  CommandStatus status
          contains the command status object
protected  java.util.Hashtable substitutions
          contains a hashtable of possible substitution classes for importing.

 

Constructor Summary
RAFTransferObject()
           
RAFTransferObject(java.util.Hashtable substitutions)
          Creates a RAFTransferObject and initializes the table of substitutions classes to use for certain classes.

 

Method Summary
 void add(java.util.Collection coll)
          adds a collection of objects to the set of objects this instance will export
 void add(java.lang.Object obj)
          adds an object to the set of objects this instance will export.
 void addAll(java.lang.Object[] objects)
          adds an array of objects to the set of objects this instance will export.
 void addMessage(java.lang.Object value)
          adds a message to the set of messages for this instance.
 void addMessages(java.util.Collection values)
          adds a collection of messages to the set of messages for this instance.
protected  java.lang.Class classForName(java.lang.String className)
           
 void clearData()
          clears the internal data.
static RAFTransferObject createInstance(java.lang.Class c, java.io.File docFile)
           
static RAFTransferObject createInstance(java.lang.Class c, java.lang.String xml)
           
static RAFTransferObject createInstance(java.io.File docFile)
          creates an instance of an RAFTransferObject and imports an XML string into the internal data structures.
 void dispose()
          This is called when you nolonger need this class
 void exportData(java.io.RandomAccessFile raf)
           
protected  void exportNonStandardData(java.io.RandomAccessFile raf)
           
 java.io.ByteArrayOutputStream exportXml()
           
 java.lang.String exportXmlAsString()
           
 java.io.File generateXmlDocument()
           
 CommandStatus getCommandStatus()
          returns the object considered to be the "command status".
 java.lang.Object[] getData()
          retrieves the set of data that this object represents.
 java.lang.Object[] getDataForClass(java.lang.Class c)
          retrieves the set of data by class type.
 XMLTransferMessage getMessage()
          This method will always return the first XMLTransferMessage
 java.util.Collection getMessages()
           
 java.lang.Object[] getMessages(java.lang.Class c)
           
static java.lang.Object getObjectFromXML(java.io.File file, java.lang.Class<?> c)
           
protected  void importCollectionNode(java.lang.Class<?> c, java.lang.Object owner, java.io.RandomAccessFile raf)
          imports a collection for an element.
 void importData(java.io.RandomAccessFile raf)
           
protected  void importNonStandardData(java.io.RandomAccessFile raf)
           
 void importXml(java.io.File file)
           
 void setCommandStatus(CommandStatus value)
          sets the command status for this transfer object.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

data

protected java.util.ArrayList data
contains the objects to be transported or that have been parsed after transport

messages

protected java.util.List messages
contains the set of messages that were parsed after transport

status

protected CommandStatus status
contains the command status object

substitutions

protected java.util.Hashtable substitutions
contains a hashtable of possible substitution classes for importing.

Constructor Detail

RAFTransferObject

public RAFTransferObject()

RAFTransferObject

public RAFTransferObject(java.util.Hashtable substitutions)
Creates a RAFTransferObject and initializes the table of substitutions classes to use for certain classes. The substitute class is used to instantiate object for requested class.
Parameters:
substitutions - the table of classes used for initialization

Method Detail

createInstance

public static RAFTransferObject createInstance(java.io.File docFile)
creates an instance of an RAFTransferObject and imports an XML string into the internal data structures.
Parameters:
xmlDoc - the text to be imported
Returns:
an instance of the requested class if everything works ok; null, otherwise.

createInstance

public static RAFTransferObject createInstance(java.lang.Class c,
                                               java.lang.String xml)

createInstance

public static RAFTransferObject createInstance(java.lang.Class c,
                                               java.io.File docFile)

importNonStandardData

protected void importNonStandardData(java.io.RandomAccessFile raf)
                              throws java.lang.Exception
Throws:
java.lang.Exception

classForName

protected java.lang.Class classForName(java.lang.String className)
                                throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

importCollectionNode

protected void importCollectionNode(java.lang.Class<?> c,
                                    java.lang.Object owner,
                                    java.io.RandomAccessFile raf)
                             throws java.lang.Exception
imports a collection for an element.
Parameters:
c - class of the owning object.
owner - the owner of the property.
e - the collection that needs to be imported.
Throws:
java.lang.Exception

add

public final void add(java.lang.Object obj)
adds an object to the set of objects this instance will export.
Parameters:
obj - the object to eventually export for transport.

addAll

public final void addAll(java.lang.Object[] objects)
adds an array of objects to the set of objects this instance will export.
Parameters:
objects - the array of objects to add.

add

public final void add(java.util.Collection coll)
adds a collection of objects to the set of objects this instance will export
Parameters:
coll - the collection of objects to add.

addMessage

public final void addMessage(java.lang.Object value)
adds a message to the set of messages for this instance.
Parameters:
value - a message object

addMessages

public final void addMessages(java.util.Collection values)
adds a collection of messages to the set of messages for this instance.
Parameters:
values - a collection of message objects.

setCommandStatus

public final void setCommandStatus(CommandStatus value)
sets the command status for this transfer object. This is used to indiacte success or failure.
Parameters:
value - the CommandStatus to be set for this object

clearData

public void clearData()
clears the internal data. This can be called so that the same XML object can be used to import/export multiple sets of data.

getCommandStatus

public final CommandStatus getCommandStatus()
returns the object considered to be the "command status". Strictly speaking, a command status is not part of the RAFTransferObject class; however, since on of the primary uses is to move data between the client and mid-tier via command requests, this is a helper routine. Semantically, we would like to force a convention that every command contain exactly one instance of a command status object when it returns from the mid-tier. In versions of EAS numbered 6.5.3 and before we cannot do that; however, beginning with version 7.0 we will enforce this rule.
Returns:
the data representing the CommandStatus for this object

getMessage

public final XMLTransferMessage getMessage()
This method will always return the first XMLTransferMessage
Returns:
the first message that is an XMLTransferMessage object.

getMessages

public final java.util.Collection getMessages()
Returns:
the collection of messages.

getMessages

public final java.lang.Object[] getMessages(java.lang.Class c)
Parameters:
c - the Class name for t
Returns:
an array containing all messages of a certain class. This array can be safely typecast by the calling method.

getData

public final java.lang.Object[] getData()
retrieves the set of data that this object represents.
Returns:
an array containing references to all of the objects.

getDataForClass

public final java.lang.Object[] getDataForClass(java.lang.Class c)
retrieves the set of data by class type. This method can be safely called in the following manner.

MyData[] results = (MyData[]) gxo.getDataForClass(MyData.class)

for (int i = 0; i < results.length; ++i)

doSomething ...

Parameters:
c - a class that represents the data we want.
Returns:
an Object array that can be safely cast to the type requested.

importXml

public final void importXml(java.io.File file)
                     throws java.lang.Exception
Throws:
java.lang.Exception

importData

public final void importData(java.io.RandomAccessFile raf)
                      throws java.lang.Exception
Throws:
java.lang.Exception

generateXmlDocument

public final java.io.File generateXmlDocument()
                                       throws java.lang.Exception
Throws:
java.lang.Exception

exportData

public final void exportData(java.io.RandomAccessFile raf)
                      throws java.lang.Exception
Throws:
java.lang.Exception

exportNonStandardData

protected void exportNonStandardData(java.io.RandomAccessFile raf)
                              throws java.lang.Exception
Throws:
java.lang.Exception

dispose

public void dispose()
This is called when you nolonger need this class

getObjectFromXML

public static java.lang.Object getObjectFromXML(java.io.File file,
                                                java.lang.Class<?> c)

exportXml

public final java.io.ByteArrayOutputStream exportXml()
                                              throws java.lang.Exception
Throws:
java.lang.Exception

exportXmlAsString

public final java.lang.String exportXmlAsString()
                                         throws java.lang.Exception
Throws:
java.lang.Exception

Skip navigation links


Copyright © 2001, 2012, Oracle. All rights reserved.