com.ls.lars.server
Class AgentJSecureSocketListener

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

public class AgentJSecureSocketListener
extends AgentSocketListener

This class is the wrapper agent needed for the communication of a jsecure socket listener. It waits for incoming socket requests from remote agents.


to Class Specification

 Incoming Messages:
      AgentJSecureSocketListener understands the following messages.
      Input parameters to be specified are listed with the messages.
      ---------------------------------------------------------------------
      set_login_agent (Config)
      ---------------------------------------------------------------------
      Function:   Sets the login agent name which is responsible
                  for user authentication.

      Parameters: login agent name (String)

      Responses:  none
      ----------------------------------------------------------------------
 Config File
      The AgentJSecureSocketListener's config file usually has two entries:
      The first is for setting the port the Agent shall listen on for
      incoming communication requests.
      The second entry specifies the name of the login agent, which is
      responsible for allowing/denying remote parties.
      ----------------------------------------------------------------------
 Notes
      The messages that AgentJSecureSocketListener will understand have the
      same XML format as the individual messages in the config files. You can
      only inject one message at a time using AgentJSecureSocketListener.

Version:
$Revision: 1.10 $
Author:
Last modified by $Author: OHittmeyer $
See Also:
AgentListener, AgentSocketListener, Serialized Form

Field Summary
static String DEFAULT_LOGIN_AGENT_NAME
          the default login agent name: "AgentLogin"
protected static int J_SECURE_SOCKET_DEFAULT_PORT
          default port for j-secure socket connections: 8006
protected  String revisionInformation
          revision information string, managed by our version control system.
 
Fields inherited from class com.ls.lars.server.AgentSocketListener
SOCKET_DEFAULT_PORT, socketListener
 
Fields inherited from class com.ls.lars.server.AgentListener
port
 
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
AgentJSecureSocketListener(String agentName, String homePlatform, List agentConfigFiles)
          Constructor that only calls super(agentName, homePlatform, agentConfigFiles) and sets the default login agent name.
 
Method Summary
protected  SocketListener createSocketListener()
          creates and returns the appropriate socket listener (here: a JSecureSocketListener)
protected  String getRevisionInformation()
          gets the revision information of this agent
protected  boolean interpretSetLoginAgent(Message currentMessage)
          Sets the login agent name for the j-secure socket communication.
protected  void setDefaultPort()
          sets port to the default port (here: J_SECURE_SOCKET_DEFAULT_PORT)
 
Methods inherited from class com.ls.lars.server.AgentSocketListener
initializeMessages, interpretSetCompression, interpretSetMaxMessageLength, terminateAction
 
Methods inherited from class com.ls.lars.server.AgentListener
interpretAskForConnectionParameters, interpretSetOutbox, interpretSetPort
 
Methods inherited from class com.ls.lars.server.AgentTemplate
executeLifeCycle, executeWhileRunning, getAgentRevisionInformation, getIPKIHandler, getOwnPublicKeyCertificate, 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, 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.

DEFAULT_LOGIN_AGENT_NAME

public static final String DEFAULT_LOGIN_AGENT_NAME
the default login agent name: "AgentLogin"

J_SECURE_SOCKET_DEFAULT_PORT

protected static final int J_SECURE_SOCKET_DEFAULT_PORT
default port for j-secure socket connections: 8006
Constructor Detail

AgentJSecureSocketListener

public AgentJSecureSocketListener(String agentName,
                                  String homePlatform,
                                  List agentConfigFiles)
Constructor that only calls super(agentName, homePlatform, agentConfigFiles) and sets the default login agent name.
Parameters:
agentName - name of the agent (example: xyz )
homePlatform - name of the home platform where the agent was created (example: 195.52.158.233/lars)
agentConfigFiles - config file(s), which should be read by the agent when it starts up
Method Detail

getRevisionInformation

protected String getRevisionInformation()
gets the revision information of this agent
Overrides:
getRevisionInformation in class AgentSocketListener
Returns:
the revision information

createSocketListener

protected SocketListener createSocketListener()
creates and returns the appropriate socket listener (here: a JSecureSocketListener)
Overrides:
createSocketListener in class AgentSocketListener
Returns:
new JSecureSocketListener(this,port,loginAgentName)

setDefaultPort

protected void setDefaultPort()
sets port to the default port (here: J_SECURE_SOCKET_DEFAULT_PORT)
Overrides:
setDefaultPort in class AgentSocketListener

interpretSetLoginAgent

protected boolean interpretSetLoginAgent(Message currentMessage)
Sets the login agent name for the j-secure socket communication. For security reasons, the sender of the message is checked: If the message is not read from a config file, its content is ignored and a warning is written to the log file.
Parameters:
currentMessage - message which should contain the login agent name
Returns:
true, if setting the login agent succeeded; false else