com.deftlabs.lock.mongo
Class DistributedLockSvcOptions

java.lang.Object
  extended by com.deftlabs.lock.mongo.DistributedLockSvcOptions

public class DistributedLockSvcOptions
extends Object

The global distributed lock service options/config.


Constructor Summary
DistributedLockSvcOptions(String pMongoUri)
          The basic constructor.
DistributedLockSvcOptions(String pMongoUri, String pDbName, String pCollectionName)
          Constructor that allows the user to specify database and colleciton name.
DistributedLockSvcOptions(String pMongoUri, String pDbName, String pCollectionName, String pAppName)
          Constructor that allows the user to specify database, colleciton and app name.
 
Method Summary
 String getAppName()
           
 String getCollectionName()
           
 String getDbName()
           
 boolean getEnableHistory()
           
 String getHistoryCollectionName()
           
 boolean getHistoryIsCapped()
           
 long getHistorySize()
           
 String getHostAddress()
           
 String getHostname()
           
 String getLibVersion()
           
 String getMongoUri()
           
 void setEnableHistory(boolean pV)
          True by default.
 void setHistoryCollectionName(String pV)
          The default collection name is: lockHistory.
 void setHistoryIsCapped(boolean pV)
          True by default.
 void setHistorySize(long pV)
          Set the size (in bytes) of the historical capped collection.
 void setHostname(String pV)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributedLockSvcOptions

public DistributedLockSvcOptions(String pMongoUri)
The basic constructor. This uses the following:


DistributedLockSvcOptions

public DistributedLockSvcOptions(String pMongoUri,
                                 String pDbName,
                                 String pCollectionName)
Constructor that allows the user to specify database and colleciton name.


DistributedLockSvcOptions

public DistributedLockSvcOptions(String pMongoUri,
                                 String pDbName,
                                 String pCollectionName,
                                 String pAppName)
Constructor that allows the user to specify database, colleciton and app name. The app name should definetly be used if the db/collection names are shared by multiple apps/systems (e.g., SomeCoolDataProcessor).

Method Detail

getMongoUri

public String getMongoUri()

getDbName

public String getDbName()

getCollectionName

public String getCollectionName()

getAppName

public String getAppName()

setEnableHistory

public void setEnableHistory(boolean pV)
True by default. Set to false to disable storing historical data. Lock data is tracked when individual locks are locked, unlocked and (possibly) timed out.


getEnableHistory

public boolean getEnableHistory()

setHistoryIsCapped

public void setHistoryIsCapped(boolean pV)
True by default. Set to fault to use a regular collection instead of a capped collection for lock history. Entries will never be deleted if this is not a capped collection.


getHistoryIsCapped

public boolean getHistoryIsCapped()

setHistorySize

public void setHistorySize(long pV)
Set the size (in bytes) of the historical capped collection. The default is 200MB.


getHistorySize

public long getHistorySize()

getLibVersion

public String getLibVersion()

getHostname

public String getHostname()

setHostname

public void setHostname(String pV)

getHostAddress

public String getHostAddress()

setHistoryCollectionName

public void setHistoryCollectionName(String pV)
The default collection name is: lockHistory. Override here.


getHistoryCollectionName

public String getHistoryCollectionName()