com.ls.lars.server
Class AgentSynchronizeConnectionHandler

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--com.ls.lars.communication.CommunicationTemplate
              |
              +--com.ls.lars.server.AgentTemplate
                    |
                    +--com.ls.lars.server.AgentSynchronization
                          |
                          +--com.ls.lars.server.AgentSynchronizeConnectionHandler
All Implemented Interfaces:
ICommunication, IToLars, Runnable, Serializable

public final class AgentSynchronizeConnectionHandler
extends AgentSynchronization

AgentSynchronizeConnectionHandler manages the connections to the remote platforms. It creates new messengers or removes messengers from a Lars platform by closing the open connections. The following connection types are possible and specified in the PlatformSynchronization.cfg:

cfg-file is common for all agent synchronization classes and possible messages defined in AgentSynchronization

Message services understood by AgentSynchronizeConnectionHandler:

------------------------------------------------------------------------ open_connections (internal use only!) ------------------------------------------------------------------------ Function: Receives a list of remote platforms and tries to establish the connections. Parameters: remote LARS platforms (List) Responses: none ------------------------------------------------------------------------ close_connections (internal use only!) ------------------------------------------------------------------------ Function: Receives a list of remote platforms and tries to close the connections. Parameters: remote LARS platforms (List) Responses: none ------------------------------------------------------------------------

Version:
$Revision: 1.15 $
Author:
Last modified by $Author: CReich $
See Also:
Serialized Form

Inner classes inherited from class com.ls.lars.server.AgentSynchronization
AgentSynchronization.LarsPlatformRepresentation
 
Field Summary
protected  String revisionInformation
          revision information string, managed by our version control system.
 
Fields inherited from class com.ls.lars.server.AgentSynchronization
agentListener, agentPlatformSecurityName, agentSychronizeConnectionHandlerName, agentSychronizeSupervisorName, ATTEMPT_CONNECTIONS, CHECK_CONNECTIONS, initiallyKnownPlatforms, LISTENER_NAME, LISTENER_TYPE, ownPlatformIP, ownPlatformName, PLATFORM_ACCESS, PLATFORM_CONNECTION_TYPE, PLATFORM_IP, PLATFORM_NAME, PLATFORM_PORT, preferredProtocolOrder, refreshTime, refreshTimeIfUnconnectedPlatforms, SYNCHRONIZATION_INTERVALS
 
Fields inherited from class com.ls.lars.server.AgentTemplate
agentMaxPool, agentMessageRouterName, agentMinPool, defaultServiceAccessPermission, defaultServiceAccessPrivilege, dynamicObjectController, FULL_SERVICE_ACCESS, iXMLHandlerForConfigLoader, localPlatform, maxInvokeStackCounter, NO_SERVICE_ACCESS, RUN_LEVEL_ACTIONS_INITIALIZED, RUN_LEVEL_CONFIG_FILE_INTERPRETED, RUN_LEVEL_CONFIG_FILE_READ, RUN_LEVEL_EMBRYONIC, RUN_LEVEL_INTERPRET_METHODS_REGISTERED, RUN_LEVEL_POOL_INITIALIZED, RUN_LEVEL_RUNNING, RUN_LEVEL_STOPPED, RUN_LEVEL_TERMINATED
 
Fields inherited from class com.ls.lars.communication.CommunicationTemplate
agentName, homePlatform, iPKIHandler, logger, STATUS_CONNECTED, STATUS_NOT_CONNECTED
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface com.ls.lars.communication.ICommunication
AUTHENTICATION_PASSWORD, AUTHENTICATION_USER, COMPRESSION_AUTO_COMPRESSION, COMPRESSION_AUTO_COMPRESSION_START_SIZE, COMPRESSION_LEVEL, COMPRESSION_TYPE, COMPRESSION_ZIP_ENTRY_NAME, CONNECTION_TYPE, HOST_ID, HOST_IP, HOST_PORT, HTTP, J_SECURE_SOCKET, J_SOCKET, JMS, JMS_INITIAL_CONTEXT_FACTORY, JMS_JMSMESSENGER_APPLICATION_LOCATION, JMS_PROVIDER_URL, JMS_RECEIVING_QUEUE_NAME, JMS_SECURITY_CREDENTIALS, JMS_SECURITY_PRINCIPAL, JMS_SENDING_QUEUE_NAME, MAXIMUM_MESSAGE_LENGTH, PROTOCOL, RMI, SOCKET, TIMEOUT, USE_OUTBOX
 
Constructor Summary
AgentSynchronizeConnectionHandler(String agentName, String homePlatform, List agentCfgFile)
          Constructor with the agentName, its homePlatform and the name of the configuration file of the new agent
 
Method Summary
protected  void initializeMessages()
          Method which is called after the cfg-file has been read.
protected  boolean interpretCloseConnections(Message currentMessage)
          Method closes given connections to remote platforms actively.
protected  boolean interpretOpenConnections(Message currentMessage)
          Method tries to make a connection to the given remote platforms.
 
Methods inherited from class com.ls.lars.server.AgentSynchronization
addPlatformToVectorOfPlatforms, checkForEqualPlatformConnections, checkForEqualPlatforms, checkPlatformInVectorOfPlatforms, deletePlaformFromVectorOfPlatforms, interpretSetConstants, interpretSynchronizePlatforms, ownPlatform
 
Methods inherited from class com.ls.lars.server.AgentTemplate
executeLifeCycle, executeWhileRunning, getAgentRevisionInformation, getIPKIHandler, getOwnPublicKeyCertificate, getRevisionInformation, initializeAction, interpret, interpretAccessDenied, interpretAgentConnected, interpretCheckRegisteredServices, interpretCloseConnection, interpretDefineObject, interpretDeliveryFailed, interpretGetRevisionInformation, interpretInterpretationSuccessful, interpretLoadObject, interpretLogInbox, interpretMonitorLookup, interpretNotifiedAgent, interpretNotifyCanceled, interpretNotifyNotCanceled, interpretNotUnderstood, interpretPing, interpretRegisterService, interpretSendAsConfigured, interpretSetAccessPrivileges, interpretSetForeignPublicKeyCertificate, interpretSetLog, interpretSetOwnPublicKeyCertificate, interpretSetPkiEnvironment, interpretSetPkiMessages, interpretSetPrivateKey, interpretSetRunLevel, interpretSignatureNotValid, interpretStartupConstraint, loadConfigFile, performDefaultBehavior, reconnectAfterMigration, registerInterpretMethods, registerInterpretMethods, registerInterpretMethods, reInitializeAction, setAgentMessageRouterName, setIXMLHandler, setLocalPlatform, setPKIMessage, terminateAction, toString
 
Methods inherited from class com.ls.lars.communication.CommunicationTemplate
addConnectionParameter, checkSendSystemReply, connect, createReplyId, disconnect, disconnectForMigration, finalize, forwardMessage, forwardMessage, getAgentName, getConnectionParameters, getInboxSize, getLarsHost, getNumberOfProcessedMessages, getNumberOfProcessedMessagesPerMinute, getStartTime, isConnected, logInbox, receiveBlockedMessage, receiveBlockedMessage, run, sendMessage, sendSynchronousRequest, sendSynchronousRequest, setConnectionParameters, setLog, setMeantimeBetweenConnectionCheck, waitForConnection, waitForConnection
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ls.lars.communication.IToLars
start
 

Field Detail

revisionInformation

protected String revisionInformation
revision information string, managed by our version control system.
Constructor Detail

AgentSynchronizeConnectionHandler

public AgentSynchronizeConnectionHandler(String agentName,
                                         String homePlatform,
                                         List agentCfgFile)
Constructor with the agentName, its homePlatform and the name of the configuration file of the new agent
Parameters:
agentName - name of the agent
homePlatform - name of the lars platform (e.g 192.168.1.1-lars)
agentCfgFile - name of the agent config file (e.g. ILogger.cfg)
Method Detail

initializeMessages

protected void initializeMessages()
Method which is called after the cfg-file has been read. Log the settings.
Overrides:
initializeMessages in class AgentSynchronization

interpretOpenConnections

protected boolean interpretOpenConnections(Message currentMessage)
Method tries to make a connection to the given remote platforms. It is called by the AgentSynchronizeSupervisor.
Parameters:
currentMessage - Incomming Message.
Returns:
Result is true if everything was ok, false otherwise.

interpretCloseConnections

protected boolean interpretCloseConnections(Message currentMessage)
Method closes given connections to remote platforms actively.
Parameters:
currentMessage - Incomming Message.
Returns:
Result is true if everything was ok, false otherwise.