public class ContentQuotaManager extends Object implements QuotaManager, Runnable
Implementation of JLAN QuotaManager interface for the Alfresco repository.
Keeps an in memory quota for each active user. After a configurable length of time quotas are removed from memory.
| Constructor and Description |
|---|
ContentQuotaManager() |
| Modifier and Type | Method and Description |
|---|---|
long |
allocateSpace(SrvSession sess,
TreeConnection tree,
NetworkFile file,
long alloc)
Allocate space on the filesystem.
|
long |
getAvailableFreeSpace()
Return the free space available in bytes
|
ContentService |
getContentService() |
ContentUsageService |
getUsageService()
Get the usage service
|
long |
getUserFreeSpace(SrvSession sess,
TreeConnection tree)
Return the free space available to the specified user/session
|
void |
init() |
void |
releaseSpace(SrvSession sess,
TreeConnection tree,
int fid,
String path,
long alloc)
Release space to the free space for the filesystem.
|
void |
run()
Inactivity checker, run in a seperate thread
|
void |
setContentService(ContentService contentService) |
void |
setUsageService(ContentUsageService usageService)
Set the usage service
|
void |
startManager(DiskInterface disk,
DiskDeviceContext ctx)
Start the quota manager.
|
void |
stopManager(DiskInterface disk,
DiskDeviceContext ctx)
Stop the quota manager
|
public void init()
public final ContentUsageService getUsageService()
public final void setUsageService(ContentUsageService usageService)
usageService - ContentUsageServicepublic long getAvailableFreeSpace()
getAvailableFreeSpace in interface QuotaManagerpublic long getUserFreeSpace(SrvSession sess, TreeConnection tree)
getUserFreeSpace in interface QuotaManagersess - SrvSessiontree - TreeConnectionpublic long allocateSpace(SrvSession sess, TreeConnection tree, NetworkFile file, long alloc) throws IOException
allocateSpace in interface QuotaManagersess - SrvSessiontree - TreeConnectionfile - NetworkFilealloc - long requested allocation sizeIOExceptionpublic void releaseSpace(SrvSession sess, TreeConnection tree, int fid, String path, long alloc) throws IOException
releaseSpace in interface QuotaManagersess - SrvSessiontree - TreeConnectionfid - intpath - Stringalloc - longIOExceptionpublic void startManager(DiskInterface disk, DiskDeviceContext ctx) throws QuotaManagerException
startManager in interface QuotaManagerdisk - DiskInterfacectx - DiskDeviceContextQuotaManagerExceptionpublic void stopManager(DiskInterface disk, DiskDeviceContext ctx) throws QuotaManagerException
stopManager in interface QuotaManagerdisk - DiskInterfacectx - DiskDeviceContextQuotaManagerExceptionpublic void run()
public void setContentService(ContentService contentService)
public ContentService getContentService()
Copyright © 2005–2014 Alfresco Software. All rights reserved.