public class DBQuotaManager extends java.lang.Object implements QuotaManager
Filesystem quota management implementation that uses the JDBC database.
Constructor and Description |
---|
DBQuotaManager(DBDeviceContext ctx,
boolean dbg)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
long |
allocateSpace(SrvSession sess,
TreeConnection tree,
NetworkFile file,
long alloc)
Allocate space from the filesystem free space.
|
long |
getAvailableFreeSpace()
Return the available free space in bytes
|
long |
getUserFreeSpace(SrvSession sess,
TreeConnection tree)
Return the free space available to the specified user/session
|
boolean |
hasDebug()
Determine if debug output is enabled
|
void |
releaseSpace(SrvSession sess,
TreeConnection tree,
int fid,
java.lang.String path,
long alloc)
Release space back to the filesystem.
|
void |
setDebug(boolean dbg)
Enable/disable debug output
|
void |
startManager(DiskInterface disk,
DiskDeviceContext ctx)
Start the quota manager
|
void |
stopManager(DiskInterface disk,
DiskDeviceContext ctx)
Stop the quota manager
|
public DBQuotaManager(DBDeviceContext ctx, boolean dbg)
ctx
- DBDeviceContextdbg
- booleanpublic long allocateSpace(SrvSession sess, TreeConnection tree, NetworkFile file, long alloc) throws java.io.IOException
allocateSpace
in interface QuotaManager
sess
- SrvSessiontree
- TreeConnectionfile
- NetworkFilealloc
- longjava.io.IOException
public void releaseSpace(SrvSession sess, TreeConnection tree, int fid, java.lang.String path, long alloc) throws java.io.IOException
releaseSpace
in interface QuotaManager
sess
- SrvSessiontree
- TreeConnectionfid
- intpath
- Stringalloc
- longjava.io.IOException
public void startManager(DiskInterface disk, DiskDeviceContext ctx) throws QuotaManagerException
startManager
in interface QuotaManager
disk
- DiskInterfacectx
- DiskDeviceContextQuotaManagerException
public void stopManager(DiskInterface disk, DiskDeviceContext ctx) throws QuotaManagerException
stopManager
in interface QuotaManager
disk
- DiskInterfacectx
- DiskDeviceContextQuotaManagerException
public long getAvailableFreeSpace()
getAvailableFreeSpace
in interface QuotaManager
public long getUserFreeSpace(SrvSession sess, TreeConnection tree)
getUserFreeSpace
in interface QuotaManager
sess
- SrvSessiontree
- TreeConnectionpublic boolean hasDebug()
public void setDebug(boolean dbg)
dbg
- booleanCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.