Project

General

Profile

« Previous | Next » 

Revision 4087

Added by daigle about 16 years ago

Add addProperty and addPropertyNoPersist for new properties

View differences:

src/edu/ucsb/nceas/metacat/MetacatReplication.java
43 43
import edu.ucsb.nceas.metacat.util.MetaCatUtil;
44 44
import edu.ucsb.nceas.metacat.util.SessionData;
45 45
import edu.ucsb.nceas.metacat.util.SystemUtil;
46
import edu.ucsb.nceas.utilities.GeneralPropertyException;
46 47
import edu.ucsb.nceas.utilities.PropertyNotFoundException;
47 48

  
48 49
import org.apache.log4j.Logger;
......
245 246
      replicationDaemon.cancel();
246 247
      replicationDaemon = new Timer(true);
247 248
      timedReplicationIsOn = false;
248
      PropertyService.setProperty(TIMEREPLICATION, (new Boolean(timedReplicationIsOn)).toString());
249
      try {
250
    	  PropertyService.setProperty(TIMEREPLICATION, (new Boolean(timedReplicationIsOn)).toString());
251
      } catch (GeneralPropertyException gpe) {
252
    	  logMetacat.warn("Could not set " + TIMEREPLICATION + " property: " + gpe.getMessage());
253
      }
249 254
      out.println("Replication Handler Stopped");
250 255
      MetacatReplication.replLog("deltaT handler stopped");
251 256

  
......
291 296
      }
292 297
      
293 298
      timedReplicationIsOn = true;
299
      try {
294 300
      // save settings to property file
295 301
      PropertyService.setProperty(TIMEREPLICATION, (new Boolean(timedReplicationIsOn)).toString());
296 302
      // note we couldn't use firstTime object because it has date info
297 303
      // we only need time info such as 10:00 PM
298 304
      PropertyService.setProperty(FIRSTTIME, firstTimeStr);
299 305
      PropertyService.setProperty(TIMEREPLICATIONINTERVAl, (new Long(timeInterval)).toString());
306
      } catch (GeneralPropertyException gpe) {
307
    	  logMetacat.warn("Could not set property: " + gpe.getMessage());
308
      }
300 309
      replicationDaemon.cancel();
301 310
      replicationDaemon = new Timer(true);
302 311
      replicationDaemon.scheduleAtFixedRate(new ReplicationHandler(), firstTime,

Also available in: Unified diff