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 | 
idConverterJOURNAL_BOUNDARYisDebugging, name, serviceClient, tickStatusSTATUS_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, propertiesLoadedcopyOf, initializeClass, name, newInstanceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckDatabase, compareTo, copyOf, getServiceClient, getTickStatus, initializeClass, L, name, newInstance, propertiesLoaded, setThreadStatuspublic 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()
CMObjectID in interface CMObjectID in class StdLibraryprotected java.util.Hashtable<java.lang.String,JournalsLibrary.JournalMetaData> getSummaryStats()
public JournalsLibrary.JournalMetaData getJournalStats(JournalsLibrary.ForumJournal journal)
JournalsLibrarygetJournalStats in interface JournalsLibraryjournal - the journalJournalsLibrary.JournalMetaDatapublic void clearJournalSummaryStats(JournalsLibrary.ForumJournal journal)
JournalsLibraryclearJournalSummaryStats in interface JournalsLibraryjournal - the journal that needs updatingJournalsLibrary.JournalMetaDatapublic int loadCommandJournals(java.lang.String list)
JournalsLibraryloadCommandJournals in interface JournalsLibrarylist - the coded stringJournalsLibrary.CommandJournal, 
JournalsLibrary.commandJournals(), 
JournalsLibrary.getCommandJournal(String), 
JournalsLibrary.getNumCommandJournals()public boolean canReadMessage(JournalEntry entry, java.lang.String srchMatch, MOB readerM, boolean ignorePrivileges)
JournalsLibrarycanReadMessage in interface JournalsLibraryentry - 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)
JournalsLibraryloadForumJournals in interface JournalsLibrarylist - the coded stringJournalsLibrary.getNumForumJournals(), 
JournalsLibrary.forumJournals(), 
JournalsLibrary.forumJournalsSorted(), 
JournalsLibrary.getForumJournal(String), 
JournalsLibrary.getForumJournal(String, Clan)public java.util.List<JournalsLibrary.ForumJournal> getClanForums(Clan clan)
JournalsLibrarygetClanForums in interface JournalsLibraryclan - the clanJournalsLibrary.registerClanForum(Clan, String)public void registerClanForum(Clan clan, java.lang.String allClanForumDefs)
JournalsLibraryregisterClanForum in interface JournalsLibraryclan - 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()
JournalsLibrarygetArchonJournalNames in interface JournalsLibraryJournalsLibrary.isArchonJournalName(String), 
ArchonOnlypublic boolean isArchonJournalName(java.lang.String journal)
JournalsLibraryisArchonJournalName in interface JournalsLibraryjournal - the journal nameJournalsLibrary.getArchonJournalNames(), 
ArchonOnlypublic java.lang.String getScriptValue(MOB mob, java.lang.String journal, java.lang.String oldValue)
JournalsLibrarygetScriptValue in interface JournalsLibrarymob - the player trying to post to the journaljournal - the journal that might be scriptedoldValue - the value entered before the scriptingpublic int getNumCommandJournals()
JournalsLibrarygetNumCommandJournals in interface JournalsLibraryJournalsLibrary.CommandJournal, 
JournalsLibrary.loadCommandJournals(String), 
JournalsLibrary.commandJournals(), 
JournalsLibrary.getCommandJournal(String)public java.util.Enumeration<JournalsLibrary.CommandJournal> commandJournals()
JournalsLibrarycommandJournals in interface JournalsLibraryJournalsLibrary.CommandJournal, 
JournalsLibrary.loadCommandJournals(String), 
JournalsLibrary.getCommandJournal(String), 
JournalsLibrary.getNumCommandJournals()public JournalsLibrary.CommandJournal getCommandJournal(java.lang.String named)
JournalsLibrarygetCommandJournal in interface JournalsLibrarynamed - 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()
CMLibraryactivate in interface CMLibraryactivate in class StdLibraryCMLibrary.shutdown()protected void initializeCalendarEvents()
protected void resetCalendarEvents(long now)
public void resetCalendarEvents()
JournalsLibraryresetCalendarEvents in interface JournalsLibraryprotected 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)
Tickabletick in interface Tickabletick in class StdLibraryticking - a reference to this Tickable objecttickID - the TICKID_ constant describing this periodic call, as defined in TickableTickable, 
ServiceEngine, 
TickableGrouppublic int getNumForumJournals()
JournalsLibrarygetNumForumJournals in interface JournalsLibraryJournalsLibrary.forumJournals(), 
JournalsLibrary.forumJournalsSorted(), 
JournalsLibrary.getForumJournal(String), 
JournalsLibrary.getForumJournal(String, Clan), 
JournalsLibrary.loadForumJournals(String)public java.util.Enumeration<JournalsLibrary.ForumJournal> forumJournals()
JournalsLibraryforumJournals in interface JournalsLibraryJournalsLibrary.getNumForumJournals(), 
JournalsLibrary.forumJournalsSorted(), 
JournalsLibrary.getForumJournal(String), 
JournalsLibrary.getForumJournal(String, Clan), 
JournalsLibrary.loadForumJournals(String)public java.util.Enumeration<JournalsLibrary.ForumJournal> forumJournalsSorted()
JournalsLibraryforumJournalsSorted in interface JournalsLibraryJournalsLibrary.getNumForumJournals(), 
JournalsLibrary.forumJournals(), 
JournalsLibrary.getForumJournal(String), 
JournalsLibrary.getForumJournal(String, Clan), 
JournalsLibrary.loadForumJournals(String)public JournalsLibrary.ForumJournal getForumJournal(java.lang.String named)
JournalsLibrarygetForumJournal in interface JournalsLibrarynamed - 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)
JournalsLibrarygetForumJournal in interface JournalsLibrarynamed - 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()
CMLibraryshutdown in interface CMLibraryshutdown in class StdLibraryCMLibrary.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)
JournalsLibrarynotifyPosting in interface JournalsLibraryjournal - 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)
JournalsLibrarynotifyReplying in interface JournalsLibraryjournal - 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)
JournalsLibrarymakeMessageASync in interface JournalsLibraryM - 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.MsgMkrResolutionprotected JournalsLibrary.MsgMkrResolution makeMessage(MOB mob, java.lang.String messageTitle, java.util.List<java.lang.String> vbuf, boolean autoAdd) throws java.io.IOException
java.io.IOExceptionpublic boolean unsubscribeFromAll(java.lang.String username)
JournalsLibraryunsubscribeFromAll in interface JournalsLibraryusername - the user/accountpublic boolean subscribeToJournal(java.lang.String journalName,
                                  java.lang.String userName,
                                  boolean saveMailingList)
JournalsLibrarysubscribeToJournal in interface JournalsLibraryjournalName - 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)
JournalsLibraryunsubscribeFromJournal in interface JournalsLibraryjournalName - the name of the journaluserName - the user who subscribedsaveMailingList - true to save afterwards, false if you'll do it later