All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface com.sun.wizards.core.WizardState

public interface WizardState
WizardState is an interface for the object responsible for maintaining data on the server side, and serving WizardConsole requests.

There is one WizardState object for each wizard. In a wizard hierarchy (an arrangement in which one wizard calls on the services of another wizard), the WizardState objects create a tree structure with a single WizardState as the root.

Implementations of the WizardState interface include com.sun.wizards.core.GenericWizardState and com.sun.wizards.rmi.GenericRemoteWizardState.


Method Index

 o addChild(String)
Add a child description to the wizard archive.
 o addChildObject(String, ServerObject)
Add a child object to this WizardState.
 o addSequence(String, Sequence)
Add a named sequence of server-side tasks to the WizardState.
 o callClientObjectMethod(Route, String, String[], Object[])
Call a method on the client.
 o callServerObjectMethod(Route, String, String[], Object[])
Call a method on the server.
 o clientIsExiting(int)
This method is called when the client is exiting.
 o closeNamedResourceStream(String)
Close the archive stream associated with the specified name.
 o exit(int)
Requests the server VM to exit with the specified exit code.
 o getAllChildrenRoutes()
Returns routes to all wizard states that are children of this wizard state.
 o getArchiveFilename()
Get the archive filename.
 o getArchivePath()
This method returns path to the class archive containing this state.
 o getChildObject(String)
This method returns the named child object of this WizardState.
 o getChildren()
Get all child states.
 o getChildStateRoute(Route, String)
Get the route for a child WizardState.
 o getChildWizardState(Route, String)
This method returns the named child WizardState.
 o getData(Route, String)
Returns the data stored under the specified id in the WizardState object identified by the specified route. Deprecated.
 o getData(String)
Returns the data stored under the specified id in this WizardState object.
 o getDesktopService()
Get the Desktop service.
 o getInitializeStatus()
Returns the initialize status.
 o getLogService()
Get the log service.
 o getName()
This method gets the name of this WizardState.
 o getNamedResource(Route, String, String)
This method returns the bytes of the named resource of the specified type.
 o getNamedResourceStream(String)
Get the archive stream associated with the specified name.
 o getParent()
This method gets the parent of this WizardState.
 o getProgressLabels(String, String, Vector)
Get the progress labels from states with the specified purpose for the progress panel with the specified name.
 o getPurpose()
This method gets the purpose of this WizardState.
 o getRegistryService()
Get the registry service.
 o getRootWizardState()
This method returns the root of the WizardState tree.
 o getRoute(Route)
Get the server side route for this WizardState.
 o getRuntimeResources()
Get the runtime classes required by this WizardState.
 o getSelectedChildren(Class)
This method returns a list of selected children.
 o getSelectedChildrenRoutes(String)
Returns routes to selected wizards that are children of this wizard and having the specified purpose.
 o getSequence(String)
Get a named sequence of server-side tasks from the WizardState.
 o getSerializedData()
Get the data that represents a serialized version of this WizardState.
 o getWizardState(Route)
Get the GenericWizardState identified by the specified route.
 o getWizardTree(Route, String)
Get the data representing a client subtree.
 o hasGUI()
This method returns GUI mode (true for a graphical user interface)
 o hasInitialized()
Returns true if the WizardState has been completely initialized; false otherwise.
 o isBusy()
Returns true if this WizardState object is busy initializing or performing a Sequence.
 o performSequence(Route, String, boolean, String)
Perform the specified sequence of tasks.
 o registerTempFile(String)
Register a temporary file that will be removed when the wizard exits.
 o removeChildWizardState(String)
This method removes the named child.
 o removeTempFile(String)
Remove the specified temporary file now.
 o resumeSequence()
Resume the sequence that is currently being performed or reversed.
 o reverseSequence(Route, String, boolean, String)
Reverse the specified sequence of tasks.
 o setChildren(Vector)
Set all child states.
 o setData(Route, String, Object)
This method sets data into the WizardState identified by the specified route object. Deprecated.
 o setData(String, Object)
This method sets data into the WizardState.
 o setName(String)
This method sets the name of this WizardState.
 o setParent(WizardState)
This method sets the parent of this WizardState.
 o setProgressLabel(String, Msg)
Sets a progress label for this this state.
 o setPurpose(String)
This method sets the purpose of this WizardState.
 o setSelectedChildren(Vector)
This method sets this WizardState's selected children.
 o setSequenceProgress(Route, int)
Set the progress of the current sequence.
 o setSequenceProgress(WizardState, String, Route, int[])
Propogate the progress up to the highest level WizardState that has the specified purpose.
 o setWizardState(DataInput)
Set up this WizardState from the specified input stream.
 o suspendSequence()
Suspend the sequence that is currently being performed or reversed.

Methods

 o exit
 public abstract void exit(int exitStatus)
Requests the server VM to exit with the specified exit code. This call results in the wizard client being notified of the exit request.

Parameters:
exitStatus - The exit code.
 o clientIsExiting
 public abstract void clientIsExiting(int exitStatus)
This method is called when the client is exiting. The result of this call is the server VM exits with the specified exit code.

Parameters:
exitStatus - The exit code.
 o isBusy
 public abstract boolean isBusy()
Returns true if this WizardState object is busy initializing or performing a Sequence.

 o setName
 public abstract void setName(String name)
This method sets the name of this WizardState.

Parameters:
name - The new name for this WizardState.
 o getName
 public abstract String getName()
This method gets the name of this WizardState.

Returns:
The name of this WizardState.
 o setPurpose
 public abstract void setPurpose(String purpose)
This method sets the purpose of this WizardState. The purpose is an indication of what the WizardState can do, and is used for grouping WizardStates within a tree.

Parameters:
purpose - The purpose of this WizardState.
 o getPurpose
 public abstract String getPurpose()
This method gets the purpose of this WizardState.

Returns:
The purpose of this WizardState.
 o hasGUI
 public abstract boolean hasGUI()
This method returns GUI mode (true for a graphical user interface)

Returns:
presence or not of Graphic User Interface, true for GUI
 o hasInitialized
 public abstract boolean hasInitialized()
Returns true if the WizardState has been completely initialized; false otherwise.

 o setParent
 public abstract void setParent(WizardState parent)
This method sets the parent of this WizardState.

Parameters:
parent - The new parent for this WizardState.
 o getParent
 public abstract WizardState getParent()
This method gets the parent of this WizardState.

Returns:
The parent of this WizardState.
 o getSelectedChildren
 public abstract Vector getSelectedChildren(Class returnClass)
This method returns a list of selected children. The vetor that is returned will have entries of the specified class. Supported classes include WizardState and String. If String is specified, the list of children will be specified by WizardState name.

Parameters:
returnClass - The requested class of the list entries.
Returns:
The currently selected children.
 o setSelectedChildren
 public abstract void setSelectedChildren(Vector selectedChildren)
This method sets this WizardState's selected children.

Parameters:
selectedChildren - The children to be selected.
 o setData
 public abstract void setData(Route route,
                              String id,
                              Object value)
Note: setData() is deprecated. You should now use setData(String, Object)

This method sets data into the WizardState identified by the specified route object. The data objects should implement the Serializable interface if the data will be saved in a wizard archive and be retrieved at runtime. All data being set into the WizardState from the client must be Serializable.

Parameters:
route - The route to the correct WizardState.
id - The data identification. This value will be used to retrieve the data.
value - The data to be saved.
 o setData
 public abstract void setData(String id,
                              Object value)
This method sets data into the WizardState. The data objects should implement the Serializable interface if the data will be saved in a wizard archive and be retrieved at runtime. All data being set into the WizardState from the client must be Serializable.

Parameters:
id - The data identification. This value will be used to retrieve the data.
value - The data to be saved.
 o getData
 public abstract Object getData(Route route,
                                String id)
Note: getData() is deprecated. You should now use getData(String)

Returns the data stored under the specified id in the WizardState object identified by the specified route.

Parameters:
route - The route to the correct WizardState.
id - The data identification.
Returns:
The requested data, or null if the requested data has not been set.
 o getData
 public abstract Object getData(String id)
Returns the data stored under the specified id in this WizardState object.

Parameters:
id - The data identification.
Returns:
The requested data, or null if the requested data has not been set.
 o getProgressLabels
 public abstract Vector getProgressLabels(String purpose,
                                          String panelName,
                                          Vector childLabels)
Get the progress labels from states with the specified purpose for the progress panel with the specified name.

Parameters:
purpose - The purpose of the wizard state.
progressKey - The key that the progress panel will use to request the label.
childLabels - This should be null.
Returns:
A vector containing all of the progress label strings.
 o setProgressLabel
 public abstract void setProgressLabel(String progressKey,
                                       Msg label)
Sets a progress label for this this state. The progress label is indexed by the name of the panel that will request it.

Parameters:
progressKey - The key that the progress panel will use to request the label.
labelText - The text for the specified progress bar.
 o getRootWizardState
 public abstract WizardState getRootWizardState()
This method returns the root of the WizardState tree.

Returns:
The root WizardState
 o getWizardState
 public abstract WizardState getWizardState(Route route)
Get the GenericWizardState identified by the specified route.

Parameters:
route - The route to the desired GenericWizardState.
Returns:
The desired WizardState.
 o getRoute
 public abstract Route getRoute(Route routeInProgress)
Get the server side route for this WizardState.

Parameters:
routeInProgress - This method should be called with routeInProgress = null.
Returns:
The route for this WizardState.
 o getChildStateRoute
 public abstract Route getChildStateRoute(Route route,
                                          String childName)
Get the route for a child WizardState.

Parameters:
route - The route to the parent of the desired WizardState.
childName - The name of the desired child.
Returns:
The route to the desired WizardState.
 o getChildWizardState
 public abstract WizardState getChildWizardState(Route route,
                                                 String name)
This method returns the named child WizardState.

Parameters:
route - The route to the parent WizardState.
name - The name of the desired WizardState.
Returns:
The desired WizardState, or null if the named WizardState does not exist.
 o removeChildWizardState
 public abstract void removeChildWizardState(String name)
This method removes the named child.

Parameters:
name - The name of the WizardState child to remove.
 o getChildObject
 public abstract Object getChildObject(String name)
This method returns the named child object of this WizardState.

Parameters:
name - The name of the desired WizardState.
Returns:
The desired WizardState, or null if the named WizardState does not exist.
 o getArchivePath
 public abstract String getArchivePath()
This method returns path to the class archive containing this state.

Returns:
Path to the class archive containing this state
 o getArchiveFilename
 public abstract String getArchiveFilename()
Get the archive filename.

Returns:
The filename of this archive, including the path.
 o getAllChildrenRoutes
 public abstract Route[] getAllChildrenRoutes()
Returns routes to all wizard states that are children of this wizard state.

 o getSelectedChildrenRoutes
 public abstract Route[] getSelectedChildrenRoutes(String purpose)
Returns routes to selected wizards that are children of this wizard and having the specified purpose.

Parameters:
purpose - The purpose of the desired WizardStates.
 o getSerializedData
 public abstract byte[] getSerializedData()
Get the data that represents a serialized version of this WizardState.

Returns:
The byte array representing the serialization of this WizardState.
 o getInitializeStatus
 public abstract int getInitializeStatus()
Returns the initialize status. The value returned is a mask that reports the completion status of the various stages of WizardState initialization.

 o setWizardState
 public abstract void setWizardState(DataInput in)
Set up this WizardState from the specified input stream.

Parameters:
in - The input stream describing the desired state of this WizardState.
 o addChild
 public abstract void addChild(String relativePath)
Add a child description to the wizard archive. At execution time, if the child is found at the specified relative path, it will be available to the server and client associated with this wizard.

Parameters:
relativePath - The relative path to the child archive.
 o addChildObject
 public abstract void addChildObject(String name,
                                     ServerObject childObject)
Add a child object to this WizardState. The child object MUST be Serializable.

Parameters:
name - The name of the object.
childObject - The object to add as a child to this WizardState.
 o getChildren
 public abstract Vector getChildren()
Get all child states.

Returns:
All children of this wizard state.
 o setChildren
 public abstract void setChildren(Vector childWizardStates)
Set all child states.

Parameters:
childWizardStates - All children of this wizard state.
 o getWizardTree
 public abstract byte[] getWizardTree(Route route,
                                      String subtreeName)
Get the data representing a client subtree.

Parameters:
route - The route to the responsible WizardState.
subtreeName - The name of the subtree, or null for the entire client tree.
Returns:
The data representing the client tree.
 o getNamedResource
 public abstract byte[] getNamedResource(Route route,
                                         String type,
                                         String name)
This method returns the bytes of the named resource of the specified type.

Parameters:
route - The route to the correct WizardState.
type - The type of resource.
name - The name of the resource.
Returns:
The byte array representing the requested resource.
 o getNamedResourceStream
 public abstract ResourceSection getNamedResourceStream(String name)
Get the archive stream associated with the specified name.

Parameters:
name - The name of the desired resource.
Returns:
An object representing the desired resource section.
 o closeNamedResourceStream
 public abstract void closeNamedResourceStream(String name)
Close the archive stream associated with the specified name.

Parameters:
name - The name of the resource used to open the stream.
 o addSequence
 public abstract void addSequence(String sequenceName,
                                  Sequence sequence)
Add a named sequence of server-side tasks to the WizardState.

Parameters:
sequenceName - The name that will be used to reference this sequence at runtime.
sequence - The sequence of tasks that will be performed at runtime.
 o getSequence
 public abstract Sequence getSequence(String sequenceName)
Get a named sequence of server-side tasks from the WizardState.

Parameters:
sequenceName - The name of the desired sequence.
Returns:
The desired sequence, or null if the sequence has not been added to this WizardState.
 o performSequence
 public abstract void performSequence(Route route,
                                      String sequenceName,
                                      boolean waitForCompletion,
                                      String sequenceCompleteMethod)
Perform the specified sequence of tasks. Unless the waitForCompletion flag is set to true, this method will return immediately.

Parameters:
route - The route back to the client object that monitors the sequence.
sequenceName - The name of the sequence to perform.
waitForCompletion - If true, this method will not return until the sequence has completed.
sequenceCompleteMethod - The name of the client panel method that should be called when the sequence has completed.
 o reverseSequence
 public abstract void reverseSequence(Route route,
                                      String sequenceName,
                                      boolean waitForCompletion,
                                      String sequenceCompleteMethod)
Reverse the specified sequence of tasks. Unless the waitForCompletion flag is set to true, this method will return immediately.

Parameters:
route - The route back to the client object that monitors the sequence.
sequenceName - The name of the sequence to reverse.
waitForCompletion - If true, this method will not return until the sequence has completed.
sequenceCompleteMethod - The name of the client panel method that should be called when the sequence has completed.
 o setSequenceProgress
 public abstract void setSequenceProgress(Route sequenceRoute,
                                          int progress)
Set the progress of the current sequence.

Parameters:
sequenceRoute - The route to the calling object.
progress - The progress of the current sequence.
 o setSequenceProgress
 public abstract void setSequenceProgress(WizardState childState,
                                          String purpose,
                                          Route progressRoute,
                                          int progress[])
Propogate the progress up to the highest level WizardState that has the specified purpose.

Parameters:
childState - The child WizardState object.
purpose - The WizardState purpose.
route - The route to the progress panel.
progress - The progress, measured from 0 to 100.
 o suspendSequence
 public abstract void suspendSequence()
Suspend the sequence that is currently being performed or reversed.

 o resumeSequence
 public abstract void resumeSequence()
Resume the sequence that is currently being performed or reversed.

 o registerTempFile
 public abstract void registerTempFile(String filename)
Register a temporary file that will be removed when the wizard exits.

Parameters:
filename - The absolute path to the file to be removed.
 o removeTempFile
 public abstract void removeTempFile(String filename)
Remove the specified temporary file now.

Parameters:
filename - The absolute path to the temporary file to be removed.
 o getRuntimeResources
 public abstract Vector getRuntimeResources()
Get the runtime classes required by this WizardState.

 o callClientObjectMethod
 public abstract void callClientObjectMethod(Route route,
                                             String methodName,
                                             String argTypes[],
                                             Object args[])
Call a method on the client. The method is sent to the correct object in the Wizard client tree via the specified route object. If the route is null, the method is called on the WizardTreeManager, which manages the client objects.

Parameters:
route - The route to the desired client object.
methodName - The name of the method to call.
argTypes - The parameter list identifying the correct method.
args - The parameters to pass to the method.
 o callServerObjectMethod
 public abstract Object callServerObjectMethod(Route route,
                                               String methodName,
                                               String argTypes[],
                                               Object args[])
Call a method on the server. The method is sent to the correct object in the Wizard state tree via the specified route object.

Parameters:
route - The route to the desired server object.
methodName - The name of the method to call.
argTypes - The parameter list identifying the correct method.
args - The parameters to pass to the method.
Returns:
The method return value.
 o getRegistryService
 public abstract RegistryService getRegistryService()
Get the registry service.

 o getLogService
 public abstract LogService getLogService()
Get the log service.

 o getDesktopService
 public abstract DesktopService getDesktopService()
Get the Desktop service.


All Packages  Class Hierarchy  This Package  Previous  Next  Index