Class ExtendableResourceActionHit
- java.lang.Object
-
- fr.paris.lutece.portal.service.resource.ExtendableResourceActionHit
-
public final class ExtendableResourceActionHit extends java.lang.ObjectClass to notify listeners of actions performed on resources. Listeners keep at least track of the number of actions performed over a given resource.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACTION_ARCHIVEArchive actionstatic java.lang.StringACTION_CREATIONCreation actionstatic java.lang.StringACTION_DELETEDelete actionstatic java.lang.StringACTION_DOWNLOADDownload actionstatic java.lang.StringACTION_UPDATEUpdate action
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetActionHit(java.lang.String strActionName, java.lang.String strExtendableResourceType)Get the total number of hit associated to a given action name and resource typestatic ExtendableResourceActionHitgetInstance()Get the service instanceintgetResourceActionHit(java.lang.String strExtendableResourceId, java.lang.String strExtendableResourceType, java.lang.String strActionName)Get the number of hit associated with a resource and an action namejava.util.Map<java.lang.String,java.lang.Integer>getResourceHit(java.lang.String strExtendableResourceId, java.lang.String strExtendableResourceType)Get the list of action names associated with a number of hit for a given resourcevoidnotifyActionOnResource(java.lang.String strExtendableResourceId, java.lang.String strExtendableResourceType, java.lang.String strActionName)Notify every listeners that an action has been performed on a resource
-
-
-
Field Detail
-
ACTION_DOWNLOAD
public static final java.lang.String ACTION_DOWNLOAD
Download action- See Also:
- Constant Field Values
-
ACTION_CREATION
public static final java.lang.String ACTION_CREATION
Creation action- See Also:
- Constant Field Values
-
ACTION_UPDATE
public static final java.lang.String ACTION_UPDATE
Update action- See Also:
- Constant Field Values
-
ACTION_ARCHIVE
public static final java.lang.String ACTION_ARCHIVE
Archive action- See Also:
- Constant Field Values
-
ACTION_DELETE
public static final java.lang.String ACTION_DELETE
Delete action- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static ExtendableResourceActionHit getInstance()
Get the service instance- Returns:
- The instance of the service
-
getActionHit
public int getActionHit(java.lang.String strActionName, java.lang.String strExtendableResourceType)Get the total number of hit associated to a given action name and resource type- Parameters:
strActionName- The name of the action to get the number of hit ofstrExtendableResourceType- The resource type to get the hit of- Returns:
- The number of hit, or 0 if this action has no hit for this resource type
-
getResourceHit
public java.util.Map<java.lang.String,java.lang.Integer> getResourceHit(java.lang.String strExtendableResourceId, java.lang.String strExtendableResourceType)Get the list of action names associated with a number of hit for a given resource- Parameters:
strExtendableResourceId- The id of the resourcestrExtendableResourceType- The type of the resource- Returns:
- A map containing associations between action names and hit number
-
getResourceActionHit
public int getResourceActionHit(java.lang.String strExtendableResourceId, java.lang.String strExtendableResourceType, java.lang.String strActionName)Get the number of hit associated with a resource and an action name- Parameters:
strExtendableResourceId- The id of the resourcestrExtendableResourceType- The type of the resourcestrActionName- The name of the action- Returns:
- The number of hit, or 0 if the resource has no hit for this action
-
notifyActionOnResource
public void notifyActionOnResource(java.lang.String strExtendableResourceId, java.lang.String strExtendableResourceType, java.lang.String strActionName)Notify every listeners that an action has been performed on a resource- Parameters:
strExtendableResourceId- The id of the resource the action was performed onstrExtendableResourceType- The type of the resource the action was performed onstrActionName- The name of the action that was performed on the resource. Action names can be any strings, but the classExtendableResourceActionHitexposes standard action names.
-
-