public class ContentQuotaManager extends Object implements org.alfresco.jlan.server.filesys.quota.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(org.alfresco.jlan.server.SrvSession sess,
org.alfresco.jlan.server.filesys.TreeConnection tree,
org.alfresco.jlan.server.filesys.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(org.alfresco.jlan.server.SrvSession sess,
org.alfresco.jlan.server.filesys.TreeConnection tree)
Return the free space available to the specified user/session
|
long |
getUserTotalSpace(org.alfresco.jlan.server.SrvSession sess,
org.alfresco.jlan.server.filesys.TreeConnection tree)
Return the quota space available to the specified user/session
|
void |
init() |
void |
releaseSpace(org.alfresco.jlan.server.SrvSession sess,
org.alfresco.jlan.server.filesys.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(org.alfresco.jlan.server.filesys.DiskInterface disk,
org.alfresco.jlan.server.filesys.DiskDeviceContext ctx)
Start the quota manager.
|
void |
stopManager(org.alfresco.jlan.server.filesys.DiskInterface disk,
org.alfresco.jlan.server.filesys.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 org.alfresco.jlan.server.filesys.quota.QuotaManager
public long getUserTotalSpace(org.alfresco.jlan.server.SrvSession sess, org.alfresco.jlan.server.filesys.TreeConnection tree)
getUserTotalSpace
in interface org.alfresco.jlan.server.filesys.quota.QuotaManager
sess
- SrvSessiontree
- TreeConnectionpublic long getUserFreeSpace(org.alfresco.jlan.server.SrvSession sess, org.alfresco.jlan.server.filesys.TreeConnection tree)
getUserFreeSpace
in interface org.alfresco.jlan.server.filesys.quota.QuotaManager
sess
- SrvSessiontree
- TreeConnectionpublic long allocateSpace(org.alfresco.jlan.server.SrvSession sess, org.alfresco.jlan.server.filesys.TreeConnection tree, org.alfresco.jlan.server.filesys.NetworkFile file, long alloc) throws IOException
allocateSpace
in interface org.alfresco.jlan.server.filesys.quota.QuotaManager
sess
- SrvSessiontree
- TreeConnectionfile
- NetworkFilealloc
- long requested allocation sizeIOException
public void releaseSpace(org.alfresco.jlan.server.SrvSession sess, org.alfresco.jlan.server.filesys.TreeConnection tree, int fid, String path, long alloc) throws IOException
releaseSpace
in interface org.alfresco.jlan.server.filesys.quota.QuotaManager
sess
- SrvSessiontree
- TreeConnectionfid
- intpath
- Stringalloc
- longIOException
public void startManager(org.alfresco.jlan.server.filesys.DiskInterface disk, org.alfresco.jlan.server.filesys.DiskDeviceContext ctx) throws org.alfresco.jlan.server.filesys.quota.QuotaManagerException
startManager
in interface org.alfresco.jlan.server.filesys.quota.QuotaManager
disk
- DiskInterfacectx
- DiskDeviceContextorg.alfresco.jlan.server.filesys.quota.QuotaManagerException
public void stopManager(org.alfresco.jlan.server.filesys.DiskInterface disk, org.alfresco.jlan.server.filesys.DiskDeviceContext ctx) throws org.alfresco.jlan.server.filesys.quota.QuotaManagerException
stopManager
in interface org.alfresco.jlan.server.filesys.quota.QuotaManager
disk
- DiskInterfacectx
- DiskDeviceContextorg.alfresco.jlan.server.filesys.quota.QuotaManagerException
public void run()
public void setContentService(ContentService contentService)
public ContentService getContentService()
Copyright © 2005–2017 Alfresco Software. All rights reserved.