ro.isdc.wro.model.resource.support.change
Class ResourceChangeInfo

java.lang.Object
  extended by ro.isdc.wro.model.resource.support.change.ResourceChangeInfo

public final class ResourceChangeInfo
extends Object

Holds details about hashes of watched resources and the group which were detected as changed.


Constructor Summary
ResourceChangeInfo()
           
 
Method Summary
 boolean isChanged(String groupName)
           
 boolean isCheckRequiredForGroup(String groupName)
          Checks if the current hash was set previously and persist the groupName in the set of the groups who are interested about the change.
 void reset()
          Resets the state of this ResourceChangeInfo by copying the current hash to previous hash and reseting current hash to null.
 String toString()
          
 void updateHashForGroup(String hash, String groupName)
          Updates the hash associated with the resource for a give groupName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResourceChangeInfo

public ResourceChangeInfo()
Method Detail

updateHashForGroup

public void updateHashForGroup(String hash,
                               String groupName)
Updates the hash associated with the resource for a give groupName.

Parameters:
hash - the most recent computed hash.
groupName - name of the group for which the change of resource is detected.

reset

public void reset()
Resets the state of this ResourceChangeInfo by copying the current hash to previous hash and reseting current hash to null. This operation should be invoked after a change cycle completes and a new one is prepared.


isChanged

public boolean isChanged(String groupName)
Parameters:
groupName - associated with the current change check.
Returns:
true if the change is detected for provided group.

isCheckRequiredForGroup

public boolean isCheckRequiredForGroup(String groupName)
Checks if the current hash was set previously and persist the groupName in the set of the groups who are interested about the change.

Parameters:
groupName - the name of the group which contains the resource for which check is performed.
Returns:
true if the change is required.

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2008-2013. All Rights Reserved.