|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.TimerTask
org.starhope.appius.user.events.Quaestor
public class Quaestor
WRITEME: Document this type.
Field Summary | |
---|---|
(package private) static Collection<ActionHandlerInterface> |
actionHandlers
collection of all action handlers in the system |
private Queue<Action> |
actionQueue
WRITEME: Document this brpocock@star-hope.org |
private static Quaestor |
defaultQuaestor
WRITEME: Document this brpocock@star-hope.org |
private static Quaestor |
localQuaestor
The local Quaestor instance, in case it's needed |
private WeakHashMap<AbstractUser,Set<ActionHandlerInterface>> |
weakListeners
weak listeners stuff |
Constructor Summary | |
---|---|
private |
Quaestor()
WRITEME: Document this constructor brpocock@star-hope.org |
Method Summary | |
---|---|
static void |
action(AbstractUser subject,
String verb)
Deprecated. use action(Action) |
static void |
action(AbstractUser subject,
String verb,
AbstractUser object)
Deprecated. use action(Action) |
static void |
action(AbstractUser user,
String verb,
String string)
Deprecated. use action(Action) |
void |
action(Action action)
WRITEME: Document this method brpocock@star-hope.org |
static void |
action(Room where,
AbstractUser subject,
String verb)
Deprecated. use action(Action) |
static void |
action(Room where,
AbstractUser subject,
String verb,
AbstractUser object)
Deprecated. use action(Action) |
static void |
action(Room where,
AbstractUser subject,
String verb,
AbstractUser object,
String indirectObject,
Object... trailer)
Deprecated. use action(Action) |
static void |
action(Room room,
AbstractUser user,
String verb,
String indirectObject)
Deprecated. use action(Action) |
static void |
action(Room where,
String verb,
AbstractUser object)
Deprecated. use action(Action) |
static void |
action(String verb)
Deprecated. use action(Action) |
static void |
action(String verb,
AbstractUser object)
Deprecated. use action(Action) |
static void |
action(String verb,
String indirectObject)
Deprecated. use action(Action) |
private boolean |
dispatchAction(Action action)
WRITEME: Document this method brpocock@star-hope.org |
private static void |
dispatchAction(Room where,
AbstractUser subject,
String verb,
AbstractUser object,
String indirectObject,
Object... trailer)
WRITEME: Document this method brpocock@star-hope.org |
static Quaestor |
getDefault()
WRITEME: Document this method brpocock@star-hope.org |
static int |
getEndedEventCount(AbstractUser user,
String moniker)
Gets a count of all ended events of a specific event type for a given user |
static EventRecord |
getEventByID(int eventID)
|
static int |
getEventCount(AbstractUser user,
String moniker)
Gets a count of a all occurrences of a specific event for a specified user regardless of finished status |
static EventType |
getEventTypeByID(int eventTypeID)
Get an event type, given its ID. |
private static EventType |
getEventTypeForMoniker(String moniker)
WRITEME: Document this method brpocock@star-hope.org |
static int |
getItemGainedEventCount(AbstractUser user,
String moniker,
int itemID)
Gets a count of a all occurrences of a specific event for a specified user that adds an item |
static Quaestor |
getLocal()
Get the local Quaestor, even if a network one is available |
static List<Integer> |
getStartedEventsByType(AbstractUser user,
String moniker)
Gets a list of all events of the given type that were started but not yet ended |
static void |
ignore(ActionHandlerInterface handler)
WRITEME: Document this method brpocock@star-hope.org |
static void |
listen(ActionHandlerInterface handler)
WRITEME: Document this method brpocock@star-hope.org |
void |
run()
|
void |
setDefault()
Set the default Quaestor to be used when getDefault() is
called. |
static void |
setDefaultToLocal()
Set the local quaestor as the default one to be used, normally flagging the death of a network Quaestor for some reason |
static org.json.JSONObject |
startEvent_JSON(AbstractUser user,
String moniker)
Start an event and return the JSON object for the client with event details |
static EventRecord |
startEvent(AbstractUser user,
String moniker)
WRITEME: Document this method brpocock@star-hope.org |
static int |
startEventRaw(AbstractUser user,
String moniker)
WRITEME: Document this method brpocock@star-hope.org |
void |
tryAction(Action action)
WRITEME: Document this method brpocock@star-hope.org |
void |
weakListen(AbstractUser u,
ActionHandlerInterface actionHandler)
Listen for an event, weakly, forgetting about it if the user logs out. |
Methods inherited from class java.util.TimerTask |
---|
cancel, scheduledExecutionTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static Collection<ActionHandlerInterface> actionHandlers
private static Quaestor defaultQuaestor
private static final Quaestor localQuaestor
private final Queue<Action> actionQueue
private final WeakHashMap<AbstractUser,Set<ActionHandlerInterface>> weakListeners
Constructor Detail |
---|
private Quaestor()
Method Detail |
---|
@Deprecated public static void action(AbstractUser subject, String verb)
action(Action)
subject
- WRITEMEverb
- WRITEME@Deprecated public static void action(AbstractUser subject, String verb, AbstractUser object)
action(Action)
subject
- WRITEMEverb
- WRITEMEobject
- WRITEME@Deprecated public static void action(AbstractUser user, String verb, String string)
action(Action)
user
- WRITEMEverb
- WRITEMEstring
- WRITEME@Deprecated public static void action(Room where, AbstractUser subject, String verb)
action(Action)
where
- WRITEMEsubject
- WRITEMEverb
- WRITEME@Deprecated public static void action(Room where, AbstractUser subject, String verb, AbstractUser object)
action(Action)
where
- WRITEMEsubject
- WRITEMEverb
- WRITEMEobject
- WRITEME@Deprecated public static void action(Room where, AbstractUser subject, String verb, AbstractUser object, String indirectObject, Object... trailer)
action(Action)
where
- WRITEMEsubject
- WRITEMEverb
- WRITEMEobject
- WRITEMEindirectObject
- WRITEMEtrailer
- WRITEME@Deprecated public static void action(Room room, AbstractUser user, String verb, String indirectObject)
action(Action)
room
- WRITEMEuser
- WRITEMEverb
- WRITEMEindirectObject
- WRITEME@Deprecated public static void action(Room where, String verb, AbstractUser object)
action(Action)
where
- WRITEMEverb
- WRITEMEobject
- WRITEME@Deprecated public static void action(String verb)
action(Action)
verb
- WRITEME@Deprecated public static void action(String verb, AbstractUser object)
action(Action)
verb
- WRITEMEobject
- WRITEME@Deprecated public static void action(String verb, String indirectObject)
action(Action)
verb
- WRITEMEindirectObject
- WRITEMEprivate static void dispatchAction(Room where, AbstractUser subject, String verb, AbstractUser object, String indirectObject, Object... trailer)
where
- WRITEMEsubject
- WRITEME WRITEMEverb
- WRITEMEobject
- WRITEMEindirectObject
- WRITEMEtrailer
- WRITEMEpublic static Quaestor getDefault()
public static int getEndedEventCount(AbstractUser user, String moniker)
user
- Usermoniker
- Event Type
public static EventRecord getEventByID(int eventID) throws NotFoundException
eventID
- the ID of the event to be loaded
NotFoundException
- if the event record does not existpublic static int getEventCount(AbstractUser user, String moniker)
user
- Usermoniker
- Event Type
public static EventType getEventTypeByID(int eventTypeID) throws NotFoundException
Nomenclator.getDataRecord(Class, int)
with
EventType.class, these days.
eventTypeID
- id number
NotFoundException
- if not foundprivate static EventType getEventTypeForMoniker(String moniker) throws NotFoundException
moniker
- WRITEME
NotFoundException
- not foundpublic static int getItemGainedEventCount(AbstractUser user, String moniker, int itemID)
user
- Usermoniker
- Event TypeitemID
- Item ID
public static Quaestor getLocal()
public static List<Integer> getStartedEventsByType(AbstractUser user, String moniker)
moniker
- Event Type monikeruser
- User
public static void ignore(ActionHandlerInterface handler)
handler
- WRITEMEpublic static void listen(ActionHandlerInterface handler)
handler
- WRITEMEpublic static void setDefaultToLocal()
public static EventRecord startEvent(AbstractUser user, String moniker) throws AlreadyExistsException, NotFoundException
user
- user starting (creating) the eventmoniker
- WRITEME
AlreadyExistsException
- if the event can't be started
again
NotFoundException
- if the type isn't foundpublic static org.json.JSONObject startEvent_JSON(AbstractUser user, String moniker)
user
- the user starting the eventmoniker
- the event moniker
public static int startEventRaw(AbstractUser user, String moniker) throws AlreadyExistsException
user
- WRITEMEmoniker
- WRITEME
AlreadyExistsException
- if the user can't perform this
event because of event limits in place on itpublic void action(Action action)
action
- WRITEMEprivate boolean dispatchAction(Action action)
action
- WRITEME
public void run()
run
in interface Runnable
run
in class TimerTask
TimerTask.run()
public void setDefault()
getDefault()
is
called. Most routines will use this one.
public void tryAction(Action action) throws NotFoundException
action
- WRITEME
NotFoundException
- if no handler accepts the actionpublic void weakListen(AbstractUser u, ActionHandlerInterface actionHandler)
u
- the user to weakly listen for an eventactionHandler
- the handler to use
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |