edu.uwf.kaos.coabsgrid
Class KAoSDirectory

java.lang.Object
  extended by Directory
      extended by edu.uwf.kaos.coabsgrid.KAoSDirectory

public class KAoSDirectory
extends Directory

Wraps returned AgentReps in KAosWrappedAgentReps. $Revision: 1.1.1.1 $


Constructor Summary
KAoSDirectory()
           
KAoSDirectory(KAoSGridHelper kgh)
           
KAoSDirectory(LookupDiscoveryManager lookupDiscoveryManager)
           
KAoSDirectory(ServiceDiscoveryManager serviceDiscoveryManager)
           
 
Method Summary
 AgentRep[] forwardMsgToGroup(AgentRep[] reps, Message msg)
          Forwards a message to a group of recepients that match the template parameter.
 ServiceItem[] forwardMsgToGroup(ServiceItem[] items, Message msg)
          Forwards a message to a group of agents.
 ServiceItem[] forwardMsgToGroup(ServiceTemplate tmpl, Message msg)
          Forwards a message to a group of recepients that match the template parameter.
 ServiceItem[] forwardMsgToGroup(ServiceTemplate tmpl, ServiceItemFilter filter, Message msg)
          Forwards a message to a group of recepients that match the template parameter.
 ServiceItem[] lookup(Entry[] aeAttributes, ServiceItemFilter predicate)
          Pass through to Jini ServiceDiscoveryManager.lookup().
 ServiceItem[] lookup(LookupInterface lu, Entry[] aeAttributes)
          Method that allows a Grid developer to substitute his own lookup algorithm.
 ServiceItem[] lookup(LookupInterface lu, ServiceTemplate tmpl)
          Method that allows a Grid developer to substitute his own lookup algorithm.
 ServiceItem[] lookup(ServiceTemplate tmpl)
          Pass through to Jini ServiceDiscoveryManager.lookup().
 ServiceItem[] lookup(ServiceTemplate tmpl, ServiceItemFilter predicate)
          Pass-through to ServiceDiscoveryManager.lookup().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KAoSDirectory

public KAoSDirectory()
              throws java.io.IOException
Throws:
java.io.IOException

KAoSDirectory

public KAoSDirectory(KAoSGridHelper kgh)
              throws java.io.IOException
Throws:
java.io.IOException

KAoSDirectory

public KAoSDirectory(ServiceDiscoveryManager serviceDiscoveryManager)
              throws java.io.IOException
Throws:
java.io.IOException

KAoSDirectory

public KAoSDirectory(LookupDiscoveryManager lookupDiscoveryManager)
              throws java.io.IOException
Throws:
java.io.IOException
Method Detail

lookup

public ServiceItem[] lookup(ServiceTemplate tmpl)
                     throws java.rmi.RemoteException
Pass through to Jini ServiceDiscoveryManager.lookup().

Parameters:
tmpl - The ServiceTemplate to match. Pass in null to get all services.
Throws:
java.rmi.RemoteException - If there is a problem doing the lookup with the Jini LUS.
java.lang.IllegalStateException - if the object has been terminated

lookup

public ServiceItem[] lookup(LookupInterface lu,
                            ServiceTemplate tmpl)
                     throws java.rmi.RemoteException
Method that allows a Grid developer to substitute his own lookup algorithm. This was suggested by Sanjeev Kumar of OGI at the Atlanta CoABS Workshop.

Parameters:
lu - The lookup algorithm provided by the grid developer.
tmpl - The template to match.
Throws:
java.rmi.RemoteException - If there is a problem doing the lookup with the Jini LUS.
java.lang.IllegalStateException - if the object has been terminated

lookup

public ServiceItem[] lookup(LookupInterface lu,
                            Entry[] aeAttributes)
                     throws java.rmi.RemoteException
Method that allows a Grid developer to substitute his own lookup algorithm. This was suggested by Sanjeev Kumar of OGI at the Atlanta CoABS Workshop.

Parameters:
lu - The lookup algorithm provided by the grid developer.
aeAttributes - An array of attributes to use as a template. Pass in null to get everything registered. Null attribute fields represent wildcards and non-null attribute fields represent exact matches.
Throws:
java.rmi.RemoteException - If there is a problem doing the lookup with the Jini LUS.
java.lang.IllegalStateException - if the object has been terminated

lookup

public ServiceItem[] lookup(Entry[] aeAttributes,
                            ServiceItemFilter predicate)
                     throws java.rmi.RemoteException
Pass through to Jini ServiceDiscoveryManager.lookup(). Method that allows completely flexible constraint-based search. An arbitrary predicate for lookup can be used that matches based on object type or interface, on attribute values (Jini Entries), or on unique ID. The attributes parameter is used as a first filter, using traditional Jini lookup based on exact attribute matches and wild cards. This limits the amount of data downloaded from the Jini Lookup Service to the client. The predicate parameter is applied to the results of the initial lookup, and only those that the ServiceItemFilter.check() method returns true for are returned in the ServiceItem array.

Parameters:
aeAttributes - An array of attributes to use as a template. Pass in null to get everything registered. Null attribute fields represent wildcards and non-null attribute fields represent exact matches.
predicate - The ServiceItemFilter to apply to filter the results returned. Null can be used to indicate no fitering.
Throws:
java.rmi.RemoteException - If there is a problem doing the lookup with the Jini LUS.
java.lang.IllegalStateException - if the object has been terminated

lookup

public ServiceItem[] lookup(ServiceTemplate tmpl,
                            ServiceItemFilter predicate)
                     throws java.rmi.RemoteException
Pass-through to ServiceDiscoveryManager.lookup(). Method that allows completely flexible constraint-based search. An arbitrary predicate for lookup can be used that matches based on object type or interface, on attribute values (Jini Entries), or on unique ID. The template parameter is used as a first filter, using traditional Jini lookup based on service type, exact attribute matches and wild cards, and ServiceID. This limits the amount of data downloaded from the Jini Lookup Service to the client. The predicate parameter is applied to the results of the initial lookup, and only those that the ServiceItemFilter.check() method returns true for are returned in the array of ServiceItem.

Parameters:
tmpl - A Jini ServiceTemplate which lets you match on attributes, service type, or ServiceID. Null will match all services.
predicate - The ServiceItemFilter to apply to filter the results returned.
Throws:
java.rmi.RemoteException - If there is a problem doing the lookup with the Jini LUS.
java.lang.IllegalStateException - if the object has been terminated

forwardMsgToGroup

public ServiceItem[] forwardMsgToGroup(ServiceTemplate tmpl,
                                       ServiceItemFilter filter,
                                       Message msg)
                                throws java.rmi.RemoteException
Forwards a message to a group of recepients that match the template parameter.

Parameters:
tmpl - A Jini ServiceTemplate which lets you match on attributes, service type, or ServiceID. Null matches everything.
filter - The ServiceItemFilter to apply to filter the results returned. Null means do no filtering.
msg - The message to be delivered.
Returns:
An array of the service items that the message was sent to.
Throws:
java.rmi.RemoteException - If there is a problem looking up matching AgentReps
java.lang.IllegalStateException - if the object has been terminated

forwardMsgToGroup

public ServiceItem[] forwardMsgToGroup(ServiceTemplate tmpl,
                                       Message msg)
                                throws java.rmi.RemoteException
Forwards a message to a group of recepients that match the template parameter.

Parameters:
tmpl - A Jini ServiceTemplate which lets you match on attributes, service type, or ServiceID. Null matches everything.
msg - The message to be delivered.
Returns:
An array of the service items that the message was sent to.
Throws:
java.rmi.RemoteException - If there is a problem looking up matching AgentReps.
java.lang.IllegalStateException - if the object has been terminated

forwardMsgToGroup

public ServiceItem[] forwardMsgToGroup(ServiceItem[] items,
                                       Message msg)
Forwards a message to a group of agents.

Parameters:
items - An array of ServiceItems. The message is sent to any ServiceItem.service that is an AgentRep.
msg - The message to be delivered.
Returns:
An array of the service items that the message was sent to. This is not necessarily the same as items, since items that were not reachable are eliminated.
Throws:
java.lang.IllegalStateException - if the object has been terminated

forwardMsgToGroup

public AgentRep[] forwardMsgToGroup(AgentRep[] reps,
                                    Message msg)
Forwards a message to a group of recepients that match the template parameter.

Parameters:
reps - An array of AgentRep to send the messages to.
msg - The message to be delivered.
Returns:
An array of the AgentReps that the message was sent to. This is not necessarily the same as reps, since agents that were not reachable are eliminated.
Throws:
java.lang.IllegalStateException - if the object has been terminated