org.sakaiproject.util
Class BasicConfigHistory

java.lang.Object
  extended by org.sakaiproject.util.BasicConfigHistory
All Implemented Interfaces:
ServerConfigurationService.ConfigHistory

public class BasicConfigHistory
extends Object
implements ServerConfigurationService.ConfigHistory

This is a basic version of the Config history to make it easy for people to create items to place in the config history

Author:
Aaron Zeckoski (azeckoski @ unicon.net) (azeckoski @ vt.edu)

Field Summary
protected  boolean secured
           
protected  String source
           
protected  long timestamp
          This is the time when the config was changed
protected  Object value
          This is the previous value of the config (the value from before the timestamp)
protected  int version
           
 
Constructor Summary
protected BasicConfigHistory(int version, long timestamp, String source, Object value)
           
  BasicConfigHistory(int version, String source, Object value)
          Make a basic history config to store in the history of a config item
 
Method Summary
 boolean equals(Object obj)
           
 String getSource()
           
 long getTimestamp()
           
 Object getValue()
           
 int getVersion()
           
 int hashCode()
           
 boolean isSecured()
           
 void setSecured(boolean secured)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

version

protected int version

timestamp

protected long timestamp
This is the time when the config was changed


source

protected String source

value

protected Object value
This is the previous value of the config (the value from before the timestamp)


secured

protected boolean secured
Constructor Detail

BasicConfigHistory

public BasicConfigHistory(int version,
                          String source,
                          Object value)
Make a basic history config to store in the history of a config item

Parameters:
version - the version (always > 0)
source - the source name (default to UNKNOWN)
value - the previous config value

BasicConfigHistory

protected BasicConfigHistory(int version,
                             long timestamp,
                             String source,
                             Object value)
Method Detail

getVersion

public int getVersion()
Specified by:
getVersion in interface ServerConfigurationService.ConfigHistory
Returns:
the version of the config item this history refers to (a newly created item is version 1)

getTimestamp

public long getTimestamp()
Specified by:
getTimestamp in interface ServerConfigurationService.ConfigHistory
Returns:
the time at which this historical version of the config item became irrelevant (this is when this version was replaced)

getSource

public String getSource()
Specified by:
getSource in interface ServerConfigurationService.ConfigHistory
Returns:
the source name for this version of the config item

getValue

public Object getValue()
Specified by:
getValue in interface ServerConfigurationService.ConfigHistory
Returns:
the value of the config item in this version of it

setSecured

public void setSecured(boolean secured)

isSecured

public boolean isSecured()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2012 The Sakai Foundation. All Rights Reserved.