cartago
Class CartagoService

java.lang.Object
  extended by cartago.CartagoService

public class CartagoService
extends java.lang.Object

Entry point for working with CArtAgO.

Author:
aricci, mguidi

Constructor Summary
CartagoService()
           
 
Method Summary
static void addArtifactFactory(java.lang.String wspName, ArtifactFactory factory)
          Add an artifact factory for artifact templates
static void enableLinkingWithNode(NodeId id, java.lang.String support, java.lang.String address)
          Enable linking to the specified node
static ICartagoController getController(java.lang.String wspName)
          Getting a controller.
static java.lang.String getVersion()
           
static void installInfrastructureLayer(java.lang.String type)
          Install a CArtAgO infrastructure layer, to enable interaction with remote nodes.
static boolean isInfrastructureLayerInstalled(java.lang.String protocol)
           
static boolean isNodeActive()
          Check if the CArtAgO node is on.
static void main(java.lang.String[] args)
          Install CArtAgO Node with RMI infrastructure service.
static void registerLogger(java.lang.String wspName, ICartagoLogger logger)
          Register a new logger for CArtAgO Workspace Kernel events
static void registerLoggerToRemoteWsp(java.lang.String wspName, java.lang.String address, java.lang.String protocol, ICartagoLogger logger)
          Register a new logger for a remote CArtAgO Workspace
static void removeArtifactFactory(java.lang.String wspName, java.lang.String name)
          Remove an existing class loader for artifacts
static void setDefaultInfrastructureLayer(java.lang.String name)
          Change the default infrastructure layer name
static void shutdownNode()
          Shutdown the CArtAgO node.
static void startInfrastructureService(java.lang.String type)
          Start a CArtAgO infrastructure service, to allow remote agents to work on this node using the specified protocol.
static void startInfrastructureService(java.lang.String type, java.lang.String address)
          Start a CArtAgO infrastructure service, to allow remote agents to work on this node using the specified protocol.
static void startNode()
          Start a CArtAgO node.
static void startNode(ICartagoLogger logger)
          Start a CArtAgO node.
static ICartagoSession startRemoteSession(java.lang.String wspName, java.lang.String wspAddress, java.lang.String protocol, cartago.security.AgentCredential cred, ICartagoListener eventListener)
          Start a working session in a remote workspace.
static ICartagoSession startSession(java.lang.String wspName, cartago.security.AgentCredential cred, ICartagoListener eventListener)
          Start a CArtAgO session in a local workspace.
static void unregisterLogger(java.lang.String wspName, ICartagoLogger logger)
          Unregister a logger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CartagoService

public CartagoService()
Method Detail

getVersion

public static java.lang.String getVersion()

startNode

public static void startNode()
                      throws CartagoException
Start a CArtAgO node.

Throws:
CartagoException

startNode

public static void startNode(ICartagoLogger logger)
                      throws CartagoException
Start a CArtAgO node.

Throws:
CartagoException

isNodeActive

public static boolean isNodeActive()
Check if the CArtAgO node is on.

Returns:

shutdownNode

public static void shutdownNode()
                         throws CartagoException
Shutdown the CArtAgO node.

Throws:
CartagoException

installInfrastructureLayer

public static void installInfrastructureLayer(java.lang.String type)
                                       throws CartagoException
Install a CArtAgO infrastructure layer, to enable interaction with remote nodes.

Parameters:
type - name of the layer, which typically corresponds to the protocol adopted. Use "default" to specify default type.
Throws:
CartagoException - if the installation fails

setDefaultInfrastructureLayer

public static void setDefaultInfrastructureLayer(java.lang.String name)
Change the default infrastructure layer name

Parameters:
name - infrastructure layer name

startInfrastructureService

public static void startInfrastructureService(java.lang.String type,
                                              java.lang.String address)
                                       throws CartagoException
Start a CArtAgO infrastructure service, to allow remote agents to work on this node using the specified protocol. Before starting the service, the corresponding infrastructure layer should have been already installed.

Parameters:
type - the type of service to start. Use "default" to specify default type.
address - address of the service.
Throws:
CartagoException - if the start fails

startInfrastructureService

public static void startInfrastructureService(java.lang.String type)
                                       throws CartagoException
Start a CArtAgO infrastructure service, to allow remote agents to work on this node using the specified protocol. Before starting the service, the corresponding infrastructure layer should have been already installed.

Parameters:
type - the type of service to start. Use "default" to specify default type.
address - address of the service.
Throws:
CartagoException - if the start fails

startSession

public static ICartagoSession startSession(java.lang.String wspName,
                                           cartago.security.AgentCredential cred,
                                           ICartagoListener eventListener)
                                    throws CartagoException
Start a CArtAgO session in a local workspace.

Parameters:
wspName - workspace to join
cred - agent credential
eventListener - listener to perceive workspace events
Returns:
Throws:
CartagoException

startRemoteSession

public static ICartagoSession startRemoteSession(java.lang.String wspName,
                                                 java.lang.String wspAddress,
                                                 java.lang.String protocol,
                                                 cartago.security.AgentCredential cred,
                                                 ICartagoListener eventListener)
                                          throws CartagoException
Start a working session in a remote workspace.

Parameters:
wspName - workspace name
wspAddress - workspace address
protocol - infrastructure protocol ("default" for default one)
cred - agent credential
eventListener - listener to workspace events to be perceived by the agent
Returns:
a context for working inside the workspace
Throws:
CartagoException

addArtifactFactory

public static void addArtifactFactory(java.lang.String wspName,
                                      ArtifactFactory factory)
                               throws CartagoException
Add an artifact factory for artifact templates

Parameters:
wspName - workspace name
factory - artifact factory
Throws:
CartagoException

removeArtifactFactory

public static void removeArtifactFactory(java.lang.String wspName,
                                         java.lang.String name)
                                  throws CartagoException
Remove an existing class loader for artifacts

Parameters:
wspName - workspace name
name - id of the artifact factory
Throws:
CartagoException

registerLogger

public static void registerLogger(java.lang.String wspName,
                                  ICartagoLogger logger)
                           throws CartagoException
Register a new logger for CArtAgO Workspace Kernel events

Parameters:
wspName -
logger -
Throws:
CartagoException

registerLoggerToRemoteWsp

public static void registerLoggerToRemoteWsp(java.lang.String wspName,
                                             java.lang.String address,
                                             java.lang.String protocol,
                                             ICartagoLogger logger)
                                      throws CartagoException
Register a new logger for a remote CArtAgO Workspace

Parameters:
wspName -
logger -
Throws:
CartagoException

unregisterLogger

public static void unregisterLogger(java.lang.String wspName,
                                    ICartagoLogger logger)
                             throws CartagoException
Unregister a logger

Parameters:
wspName -
logger -
Throws:
CartagoException

enableLinkingWithNode

public static void enableLinkingWithNode(NodeId id,
                                         java.lang.String support,
                                         java.lang.String address)
Enable linking to the specified node

Parameters:
id - node id
support -
address -

getController

public static ICartagoController getController(java.lang.String wspName)
                                        throws CartagoException
Getting a controller.

Parameters:
wspName -
Returns:
Throws:
CartagoException

isInfrastructureLayerInstalled

public static boolean isInfrastructureLayerInstalled(java.lang.String protocol)

main

public static void main(java.lang.String[] args)
Install CArtAgO Node with RMI infrastructure service.



>DEIS - University of Bologna