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

CacheFile.java

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2001-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: CacheFile.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.DbConstants;
00013 import com.sleepycat.db.internal.DbMpoolFile;
00014 
00015 public class CacheFile {
00016     private DbMpoolFile mpf;
00017 
00018     /* package */
00019     CacheFile(final DbMpoolFile mpf) {
00020         this.mpf = mpf;
00021     }
00022 
00023     public CacheFilePriority getPriority()
00024         throws DatabaseException {
00025 
00026         return CacheFilePriority.fromFlag(mpf.get_priority());
00027     }
00028 
00029     public void setPriority(final CacheFilePriority priority)
00030         throws DatabaseException {
00031 
00032         mpf.set_priority(priority.getFlag());
00033     }
00034 
00035     public long getMaximumSize()
00036         throws DatabaseException {
00037 
00038         return mpf.get_maxsize();
00039     }
00040 
00041     public void setMaximumSize(final long bytes)
00042         throws DatabaseException {
00043 
00044         mpf.set_maxsize(bytes);
00045     }
00046 
00047     public boolean getNoFile()
00048         throws DatabaseException {
00049 
00050         return (mpf.get_flags() & DbConstants.DB_MPOOL_NOFILE) != 0;
00051     }
00052 
00053     public void setNoFile(final boolean onoff)
00054         throws DatabaseException {
00055 
00056         mpf.set_flags(DbConstants.DB_MPOOL_NOFILE, onoff);
00057     }
00058 
00059     public boolean getUnlink()
00060         throws DatabaseException {
00061 
00062         return (mpf.get_flags() & DbConstants.DB_MPOOL_UNLINK) != 0;
00063     }
00064 
00065     public void setUnlink(boolean onoff)
00066         throws DatabaseException {
00067 
00068         mpf.set_flags(DbConstants.DB_MPOOL_UNLINK, onoff);
00069     }
00070 }

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