Changeset 001c361


Ignore:
Timestamp:
Oct 17, 2009 2:21:38 AM (11 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
2190954
Parents:
e21a172e
Message:

MessageHistory? cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • router/java/src/net/i2p/router/MessageHistory.java

    re21a172e r001c361  
    4040    private final static int FLUSH_SIZE = 1000; // write out at least once every 1000 entries
    4141       
    42     /** config property determining whether we want to debug with the message history */
     42    /** config property determining whether we want to debug with the message history - default false */
    4343    public final static String PROP_KEEP_MESSAGE_HISTORY = "router.keepHistory";
    44     public final static boolean DEFAULT_KEEP_MESSAGE_HISTORY = false;
    4544    /** config property determining where we want to log the message history, if we're keeping one */
    4645    public final static String PROP_MESSAGE_HISTORY_FILENAME = "router.historyFilename";
     
    6867   
    6968    private void updateSettings() {
    70         String keepHistory = _context.router().getConfigSetting(PROP_KEEP_MESSAGE_HISTORY);
    71         if (keepHistory != null) {
    72             _doLog = Boolean.TRUE.toString().equalsIgnoreCase(keepHistory);
    73         } else {
    74             _doLog = DEFAULT_KEEP_MESSAGE_HISTORY;
    75         }
    76 
    77         String filename = null;
    78         if (_doLog) {
    79             filename = _context.router().getConfigSetting(PROP_MESSAGE_HISTORY_FILENAME);
    80             if ( (filename == null) || (filename.trim().length() <= 0) )
    81                 filename = DEFAULT_MESSAGE_HISTORY_FILENAME;
    82         }
     69        _doLog = Boolean.valueOf(_context.getProperty(PROP_KEEP_MESSAGE_HISTORY)).booleanValue();
     70        _historyFile = _context.getProperty(PROP_MESSAGE_HISTORY_FILENAME, DEFAULT_MESSAGE_HISTORY_FILENAME);
    8371    }
    8472   
     
    9785            _context.jobQueue().addJob(_reinitializeJob);
    9886        } else {
    99             String filename = null;
    100             filename = _context.router().getConfigSetting(PROP_MESSAGE_HISTORY_FILENAME);
    101             if ( (filename == null) || (filename.trim().length() <= 0) )
    102                 filename = DEFAULT_MESSAGE_HISTORY_FILENAME;
    103 
    104             _doLog = DEFAULT_KEEP_MESSAGE_HISTORY;
    105             _historyFile = filename;
    10687            _localIdent = getName(_context.routerHash());
    10788            // _unwrittenEntries = new ArrayList(64);
Note: See TracChangeset for help on using the changeset viewer.