public class ContentUsageImpl extends Object implements ContentUsageService, NodeServicePolicies.OnUpdatePropertiesPolicy, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnCreateNodePolicy
Policy.Arg
ARG_0, ARG_1, ARG_2, QNAME
QNAME
QNAME
Constructor and Description |
---|
ContentUsageImpl() |
Modifier and Type | Method and Description |
---|---|
void |
beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Called before a node is deleted.
|
boolean |
getEnabled()
Are ContentUsages enabled (refer to 'system.usages.enabled' repository property) ?
|
List<String> |
getStores() |
long |
getUserQuota(String userName)
Gets user quota
Note: -1 means no quota limit set
|
long |
getUserStoredUsage(org.alfresco.service.cmr.repository.NodeRef personNodeRef) |
long |
getUserUsage(org.alfresco.service.cmr.repository.NodeRef personNodeRef,
boolean removeDeltas) |
long |
getUserUsage(String userName)
Gets user usage
|
void |
init()
The initialise method
|
void |
onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
Called when a new node has been created.
|
void |
onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef,
Map<org.alfresco.service.namespace.QName,Serializable> before,
Map<org.alfresco.service.namespace.QName,Serializable> after)
Called after a node's properties have been changed.
|
void |
setAuthenticationContext(AuthenticationContext authenticationContext) |
void |
setEnabled(boolean enabled) |
void |
setExcludedTypes(List<String> excludedTypes) |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService) |
void |
setPersonService(PersonService personService) |
void |
setPolicyComponent(PolicyComponent policyComponent) |
void |
setStores(List<String> stores) |
void |
setTenantService(org.alfresco.repo.tenant.TenantService tenantService) |
void |
setUsageService(UsageService usageService) |
void |
setUserQuota(String userName,
long currentQuota)
Set user's current quota.
|
void |
setUserStoredUsage(org.alfresco.service.cmr.repository.NodeRef personNodeRef,
long currentUsage)
Set user's usage.
|
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setPersonService(PersonService personService)
public void setUsageService(UsageService usageService)
public void setPolicyComponent(PolicyComponent policyComponent)
public void setAuthenticationContext(AuthenticationContext authenticationContext)
public void setTenantService(org.alfresco.repo.tenant.TenantService tenantService)
public void setEnabled(boolean enabled)
public void init()
public void onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
NodeServicePolicies.OnCreateNodePolicy
onCreateNode
in interface NodeServicePolicies.OnCreateNodePolicy
childAssocRef
- the created child association referencepublic void onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef nodeRef, Map<org.alfresco.service.namespace.QName,Serializable> before, Map<org.alfresco.service.namespace.QName,Serializable> after)
onUpdateProperties
in interface NodeServicePolicies.OnUpdatePropertiesPolicy
nodeRef
- reference to the updated nodebefore
- the node's properties before the changeafter
- the node's properties after the changepublic void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
beforeDeleteNode
in interface NodeServicePolicies.BeforeDeleteNodePolicy
nodeRef
- the node referencepublic void setUserStoredUsage(org.alfresco.service.cmr.repository.NodeRef personNodeRef, long currentUsage)
personNodeRef
- person nodeRefcurrentUsage
- longpublic long getUserStoredUsage(org.alfresco.service.cmr.repository.NodeRef personNodeRef)
public long getUserUsage(String userName)
ContentUsageService
getUserUsage
in interface ContentUsageService
public long getUserUsage(org.alfresco.service.cmr.repository.NodeRef personNodeRef, boolean removeDeltas)
public void setUserQuota(String userName, long currentQuota)
setUserQuota
in interface ContentUsageService
userName
- user namecurrentQuota
- User's new quota (in bytes)public long getUserQuota(String userName)
ContentUsageService
getUserQuota
in interface ContentUsageService
public boolean getEnabled()
ContentUsageService
getEnabled
in interface ContentUsageService
Copyright © 2005–2017 Alfresco Software. All rights reserved.