Package net.sf.ehcache.config
Class TerracottaClientConfiguration
- java.lang.Object
-
- net.sf.ehcache.config.TerracottaClientConfiguration
-
- All Implemented Interfaces:
java.lang.Cloneable
public class TerracottaClientConfiguration extends java.lang.Object implements java.lang.CloneableHolds the Terracotta configuration for a particular client- Author:
- amiller@terracotta.org, Abhishek Sanoujam
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_REJOIN_VALUEDefault value of rejoin attributestatic booleanDEFAULT_WAN_ENABLED_TSA_VALUEDefault value for whether WAN replication enabled or not
-
Constructor Summary
Constructors Constructor Description TerracottaClientConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TerracottaClientConfigurationclone()Clones this object, following the usual contract.voidextractTcconfig(java.lang.String text)Tell the BeanHandler to extract the entire subtree xml as text at element<tc-config/>.voidfreezeConfig()Freezes the configjava.lang.StringgetEmbeddedConfig()Get the embedded config read as<tc-config/>java.lang.StringgetOriginalEmbeddedConfig()Get the original embedded configjava.lang.StringgetUrl()Get url stringbooleanisRejoin()Returns true if rejoin is enabledbooleanisUrlConfig()Helper to check whether this is url config or embedded configbooleanisWanEnabledTSA()Returns true if it is a WAN enabled TSATerracottaClientConfigurationrejoin(boolean rejoin)Builder method to set rejoinvoidsetRejoin(boolean rejoin)Set rejoin valuevoidsetUrl(java.lang.String url)Set urlvoidsetWanEnabledTSA(boolean wanEnabledTSA)Set wanEnabledTSA valueTerracottaClientConfigurationurl(java.lang.String url)Builder method to set the URL.TerracottaClientConfigurationurl(java.lang.String host, java.lang.String port)Builder method to set the URL for a host and a port.TerracottaClientConfigurationwanEnabledTSA(boolean wanEnabledTSA)Builder method to set wanEnabledTSA
-
-
-
Field Detail
-
DEFAULT_REJOIN_VALUE
public static final boolean DEFAULT_REJOIN_VALUE
Default value of rejoin attribute- See Also:
- Constant Field Values
-
DEFAULT_WAN_ENABLED_TSA_VALUE
public static final boolean DEFAULT_WAN_ENABLED_TSA_VALUE
Default value for whether WAN replication enabled or not- See Also:
- Constant Field Values
-
-
Method Detail
-
clone
public TerracottaClientConfiguration clone() throws java.lang.CloneNotSupportedException
Clones this object, following the usual contract.- Overrides:
clonein classjava.lang.Object- Returns:
- a copy, which independent other than configurations than cannot change.
- Throws:
java.lang.CloneNotSupportedException
-
url
public final TerracottaClientConfiguration url(java.lang.String url)
Builder method to set the URL.- Parameters:
url- the URL to set- Returns:
- this configuration instance
-
url
public final TerracottaClientConfiguration url(java.lang.String host, java.lang.String port)
Builder method to set the URL for a host and a port.- Parameters:
host- the host where to get the Terracotta configuration fromport- the port on that host- Returns:
- this configuration instance
-
setUrl
public final void setUrl(java.lang.String url)
Set url
-
getUrl
public final java.lang.String getUrl()
Get url string
-
extractTcconfig
public final void extractTcconfig(java.lang.String text)
Tell the BeanHandler to extract the entire subtree xml as text at element<tc-config/>. Expects to receive the contents of the<tc-config/>tag and will wrap it in a proper tc-config header / footer.
-
getEmbeddedConfig
public final java.lang.String getEmbeddedConfig()
Get the embedded config read as<tc-config/>
-
getOriginalEmbeddedConfig
public final java.lang.String getOriginalEmbeddedConfig()
Get the original embedded config- Returns:
- original embedded config
-
isUrlConfig
public final boolean isUrlConfig()
Helper to check whether this is url config or embedded config
-
isRejoin
public boolean isRejoin()
Returns true if rejoin is enabled- Returns:
- the rejoin
-
setRejoin
public void setRejoin(boolean rejoin)
Set rejoin value- Parameters:
rejoin- the rejoin to set
-
rejoin
public TerracottaClientConfiguration rejoin(boolean rejoin)
Builder method to set rejoin- Parameters:
rejoin-- Returns:
- this instance
-
isWanEnabledTSA
public boolean isWanEnabledTSA()
Returns true if it is a WAN enabled TSA- Returns:
- wanEnabledTSA
-
setWanEnabledTSA
public void setWanEnabledTSA(boolean wanEnabledTSA)
Set wanEnabledTSA value- Parameters:
wanEnabledTSA-
-
wanEnabledTSA
public TerracottaClientConfiguration wanEnabledTSA(boolean wanEnabledTSA)
Builder method to set wanEnabledTSA- Parameters:
wanEnabledTSA-- Returns:
- this instance
-
freezeConfig
public void freezeConfig()
Freezes the config
-
-