|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--ajanta.server.AgentServer
Ajanta provides a generic agent server that can be suitably
extended by a programmer to define an application-specific server.
It supports several important functions:
1. Agent Transfer Protocol for agent migration to/from other servers.
2. Execution of visiting agents within secure protection domains.
3. Secure access to server resources for agents.
4. Primitives for inter-agent communication, resource access and migration.
5. Secure agent control and monitoring functions for agent creators.
The server's agent environment object acts as the interface
between agents and the services provided at the host. Agents can
invoke operations on their environment that allow them to migrate,
communicate, access resources, etc. Each server maintains a
domain registry that keeps track of the agents currently executing on
it. A server usually provides access to some application-defined resources.
Such resources are registered in the server's resource registry. This
registry maps the URN of a resource to its object reference. A server has
to explicitly make a resource visible to visiting agents by registering it
in the resource registry by using the registerResource function.
Field Summary | |
protected ajanta.server.ATPListener |
atp
thread which handles agent transfer |
protected int |
atp_port
port number on which agent transfer take place |
protected ajanta.naming.CA |
ca
|
protected java.net.URL |
codeBase
Code server running in this Agent Server |
protected ajanta.server.ClassServer |
cs
class (code) server thread |
protected int |
cs_port
port number of class (code) server thread |
protected java.util.Hashtable |
dd
The domains database table -- conatin an entry for all the agent currently residing on the server |
protected java.security.Signature |
dsa
DSA signature object |
protected java.security.PrivateKey |
dsa_priv
DSA private key |
protected java.security.PublicKey |
dsa_pub
DSA public key |
protected java.security.Signature |
dsa_v
DSA object for signature verification |
protected ajanta.crypto.ElGamal |
eg
ElGamal object used for encryption |
protected ajanta.crypto.EGPrivateKey |
eg_priv
ElGamal private key for server's owner |
protected ajanta.crypto.EGPublicKey |
eg_pub
ElGamal public key for server's owner |
protected ajanta.server.AgentEnv |
host
server's context object -- an instance of this is passed to all the visting agents |
protected java.io.PrintStream |
logger
a logger file output stream |
protected java.security.cert.X509Certificate |
myCertificate
|
protected java.lang.String |
myHost
DNS name of my host machine |
protected ajanta.naming.URN |
myURN
this agent server's URN ( name ) |
protected ajanta.server.NRAccess |
namereg
a sycronized class for calling namereg api's |
protected java.security.cert.X509Certificate |
nameregistryCertificate
|
protected java.util.Hashtable |
nameTGmap
maps agent names to thread group id |
protected java.net.URL |
rmiRegURL
local server specific rmi registry |
protected java.util.Hashtable |
rr
The resource registry table -- contain an entry for each registered resource |
protected ajanta.server.AjantaSecurityManager |
securityManager
the security manager for the server |
protected java.security.SecureRandom |
srand
Secure random number generator |
protected ajanta.util.AgentTicketing |
tkt
used for ticket generation/verification |
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary | |
AgentServer(java.lang.String n)
AgentServer constructor |
Method Summary | |
ajanta.util.Ticket |
authenticate(ajanta.naming.URN caller,
int nonce,
ajanta.util.ContextObject context)
It is used to obtain ticket from this server from a remote site. |
boolean |
checkAdmissionPolicy(ajanta.agent.Credentials agentCredentials,
java.net.InetAddress inetAddress,
ajanta.naming.URN senderAgentServerURN)
The function returns true if the incoming agent can be accepted based on the agent server admission policy. |
byte[] |
decrypt(ajanta.crypto.EGCipherText cipher)
|
void |
deleteDDEntry(ajanta.server.DDEntry obj)
This function removes the calling agent DDEntry from the domain database. |
void |
deleteDDEntry(ajanta.naming.URN name)
This function removes the calling agent DDEntry from the domain database. |
ajanta.crypto.EGCipherText |
encrypt(ajanta.crypto.EGPublicKey pk,
byte[] plaintext)
|
ajanta.server.AServer |
getAgentCurrentServer(ajanta.naming.URN agentURN)
given URN of agent it locates it's current server and return reference to the server. |
ajanta.naming.CascadedCertificate |
getCascadedCertificate(int key_length,
long duration)
|
void |
getCertificiates()
|
long |
getMaxDuration(ajanta.naming.URN agentURN)
|
ajanta.server.NRAccess |
getNR()
It returns a reference to NRAcess - sycronized class for calling namereg api's |
java.net.URL |
getRegURL()
Return local server specific rmi registry URL. |
java.security.PrivateKey |
getTemporaryPrivateKey()
|
java.security.PublicKey |
getTemporaryPublicKey()
|
void |
launch(ajanta.agent.Agent ag,
ajanta.naming.URN dest,
java.lang.String method,
java.lang.Class[] formals,
java.lang.Object[] actuals)
It launches a given agent to the specified destination. |
boolean |
logEvent(ajanta.logger.Event e)
|
static void |
main(java.lang.String[] args)
Main program, which starts up the agent server This is only a generic main program. |
java.lang.String |
ping()
Returns Agent Server Status. |
void |
recall(ajanta.naming.URN target,
ajanta.naming.URN reportTo,
ajanta.util.Ticket t)
It is used to recall an agent ...which basically allow an agent to complete its task at the current server and upon completion migate it to the reportTo server ( but it aborts its prespecifed itinerary). |
void |
recall(ajanta.naming.URN target,
ajanta.naming.URN recaller,
ajanta.naming.URN reportTo)
It is used to recall an agent ...which basically allow an agent to complete its task at the current server ( but it aborts its prespecifed itinerary) and upon completion migate it to the reportTo server. |
void |
registerAgent(ajanta.agent.Agent ag)
Registers an agent with the name registry, If an older entry exists try to rebind the agent. |
ajanta.util.Ticket |
remoteServerTicket(ajanta.server.AServer targetServer,
ajanta.naming.URN caller,
int nonce,
java.security.PrivateKey dsa_priv)
It is used to do two way authentication...first it obtains a Ticket from the remote server and then using that ticket it creates another ticket and return to the caller. |
void |
report(ajanta.agent.Agent ag)
This method is invoked by agents which report back to their home site, either because their task is done, or in response to reacll / retract, or because they have encountered some exception which they could not handle. |
void |
retract(ajanta.naming.URN target,
ajanta.naming.URN reportTo,
ajanta.util.Ticket t)
It is used to retract an agent ...it preempts the agent from its current task and its prespecifed itinerary. |
void |
retract(ajanta.naming.URN target,
ajanta.naming.URN retractor,
ajanta.naming.URN reportTo)
It is used to retract an agent ...it preempts the agent from its current task and its prespecified itinerary. |
byte[] |
sign(byte[] text)
|
void |
terminate(ajanta.naming.URN target)
It is used to abort an agent ...it immediately kill the agent. |
void |
terminate(ajanta.naming.URN target,
ajanta.util.Ticket t)
It is used to abort an agent ...it immediately kills the agent. |
boolean |
verify(byte[] text,
byte[] sig,
java.security.PublicKey pub)
|
ajanta.naming.URN |
whoAreYou()
A simple method in the AServer interface, for obtaining an agent server's URN |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected ajanta.naming.URN myURN
protected java.lang.String myHost
protected java.net.URL codeBase
protected java.net.URL rmiRegURL
protected java.util.Hashtable dd
protected java.util.Hashtable rr
protected java.util.Hashtable nameTGmap
protected ajanta.server.ATPListener atp
protected int atp_port
protected ajanta.server.ClassServer cs
protected int cs_port
protected ajanta.server.AgentEnv host
protected ajanta.crypto.EGPublicKey eg_pub
protected ajanta.crypto.EGPrivateKey eg_priv
protected java.security.PublicKey dsa_pub
protected java.security.PrivateKey dsa_priv
protected ajanta.crypto.ElGamal eg
protected java.security.Signature dsa
protected ajanta.util.AgentTicketing tkt
protected java.security.SecureRandom srand
protected java.security.Signature dsa_v
protected ajanta.server.AjantaSecurityManager securityManager
protected ajanta.server.NRAccess namereg
protected java.io.PrintStream logger
protected ajanta.naming.CA ca
protected java.security.cert.X509Certificate myCertificate
protected java.security.cert.X509Certificate nameregistryCertificate
Constructor Detail |
public AgentServer(java.lang.String n) throws java.rmi.RemoteException
n
- urn ( name ) of the agent serverAgentServer
Method Detail |
public byte[] decrypt(ajanta.crypto.EGCipherText cipher)
public ajanta.crypto.EGCipherText encrypt(ajanta.crypto.EGPublicKey pk, byte[] plaintext)
public byte[] sign(byte[] text) throws java.security.SignatureException
java.security.SignatureException
public boolean verify(byte[] text, byte[] sig, java.security.PublicKey pub) throws java.security.InvalidKeyException, java.security.SignatureException
java.security.InvalidKeyException
java.security.SignatureException
public ajanta.naming.URN whoAreYou() throws java.rmi.RemoteException
whoAreYou
in interface AServer
java.rmi.RemoteException
public ajanta.server.AServer getAgentCurrentServer(ajanta.naming.URN agentURN)
agentURN
- URN of the agent to be located
AServer
public void recall(ajanta.naming.URN target, ajanta.naming.URN recaller, ajanta.naming.URN reportTo) throws java.rmi.RemoteException
recall
in interface AServer
target
- URN of the agent to be relocatedrecaller
- URN of the recallerreportTo
- URN of the entity to whom agent has to report
java.rmi.RemoteException
public void retract(ajanta.naming.URN target, ajanta.naming.URN retractor, ajanta.naming.URN reportTo) throws java.rmi.RemoteException
retract
in interface AServer
target
- URN of the agent to be relocatedreportTo
- URN of the entity to whom agent has to report
java.rmi.RemoteException
public void terminate(ajanta.naming.URN target) throws java.rmi.RemoteException
terminate
in interface AServer
target
- URN of the agent to be terminated
java.rmi.RemoteException
public java.lang.String ping() throws java.rmi.RemoteException
ping
in interface AServer
java.rmi.RemoteException
public ajanta.util.Ticket authenticate(ajanta.naming.URN caller, int nonce, ajanta.util.ContextObject context)
authenticate
in interface AServer
caller
- caller identity( URN )nonce
- random number used as challengepublic ajanta.util.Ticket remoteServerTicket(ajanta.server.AServer targetServer, ajanta.naming.URN caller, int nonce, java.security.PrivateKey dsa_priv) throws java.rmi.RemoteException
targetServer
- reference to the remote agent servercaller
- URN of the caller ( server )nonce
- any random numberdsa_priv
- dsa private key of the caller
java.rmi.RemoteException
public void recall(ajanta.naming.URN target, ajanta.naming.URN reportTo, ajanta.util.Ticket t) throws java.rmi.RemoteException, java.security.InvalidKeyException, java.security.SignatureException
AServer targetServer = getAgentCurrentServer( agentURN ); Ticket ticket = remoteServerTicket ( targetServer, myURN , 3000, dsa_priv ); recall (agentURN , myURN , ticket )
recall
in interface AServer
target
- URN of the agent to be relocatedreportTo
- URN of the entity to whom agent has to reportt
- ticket obtained from the remote server
java.rmi.RemoteException
java.security.InvalidKeyException
java.security.SignatureException
public void retract(ajanta.naming.URN target, ajanta.naming.URN reportTo, ajanta.util.Ticket t) throws java.rmi.RemoteException, java.security.InvalidKeyException, java.security.SignatureException
AServer targetServer = getAgentCurrentServer( agentURN ); Ticket ticket = remoteServerTicket ( targetServer, myURN , 3000, dsa_priv ); retract (agentURN , myURN , ticket )
retract
in interface AServer
target
- URN of the agent to be retractedreportTo
- URN of the entity to whom agent has to reportt
- ticket obtained from the remote server
java.rmi.RemoteException
java.security.InvalidKeyException
java.security.SignatureException
public void terminate(ajanta.naming.URN target, ajanta.util.Ticket t) throws java.rmi.RemoteException, java.security.InvalidKeyException, java.security.SignatureException
AServer targetServer = getAgentCurrentServer( agentURN ); Ticket ticket = remoteServerTicket ( targetServer, myURN , 3000, dsa_priv ); terminate (agentURN , ticket )
terminate
in interface AServer
target
- URN of the agent to be terminated
java.rmi.RemoteException
java.security.InvalidKeyException
java.security.SignatureException
public void launch(ajanta.agent.Agent ag, ajanta.naming.URN dest, java.lang.String method, java.lang.Class[] formals, java.lang.Object[] actuals) throws LaunchFailedException
ag
- reference of the agent to be launcheddest
- URN of the destinationmethod
- name of the method to executeformals
- array of class names of method parametrsactuals
- array of objects i.e. values of the parametrs to the method
LaunchFailedException
public void report(ajanta.agent.Agent ag) throws AgentTerminateException
report
in interface Reportable
ag
- reference of the agent reporting
AgentTerminateException
public ajanta.server.NRAccess getNR()
public void deleteDDEntry(ajanta.server.DDEntry obj)
obj
- reference of the DDEntry to be deletedpublic void deleteDDEntry(ajanta.naming.URN name)
public java.net.URL getRegURL()
public void registerAgent(ajanta.agent.Agent ag)
ag
- reference of the agent to be registeredpublic static void main(java.lang.String[] args)
public boolean checkAdmissionPolicy(ajanta.agent.Credentials agentCredentials, java.net.InetAddress inetAddress, ajanta.naming.URN senderAgentServerURN)
public boolean logEvent(ajanta.logger.Event e)
public void getCertificiates()
public ajanta.naming.CascadedCertificate getCascadedCertificate(int key_length, long duration)
public java.security.PrivateKey getTemporaryPrivateKey()
public java.security.PublicKey getTemporaryPublicKey()
public long getMaxDuration(ajanta.naming.URN agentURN)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |