com.plumtree.uiinfrastructure.web
Class BaseVarPack

java.lang.Object
  extended by com.plumtree.uiinfrastructure.web.BaseVarPack
All Implemented Interfaces:
IVarPack
Direct Known Subclasses:
ConfigVarPack, DevicesVarPack, PTAnalyticsVarPack, PTDirPrefsVarPack, PTDocTypesVarPack, PTNavSettingsVarPack, PTSearchLocaleVarPack, PTSSOVarPack, PTTimeZoneVarPack, SecureASVarPack, URLASMappingsVarPack, XMLBaseVarPack

public abstract class BaseVarPack
extends java.lang.Object
implements IVarPack

Base class for var packs to extend. BaseVarPack adds common features.


Constructor Summary
BaseVarPack()
          An abstract Var pack to extend off of.
 
Method Summary
 boolean CanReloadVarPackFromUI()
          By default VarPacks cannot be reloaded from the UI.
protected abstract  void ExpireContent()
          Expire content in this var pack.
 void ExpireVarPackContent()
          Expire content in this var pack.
 java.lang.String GetConfigPath()
          Gets the path to the configuration directory, if there is any.
 int GetExpireTimeout()
          Get how many seconds of innactivity until this var pack unloads
 XPDateTime GetLastAccessedTimeStamp()
          Get the last accessed time stamp.
 int GetReloadInterval()
          Get number of seconds before the var pack should be reloaded.
protected abstract  java.lang.Object GetValue(java.lang.String key)
          Get a value from the Var pack.
abstract  java.lang.String GetVarPackID()
          Get the id of this var pack instance.
abstract  IXPEnumerator GetVarPackKeys()
          Get an enumeration of keys in the var pack.
 java.lang.Object GetVarPackValue(java.lang.String key)
          Get a value from the Var pack.
 boolean IsLoaded()
          Check to see if the var pack currently is loaded
protected abstract  void Load()
          Load the var pack.
 void LoadVarPack(java.lang.String strConfigPath)
          Load this var pack.
protected abstract  void Reload()
          Reload the var pack.
 void ReloadVarPack()
          Reload this var pack.
 void SetExpireTimeout(int time)
          Get how many seconds of innactivity until this var pack unloads
 void SetReloadInterval(int numberOfSeconds)
          Set the number of seconds before the var pack should be reloaded.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseVarPack

public BaseVarPack()
An abstract Var pack to extend off of.

Method Detail

GetConfigPath

public java.lang.String GetConfigPath()
Gets the path to the configuration directory, if there is any. May be null or "".


GetLastAccessedTimeStamp

public XPDateTime GetLastAccessedTimeStamp()
Get the last accessed time stamp.

Returns:
XPDateTime timestamp of last accessed

GetExpireTimeout

public int GetExpireTimeout()
Get how many seconds of innactivity until this var pack unloads

Returns:
number of seconds

GetReloadInterval

public int GetReloadInterval()
Get number of seconds before the var pack should be reloaded.

Returns:
number of seconds.

GetVarPackID

public abstract java.lang.String GetVarPackID()
Get the id of this var pack instance. Note: VarPackManager only has 1 key per var pack. This should be unquie per class instance.

Specified by:
GetVarPackID in interface IVarPack
Returns:
A unique key to store the var pack in the varpackmanager.

GetVarPackKeys

public abstract IXPEnumerator GetVarPackKeys()
Get an enumeration of keys in the var pack.

Specified by:
GetVarPackKeys in interface IVarPack
Returns:
IXPEnumerator of keys in the var pack.

ExpireVarPackContent

public final void ExpireVarPackContent()
Expire content in this var pack. This will call ExpireContent() and set the loaded flag to false.

Specified by:
ExpireVarPackContent in interface IVarPack

GetVarPackValue

public final java.lang.Object GetVarPackValue(java.lang.String key)
Get a value from the Var pack. This will update the timestamp then call GetValue(String)

Specified by:
GetVarPackValue in interface IVarPack
Parameters:
key - The key for the lookup
Returns:
the value from the lookup (null if not found)
Throws:
XPException - if VarPack has not been loaded.
See Also:
GetValue(String)

IsLoaded

public boolean IsLoaded()
Check to see if the var pack currently is loaded

Returns:
true if the var pack currently is loaded

LoadVarPack

public final void LoadVarPack(java.lang.String strConfigPath)
Load this var pack. This will update the timestamp, call Load(), and set the loaded flag.

Specified by:
LoadVarPack in interface IVarPack
Parameters:
strConfigPath - the path to the configuration folder. This may be null or the empty string if there is no configuration folder set up (for instance, when loading VarPacks from the VarPack XML file specified in the web.config or web.xml files)
See Also:
Load()

ReloadVarPack

public final void ReloadVarPack()
Reload this var pack. This will update the timestamp, call Reload(), and set the loaded flag.

Specified by:
ReloadVarPack in interface IVarPack
See Also:
Reload()

CanReloadVarPackFromUI

public boolean CanReloadVarPackFromUI()
By default VarPacks cannot be reloaded from the UI.

Specified by:
CanReloadVarPackFromUI in interface IVarPack
Returns:
boolean

SetExpireTimeout

public void SetExpireTimeout(int time)
Get how many seconds of innactivity until this var pack unloads

Parameters:
time - number of seconds

SetReloadInterval

public void SetReloadInterval(int numberOfSeconds)
Set the number of seconds before the var pack should be reloaded.

Parameters:
numberOfSeconds - Number of seconds.

ExpireContent

protected abstract void ExpireContent()
Expire content in this var pack.


GetValue

protected abstract java.lang.Object GetValue(java.lang.String key)
Get a value from the Var pack.

Parameters:
key - The key for the lookup
Returns:
the value from the lookup (null if not found)

Load

protected abstract void Load()
Load the var pack. -- The ConfigPath is guaranteed to be set before this method is called (although it may be null or "").


Reload

protected abstract void Reload()
Reload the var pack.




Copyright © 2002,2003,2004,2005 Plumtree Software, Inc., All Rights Reserved.