|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.sandev.basics.structs.DataImportExportStruct
public class DataImportExportStruct
A transmittable directive for import/export actions used for system administration or similar purposes. A DataImportExport operation is intended for use in situations outside of the standard query processing mechanisms, where the usual user semantics do not apply. Like Ping, authorization should be granted with caution. Care should also be taken so that the result of an import/export action does not pose a security risk.
Sources of DataImportExport messages include administrative interfaces such as custom control panels. The DataManager is a typical receiver (if configured with a supporting Persister implementation), but targets may also include adaptor nodes with access to data sources.
A DataImportExport message is its own return value and is used solely for the side effects it produces. The return status and messages can be read from the SandTransmitMessage interface.
Notes on use:
When setting the dataDescriptions, be aware that if ChildStruct extends ParentStruct, and you provide a general ParentQuery and ChildQuery, then you may end up with duplicate instances of Child messages. One from when they were retrieved as a Parent, and one from when they were retrieved as a Child.
There are specific solutions to this, and it is possible for a Persister to handle this intelligently, but the needs of bulk data export are different than what is usually required for query processing, and it seems excessive to require this from a Persister implementation. Especially as most databases have their own backup processing which is far more efficient. In general, if you put a field in the parent class to indicate whether it's actually a child class, you break stuff about what inheritance means. If you try and tag things in the child, you run into problems with inheritance trees. This issue can't generally be solved well, but it can be solved in any specific application. Options:
The correct solution depends on your data model, application requirements, and underlying persistence technology.
| Field Summary | |
|---|---|
protected int |
action
Whether this is an import or export operation. |
protected SandQueryMessage[] |
dataDescriptions
A series of queries describing the data to be exported. |
protected SandStructMessage |
existingInstance
In the event of an import failure due to conflicting instances this holds the existing instance. |
protected SandStructMessage |
importInstance
In the event of an import failure due to conflicting instances this holds the import instance. |
protected int |
maxReturnOverride
The value to use for maxReturn in the queries passed in the dataDescriptions field. |
protected int |
resolution
Indicates the action which should occur in the event that the data being imported already exists and is different. |
protected java.lang.String |
source
The import or export location. |
| Constructor Summary | |
|---|---|
DataImportExportStruct()
|
|
| Method Summary |
|---|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String source
protected int action
enumerated constant values:
EXPORT("Export") = 0IMPORT("Import") = 1RESTORE("Restore") = 2protected SandQueryMessage[] dataDescriptions
protected int maxReturnOverride
To get around this export limit you can:
Be aware that the maxReturn limit on queries is there for a reason. You can definitely load more data from the database than what will fit into memory, and that's what this override is allowing you to do.
The override is applied if its value is greater than zero.
protected int resolution
enumerated constant values:
ABORT("Abort") = 0OVERWRITE("Overwrite") = 1MERGE("Merge") = 2FAIL("Fail") = 3protected SandStructMessage existingInstance
protected SandStructMessage importInstance
| Constructor Detail |
|---|
public DataImportExportStruct()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||