public class DatasetWrapper
extends java.lang.Object
implements java.io.Externalizable
DsTableDefinition and DsRelationDefinition the
components of the DataSet instance before sending them to a remote side.
This class is intended to be used only by FWD runtime.
| Modifier and Type | Field and Description |
|---|---|
private boolean |
append
Flag indicating this dataset is sent in APPEND mode.
|
private boolean |
asXml
Flag indicating if the transfer is made via XML.
|
private boolean |
dsHandle
Determines if this wrapper wraps data from a DATASET-HANDLE parameter.
|
private java.lang.String |
dsName
The name of the DataSet.
|
private boolean |
fromJson
Flag indicating if the source is a JSON dataset.
|
private boolean |
hasError
The
ERROR attribute of the dataset. |
private boolean |
input
Flag indicating this dataset is sent in INPUT or INPUT-OUTPUT mode.
|
private boolean |
output
Flag indicating this dataset is sent in OUTPUT or INPUT-OUTPUT mode.
|
private java.util.List<DsRelationDefinition> |
relationsDefs
The relations definitions to be read for the dataset.
|
private DataSetContainer |
resource
The result set to be sent to the remote side.
|
private static long |
serialVersionUID
A static serialization ID - required when enabling AOP method tracing (see
MethodTraceAspect. |
private java.util.List<DsTableDefinition> |
tableDefs
The tables definitions to be read for the dataset.
|
private boolean |
useBeforeImage
Flag indicating if the before-table must be interpreted, too.
|
private boolean |
valid
Flag indicating if this container holds a valid dataset.
|
private java.lang.String |
xmlDataset
For SOAP web services, the DATASET is sent (and received) serialized as XML, as the requester can't
(de)serialize it properly (the relations have dependencies on executing a query to determine the
related child-table rows).
|
private java.lang.String |
xmlNodeName
The XML-NODE-NAME attribute for this dataset.
|
private java.lang.String |
xmlns
The XML namespace for this dataset.
|
private java.lang.String |
xmlPrefix
The XML prefix for this dataset.
|
| Constructor and Description |
|---|
DatasetWrapper()
Default c'tor, explicitly added to allow instances of this class to be created on
deserialization.
|
DatasetWrapper(boolean input,
boolean output,
boolean dsHandle)
Create a new wrapper.
|
DatasetWrapper(boolean fromJson,
DataSetContainer resource)
Wrap a custom result set in a class known to FWD, so the remote side can deserialize it.
|
DatasetWrapper(DataSetContainer resource)
Wrap a custom result set in a class known to FWD, so the remote side can deserialize it.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDatasetName()
Obtain the dataset name.
|
java.util.List<DsRelationDefinition> |
getRelationsDefs()
Returns the list of relations definitions between the temp-tables from this
DataSet. |
DataSetContainer |
getResource()
Get the dataset container resource.
|
java.util.List<DsTableDefinition> |
getTableDefs()
Returns the list of table definitions for the temp-tables from this
DataSet. |
TableWrapper |
getTableWrapper(int k)
Obtain a
TableWrapper for a specific table of this DataSet. |
java.lang.String |
getXmlDataset()
Get the
xmlDataset. |
java.lang.String |
getXmlNodeName()
Get the XML node name of the DATASET.
|
boolean |
hasError()
Get the ERROR attribute of the DATASET.
|
boolean |
isAppend()
Check if this dataset is in APPEND mode.
|
boolean |
isAsXml()
Get the
asXml flag. |
boolean |
isDatasetHandle()
Determines if this wrapper wraps data from a DATASET-HANDLE parameter.
|
boolean |
isFromJson()
Check if the source is a JSON.
|
boolean |
isInput()
Check if this dataset is in INPUT or INPUT-OUTPUT mode.
|
boolean |
isOutput()
Check if this dataset is in OUTPUT or INPUT-OUTPUT mode.
|
boolean |
isUseBeforeImage()
Get the
useBeforeImage flag. |
boolean |
isValid()
Get the
valid flag. |
java.lang.String |
namespacePrefix()
Get the XML prefix of the DATASET.
|
java.lang.String |
namespaceURI()
Get the XML namespace of the DATASET.
|
void |
readExternal(java.io.ObjectInput in)
Read the result set (metadata and rows) from the specified input source.
|
void |
setAsXml(boolean asXml)
Set the
asXml flag. |
void |
setDatasetHandle(boolean datasetHandle)
Set if this wrapper wraps data from a DATASET-HANDLE parameter.
|
void |
setDatasetName(java.lang.String dsName)
Sets the dataset name.
|
void |
setUseBeforeImage(boolean useBeforeImage)
Set the
useBeforeImage flag. |
void |
setXmlDataset(java.lang.String xmlDataset)
Set the
xmlDataset. |
java.lang.String |
toString()
Get a string representation of this dataset.
|
void |
writeExternal(java.io.ObjectOutput out)
Send the result set (metadata and rows) to the specified output destination.
|
private static final long serialVersionUID
MethodTraceAspect.private DataSetContainer resource
private boolean input
private boolean output
private boolean append
private java.util.List<DsTableDefinition> tableDefs
private java.util.List<DsRelationDefinition> relationsDefs
private boolean dsHandle
private java.lang.String dsName
private java.lang.String xmlns
private java.lang.String xmlPrefix
private boolean hasError
ERROR attribute of the dataset.private java.lang.String xmlNodeName
private boolean fromJson
private java.lang.String xmlDataset
private boolean asXml
private boolean useBeforeImage
private boolean valid
public DatasetWrapper()
public DatasetWrapper(boolean input,
boolean output,
boolean dsHandle)
input - Flag indicating the wrapper is in INPUT mode.output - Flag indicating the wrapper is in OUTPUT mode.dsHandle - Flag indicating the wrapper is for a DATASET-HANDLE.public DatasetWrapper(DataSetContainer resource)
resource - The resource, which is a (subclass of) DataSet.public DatasetWrapper(boolean fromJson,
DataSetContainer resource)
fromJson - Flag indicating if the dataset is from a JSON source.resource - The resource, which is a (subclass of) DataSet.public boolean isValid()
valid flag.true if this container is for a valid dataset.public void setUseBeforeImage(boolean useBeforeImage)
useBeforeImage flag.useBeforeImage - Flag indicating that the before-image for the dataset is used.public boolean isUseBeforeImage()
useBeforeImage flag.public void setXmlDataset(java.lang.String xmlDataset)
xmlDataset.xmlDataset - The XML representation of the dataset.public java.lang.String getXmlDataset()
xmlDataset.public boolean isAsXml()
asXml flag.public void setAsXml(boolean asXml)
asXml flag.asXml - When true, the dataset is transferred via its XML representation.public DataSetContainer getResource()
resource.public java.lang.String namespaceURI()
public java.lang.String namespacePrefix()
public java.lang.String getXmlNodeName()
public boolean hasError()
public java.util.List<DsTableDefinition> getTableDefs()
DataSet.DataSet.public java.util.List<DsRelationDefinition> getRelationsDefs()
DataSet.
All relations are returned, whether they are active or not.DataSet.public boolean isInput()
readExternal(java.io.ObjectInput). Must not be called when resource is
set.input flag.public boolean isOutput()
readExternal(java.io.ObjectInput). Must not be called when resource
is set.output flag.public boolean isAppend()
readExternal(java.io.ObjectInput). Must not be called when resource is set.append flag.public boolean isDatasetHandle()
true if this wrapper wraps data from a DATASET-HANDLE parameter.public boolean isFromJson()
fromJson flag.public void setDatasetHandle(boolean datasetHandle)
datasetHandle - true if this wrapper wraps data from a DATASET-HANDLE parameter.public java.lang.String getDatasetName()
public void setDatasetName(java.lang.String dsName)
dsName - The (new) dataset name.public final void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizableout - The output destination to which the result set will be sent.java.io.IOException - In case of I/O errors.public final void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablein - The input source from which the result set will be read.java.io.IOException - In case of I/O errors.java.lang.ClassNotFoundException - If a class load operation fails.public TableWrapper getTableWrapper(int k)
TableWrapper for a specific table of this DataSet. The table is
identified by its index in the buffer list.k - The index of the table whose TableWrapper will be returned.public java.lang.String toString()
toString in class java.lang.Object