CMObject
, Tickable
, CMLibrary
, JournalsLibrary
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
public class CMJournals extends StdLibrary implements JournalsLibrary
Modifier and Type | Class | Description |
---|---|---|
protected static class |
CMJournals.JScriptWindow |
JournalsLibrary.CommandJournal, JournalsLibrary.CommandJournalFlags, JournalsLibrary.ForumJournal, JournalsLibrary.ForumJournalFlags, JournalsLibrary.JournalMetaData, JournalsLibrary.MsgMkrCallback, JournalsLibrary.MsgMkrResolution, JournalsLibrary.SMTPJournal
Modifier and Type | Field | Description |
---|---|---|
protected java.util.Map<java.lang.String,java.util.List<JournalsLibrary.ForumJournal>> |
clanForums |
|
protected SHashtable<java.lang.String,JournalsLibrary.CommandJournal> |
commandJournals |
|
protected PairList<java.lang.Long,java.lang.String> |
cronJobs |
|
protected static java.util.List<JournalsLibrary.ForumJournal> |
emptyForums |
|
protected SHashtable<java.lang.String,JournalsLibrary.ForumJournal> |
forumJournals |
|
protected java.util.Vector<JournalsLibrary.ForumJournal> |
forumJournalsSorted |
|
protected int |
lastMotdDate |
|
protected long |
lastSweepTime |
|
protected java.util.List<JournalEntry> |
nextEvents |
|
int |
QUEUE_SIZE |
|
protected static int |
SWEEP_TICK_MAX |
|
protected int |
sweepTickDown |
idConverter
JOURNAL_BOUNDARY
isDebugging, name, serviceClient, tickStatus
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
CMJournals() |
Modifier and Type | Method | Description |
---|---|---|
boolean |
activate() |
Activates the library.
|
boolean |
canReadMessage(JournalEntry entry,
java.lang.String srchMatch,
MOB readerM,
boolean ignorePrivileges) |
A security checker for whether the given user can read the
given message.
|
void |
clearJournalSummaryStats(JournalsLibrary.ForumJournal journal) |
Clears the forum journal summary stats so that they can
be rebuilt from the database.
|
java.util.Enumeration<JournalsLibrary.CommandJournal> |
commandJournals() |
Returns an enumeration of all registered command
journals
|
protected void |
expirationJournalSweep() |
|
java.util.Enumeration<JournalsLibrary.ForumJournal> |
forumJournals() |
Returns an enumeration of all normal forumJournals (not
clan ones).
|
java.util.Enumeration<JournalsLibrary.ForumJournal> |
forumJournalsSorted() |
Returns an enumeration of all normal ForumJournals (not
clan ones), sorted by somehow.
|
java.util.Set<java.lang.String> |
getArchonJournalNames() |
Returns the cached set of basic items that implement
the ArchonOnly interface, thus making them ArchonOnly
journals.
|
protected java.lang.String |
getCalendarEvent(TimeClock localClock,
JournalEntry event) |
|
java.util.List<JournalsLibrary.ForumJournal> |
getClanForums(Clan clan) |
Returns the list of ForumJournals that exist for the given clan.
|
JournalsLibrary.CommandJournal |
getCommandJournal(java.lang.String named) |
Returns the information about the Command Journal
of the given name.
|
JournalsLibrary.ForumJournal |
getForumJournal(java.lang.String named) |
Returns a ForumJournal of the given name.
|
JournalsLibrary.ForumJournal |
getForumJournal(java.lang.String named,
Clan clan) |
Retreives a specific forum journal given to a particular clan.
|
JournalsLibrary.JournalMetaData |
getJournalStats(JournalsLibrary.ForumJournal journal) |
Get the forum journal summary stats, caching them after
calculation from the database
|
protected java.lang.String |
getMsgMkrHelp(Session sess) |
|
int |
getNumCommandJournals() |
Returns the number of command journals, or journals
written to using standard game commands.
|
int |
getNumForumJournals() |
Returns the number of forum journals.
|
java.lang.String |
getScriptValue(MOB mob,
java.lang.String journal,
java.lang.String oldValue) |
If the given journal requires running a MOBPROG script
in order to produce a final message, this function will
run that script.
|
protected java.util.Hashtable<java.lang.String,JournalsLibrary.JournalMetaData> |
getSummaryStats() |
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
protected void |
initializeCalendarEvents() |
|
boolean |
isArchonJournalName(java.lang.String journal) |
Returns whether the given journal appears on the archon
journal names list.
|
int |
loadCommandJournals(java.lang.String list) |
Given an encoded journals list string, this function will
register all the CommandJournals described by the encoded
list string.
|
int |
loadForumJournals(java.lang.String list) |
Loads the forumjournals from the given encoded forum
definition string.
|
protected JournalsLibrary.MsgMkrResolution |
makeMessage(MOB mob,
java.lang.String messageTitle,
java.util.List<java.lang.String> vbuf,
boolean autoAdd) |
|
void |
makeMessageASync(MOB M,
java.lang.String messageTitle,
java.util.List<java.lang.String> vbuf,
boolean autoAdd,
JournalsLibrary.MsgMkrCallback back) |
An asynchronous system for allowing a user to edit a text document with options for search and replace, line
inserting and deleting, and line replacement.
|
void |
notifyPosting(java.lang.String journal,
java.lang.String from,
java.lang.String to,
java.lang.String subject) |
Whenever a post to a journal is made, this function is called to send a notification to online
users who have subscribed to such things.
|
void |
notifyReplying(java.lang.String journal,
java.lang.String tpAuthor,
java.lang.String reAuthor,
java.lang.String subject) |
Whenever a reply to a journal is made, this function is called to send a notification to online
users who have subscribed to such things.
|
java.util.List<JournalsLibrary.ForumJournal> |
parseForumJournals(java.lang.String list) |
|
protected void |
postCalendarEventTo(JournalEntry event,
java.util.List<Area> areas,
MOB M) |
|
protected void |
processCalendarEvents() |
|
protected JournalEntry |
processCalendarExpiration(JournalEntry expiredEntry) |
|
void |
registerClanForum(Clan clan,
java.lang.String allClanForumDefs) |
Registers a set of ForumJournals for the given clan from the
coded string.
|
void |
resetCalendarEvents() |
Since Calendar events are also journal entries, whenever the calendar is changed,
this method must be called to make sure notifications for new events occurs.
|
protected void |
resetCalendarEvents(long now) |
|
protected long |
runCronJob(java.lang.String jobKey,
boolean debug) |
|
boolean |
shutdown() |
Shuts down the library.
|
boolean |
subscribeToJournal(java.lang.String journalName,
java.lang.String userName,
boolean saveMailingList) |
Called to add a user to the subscription list for a journal.
|
boolean |
tick(Tickable ticking,
int tickID) |
this is the method which is called periodically by the threading engine.
|
boolean |
unsubscribeFromAll(java.lang.String username) |
Unsubscribes the given user/account from every mailing list.
|
boolean |
unsubscribeFromJournal(java.lang.String journalName,
java.lang.String userName,
boolean saveMailingList) |
Called to remove a user from the subscription list for a journal.
|
getServiceClient, L, propertiesLoaded
copyOf, initializeClass, name, newInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatus
public final int QUEUE_SIZE
protected static final int SWEEP_TICK_MAX
protected volatile int sweepTickDown
protected volatile long lastSweepTime
protected final SHashtable<java.lang.String,JournalsLibrary.CommandJournal> commandJournals
protected final java.util.Vector<JournalsLibrary.ForumJournal> forumJournalsSorted
protected final SHashtable<java.lang.String,JournalsLibrary.ForumJournal> forumJournals
protected final java.util.Map<java.lang.String,java.util.List<JournalsLibrary.ForumJournal>> clanForums
protected final PairList<java.lang.Long,java.lang.String> cronJobs
protected final java.util.List<JournalEntry> nextEvents
protected volatile int lastMotdDate
protected static final java.util.List<JournalsLibrary.ForumJournal> emptyForums
public java.lang.String ID()
CMObject
ID
in interface CMObject
ID
in class StdLibrary
protected java.util.Hashtable<java.lang.String,JournalsLibrary.JournalMetaData> getSummaryStats()
public JournalsLibrary.JournalMetaData getJournalStats(JournalsLibrary.ForumJournal journal)
JournalsLibrary
getJournalStats
in interface JournalsLibrary
journal
- the journalJournalsLibrary.JournalMetaData
public void clearJournalSummaryStats(JournalsLibrary.ForumJournal journal)
JournalsLibrary
clearJournalSummaryStats
in interface JournalsLibrary
journal
- the journal that needs updatingJournalsLibrary.JournalMetaData
public int loadCommandJournals(java.lang.String list)
JournalsLibrary
loadCommandJournals
in interface JournalsLibrary
list
- the coded stringJournalsLibrary.CommandJournal
,
JournalsLibrary.commandJournals()
,
JournalsLibrary.getCommandJournal(String)
,
JournalsLibrary.getNumCommandJournals()
public boolean canReadMessage(JournalEntry entry, java.lang.String srchMatch, MOB readerM, boolean ignorePrivileges)
JournalsLibrary
canReadMessage
in interface JournalsLibrary
entry
- the journal entrysrchMatch
- null, or a string to match almost anything in the entryreaderM
- null, or the reader of the messageignorePrivileges
- true to NOT require JOURNAL secflag, false to require itpublic int loadForumJournals(java.lang.String list)
JournalsLibrary
loadForumJournals
in interface JournalsLibrary
list
- the coded stringJournalsLibrary.getNumForumJournals()
,
JournalsLibrary.forumJournals()
,
JournalsLibrary.forumJournalsSorted()
,
JournalsLibrary.getForumJournal(String)
,
JournalsLibrary.getForumJournal(String, Clan)
public java.util.List<JournalsLibrary.ForumJournal> getClanForums(Clan clan)
JournalsLibrary
getClanForums
in interface JournalsLibrary
clan
- the clanJournalsLibrary.registerClanForum(Clan, String)
public void registerClanForum(Clan clan, java.lang.String allClanForumDefs)
JournalsLibrary
registerClanForum
in interface JournalsLibrary
clan
- the clanallClanForumDefs
- the coded stringJournalsLibrary.getClanForums(Clan)
public java.util.List<JournalsLibrary.ForumJournal> parseForumJournals(java.lang.String list)
public java.util.Set<java.lang.String> getArchonJournalNames()
JournalsLibrary
getArchonJournalNames
in interface JournalsLibrary
JournalsLibrary.isArchonJournalName(String)
,
ArchonOnly
public boolean isArchonJournalName(java.lang.String journal)
JournalsLibrary
isArchonJournalName
in interface JournalsLibrary
journal
- the journal nameJournalsLibrary.getArchonJournalNames()
,
ArchonOnly
public java.lang.String getScriptValue(MOB mob, java.lang.String journal, java.lang.String oldValue)
JournalsLibrary
getScriptValue
in interface JournalsLibrary
mob
- the player trying to post to the journaljournal
- the journal that might be scriptedoldValue
- the value entered before the scriptingpublic int getNumCommandJournals()
JournalsLibrary
getNumCommandJournals
in interface JournalsLibrary
JournalsLibrary.CommandJournal
,
JournalsLibrary.loadCommandJournals(String)
,
JournalsLibrary.commandJournals()
,
JournalsLibrary.getCommandJournal(String)
public java.util.Enumeration<JournalsLibrary.CommandJournal> commandJournals()
JournalsLibrary
commandJournals
in interface JournalsLibrary
JournalsLibrary.CommandJournal
,
JournalsLibrary.loadCommandJournals(String)
,
JournalsLibrary.getCommandJournal(String)
,
JournalsLibrary.getNumCommandJournals()
public JournalsLibrary.CommandJournal getCommandJournal(java.lang.String named)
JournalsLibrary
getCommandJournal
in interface JournalsLibrary
named
- the command journal nameJournalsLibrary.CommandJournal
,
JournalsLibrary.loadCommandJournals(String)
,
JournalsLibrary.commandJournals()
,
JournalsLibrary.getNumCommandJournals()
protected long runCronJob(java.lang.String jobKey, boolean debug)
protected JournalEntry processCalendarExpiration(JournalEntry expiredEntry)
protected void expirationJournalSweep()
public boolean activate()
CMLibrary
activate
in interface CMLibrary
activate
in class StdLibrary
CMLibrary.shutdown()
protected void initializeCalendarEvents()
protected void resetCalendarEvents(long now)
public void resetCalendarEvents()
JournalsLibrary
resetCalendarEvents
in interface JournalsLibrary
protected java.lang.String getCalendarEvent(TimeClock localClock, JournalEntry event)
protected void postCalendarEventTo(JournalEntry event, java.util.List<Area> areas, MOB M)
protected void processCalendarEvents()
public boolean tick(Tickable ticking, int tickID)
Tickable
tick
in interface Tickable
tick
in class StdLibrary
ticking
- a reference to this Tickable objecttickID
- the TICKID_ constant describing this periodic call, as defined in TickableTickable
,
ServiceEngine
,
TickableGroup
public int getNumForumJournals()
JournalsLibrary
getNumForumJournals
in interface JournalsLibrary
JournalsLibrary.forumJournals()
,
JournalsLibrary.forumJournalsSorted()
,
JournalsLibrary.getForumJournal(String)
,
JournalsLibrary.getForumJournal(String, Clan)
,
JournalsLibrary.loadForumJournals(String)
public java.util.Enumeration<JournalsLibrary.ForumJournal> forumJournals()
JournalsLibrary
forumJournals
in interface JournalsLibrary
JournalsLibrary.getNumForumJournals()
,
JournalsLibrary.forumJournalsSorted()
,
JournalsLibrary.getForumJournal(String)
,
JournalsLibrary.getForumJournal(String, Clan)
,
JournalsLibrary.loadForumJournals(String)
public java.util.Enumeration<JournalsLibrary.ForumJournal> forumJournalsSorted()
JournalsLibrary
forumJournalsSorted
in interface JournalsLibrary
JournalsLibrary.getNumForumJournals()
,
JournalsLibrary.forumJournals()
,
JournalsLibrary.getForumJournal(String)
,
JournalsLibrary.getForumJournal(String, Clan)
,
JournalsLibrary.loadForumJournals(String)
public JournalsLibrary.ForumJournal getForumJournal(java.lang.String named)
JournalsLibrary
getForumJournal
in interface JournalsLibrary
named
- the name of the forumjournalJournalsLibrary.getNumForumJournals()
,
JournalsLibrary.forumJournals()
,
JournalsLibrary.forumJournalsSorted()
,
JournalsLibrary.getForumJournal(String, Clan)
,
JournalsLibrary.loadForumJournals(String)
public JournalsLibrary.ForumJournal getForumJournal(java.lang.String named, Clan clan)
JournalsLibrary
getForumJournal
in interface JournalsLibrary
named
- the name of the journalclan
- the clan to whom the journal belongsJournalsLibrary.getNumForumJournals()
,
JournalsLibrary.forumJournals()
,
JournalsLibrary.forumJournalsSorted()
,
JournalsLibrary.getForumJournal(String)
,
JournalsLibrary.loadForumJournals(String)
public boolean shutdown()
CMLibrary
shutdown
in interface CMLibrary
shutdown
in class StdLibrary
CMLibrary.activate()
protected java.lang.String getMsgMkrHelp(Session sess)
public void notifyPosting(java.lang.String journal, java.lang.String from, java.lang.String to, java.lang.String subject)
JournalsLibrary
notifyPosting
in interface JournalsLibrary
journal
- the journal posted atfrom
- the author of the message postedto
- who the post is toosubject
- the subject of the top messagepublic void notifyReplying(java.lang.String journal, java.lang.String tpAuthor, java.lang.String reAuthor, java.lang.String subject)
JournalsLibrary
notifyReplying
in interface JournalsLibrary
journal
- the journal replied attpAuthor
- the author of the message replied toreAuthor
- the author of the replysubject
- the subject of the top messagepublic void makeMessageASync(MOB M, java.lang.String messageTitle, java.util.List<java.lang.String> vbuf, boolean autoAdd, JournalsLibrary.MsgMkrCallback back)
JournalsLibrary
makeMessageASync
in interface JournalsLibrary
M
- the player doing the editingmessageTitle
- the title of the messagevbuf
- the text of the messageautoAdd
- true to go directly into line adding mode, false to start in menuback
- the callBack when doneJournalsLibrary.MsgMkrCallback
,
JournalsLibrary.MsgMkrResolution
protected JournalsLibrary.MsgMkrResolution makeMessage(MOB mob, java.lang.String messageTitle, java.util.List<java.lang.String> vbuf, boolean autoAdd) throws java.io.IOException
java.io.IOException
public boolean unsubscribeFromAll(java.lang.String username)
JournalsLibrary
unsubscribeFromAll
in interface JournalsLibrary
username
- the user/accountpublic boolean subscribeToJournal(java.lang.String journalName, java.lang.String userName, boolean saveMailingList)
JournalsLibrary
subscribeToJournal
in interface JournalsLibrary
journalName
- the name of the journaluserName
- the user who subscribedsaveMailingList
- true to save afterwards, false if you'll do it laterpublic boolean unsubscribeFromJournal(java.lang.String journalName, java.lang.String userName, boolean saveMailingList)
JournalsLibrary
unsubscribeFromJournal
in interface JournalsLibrary
journalName
- the name of the journaluserName
- the user who subscribedsaveMailingList
- true to save afterwards, false if you'll do it later