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

java.lang.Object
  extended by gov.sandia.ccaffeine.dc.user_iface.ccacmd.Server
All Implemented Interfaces:
GuiListener, java.util.EventListener

public class Server
extends java.lang.Object
implements GuiListener

Interface to Server


Constructor Summary
Server(CmdContextCCA cmdContextCCA)
           
 
Method Summary
 void componentProperties(ComponentPropertiesEvent event)
          The GUI is requesting the cca server to send back or to set the value of a component property.
 void componentProperties(int numberOfArguments, java.lang.String componentInstanceName, java.lang.String propertyName, java.lang.String propertyValue)
          Retrieve the value of a component property or set the value of a component property.
 void connect(ConnectEvent event)
          The GUI is asking the cca server to connect the Provides Port of a cca component to a Uses Port.
 void disconnect(DisconnectEvent event)
          The GUI is asking the cca server to disconnect the connection between a Provides Port of a cca component and a Uses Port.
 void display(DisplayEvent event)
          The GUI is requesting some information from the cca server.
 void displayComponent(DisplayComponentEvent event)
          The GUI is requesting the cca server to send back a cca component.
 void displayPalette(DisplayPaletteEvent event)
          The GUI is requesting the cca server to send back all of the components that are in the palette.
 void displayState(DisplayStateEvent event)
          The GUI is requesting the cca server to send back all components that are in the arena and to send back all connections.
 void exit(ExitEvent event)
          The GUI wants to tell the cca server that the GUI is shutting down.
 void getAllInstancesInArena(GetInstancesEvent event)
          The GUI is asking the cca server to send back all of the instantiated cca components.
 void getComponentProperty(GetComponentPropertyEvent event)
          The GUI is requesting the cca server to send back the value of a property that is inside a cca component.
 void getPortParameter(ParamGetCurrentEvent event)
          The GUI is asking the cca server to send back the value of one of the parameters of a port that is on a cca component.
 void go(GoEvent event)
          The GUI wants the cca server to launch an application.
 void go(int numberOfArguments, java.lang.String componentInstanceName, java.lang.String portInstanceName)
          Launch the application.
 void goComponentPort(GoComponentPortEvent event)
          The GUI is requesting that the cca server execute the "go" command" on a specific port that is located on a specific component.
 void heartbeat(HeartbeatEvent event)
          The GUI wants to send a heartbeat to the cca server.
 void instantiate(InstantiateEvent event)
          The GUI is asking the cca server to retrieve a cca component.
 void links(DisplayChainEvent event)
          The GUI is requesting the cca server to send back all connections.
 void nukeAll(NukeAllEvent event)
          The GUI is requesting the cca server to delete all components.
 void path(PathEvent event)
          The GUI wants to tell the cca server to send back or to set the file path that contains cca components.
 void portParameter(int numberOfArguments, java.lang.String componentInstanceName, java.lang.String portInstanceName, java.lang.String dataFieldName, java.lang.String dataFieldValue)
          Cca components contain ports.
 void portParameter(ParamEvent event)
          The GUI is asking the cca server to get or set one of the parameters of a port that is on a cca port.
 void portProperties(PortPropertiesEvent event)
          The GUI is requesting the cca server to send back or to set the value of a port property.
 void remove(RemoveEvent event)
          The GUI wants the cca server to remove an instantiation of a cca component.
 void repository(RepositoryEvent event)
          The GUI wants the cca server to send back all components that are in the repository or to send back one specific compnonent that is in the repository.
 void sendMessage(StringEvent event)
          The GUI wants to send a message to the cca server.
 void setComponentProperty(SetComponentPropertyEvent event)
          The GUI wants the server to set the value of a property that is inside of a cca component.
 void setDebug(SetDebugEvent event)
          The GUI is asking the cca server to turn on debugging.
 void setNoDebug(SetDebugEvent event)
          The GUI is asking the cca server to turn off debugging
 void setPortParameter(ParamCurrentEvent event)
          The GUI is asking the cca server to set one of the parameters of a port that is on a cca component.
 void shell(ShellEvent event)
          The GUI wants to send an O.S.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Server

public Server(CmdContextCCA cmdContextCCA)
Method Detail

remove

public void remove(RemoveEvent event)
The GUI wants the cca server to remove an instantiation of a cca component.

Specified by:
remove in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to remove an instantiation of a cca component.

go

public void go(GoEvent event)
The GUI wants the cca server to launch an application.

Specified by:
go in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to launch the application.

go

public void go(int numberOfArguments,
               java.lang.String componentInstanceName,
               java.lang.String portInstanceName)
Launch the application.

Parameters:
numberOfArguments - the number of arguments in the "go" command.
componentInstanceName - ITo 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, pass in the name of the "go" port. Can be null.

instantiate

public void instantiate(InstantiateEvent event)
The GUI is asking the cca server to retrieve a cca component.

Specified by:
instantiate in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to retrieve a cca component.

connect

public void connect(ConnectEvent event)
The GUI is asking the cca server to connect the Provides Port of a cca component to a Uses Port. The Uses Port may be one the same component or may be on a different component.

Specified by:
connect in interface GuiListener
Parameters:
event - The event that is sent whenever the GUI wants to connect a Uses Port with a Provides Port.

disconnect

public void disconnect(DisconnectEvent event)
The GUI is asking the cca server to disconnect the connection between a Provides Port of a cca component and a Uses Port.

Specified by:
disconnect in interface GuiListener
Parameters:
event - The event that is sent whenever the GUI wants to connect a Uses Port with a Provides Port.

setPortParameter

public void setPortParameter(ParamCurrentEvent event)
The GUI is asking the cca server to set one of the parameters of a port that is on a cca component.

Specified by:
setPortParameter in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to set the value of a data field.

getPortParameter

public void getPortParameter(ParamGetCurrentEvent event)
The GUI is asking the cca server to send back the value of one of the parameters of a port that is on a cca component.

Specified by:
getPortParameter in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants the value of one of the data fields.

portParameter

public void portParameter(ParamEvent event)
The GUI is asking the cca server to get or set one of the parameters of a port that is on a cca port.

Specified by:
portParameter in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to get or set the value of one of the data fields.

portParameter

public void portParameter(int numberOfArguments,
                          java.lang.String componentInstanceName,
                          java.lang.String portInstanceName,
                          java.lang.String dataFieldName,
                          java.lang.String dataFieldValue)
Cca components contain ports. Some of the ports contain data fields. Get or set the value of one of the 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 which contains the data field. 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 data field. Example: "configure_port"
dataFieldName - The name of the data field.
dataFieldValue - If an entity is setting the value of a data field then we need to know what that value is. Can be set to null;

getAllInstancesInArena

public void getAllInstancesInArena(GetInstancesEvent event)
The GUI is asking the cca server to send back all of the instantiated cca components.

Specified by:
getAllInstancesInArena in interface GuiListener
Parameters:
event - That event that is generated whenever the GUI wants to get all of the instantiated cca components.

setDebug

public void setDebug(SetDebugEvent event)
The GUI is asking the cca server to turn on debugging.

Specified by:
setDebug in interface GuiListener

setNoDebug

public void setNoDebug(SetDebugEvent event)
The GUI is asking the cca server to turn off debugging

Specified by:
setNoDebug in interface GuiListener

display

public void display(DisplayEvent event)
The GUI is requesting some information from the cca server. The GUI can request the following info:
    display palette
    display arena
    display chain
    display component
    display state

If the GUI sends the server a "draw palette" request, the server will send back all of the cca classes that are in the palette. The GUI can respond by rendering an icon, in the palette, for each cca class.

If the GUI sends the server a "draw arena" request, the server will send back all of the cca instances that are in the work area. The GUI can respond by rendering an icon, in the work area, for each cca instance.

If the GUI sends the server a "draw chain" request, the server will send back a connection, or a line, that connects two different ports; the two ports may be on the same cca component or may be on different components. The GUI can respond by drawing a line between the two ports.

If the GUI sends the server a "draw component" request, the server will send back one instantiated component. The GUI can respond by rendering the component in the work area.

If the GUI sends the server a "draw state" request, the server will send back all of the components that are in the work area and will send back all of the connections that are attached to two ports. The GUI can respond by rendering the components and the connections in the work area.

Specified by:
display in interface GuiListener
Parameters:
DisplayEvent - The event that is generated whenever an entity is requesting some information from the server.

displayPalette

public void displayPalette(DisplayPaletteEvent event)
The GUI is requesting the cca server to send back all of the components that are in the palette. A palette is a menu of cca components; the end-user can drag components from the palette to the arena (workspace).

The cca server will send back all of the components that are in the palette. A GUI might respond by rending an icon, in the palette, for each component.

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

links

public void links(DisplayChainEvent event)
The GUI is requesting the cca server to send back all connections. A connection connects a user port of a component to a provider port; the two ports may be on the same cca component or may be on different components.

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

displayComponent

public void displayComponent(DisplayComponentEvent event)
The GUI is requesting the cca server to send back a cca component.

The cca server will respond by sending back one cca component. The GUI might respond by rendering the component in the workspace.

Specified by:
displayComponent in interface GuiListener
Parameters:
source - The entity that created this event.
componentInstanceName - 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"
event - The event that is created whenever the GUI wants some information on a cca component.

displayState

public void displayState(DisplayStateEvent event)
The GUI is requesting the cca server to send back all components that are in the arena and to send back all connections. A connection connects a user port of a component with a provider port; the two ports may be on the same cca component or may be on different components.

The cca server will respond by sending back all of the components that are in the workspace and all of the connections. A GUI might respond by rendering an icon, in the work area, for each component and by drawing lines between the components to connect them.

Specified by:
displayState in interface GuiListener
Parameters:
event - The event that is created whenever we want to know the state of the arena.

goComponentPort

public void goComponentPort(GoComponentPortEvent event)
The GUI is requesting that the cca server execute the "go" command" on a specific port that is located on a specific component.

Specified by:
goComponentPort in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to invoke the "go" command.

nukeAll

public void nukeAll(NukeAllEvent event)
The GUI is requesting the cca server to delete all components.

The server will respond by deleting all components. The GUI might respond by removing all components from the workspace. param event The event that is created whenever the GUI wants to to delete all components.

Specified by:
nukeAll in interface GuiListener

portProperties

public void portProperties(PortPropertiesEvent event)
The GUI is requesting the cca server to send back or to set the value of a port property.

Specified by:
portProperties in interface GuiListener
Parameters:
event - The event that is generated whenever an entity wants to either get or set the value of a port property.

componentProperties

public void componentProperties(ComponentPropertiesEvent event)
The GUI is requesting the cca server to send back or to set the value of a component property. An example of a component property is the "name" of the component.

Specified by:
componentProperties in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to either get or set the value of a component property.

componentProperties

public void componentProperties(int numberOfArguments,
                                java.lang.String componentInstanceName,
                                java.lang.String propertyName,
                                java.lang.String propertyValue)
Retrieve the value of a component property or set the value of a component property. A view entity might respond by either displaying the current value of a component property or by setting the value of a component property.

An example of a component property is "name" of component, the component's "key" value, and "value" of the component.

Parameters:
event - The event that is generated whenever an entity wants to either get or set the value of a component property.
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 component property, then we need the name of the property.
propertyValue - If we are setting the value of a specific component property, then we need the value of the property.

getComponentProperty

public void getComponentProperty(GetComponentPropertyEvent event)
The GUI is requesting the cca server to send back the value of a property that is inside a cca component.

Specified by:
getComponentProperty in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants the value of a property that is inside a component.

setComponentProperty

public void setComponentProperty(SetComponentPropertyEvent event)
The GUI wants the server to set the value of a property that is inside of a cca component.

Specified by:
setComponentProperty in interface GuiListener
Parameters:
event - The event that is created whenever the GUI wants to set the value of a property.

sendMessage

public void sendMessage(StringEvent event)
The GUI wants to send a message to the cca server.

Specified by:
sendMessage in interface GuiListener
Parameters:
event - The event that is created the GUI wants to send a string to the cca server.

heartbeat

public void heartbeat(HeartbeatEvent event)
The GUI wants to send a heartbeat to the cca server.

Specified by:
heartbeat in interface GuiListener
Parameters:
event - The event that is fabricated the GUI wants to emit a heartbeat.

exit

public void exit(ExitEvent event)
The GUI wants to tell the cca server that the GUI is shutting down.

Specified by:
exit in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants to exit the application.

path

public void path(PathEvent event)
The GUI wants to tell the cca server to send back or to set the file path that contains cca components.

Specified by:
path in interface GuiListener
Parameters:
event - The event that is generated whenever the GUI wants either to set the path to a new value or to query for the path value.

repository

public void repository(RepositoryEvent event)
The GUI wants the cca server to send back all components that are in the repository or to send back one specific compnonent that is in the repository.

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

shell

public void shell(ShellEvent event)
The GUI wants to send an O.S. command to the cca server. The cca server will execute the command.

Specified by:
shell in interface GuiListener
Parameters:
event - The event that is created whenever the GUI wants an O.S. command executed.