konark.manager
Class ItineraryAgent

java.lang.Object
  extended byajanta.agent.Agent
      extended byajanta.agent.ItinAgent
          extended bykonark.manager.BasicItineraryAgent
              extended bykonark.manager.ItineraryAgent
All Implemented Interfaces:
Monitor, java.rmi.Remote, java.io.Serializable, Subscriber

public class ItineraryAgent
extends BasicItineraryAgent
implements Subscriber

See Also:
Serialized Form

Field Summary
protected  java.lang.String dbpasswd
           
protected  java.lang.String dburl
           
protected  java.lang.String dbuser
           
 
Fields inherited from class konark.manager.BasicItineraryAgent
dbModule, defaultSubscriber, eventIDGenerator, eventTable, keepRunning, localTriggerTable, remoteTriggerTable, reportedEventList, sql, subscriberHashtable
 
Fields inherited from class ajanta.agent.ItinAgent
itin
 
Fields inherited from class ajanta.agent.Agent
creatorSignature, cred, host, myRef, name, ownerSignature, status
 
Constructor Summary
ItineraryAgent(ajanta.agent.Credentials cred, java.util.Hashtable monInfo, java.lang.String dburl, java.lang.String dbuser, java.lang.String dbpasswd, boolean ifSql, ajanta.naming.URN defSubURN, ajanta.pattern.Itinerary itin)
           
ItineraryAgent(ajanta.agent.Credentials cred, ajanta.pattern.Itinerary itin)
           
 
Method Summary
 void addHandlerPostAction(EventHandler handler)
           
 void addSubscription(java.util.Vector eventList, ajanta.naming.URN agentURN)
           
 void addUser(java.lang.String userName)
           
static ajanta.pattern.Itinerary createItinerary(ajanta.server.AgentEnv creatingHost, java.lang.String travelpattern, java.lang.String hostfile, int loopInterval)
          Function called by ConfigManager which supplies the file containing list of hosts.
 java.lang.Object createObject(java.lang.String name)
           
 void executeBeforeRun()
           
 java.lang.String getAgentID()
           
 java.lang.String getLocation(java.lang.String user)
           
 java.lang.String getRoomContents()
           
 java.util.Vector getUserList()
           
 boolean isColocated(java.lang.String user1, java.lang.String user2)
           
 boolean isColocatedAll(java.lang.String user1, java.util.Vector userList)
           
 boolean isColocatedAny(java.lang.String user1, java.util.Vector userList)
           
 boolean isPresent(java.lang.String userName)
           
 int presentUserCount()
           
 void removeSubscription(ajanta.naming.URN monitorURN, java.lang.String event)
           
 void removeUser(java.lang.String userName)
           
 void removeUserFromLocationTable(java.lang.String user, java.lang.String loc)
           
 void report(Event event)
           
 void resubscribe(ajanta.naming.URN monitorURN)
           
 void run()
           
 void startEventDetectorThread()
           
 boolean subscribe(java.util.Vector eventList, ajanta.naming.URN agURN)
           
 void subscribeEvent(java.lang.String eventClassName, ajanta.naming.URN subscriber, java.util.Hashtable filterTable)
           
 void unsubscribeEvent(java.lang.String eventClassName, ajanta.naming.URN subscriber)
           
 void updateUserLocation(java.lang.String user, java.lang.String loc)
           
 
Methods inherited from class konark.manager.BasicItineraryAgent
addEvent, addEvent, addEventDetector, addEventHandler, addOldSynchornizerObjects, addSubscriber, deleteEvent, deleteSubscriber, deleteSubscriber, getDefaultSubscriber, getEventIDGenerator, handlerAction, modifyDetector, printRunningThreads, removeDetector, replaceEventDetector, replaceEventHandler, restoreDetector, setAlarmLevel, setAlertLevel, stopAgent, subscribeEvent, switchOffPrintRunningThreads
 
Methods inherited from class ajanta.agent.ItinAgent
arrive, checkDepartStatus, depart, getItinerary, noOp, setItinerary, start
 
Methods inherited from class ajanta.agent.Agent
agentEntry, agentExit, colocate, colocate, meet, recallCommand, signCreator, signOwner, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface konark.manager.Subscriber
subscribeEvent
 

Field Detail

dbpasswd

protected java.lang.String dbpasswd

dbuser

protected java.lang.String dbuser

dburl

protected java.lang.String dburl
Constructor Detail

ItineraryAgent

public ItineraryAgent(ajanta.agent.Credentials cred,
                      ajanta.pattern.Itinerary itin)
Parameters:
cred -
itin -

ItineraryAgent

public ItineraryAgent(ajanta.agent.Credentials cred,
                      java.util.Hashtable monInfo,
                      java.lang.String dburl,
                      java.lang.String dbuser,
                      java.lang.String dbpasswd,
                      boolean ifSql,
                      ajanta.naming.URN defSubURN,
                      ajanta.pattern.Itinerary itin)
Parameters:
cred -
monInfo -
dburl -
dbuser -
dbpasswd -
ifSql -
defSubURN -
Method Detail

createItinerary

public static ajanta.pattern.Itinerary createItinerary(ajanta.server.AgentEnv creatingHost,
                                                       java.lang.String travelpattern,
                                                       java.lang.String hostfile,
                                                       int loopInterval)
                                                throws java.lang.Exception
Function called by ConfigManager which supplies the file containing list of hosts. This function parses the host file, creates the itinerary file and creates the Itinerary object and returns it to ConfigManager.

Parameters:
hostfile -
loopInterval -
Throws:
java.lang.Exception

report

public void report(Event event)
            throws java.rmi.RemoteException
Specified by:
report in interface Subscriber
Parameters:
event -
Throws:
java.rmi.RemoteException

subscribeEvent

public void subscribeEvent(java.lang.String eventClassName,
                           ajanta.naming.URN subscriber,
                           java.util.Hashtable filterTable)
                    throws java.rmi.RemoteException,
                           remoteConfigException
Specified by:
subscribeEvent in interface Subscriber
Throws:
java.rmi.RemoteException
remoteConfigException

addSubscription

public void addSubscription(java.util.Vector eventList,
                            ajanta.naming.URN agentURN)
                     throws java.rmi.RemoteException,
                            remoteConfigException
Specified by:
addSubscription in interface Subscriber
Throws:
java.rmi.RemoteException
remoteConfigException

removeSubscription

public void removeSubscription(ajanta.naming.URN monitorURN,
                               java.lang.String event)
                        throws java.rmi.RemoteException
Specified by:
removeSubscription in interface Subscriber
Throws:
java.rmi.RemoteException

unsubscribeEvent

public void unsubscribeEvent(java.lang.String eventClassName,
                             ajanta.naming.URN subscriber)
                      throws java.rmi.RemoteException,
                             remoteConfigException
Specified by:
unsubscribeEvent in interface Subscriber
Throws:
java.rmi.RemoteException
remoteConfigException

subscribe

public boolean subscribe(java.util.Vector eventList,
                         ajanta.naming.URN agURN)
                  throws remoteConfigException
Throws:
remoteConfigException

createObject

public java.lang.Object createObject(java.lang.String name)
Parameters:
name -

executeBeforeRun

public void executeBeforeRun()

run

public void run()

startEventDetectorThread

public void startEventDetectorThread()

resubscribe

public void resubscribe(ajanta.naming.URN monitorURN)
                 throws java.rmi.RemoteException
Specified by:
resubscribe in interface Subscriber
Throws:
java.rmi.RemoteException

addHandlerPostAction

public void addHandlerPostAction(EventHandler handler)
Specified by:
addHandlerPostAction in class BasicItineraryAgent

getRoomContents

public java.lang.String getRoomContents()
                                 throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

presentUserCount

public int presentUserCount()
                     throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getAgentID

public java.lang.String getAgentID()
                            throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

isPresent

public boolean isPresent(java.lang.String userName)
                  throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

addUser

public void addUser(java.lang.String userName)
             throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getUserList

public java.util.Vector getUserList()
                             throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

removeUser

public void removeUser(java.lang.String userName)
                throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

getLocation

public java.lang.String getLocation(java.lang.String user)
                             throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

updateUserLocation

public void updateUserLocation(java.lang.String user,
                               java.lang.String loc)
                        throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

removeUserFromLocationTable

public void removeUserFromLocationTable(java.lang.String user,
                                        java.lang.String loc)
                                 throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

isColocated

public boolean isColocated(java.lang.String user1,
                           java.lang.String user2)
                    throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

isColocatedAny

public boolean isColocatedAny(java.lang.String user1,
                              java.util.Vector userList)
                       throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException

isColocatedAll

public boolean isColocatedAll(java.lang.String user1,
                              java.util.Vector userList)
                       throws java.rmi.RemoteException
Throws:
java.rmi.RemoteException