com.ls.lars.server
Class AgentLogin
java.lang.Object
|
+--java.lang.Thread
|
+--com.ls.lars.communication.CommunicationTemplate
|
+--com.ls.lars.server.AgentTemplate
|
+--com.ls.lars.server.AgentLogin
- All Implemented Interfaces:
- ICommunication, IToLars, Runnable, Serializable
- public class AgentLogin
- extends AgentTemplate
This agent handles the login process pertaining JSecureSocket communication.
The authentication happens without a database. The configuration file for
this agent should contain a "set_user_list" message with users and
their passwords in plain text. For security reasons be cautious where to place
this configuration.
to Class Specification
Incoming Messages:
You can send messages requesting the following services from
AgentLogin.
Input parameters you have to specify are listed with the messages and
must be transmitted using a map.
----------------------------------------------------------------------
set_user_list (Config)
----------------------------------------------------------------------
Function: Sets a list of users, which are allowed to
contact the platform via JSecureSocket communication.
Parameters: name, password (Map)
name The name of an user.
password The user's password.
Responses: none
----------------------------------------------------------------------
authenticate
----------------------------------------------------------------------
Function: Checks an user, if he is allowed to contact the platform.
Parameters: userid, seed, public_key, hash (Map)
user the name of the user
seed random number generated by the client
public_key the public key for the encrypted
communication
fingerprint a finger print including the user's
password
Responses: user_ok The user was successfully
authenticated.
user_not_ok The user was not successfully
authenticated.
----------------------------------------------------------------------
Config File:
The config file for AgentLogin is usually called AgentLogin.cfg and
is located in the conf/lars directory of the platform installation.
Mostly important, it contains the messages to set the user list.
- Version:
- $Revision: 1.8 $
- Author:
- Last modified by $Author: ODrugan $
- See Also:
- Serialized Form
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 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 |
AgentLogin(String agentName,
String homePlatform,
List agentConfigFiles)
Constructor with the agentName, its homePlatform and a List containing
the names of the configuration file(s) of the new agent.
It initializes the administration of all authorized users. |
Methods inherited from class com.ls.lars.server.AgentTemplate |
executeLifeCycle, executeWhileRunning, getAgentRevisionInformation, getIPKIHandler, getOwnPublicKeyCertificate, initializeAction, initializeMessages, 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 interface com.ls.lars.communication.IToLars |
start |
revisionInformation
protected String revisionInformation
- revision information string, managed by our version control system.
AgentLogin
public AgentLogin(String agentName,
String homePlatform,
List agentConfigFiles)
- Constructor with the agentName, its homePlatform and a
List
containing
the names of the configuration file(s) of the new agent.
It initializes the administration of all authorized users.
- Parameters:
agentName
- name of the agent (example: xyz )homePlatform
- name of the homePlatform 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
getRevisionInformation
protected String getRevisionInformation()
- gets the revision information of this agent
- Overrides:
getRevisionInformation
in class AgentTemplate
- Returns:
- the revision information
interpretSetUserList
protected boolean interpretSetUserList(Message currentMessage)
- Adds one or more users and their passwords to the set of
users, which are authorized to contact the platform.
- Parameters:
currentMessage
- Message with names and passwords of the users- Returns:
- true, if successful; false else
interpretAuthenticate
protected boolean interpretAuthenticate(Message currentMessage)
- Checks, if an user is authorized.
NOTE: This method sends a reply message with the service user_ok or user_not_ok.
- Parameters:
currentMessage
- Message with user name and his fingerprint.- Returns:
- boolean if successful true, else false (in this case always return true)