Changeset d81f42e3


Ignore:
Timestamp:
Apr 10, 2004 10:08:33 AM (17 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
3e5f56b
Parents:
4fb3d347
git-author:
shendaras <shendaras> (04/10/04 10:08:33)
git-committer:
zzz <zzz@…> (04/10/04 10:08:33)
Message:

again? Longer wrapping
(shendaras)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/heartbeat/java/src/net/i2p/heartbeat/ClientConfig.java

    r4fb3d347 rd81f42e3  
    119119     *            list of minutes to summarize over
    120120     */
    121     public ClientConfig(Destination peer, Destination us, String statFile,
    122             int duration, int statFreq, int sendFreq, int sendSize,
    123             int numHops, String comment, int averagePeriods[]) {
     121    public ClientConfig(Destination peer, Destination us, String statFile, int duration, int statFreq, int sendFreq,
     122            int sendSize, int numHops, String comment, int averagePeriods[]) {
    124123        _peer = peer;
    125124        _us = us;
     
    346345    public boolean load(Properties clientConfig, int peerNum) {
    347346        if ((clientConfig == null) || (peerNum < 0)) return false;
    348         String peerVal = clientConfig.getProperty(PROP_PREFIX + peerNum
    349                 + PROP_PEER);
    350         String statFileVal = clientConfig.getProperty(PROP_PREFIX + peerNum
    351                 + PROP_STATFILE);
    352         String statDurationVal = clientConfig.getProperty(PROP_PREFIX + peerNum
    353                 + PROP_STATDURATION);
    354         String statFrequencyVal = clientConfig.getProperty(PROP_PREFIX
    355                 + peerNum + PROP_STATFREQUENCY);
    356         String sendFrequencyVal = clientConfig.getProperty(PROP_PREFIX
    357                 + peerNum + PROP_SENDFREQUENCY);
    358         String sendSizeVal = clientConfig.getProperty(PROP_PREFIX + peerNum
    359                 + PROP_SENDSIZE);
    360         String commentVal = clientConfig.getProperty(PROP_PREFIX + peerNum
    361                 + PROP_COMMENT);
    362         String periodsVal = clientConfig.getProperty(PROP_PREFIX + peerNum
    363                 + PROP_AVERAGEPERIODS);
    364 
    365         if ((peerVal == null) || (statFileVal == null)
    366                 || (statDurationVal == null) || (statFrequencyVal == null)
     347        String peerVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_PEER);
     348        String statFileVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_STATFILE);
     349        String statDurationVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_STATDURATION);
     350        String statFrequencyVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_STATFREQUENCY);
     351        String sendFrequencyVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_SENDFREQUENCY);
     352        String sendSizeVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_SENDSIZE);
     353        String commentVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_COMMENT);
     354        String periodsVal = clientConfig.getProperty(PROP_PREFIX + peerNum + PROP_AVERAGEPERIODS);
     355
     356        if ((peerVal == null) || (statFileVal == null) || (statDurationVal == null) || (statFrequencyVal == null)
    367357                || (sendFrequencyVal == null) || (sendSizeVal == null)) {
    368358            if (_log.shouldLog(Log.DEBUG)) {
     
    378368            int sendSize = getInt(sendSizeVal);
    379369
    380             if ((duration <= 0) || (statFreq <= 0) || (sendFreq <= 0)
    381                     || (sendSize <= 0)) {
     370            if ((duration <= 0) || (statFreq <= 0) || (sendFreq <= 0) || (sendSize <= 0)) {
    382371                if (_log.shouldLog(Log.WARN)) {
    383                     _log.warn("Invalid client config: duration ["
    384                             + statDurationVal + "] stat frequency ["
    385                             + statFrequencyVal + "] send frequency ["
    386                             + sendFrequencyVal + "] send size [" + sendSizeVal
     372                    _log.warn("Invalid client config: duration [" + statDurationVal + "] stat frequency ["
     373                            + statFrequencyVal + "] send frequency [" + sendFrequencyVal + "] send size [" + sendSizeVal
    387374                            + "]");
    388375                }
     
    434421            return true;
    435422        } catch (DataFormatException dfe) {
    436             _log.error("Peer destination for " + peerNum + " was invalid: "
    437                     + peerVal);
     423            _log.error("Peer destination for " + peerNum + " was invalid: " + peerVal);
    438424            return false;
    439425        }
     
    451437     */
    452438    public boolean store(Properties clientConfig, int peerNum) {
    453         if ((_peer == null) || (_sendFrequency <= 0) || (_sendSize <= 0)
    454                 || (_statDuration <= 0) || (_statFrequency <= 0)
     439        if ((_peer == null) || (_sendFrequency <= 0) || (_sendSize <= 0) || (_statDuration <= 0) || (_statFrequency <= 0)
    455440                || (_statFile == null)) { return false; }
    456441
     
    470455        }
    471456
    472         clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_PEER, _peer
    473                 .toBase64());
    474         clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_STATFILE,
    475                 _statFile);
    476         clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_STATDURATION,
    477                 _statDuration + "");
    478         clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_STATFREQUENCY,
    479                 _statFrequency + "");
    480         clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_SENDFREQUENCY,
    481                 _sendFrequency + "");
    482         clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_SENDSIZE,
    483                 _sendSize + "");
     457        clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_PEER, _peer.toBase64());
     458        clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_STATFILE, _statFile);
     459        clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_STATDURATION, _statDuration + "");
     460        clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_STATFREQUENCY, _statFrequency + "");
     461        clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_SENDFREQUENCY, _sendFrequency + "");
     462        clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_SENDSIZE, _sendSize + "");
    484463        clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_COMMENT, comment);
    485         clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_AVERAGEPERIODS,
    486                 buf.toString());
     464        clientConfig.setProperty(PROP_PREFIX + peerNum + PROP_AVERAGEPERIODS, buf.toString());
    487465        return true;
    488466    }
Note: See TracChangeset for help on using the changeset viewer.