All Packages Class Hierarchy This Package Previous Next Index
Class RouterLayer.Router.RegistrarSecurity
Abstract.Security
|
+----RouterLayer.Router.RegistrarSecurity
- public class RegistrarSecurity
- extends Security
Secure the connection. Check whether the register protocol is satisfied.
Since there's no register protocol upon which all the agent communities agree,
we are just suggesting the protocol,which is neither sufficient nor theoretically
correct. We hope this problem to be resolved in the near future. This is our current
register protocol messages
At first, upon request, Router will accept() and request identification to the
connected agent using 'identify-self' performative. Then, the client will send its
identification using 'whoiam'. If the 'whoiam' information is acceptable, the Router
will send the 'accepted' message to the client. If not, the Router will disconnect the
connection. For example:
- Agent sends message to the Router
(register-agent :sender agent :receiver RouterRegistrar :password xxxxx)
- Server send message to the agent
(identify-self :sender Router :receiver agent)
- Client will response
(whoiam :sender client :receiver RouterRegistrar :content (contact-information :host aaa.ggg.com :port 4321 :email aaa@bbb.com) :message-method MessageRouter
:description (advertize DesignAgent) :KQML-extensions http://cdr.stanford.edu/newprotocol)
- Server will send message
- (register-accepted :sender server :receiver client)
- See Also:
- RegistrarRecvThread
-
RegistrarSecurity()
- Default constructor
-
RegistrarSecurity(RouterSecurity)
- Constructor
The RouterSecurity is passed as an argument to update the user list after
registration is successful.
-
denyConnection(ReceiverThread, String)
- Error occurs from the connection process.
-
isValidAgent(Object)
- Check the user is valid
-
processClientLogin(ReceiverThread, Address)
- Opposite to the processServerLogin.
-
processClientLogout(ReceiverThread)
- Registrar does not send out disconnect message
-
processErrorLogin(int, ReceiverThread, String)
- According to the error condition, the processErrorLogin will be performed.
-
processServerLogin(ReceiverThread)
- Security check process from the RegistrarServerThread.
-
registerAgent(String, String, String, String, String, String)
- Register the agent to the agent list.
-
secureAgent(String, String)
- Check the client send its name and the name is different from mine
-
startConnection(ReceiverThread, String, String)
- Start conneciton.
-
SystemOut(String)
- If you use GUI, override this method
RegistrarSecurity
public RegistrarSecurity()
- Default constructor
RegistrarSecurity
public RegistrarSecurity(RouterSecurity security)
- Constructor
The RouterSecurity is passed as an argument to update the user list after
registration is successful.
- Parameters:
- security - Main Router security
processServerLogin
public void processServerLogin(ReceiverThread con)
- Security check process from the RegistrarServerThread. The connection is accepted and
the security check is performed using this method. For error condition, the
connection may be denied after sending error message.
For both registration and connection, the lowest level connection protocol is:
Router : 201 AMR "Router name"
or
Router : 500 Internal Error
for any error conditions.
Then, the Agent will request register by sending "register-agent" protocol.
For example,
Agent : (register-agent :sender agent :receiver RouterRegistrar :password xxxxxx)
Router : (identify-self :sender RouterRegistrar :receiver agent)
Agent : (whoiam :sender agent :receiver RouterRegistrar :message-method AMR :KQML-extensions
http://java.stanford.edu/myprotocol :description (advertize DesignAgent)
:content (contact-information :host www.sun.com :port 1234 :email aaa@sun.com))
Router : (register-accepted :sender RouterRegistrar :receiver agent)>BR>
The router will disconnect the connection just after the registration process is finished.
The agent use "reconnect-agent" protocol to connect the agent, afterwards.
For more information for the protocol, refer to processServerLogin in class Security
processErrorLogin
protected boolean processErrorLogin(int errorCode,
ReceiverThread con,
String myid)
- According to the error condition, the processErrorLogin will be performed.
If the agent name is missing or if the agent name is the same as the Router
name or if the password is missing(when passwordCheckBit is true) or
if the password is mismatch(when passwordCheckBit is true), the Registrar will
send 'error' message to the agent and will close the connection
- Parameters:
- errorCode - Error code which happens during connection process
- con - ReceiverRecvThread, which wants to be connected
- myid - The Router name
startConnection
protected void startConnection(ReceiverThread con,
String agentid,
String myid)
- Start conneciton. This does not mean that the connection will be established.
After register, the agent should reconnect to the Router. This method will
send 'register-accepted' message to the client and will be kill the RegistrarRecvThread
- Parameters:
- con - ReceiverThread to be started
- agentid - The agent name
- myid - The Router registrar name
denyConnection
protected void denyConnection(ReceiverThread con,
String id)
- Error occurs from the connection process. Send 'error' message to the agent
and disconnect the conneciton
- Parameters:
- con - ReceiverThread to be disconnected
- id - The RouterRegistrar name
secureAgent
protected int secureAgent(String me,
String client)
- Check the client send its name and the name is different from mine
- Parameters:
- me - My name, sent back from the client
- client - The agent name
processClientLogin
public void processClientLogin(ReceiverThread c,
Address serveraddress) throws ConnectionException
- Opposite to the processServerLogin. The agent(me) wants to connect to the
Router and it will send 'whoiam' message to the Router
- Parameters:
- c - ReceiverThread, which will connect to the Router
- serveraddress - The Rotuer server address
- Overrides:
- processClientLogin in class Security
processClientLogout
public void processClientLogout(ReceiverThread c)
- Registrar does not send out disconnect message
- Parameters:
- c - RouterRecvThread to be disconnected
- Overrides:
- processClientLogout in class Security
registerAgent
public int registerAgent(String id,
String host,
String port,
String type,
String description,
String password)
- Register the agent to the agent list. The address table will be updated
- Parameters:
- id - Agent name
- host - Internet host name
- port - Port number
- type - Message method
- description - Agent description
- password - Password for the agent to be checked afterwards
isValidAgent
public boolean isValidAgent(Object o)
- Check the user is valid
- Parameters:
- o - String argument, agent name and password
- Returns:
- True if the agent is valid
- Overrides:
- isValidAgent in class Security
SystemOut
public void SystemOut(String str)
- If you use GUI, override this method
- Parameters:
- str - String which will be displayed to the GUI or System.out
All Packages Class Hierarchy This Package Previous Next Index