Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

CheckpointConfig.java

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2002-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: CheckpointConfig.java,v 12.1 2005/06/16 20:22:58 bostic Exp $
00008  */
00009 
00010 package com.sleepycat.db;
00011 
00012 import com.sleepycat.db.internal.DbEnv;
00013 import com.sleepycat.db.internal.DbConstants;
00014 
00015 public class CheckpointConfig  {
00016     public static final CheckpointConfig DEFAULT = new CheckpointConfig();
00017 
00018     private boolean force = false;
00019     private int kBytes = 0;
00020     private int minutes = 0;
00021 
00022     public CheckpointConfig() {
00023     }
00024 
00025     /* package */
00026     static CheckpointConfig checkNull(CheckpointConfig config) {
00027         return (config == null) ? DEFAULT : config;
00028     }
00029 
00030     public void setKBytes(final int kBytes) {
00031         this.kBytes = kBytes;
00032     }
00033 
00034     public int getKBytes() {
00035         return kBytes;
00036     }
00037 
00038     public void setMinutes(final int minutes) {
00039         this.minutes = minutes;
00040     }
00041 
00042     public int getMinutes() {
00043         return minutes;
00044     }
00045 
00046     public void setForce(final boolean force) {
00047         this.force = force;
00048     }
00049 
00050     public boolean getForce() {
00051         return force;
00052     }
00053 
00054     /* package */
00055     void runCheckpoint(final DbEnv dbenv)
00056         throws DatabaseException {
00057 
00058         dbenv.txn_checkpoint(kBytes, minutes, force ? DbConstants.DB_FORCE : 0);
00059     }
00060 }

Generated on Sun Dec 25 12:14:32 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2