fr.paris.lutece.portal.service.resource
Class ExtendableResourceActionHit

java.lang.Object
  extended by fr.paris.lutece.portal.service.resource.ExtendableResourceActionHit

public final class ExtendableResourceActionHit
extends Object

Class 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
static String ACTION_ARCHIVE
          Archive action
static String ACTION_CREATION
          Creation action
static String ACTION_DELETE
          Delete action
static String ACTION_DOWNLOAD
          Download action
static String ACTION_UPDATE
          Update action
 
Method Summary
 int getActionHit(String strActionName, String strExtendableResourceType)
          Get the total number of hit associated to a given action name and resource type
static ExtendableResourceActionHit getInstance()
          Get the service instance
 int getResourceActionHit(String strExtendableResourceId, String strExtendableResourceType, String strActionName)
          Get the number of hit associated with a resource and an action name
 Map<String,Integer> getResourceHit(String strExtendableResourceId, String strExtendableResourceType)
          Get the list of action names associated with a number of hit for a given resource
 void notifyActionOnResource(String strExtendableResourceId, String strExtendableResourceType, String strActionName)
          Notify every listeners that an action has been performed on a resource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_DOWNLOAD

public static final String ACTION_DOWNLOAD
Download action

See Also:
Constant Field Values

ACTION_CREATION

public static final String ACTION_CREATION
Creation action

See Also:
Constant Field Values

ACTION_UPDATE

public static final String ACTION_UPDATE
Update action

See Also:
Constant Field Values

ACTION_ARCHIVE

public static final String ACTION_ARCHIVE
Archive action

See Also:
Constant Field Values

ACTION_DELETE

public static final 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(String strActionName,
                        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 of
strExtendableResourceType - 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 Map<String,Integer> getResourceHit(String strExtendableResourceId,
                                          String strExtendableResourceType)
Get the list of action names associated with a number of hit for a given resource

Parameters:
strExtendableResourceId - The id of the resource
strExtendableResourceType - The type of the resource
Returns:
A map containing associations between action names and hit number

getResourceActionHit

public int getResourceActionHit(String strExtendableResourceId,
                                String strExtendableResourceType,
                                String strActionName)
Get the number of hit associated with a resource and an action name

Parameters:
strExtendableResourceId - The id of the resource
strExtendableResourceType - The type of the resource
strActionName - 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(String strExtendableResourceId,
                                   String strExtendableResourceType,
                                   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 on
strExtendableResourceType - The type of the resource the action was performed on
strActionName - The name of the action that was performed on the resource. Action names can be any strings, but the class ExtendableResourceActionHit exposes standard action names.


Copyright © 2014 Mairie de Paris. All Rights Reserved.