Top Description Fields Constructors Methods
net.sf.ehcache.config

public Class TerracottaClientConfiguration

extends Object
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
net.sf.ehcache.CacheException

Holds the Terracotta configuration for a particular client
Authors
[email protected], Abhishek Sanoujam

Field Summary

Modifier and TypeField and Description
private volatile boolean
public static final boolean
DEFAULT_REJOIN_VALUE

Default value of rejoin attribute

public static final boolean
DEFAULT_WAN_ENABLED_TSA_VALUE

Default value for whether WAN replication enabled or not

private String
private boolean
private static final String
private static final String
private String
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public TerracottaClientConfiguration

Returns:

a copy, which independent other than configurations than cannot change.
clone
()

Overrides java.lang.Object.clone.

Clones this object, following the usual contract.
public final void
extractTcconfig(String text)

Tell the BeanHandler to extract the entire subtree xml as text at element<tc-config/>.

public void
freezeConfig()

Freezes the config

public final String
getEmbeddedConfig()

Get the embedded config read as <tc-config/>

public final String

Returns:

original embedded config
getOriginalEmbeddedConfig
()

Get the original embedded config

public final String
getUrl()

Get url string

public boolean

Returns:

the rejoin
isRejoin
()

Returns true if rejoin is enabled

public final boolean
isUrlConfig()

Helper to check whether this is url config or embedded config

public boolean

Returns:

wanEnabledTSA
isWanEnabledTSA
()

Returns true if it is a WAN enabled TSA

public TerracottaClientConfiguration

Returns:

this instance
rejoin
(boolean rejoin)

Builder method to set rejoin

public void
setRejoin(boolean
the rejoin to set
rejoin
)

Set rejoin value

public final void
setUrl(String url)

Set url

public void
setWanEnabledTSA(boolean wanEnabledTSA)

Set wanEnabledTSA value

public final TerracottaClientConfiguration

Returns:

this configuration instance
url
(String
the URL to set
url
)

Builder method to set the URL.

public final TerracottaClientConfiguration

Returns:

this configuration instance
url
(String
the host where to get the Terracotta configuration from
host
,
String
the port on that host
port
)

Builder method to set the URL for a host and a port.

private void
public TerracottaClientConfiguration

Returns:

this instance
wanEnabledTSA
(boolean wanEnabledTSA)

Builder method to set wanEnabledTSA

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configFrozenback to summary
private volatile boolean configFrozen
DEFAULT_REJOIN_VALUEback to summary
public static final boolean DEFAULT_REJOIN_VALUE

Default value of rejoin attribute

DEFAULT_WAN_ENABLED_TSA_VALUEback to summary
public static final boolean DEFAULT_WAN_ENABLED_TSA_VALUE

Default value for whether WAN replication enabled or not

embeddedConfigback to summary
private String embeddedConfig
rejoinback to summary
private boolean rejoin
TC_CONFIG_HEADERback to summary
private static final String TC_CONFIG_HEADER
urlback to summary
private String url
wanEnabledTSAback to summary
private boolean wanEnabledTSA

Constructor Detail

TerracottaClientConfigurationback to summary
public TerracottaClientConfiguration()

Method Detail

cloneback to summary
public TerracottaClientConfiguration clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Clones this object, following the usual contract.

Returns:TerracottaClientConfiguration

a copy, which independent other than configurations than cannot change.

Annotations
@Override
Exceptions
CloneNotSupportedException:

Doc from java.lang.Object.clone.

if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

extractTcconfigback to summary
public final void extractTcconfig(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.

freezeConfigback to summary
public void freezeConfig()

Freezes the config

getEmbeddedConfigback to summary
public final String getEmbeddedConfig()

Get the embedded config read as <tc-config/>

getOriginalEmbeddedConfigback to summary
public final String getOriginalEmbeddedConfig()

Get the original embedded config

Returns:String

original embedded config

getUrlback to summary
public final String getUrl()

Get url string

isRejoinback to summary
public boolean isRejoin()

Returns true if rejoin is enabled

Returns:boolean

the rejoin

isUrlConfigback to summary
public final boolean isUrlConfig()

Helper to check whether this is url config or embedded config

isWanEnabledTSAback to summary
public boolean isWanEnabledTSA()

Returns true if it is a WAN enabled TSA

Returns:boolean

wanEnabledTSA

rejoinback to summary
public TerracottaClientConfiguration rejoin(boolean rejoin)

Builder method to set rejoin

Returns:TerracottaClientConfiguration

this instance

setRejoinback to summary
public void setRejoin(boolean rejoin)

Set rejoin value

Parameters
rejoin:boolean

the rejoin to set

setUrlback to summary
public final void setUrl(String url)

Set url

setWanEnabledTSAback to summary
public void setWanEnabledTSA(boolean wanEnabledTSA)

Set wanEnabledTSA value

urlback to summary
public final TerracottaClientConfiguration url(String url)

Builder method to set the URL.

Parameters
url:String

the URL to set

Returns:TerracottaClientConfiguration

this configuration instance

urlback to summary
public final TerracottaClientConfiguration url(String host, String port)

Builder method to set the URL for a host and a port.

Parameters
host:String

the host where to get the Terracotta configuration from

port:String

the port on that host

Returns:TerracottaClientConfiguration

this configuration instance

validateConfigurationback to summary
private void validateConfiguration()
wanEnabledTSAback to summary
public TerracottaClientConfiguration wanEnabledTSA(boolean wanEnabledTSA)

Builder method to set wanEnabledTSA

Returns:TerracottaClientConfiguration

this instance