org.silverpeas.cache.service
Class VolatileResourceCacheService

java.lang.Object
  extended by org.silverpeas.cache.service.VolatileResourceCacheService

public class VolatileResourceCacheService
extends Object

This cache permits to reference some volatile resources (an entity that is being registered into persistence, but not yet validated by the user)

Author:
Yohann Chastagnier

Constructor Summary
VolatileResourceCacheService()
           
 
Method Summary
 Object addComponentResource(SilverpeasContent contribution)
          Adds a contribution into the cache.
 void clear()
          Clears all the resources referenced into this instance of volatile cache.
static void clearFrom(SessionInfo sessionInfo)
          Clears the volatile cache attached to a user session.
 int newVolatileIntegerIdentifier()
          Creates a new volatile identifier of integer type.
 String newVolatileIntegerIdentifierAsString()
          Creates a new volatile identifier of integer type converted as string value.
 long newVolatileLongIdentifier()
          Creates a new volatile identifier of long type.
 String newVolatileLongIdentifierAsString()
          Creates a new volatile identifier of long type converted as string value.
 String newVolatileStringIdentifier()
          Creates a new volatile identifier of string type.
 Object removeComponentResource(String resourceId, String componentInstanceId)
          Removes from the cache a component resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VolatileResourceCacheService

public VolatileResourceCacheService()
Method Detail

newVolatileIntegerIdentifier

public int newVolatileIntegerIdentifier()
Creates a new volatile identifier of integer type.

Returns:
a new volatile identifier of integer type.

newVolatileIntegerIdentifierAsString

public String newVolatileIntegerIdentifierAsString()
Creates a new volatile identifier of integer type converted as string value.

Returns:
a new volatile identifier of integer type converted as string value.

newVolatileLongIdentifier

public long newVolatileLongIdentifier()
Creates a new volatile identifier of long type.

Returns:
a new volatile identifier of long type.

newVolatileLongIdentifierAsString

public String newVolatileLongIdentifierAsString()
Creates a new volatile identifier of long type converted as string value.

Returns:
a new volatile identifier of long type converted as string value.

newVolatileStringIdentifier

public String newVolatileStringIdentifier()
Creates a new volatile identifier of string type.

Returns:
a new volatile identifier of string type.

addComponentResource

public Object addComponentResource(SilverpeasContent contribution)
Adds a contribution into the cache.

Parameters:
contribution - the contribution to add into the cache.
Returns:
the previous value associated with key, or null if there was no mapping for key. (A null return can also indicate that the map previously associated null with key, if the implementation supports null values.)

removeComponentResource

public Object removeComponentResource(String resourceId,
                                      String componentInstanceId)
Removes from the cache a component resource.

Parameters:
resourceId - the identifier of the resource into the component instance.
componentInstanceId - the identifier of the component which holds the resource.
Returns:
the previous value associated with key, or null if there was no mapping for key.

clear

public void clear()
Clears all the resources referenced into this instance of volatile cache.


clearFrom

public static void clearFrom(SessionInfo sessionInfo)
Clears the volatile cache attached to a user session.

Parameters:
sessionInfo - the session of a user.


Copyright © 2016 Silverpeas. All Rights Reserved.