|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.wabit.dao.OpenWorkspaceXMLDAO
public class OpenWorkspaceXMLDAO
This DAO will load workspaces to a context from a given input stream. Each time a new input stream is to be loaded a new instance of this class should be created.
| Field Summary | |
|---|---|
static long |
UNKNOWN_STREAM_LENGTH
Constant specifying that the length of a workspace XML stream is unknown. |
| Constructor Summary | |
|---|---|
OpenWorkspaceXMLDAO(WabitSessionContext context,
java.io.InputStream in,
long bytesInStream)
Creates a new XML DAO for Wabit workspaces. |
|
| Method Summary | |
|---|---|
void |
addImportedWorkspaceContentToWorkspace(WabitSession session)
Call this method to add the WabitObjects in the loaded workspaces
to the given session . |
WabitSession |
addLoadedWorkspacesToContext()
Call this method to register the loaded workspace with the context in this DAO. |
java.lang.Integer |
getJobSize()
|
java.lang.String |
getMessage()
|
int |
getProgress()
|
boolean |
hasStarted()
|
void |
importWorkspaces(WabitSession session)
Calling this method will import all of the workspaces from the input stream into the session given. |
boolean |
isCancelled()
|
boolean |
isFinished()
|
void |
loadWorkspacesFromStream()
Call this method to load the workspaces in the given stream into the saxHandler. |
WabitSession |
openWorkspaces()
Calling this method will load the workspaces from the input stream into the context that was given to this class when its constructor was called. |
void |
setCancelled(boolean cancelled)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long UNKNOWN_STREAM_LENGTH
| Constructor Detail |
|---|
public OpenWorkspaceXMLDAO(WabitSessionContext context,
java.io.InputStream in,
long bytesInStream)
context - The session context to create new sessions in.in - The input stream of the workspace's XML representation.bytesInStream - The length of the stream in question. If not known, specify
UNKNOWN_STREAM_LENGTH.| Method Detail |
|---|
public void loadWorkspacesFromStream()
saxHandler. This is the first step to loading or importing a
file into Wabit. This needs to be done before any other parts of loading
if it is being done in multiple parts.
If loading is done on multiple threads this operation can be done on a separate thread. This method should only be called once for each DAO.
public WabitSession addLoadedWorkspacesToContext()
If loading is done on multiple threads this operation must be done on the event dispatch thread. This should only be called once for each DAO or the same workspace will be added to the context multiple times.
public void addImportedWorkspaceContentToWorkspace(WabitSession session)
WabitObjects in the loaded workspaces
to the given session . This is the last step to importing a file into
Wabit workspace.
If importing is done on multiple threads this operation must be done on the event dispatch thread. This should only be called once for each DAO or the same workspace will be added to the context multiple times.
session - The session that will have WabitObjects added to it.
Null should not be passed into this method.public WabitSession openWorkspaces()
Use this method to load a file into Wabit if there is no concerns about multi threading.
public void importWorkspaces(WabitSession session)
Use this method to import a file into Wabit if there is no concerns about multi threading.
session - The session to import WabitObjects into. This should
not be null.public java.lang.Integer getJobSize()
getJobSize in interface ca.sqlpower.util.Monitorablepublic java.lang.String getMessage()
getMessage in interface ca.sqlpower.util.Monitorablepublic int getProgress()
getProgress in interface ca.sqlpower.util.Monitorablepublic boolean hasStarted()
hasStarted in interface ca.sqlpower.util.Monitorablepublic boolean isFinished()
isFinished in interface ca.sqlpower.util.Monitorablepublic boolean isCancelled()
isCancelled in interface ca.sqlpower.util.Monitorablepublic void setCancelled(boolean cancelled)
setCancelled in interface ca.sqlpower.util.Monitorable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||