gov.sandia.ccaffeine.dc.user_iface.ccacmd
Class CmdActionCCA

java.lang.Object
  extended by gov.sandia.ccaffeine.dc.user_iface.ccacmd.CmdActionCCA
All Implemented Interfaces:
CmdAction
Direct Known Subclasses:
CmdActionCCAArena, CmdActionCCAConfig, CmdActionCCAConnect, CmdActionCCADebug, CmdActionCCADisconnect, CmdActionCCADisplay, CmdActionCCAGo, CmdActionCCAInstantiate, CmdActionCCALinks, CmdActionCCANoDebug, CmdActionCCANuke, CmdActionCCAPallet, CmdActionCCAPath, CmdActionCCAPortProperties, CmdActionCCAProperties, CmdActionCCARemove, CmdActionCCARepository, CmdActionCCAShell

public abstract class CmdActionCCA
extends java.lang.Object
implements CmdAction

Used by the parser to parse String commands from the cca server. The results of a parse are sent to all registered AccessServerListeners.


Constructor Summary
CmdActionCCA()
           
 
Method Summary
 void addGuiListener(GuiListener listener)
          Add a new GuiListener.
 void broadcastComponentProperties(ComponentPropertiesEvent event)
          The client wants the cca server either to get the value of or to set the value of a specific property that is contained inside a specific component.
 void broadcastComponentProperties(int numberOfArguments, java.lang.String componentInstanceName, java.lang.String propertyName, java.lang.String propertyValue)
          The client wants the cca server either to get or to set the value of a specific property that is contained inside a specific component.
 void broadcastConnect(ConnectEvent event)
          The client wants the cca server to connect two ports.
 void broadcastConnect(java.lang.String sourceComponentName, java.lang.String sourcePortName, java.lang.String targetComponentName, java.lang.String targetPortName)
          The client wants the cca server to connect two ports.
 void broadcastDisconnect(DisconnectEvent event)
          The client wants the cca server to break the connection that exists between two ports.
 void broadcastDisconnect(java.lang.String sourceComponentName, java.lang.String sourcePortName, java.lang.String targetComponentName, java.lang.String targetPortName)
          The client wants the cca server to break the connection that exists between two ports.
 void broadcastDisplay(DisplayEvent event)
          The client wants the cca server to retrieve some information.
 void broadcastDisplay(int numberOfArguments, java.lang.String entity, java.lang.String componentInstanceName)
          The client wants the cca server to retrieve some information.
 void broadcastDisplayPalette()
          The client wants the cca server to retrieve information on every component that is inside the palette.
 void broadcastDisplayPalette(DisplayPaletteEvent event)
          The client wants the cca server to retrieve information on every component that is inside the palette.
 void broadcastGetAllInstancesInArena()
          The client wants the cca server to retrieve information on all components that are inside the arena.
 void broadcastGetAllInstancesInArena(GetInstancesEvent event)
          The client wants the cca server to retrieve information on all components that are inside the arena.
 void broadcastGo(GoEvent event)
          The client wants the cca server to lanuch the applicaton.
 void broadcastGo(int numberOfArguments, java.lang.String componentInstanceName, java.lang.String portInstanceName)
          The client wants the cca server to lanuch the applicaton.
 void broadcastInstantiateComponent(InstantiateEvent event)
          The client wants the cca server to instantatiate a component.
 void broadcastInstantiateComponent(java.lang.String className, java.lang.String instanceName)
          The client wants the cca server to instantatiate a component.
 void broadcastLinks()
          The client wants the cca server to retrieve information on every connection that is inside the arena.
 void broadcastLinks(DisplayChainEvent event)
          The client wants the cca server to retrieve information on every connection that is inside the arena.
 void broadcastNukeAll(int numberOfArguments, java.lang.String entity)
          The client wants the cca server to destroy all of the instantiated components (i.e.
 void broadcastNukeAll(NukeAllEvent event)
          The client wants the cca server to destroy all of the instantiated components (i.e.
 void broadcastPath(int numberOfArguments, java.lang.String commandToAlterPath, java.lang.String directory)
          The client wants either to tell the cca server the name of the folder that contains cca component or to ask the cca server to retrieve the name of the folder.
 void broadcastPath(PathEvent event)
          The client wants either to tell the cca server the name of the folder that contains cca component or to ask the cca server to retrieve the name of the folder.
 void broadcastPortParam(int numberOfArguments, java.lang.String componentInstanceName, java.lang.String portInstanceName, java.lang.String dataFieldName, java.lang.String dataFieldValue)
          The client wants the cca server either to retrieve or to set the value of one of the parameters that are inside a port.
 void broadcastPortParam(ParamEvent event)
          The client wants the cca server either to retrieve or to set the value of one of the parameters that are inside a port.
 void broadcastPortProperties(int numberOfArguments, java.lang.String componentInstanceName, java.lang.String portName, java.lang.String propertyName, java.lang.String dataTypeOfPropertyValue, java.lang.String propertyValue)
          The client wants the cca server either to get or to set the value of one of the parameters that are inside a port.
 void broadcastPortProperties(PortPropertiesEvent event)
          The client wants the cca server to set the value of one of the parameters that are inside a port.
 void broadcastRemove(java.lang.String componentInstanceName)
          The client wants the cca server to remove an instantiation of a cca component.
protected  void broadcastRemoveEvent(RemoveEvent event)
          The client wants the cca server to remove an instantiation of a cca component.
 void broadcastRepository(int numberOfArguments, java.lang.String command, java.lang.String className)
          The client wants the cca server either to send informaton on every component that is inside the repository or to send information on one specific component that is inside the repository.
 void broadcastRepository(RepositoryEvent event)
          The client wants the cca server either to send informaton on every component that is inside the repository or to send information on one specific component that is inside the repository.
 void broadcastSetDebug()
          The client wants the cca server to print debugging statements.
 void broadcastSetDebug(SetDebugEvent event)
          The client wants the cca server to print debugging statements.
 void broadcastSetNoDebug()
          The client wants the cca server to stop printing debugging statements.
 void broadcastSetNoDebug(SetDebugEvent event)
          The client wants the cca server to stop printing debugging statements.
 void broadcastShell(int numberOfArguments, java.lang.String command)
          The client wants the cca server to execute a specific command.
 void broadcastShell(ShellEvent event)
          The client wants the cca server to execute a specific command.
 void removeGuiListener(GuiListener listener)
          Remove an GuiListener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.ccaffeine.cmd.CmdAction
argtype, doIt, help, names
 

Constructor Detail

CmdActionCCA

public CmdActionCCA()
Method Detail

addGuiListener

public void addGuiListener(GuiListener listener)
Add a new GuiListener. GuiListeners are notified whenever someone wants to access the server.

Parameters:
listener - The new GuiListener

removeGuiListener

public void removeGuiListener(GuiListener listener)
Remove an GuiListener. The input GuiListener is no longer notified whenever someone accesses the server.

Parameters:
listener - The AccesServerListener that no lonter wants to be notified whenever someone accesses the server.

broadcastGetAllInstancesInArena

public void broadcastGetAllInstancesInArena()
The client wants the cca server to retrieve information on all components that are inside the arena. The client's view will respond by sending an "instances" command to the cca server.


broadcastGetAllInstancesInArena

public void broadcastGetAllInstancesInArena(GetInstancesEvent event)
The client wants the cca server to retrieve information on all components that are inside the arena. The client's view will respond by sending an "instances" command to the cca server.

Parameters:
event - The event that is generated whenever the GUI wants to get information on all of the instantiated components.

broadcastPortParam

public void broadcastPortParam(int numberOfArguments,
                               java.lang.String componentInstanceName,
                               java.lang.String portInstanceName,
                               java.lang.String dataFieldName,
                               java.lang.String dataFieldValue)
The client wants the cca server either to retrieve or to set the value of one of the parameters that are inside a port. A client's view will respond by sending a "configure" or a "parameters" command to the cca server.

Cca components contain ports. Some of the ports contain data fields. This event can be used to notify components that an entity is either sending the value of one of these data fields or is querying for the value of one of these data fields.

Parameters:
numberOfArguments - If we are tying to get the value of a parameter then we need 3 arguments (instanceName, portName, parameterName). If we are trying to set the value of a parameter then we need 4 or more arguments
componentInstanceName - The name of the cca component that contains the port. The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "TimeStamper0"
portInstanceName - The name of a port that contains the parameter. Example: "configure_port"
dataFieldName - The name of the parameter. Tell all GuiListeners that we want to either get or set the value of a parameter.
dataFieldValue - If we are setting the value of a data field then we need to know what that value is. Can be set to null;

broadcastPortParam

public void broadcastPortParam(ParamEvent event)
The client wants the cca server either to retrieve or to set the value of one of the parameters that are inside a port. A client's view will respond by sending a "configure" or a "parameters" command to the cca server.

Cca components contain ports. Some of the ports contain data fields. This event can be used to notify components that an entity is either sending the value of one of these data fields or is querying for the value of one of these data fields.

Parameters:
event - The event that is generated whenever the GUI wants either to set the value of a port parameter or to query for the value of a port parameter.

broadcastConnect

public void broadcastConnect(java.lang.String sourceComponentName,
                             java.lang.String sourcePortName,
                             java.lang.String targetComponentName,
                             java.lang.String targetPortName)
The client wants the cca server to connect two ports. The two ports may be on different components or may be on the same component. The client's view will respond by sending a "connect" command to the cca server.

Parameters:
sourceComponentName - The name of the component that houses the source port. The "source" is the entity that is requesting the connection. The "source" is to be connected to the "target." The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "StartComponent0"
sourcePortName - The name of the source port. The "source" is the entity that is requesting the connection. The "source" is to be connected to the "target." Example: "out0"
targetComponentName - The name of the component that houses the target port. The "target" is the entity that receives the connection request. The "source" is to be connected to the "target." The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "PrinterComponent0"
targetPortName - the name of the target port. The "target" is the entity that receives the connection request. The "source" is to be connected to the "target." Example: "out0"

broadcastConnect

public void broadcastConnect(ConnectEvent event)
The client wants the cca server to connect two ports. The two ports may be on different components or may be on the same component. The client's view will respond by sending a "connect" command to the cca server.

Parameters:
The - event that is generated whenever the GUI wants to connect a ProvidesPort to a UsesPort.

broadcastSetDebug

public void broadcastSetDebug()
The client wants the cca server to print debugging statements. A client's view will respond by sending a "debug" or "noisy" command to the cca server.


broadcastSetDebug

public void broadcastSetDebug(SetDebugEvent event)
The client wants the cca server to print debugging statements. A client's view will respond by sending a "debug" or "noisy" command to the cca server.


broadcastDisconnect

public void broadcastDisconnect(java.lang.String sourceComponentName,
                                java.lang.String sourcePortName,
                                java.lang.String targetComponentName,
                                java.lang.String targetPortName)
The client wants the cca server to break the connection that exists between two ports. The client's view will respond by sending a "disconnect" command to the cca server.

Parameters:
sourceComponentName - The name of the component that houses the source port. The "source" is the entity that originally requested the connection. The "source" is connected to the "target." The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "StartComponent0"
sourcePortName - The name of the source port. The "source" is the entity that originally requested the connection. The "source" is connected to the "target." Example: "out0"
targetComponentName - The name of the component that houses the target port. The "target" is the entity that originally received the connection request. The "source" is to be connected to the "target." The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "PrinterComponent0"
targetPortName - the name of the target port. The "target" is the entity that originally received the connection request. The "source" is connected to the "target." Example: "out0"

broadcastDisconnect

public void broadcastDisconnect(DisconnectEvent event)
The client wants the cca server to break the connection that exists between two ports. The client's view will respond by sending a "disconnect" command to the cca server.

Parameters:
The - event that is generated whenever the GUI wants to disconnect the connection between a ProvidesPort and a UsesPort.

broadcastDisplay

public void broadcastDisplay(int numberOfArguments,
                             java.lang.String entity,
                             java.lang.String componentInstanceName)
The client wants the cca server to retrieve some information. The client's view will respond by sending one of the following commands to the cca server:
    display palette
    display arena
    display chain
    display component
    display state

The cca server will respond to a "display palette" command by retrieving information on every component that is inside the palette.

The cca server will respond to a "display arena" command by retrieving information on every component that is inside the arena.

The cca server will respond to a "display chain" command by retrieving information on every connection that is inside the arena. A connection connects a "uses" port with a "provides" port.

The cca server will respond to a "display component" command by retrieving information on a specific component.

The cca server will respond to a "display state" command by retrieving information on every component and on every connection that is inside the arena.

Parameters:
source - The entity that created this event.
entity - We are requesting info on which entity? We can request info on the PALETTE, ARENA, CHAIN, COMPONENT, STATE.
componentInstanceName - If an entity wants some info on a particular component, then that entity has to supply the name of the component. The instance name is usually the name of the component's java class (without the package name) concatenated with an index number. EXAMPLE: "StarterComponent0" Can be set to null.

broadcastDisplay

public void broadcastDisplay(DisplayEvent event)
The client wants the cca server to retrieve some information. The client's view will respond by sending one of the following commands to the cca server:
    display palette
    display arena
    display chain
    display component
    display state

The cca server will respond to a "display palette" command by retrieving information on every component that is inside the palette.

The cca server will respond to a "display arena" command by retrieving information on every component that is inside the arena.

The cca server will respond to a "display chain" command by retrieving information on every connection that is inside the arena. A connection connects a "uses" port with a "provides" port.

The cca server will respond to a "display component" command by retrieving information on a specific component.

The cca server will respond to a "display state" command by retrieving information on every component and on every connection that is inside the arena.

Parameters:
source - The entity that created this event.
entity - We are requesting info on which entity? We can request info on the PALETTE, ARENA, CHAIN, COMPONENT, STATE.
DisplayEvent - The event that is generated whenever the GUI is requesting some information from the server.

broadcastGo

public void broadcastGo(int numberOfArguments,
                        java.lang.String componentInstanceName,
                        java.lang.String portInstanceName)
The client wants the cca server to lanuch the applicaton. The client's view will send a "run" command to the cca server.

Parameters:
numberOfArguments - the number of arguments in the "go" command.
componentInstanceName - To call "go" on a specific component, pass in the name of the component. The instance name is usually the name of the component's java class (without the package name) concatenated with an index number. EXAMPLE: "StarterComponent0". Can be null.
portInstanceName - To call"go" on a specific "go" port on a specific component then, pass in the name of the "go" port. Can be null.

broadcastGo

public void broadcastGo(GoEvent event)
The client wants the cca server to lanuch the applicaton. The client's view will send a "run" command to the cca server.

Parameters:
event - The event that is created whenever the GUI wants the cca server to launch the application.

broadcastInstantiateComponent

public void broadcastInstantiateComponent(java.lang.String className,
                                          java.lang.String instanceName)
The client wants the cca server to instantatiate a component. The client's view will respond by sending a "pull down" command to the cca server.

Parameters:
className - The name of the component's class. The name is actually the name of the component's java class. EXAMPLE: "gov.sandia.ccaffeine.dc.component.PrinterComponent"
instanceName - The name of the cca component object. The instance name is usually the name of the component's java class (without the package name) concatenated with an index number. EXAMPLE: "StarterComponent0"

broadcastInstantiateComponent

public void broadcastInstantiateComponent(InstantiateEvent event)
The client wants the cca server to instantatiate a component. The client's view will respond by sending a "pull down" command to the cca server.

Parameters:
The - event that is generated whenever the GUI is requesting that a component be instantiated.

broadcastLinks

public void broadcastLinks()
The client wants the cca server to retrieve information on every connection that is inside the arena. A connection connects a "uses" port with a "provides" port. A client's view will respond by sending a "links" command to the cca server.


broadcastLinks

public void broadcastLinks(DisplayChainEvent event)
The client wants the cca server to retrieve information on every connection that is inside the arena. A connection connects a "uses" port with a "provides" port. A client's view will respond by sending a "links" command to the cca server.

Parameters:
event - The event that is created whenever the GUI wants to know what connections are in the arena.

broadcastSetNoDebug

public void broadcastSetNoDebug()
The client wants the cca server to stop printing debugging statements. A client's view will respond by sending a "nodebug" or "quiet" command to the cca server.


broadcastSetNoDebug

public void broadcastSetNoDebug(SetDebugEvent event)
The client wants the cca server to stop printing debugging statements. A client's view will respond by sending a "nodebug" or "quiet" command to the cca server.


broadcastRemove

public void broadcastRemove(java.lang.String componentInstanceName)
The client wants the cca server to remove an instantiation of a cca component. The client's view will respond by sending a "remove" command to the cca server.

Parameters:
componentInstanceName - The name of the component that was removed. The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "StartComponent0"

broadcastRemoveEvent

protected void broadcastRemoveEvent(RemoveEvent event)
The client wants the cca server to remove an instantiation of a cca component. The client's view will respond by sending a "remove" command to the cca server.

Parameters:
event - The event that is generated whenever the GUI is requesting that a component be removed.

broadcastNukeAll

public void broadcastNukeAll(int numberOfArguments,
                             java.lang.String entity)
The client wants the cca server to destroy all of the instantiated components (i.e. all of the components that are in the arena). A client's view will respond by sending a "nuke all" command to the cca server.

Parameters:
numberOfArguments - The number of arguments in the nuke command.
entity - The entity that is to be removed. NOTE: As of Oct 2003, "all" is the only entity that can be nuked.

broadcastNukeAll

public void broadcastNukeAll(NukeAllEvent event)
The client wants the cca server to destroy all of the instantiated components (i.e. all of the components that are in the arena). A client's view will respond by sending a "nuke all" command to the cca server. param event The event that is created when the GUI wants to to delete all components.


broadcastDisplayPalette

public void broadcastDisplayPalette()
The client wants the cca server to retrieve information on every component that is inside the palette. A client's view will respond by sending a "display palette" command to the cca server.


broadcastDisplayPalette

public void broadcastDisplayPalette(DisplayPaletteEvent event)
The client wants the cca server to retrieve information on every component that is inside the palette. A client's view will respond by sending a "display palette" command to the cca server.

Parameters:
event - The event that is generated whenever the GUI wants to know what components are in the palette.

broadcastPath

public void broadcastPath(int numberOfArguments,
                          java.lang.String commandToAlterPath,
                          java.lang.String directory)
The client wants either to tell the cca server the name of the folder that contains cca component or to ask the cca server to retrieve the name of the folder. A client's view will respond by sending a "path" command to the cca server.

Parameters:
numberOfArguments - The number of arguments in the path command.
commandToAlterPath - To alter the path, specify how the path is to be chagned by issuing any of the following commands: INIT, APPEND, PREPEND, SET. Can be set to null.
directory - To alter the path, specify the value of the new path. Can be set to null.

broadcastPath

public void broadcastPath(PathEvent event)
The client wants either to tell the cca server the name of the folder that contains cca component or to ask the cca server to retrieve the name of the folder. A client's view will respond by sending a "path" command to the cca server.

Parameters:
event - The event that is generated whenever the GUI wants the cca server either to set the path to a new value or to query for the path value.

broadcastPortProperties

public void broadcastPortProperties(int numberOfArguments,
                                    java.lang.String componentInstanceName,
                                    java.lang.String portName,
                                    java.lang.String propertyName,
                                    java.lang.String dataTypeOfPropertyValue,
                                    java.lang.String propertyValue)
The client wants the cca server either to get or to set the value of one of the parameters that are inside a port. A client's view will respond by sending a "port-parameters" command to the cca server.

Parameters:
numberOfArguments - The number of arguments in the "port-properties" command.
componentInstanceName - The name of the component that contains the property. The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "StartComponent0"
portName - The name of the port that contains the property.
propertyName - If we want to get or set the value of a specific port property, then we need the name of the property.
dataTypeOfPropertyValue - If we are setting the value of a specific port property, then we need the datatype of the property value.
propertyValue - If we are setting the value of a specific port property, then we need the value of the property.

broadcastPortProperties

public void broadcastPortProperties(PortPropertiesEvent event)
The client wants the cca server to set the value of one of the parameters that are inside a port. A client's view will respond by sending a "port-properties" command to the cca server.

Parameters:
The - event that is generated whenever the GUI wants to set the value of a port parameter.

broadcastComponentProperties

public void broadcastComponentProperties(int numberOfArguments,
                                         java.lang.String componentInstanceName,
                                         java.lang.String propertyName,
                                         java.lang.String propertyValue)
The client wants the cca server either to get or to set the value of a specific property that is contained inside a specific component. A client's view will respond by sending a "property" or a "set property" command to the cca server.

Parameters:
numberOfArguments - The number of arguments in the "properties" command.
componentInstanceName - The name of the component that contains the property The name is usually the java class name of the component (without the package name) concatenated with an index number. Example: "StartComponent0"
propertyName - If we want to get or set the value of a specific port property, then we need the name of the property.
propertyValue - If we are setting the value of a specific port property, then we need the value of the property.

broadcastComponentProperties

public void broadcastComponentProperties(ComponentPropertiesEvent event)
The client wants the cca server either to get the value of or to set the value of a specific property that is contained inside a specific component. A client's view will respond by sending a "property" or a "set property" command to the cca server.

Parameters:
event - The event that is generated whenever the GUI wants to either get or set the value of a component property.

broadcastRepository

public void broadcastRepository(int numberOfArguments,
                                java.lang.String command,
                                java.lang.String className)
The client wants the cca server either to send informaton on every component that is inside the repository or to send information on one specific component that is inside the repository. The client's view will respond by sending a "repository" command to the cca server.

Parameters:
source - The entity that created this event.
numberOfArguments - The number of arguments in the command line.
command - the command. The command can be one of the following values: LIST, GET, GET_GLOBAL, GET_LAZY, GET_LAZY_GLOBAL
className - If we are retrieving the value of one class, then we need the name of the class.

broadcastRepository

public void broadcastRepository(RepositoryEvent event)
The client wants the cca server either to send informaton on every component that is inside the repository or to send information on one specific component that is inside the repository. The client's view will respond by sending a "repository" command to the cca server.

Parameters:
event - The event that is created whenever the GUI wants to get one component or all components from the repository,

broadcastShell

public void broadcastShell(int numberOfArguments,
                           java.lang.String command)
The client wants the cca server to execute a specific command. The client's view will respond by sending a "shell" command to the cca server.

Parameters:
numberOfArguments - The number of arguments in the "shell" command.
command - The command that is to be executed.

broadcastShell

public void broadcastShell(ShellEvent event)
The client wants the cca server to execute a specific command. The client's view will respond by sending a "shell" command to the cca server.

Parameters:
event - The event that is created whenever the GUI wants an O.S. command executed.