Class TCPLateralCacheAttributes
java.lang.Object
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheAttributes
org.apache.commons.jcs3.auxiliary.lateral.LateralCacheAttributes
org.apache.commons.jcs3.auxiliary.lateral.socket.tcp.TCPLateralCacheAttributes
- All Implemented Interfaces:
Serializable
,Cloneable
,AuxiliaryCacheAttributes
,ILateralCacheAttributes
,ITCPLateralCacheAttributes
public class TCPLateralCacheAttributes
extends LateralCacheAttributes
implements ITCPLateralCacheAttributes
This interface defines functions that are particular to the TCP Lateral Cache plugin. It extends
the generic LateralCacheAttributes interface which in turn extends the AuxiliaryCache interface.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.commons.jcs3.auxiliary.lateral.behavior.ILateralCacheAttributes
ILateralCacheAttributes.Type
-
Field Summary
Fields inherited from interface org.apache.commons.jcs3.auxiliary.lateral.behavior.ILateralCacheAttributes
DEFAULT_ZOMBIE_QUEUE_MAX_SIZE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
int
Gets the tcpListenerHost attribute of the ILateralCacheAttributes objectint
Gets the tcpListenerPort attribute of the ILateralCacheAttributes objectGets the tcpServer attribute of the ILateralCacheAttributes objectGets the tcpServers attribute of the ILateralCacheAttributes objectThe address to broadcast to if UDPDiscovery is enabled.int
The port to use if UDPDiscovery is enabled.int
The time-to-live for the UDP multicast packetsboolean
Is the lateral allowed to try and get from other laterals.boolean
Is the lateral allowed to put objects to other laterals.boolean
Should the receiver try to match hash codes.boolean
Should the client send a remove command rather than a put when update is called.boolean
Whether or not TCP laterals can try to find each other by multicast communication.void
setAllowGet
(boolean allowGet) Is the lateral allowed to try and get from other laterals.void
setAllowPut
(boolean allowPut) Is the lateral allowed to put objects to other laterals.void
setFilterRemoveByHashCode
(boolean filter) Should the receiver try to match hash codes.void
setIssueRemoveOnPut
(boolean issueRemoveOnPut) Should the client send a remove command rather than a put when update is called.void
setOpenTimeOut
(int openTimeOut) void
setSocketTimeOut
(int socketTimeOut) void
setTcpListenerHost
(String val) Sets the tcpListenerHost attribute of the ILateralCacheAttributes objectvoid
setTcpListenerPort
(int val) Sets the tcpListenerPort attribute of the ILateralCacheAttributes objectvoid
setTcpServer
(String val) Sets the tcpServer attribute of the ILateralCacheAttributes objectvoid
setTcpServers
(String val) Sets the tcpServers attribute of the ILateralCacheAttributes objectvoid
setUdpDiscoveryAddr
(String udpDiscoveryAddr) Sets the address to broadcast to if UDPDiscovery is enabled.void
setUdpDiscoveryEnabled
(boolean udpDiscoveryEnabled) Can setup UDP Discovery.void
setUdpDiscoveryPort
(int udpDiscoveryPort) Sets the port to use if UDPDiscovery is enabled.void
setUdpTTL
(int udpTTL) Sets the time-to-live for the UDP multicast packettoString()
Used to key the instance TODO create another method for this and use toString for debugging only.Methods inherited from class org.apache.commons.jcs3.auxiliary.lateral.LateralCacheAttributes
getHttpListenerPort, getHttpServer, getHttpServers, getPutOnlyMode, getTransmissionType, getTransmissionTypeName, getUdpMulticastAddr, getUdpMulticastPort, getZombieQueueMaxSize, isReceive, setHttpListenerPort, setHttpServer, setHttpServers, setPutOnlyMode, setReceive, setTransmissionType, setTransmissionTypeName, setUdpMulticastAddr, setUdpMulticastPort, setZombieQueueMaxSize
Methods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheAttributes
clone, getCacheName, getEventQueuePoolName, getEventQueueType, getName, setCacheName, setEventQueuePoolName, setEventQueueType, setName
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.commons.jcs3.auxiliary.AuxiliaryCacheAttributes
clone, getCacheName, getEventQueuePoolName, getEventQueueType, getName, setCacheName, setEventQueuePoolName, setEventQueueType, setName
Methods inherited from interface org.apache.commons.jcs3.auxiliary.lateral.behavior.ILateralCacheAttributes
getHttpListenerPort, getHttpServer, getHttpServers, getPutOnlyMode, getTransmissionType, getTransmissionTypeName, getUdpMulticastAddr, getUdpMulticastPort, getZombieQueueMaxSize, isReceive, setHttpListenerPort, setHttpServer, setHttpServers, setPutOnlyMode, setReceive, setTransmissionType, setTransmissionTypeName, setUdpMulticastAddr, setUdpMulticastPort, setZombieQueueMaxSize
-
Constructor Details
-
TCPLateralCacheAttributes
public TCPLateralCacheAttributes()
-
-
Method Details
-
setTcpServer
Sets the tcpServer attribute of the ILateralCacheAttributes object- Specified by:
setTcpServer
in interfaceITCPLateralCacheAttributes
- Parameters:
val
- The new tcpServer value
-
getTcpServer
Gets the tcpServer attribute of the ILateralCacheAttributes object- Specified by:
getTcpServer
in interfaceITCPLateralCacheAttributes
- Returns:
- The tcpServer value
-
setTcpServers
Sets the tcpServers attribute of the ILateralCacheAttributes object- Specified by:
setTcpServers
in interfaceITCPLateralCacheAttributes
- Parameters:
val
- The new tcpServers value
-
getTcpServers
Gets the tcpServers attribute of the ILateralCacheAttributes object- Specified by:
getTcpServers
in interfaceITCPLateralCacheAttributes
- Returns:
- The tcpServers value
-
setTcpListenerPort
Sets the tcpListenerPort attribute of the ILateralCacheAttributes object- Specified by:
setTcpListenerPort
in interfaceITCPLateralCacheAttributes
- Parameters:
val
- The new tcpListenerPort value
-
getTcpListenerPort
Gets the tcpListenerPort attribute of the ILateralCacheAttributes object- Specified by:
getTcpListenerPort
in interfaceITCPLateralCacheAttributes
- Returns:
- The tcpListenerPort value
-
setTcpListenerHost
Sets the tcpListenerHost attribute of the ILateralCacheAttributes object- Specified by:
setTcpListenerHost
in interfaceITCPLateralCacheAttributes
- Parameters:
val
- The new tcpListenerHost value
-
getTcpListenerHost
Gets the tcpListenerHost attribute of the ILateralCacheAttributes object- Specified by:
getTcpListenerHost
in interfaceITCPLateralCacheAttributes
- Returns:
- The tcpListenerHost value
-
setUdpDiscoveryEnabled
Can setup UDP Discovery. This only works for TCp laterals right now. It allows TCP laterals to find each other by broadcasting to a multicast port.- Specified by:
setUdpDiscoveryEnabled
in interfaceITCPLateralCacheAttributes
- Parameters:
udpDiscoveryEnabled
- The udpDiscoveryEnabled to set.
-
isUdpDiscoveryEnabled
Whether or not TCP laterals can try to find each other by multicast communication.- Specified by:
isUdpDiscoveryEnabled
in interfaceITCPLateralCacheAttributes
- Returns:
- Returns the udpDiscoveryEnabled.
-
getUdpDiscoveryPort
The port to use if UDPDiscovery is enabled.- Specified by:
getUdpDiscoveryPort
in interfaceITCPLateralCacheAttributes
- Returns:
- Returns the udpDiscoveryPort.
-
setUdpDiscoveryPort
Sets the port to use if UDPDiscovery is enabled.- Specified by:
setUdpDiscoveryPort
in interfaceITCPLateralCacheAttributes
- Parameters:
udpDiscoveryPort
- The udpDiscoveryPort to set.
-
getUdpDiscoveryAddr
The address to broadcast to if UDPDiscovery is enabled.- Specified by:
getUdpDiscoveryAddr
in interfaceITCPLateralCacheAttributes
- Returns:
- Returns the udpDiscoveryAddr.
-
setUdpDiscoveryAddr
Sets the address to broadcast to if UDPDiscovery is enabled.- Specified by:
setUdpDiscoveryAddr
in interfaceITCPLateralCacheAttributes
- Parameters:
udpDiscoveryAddr
- The udpDiscoveryAddr to set.
-
getUdpTTL
The time-to-live for the UDP multicast packets- Specified by:
getUdpTTL
in interfaceITCPLateralCacheAttributes
- Returns:
- Returns the udpTTL.
- Since:
- 3.1
-
setUdpTTL
Sets the time-to-live for the UDP multicast packet- Specified by:
setUdpTTL
in interfaceITCPLateralCacheAttributes
- Parameters:
udpTTL
- The udpTTL to set.- Since:
- 3.1
-
setAllowGet
Is the lateral allowed to try and get from other laterals.This replaces the old putOnlyMode
- Specified by:
setAllowGet
in interfaceITCPLateralCacheAttributes
- Parameters:
allowGet
-
-
isAllowGet
Is the lateral allowed to try and get from other laterals.- Specified by:
isAllowGet
in interfaceITCPLateralCacheAttributes
- Returns:
- true if the lateral will try to get
-
setAllowPut
Is the lateral allowed to put objects to other laterals.- Specified by:
setAllowPut
in interfaceITCPLateralCacheAttributes
- Parameters:
allowPut
-
-
isAllowPut
Is the lateral allowed to put objects to other laterals.- Specified by:
isAllowPut
in interfaceITCPLateralCacheAttributes
- Returns:
- true if puts are allowed
-
setIssueRemoveOnPut
Should the client send a remove command rather than a put when update is called. This is a client option, not a receiver option. This allows you to prevent the lateral from serializing objects.- Specified by:
setIssueRemoveOnPut
in interfaceITCPLateralCacheAttributes
- Parameters:
issueRemoveOnPut
-
-
isIssueRemoveOnPut
Should the client send a remove command rather than a put when update is called. This is a client option, not a receiver option. This allows you to prevent the lateral from serializing objects.- Specified by:
isIssueRemoveOnPut
in interfaceITCPLateralCacheAttributes
- Returns:
- true if updates will result in a remove command being sent.
-
isFilterRemoveByHashCode
Should the receiver try to match hash codes. If true, the receiver will see if the client supplied a hash code. If it did, then it will try to get the item locally. If the item exists, then it will compare the hash code. if they are the same, it will not remove. This isn't perfect since different objects can have the same hash code, but it is unlikely of objects of the same type.- Specified by:
isFilterRemoveByHashCode
in interfaceITCPLateralCacheAttributes
- Returns:
- boolean
-
setFilterRemoveByHashCode
Should the receiver try to match hash codes. If true, the receiver will see if the client supplied a hash code. If it did, then it will try to get the item locally. If the item exists, then it will compare the hash code. if they are the same, it will not remove. This isn't perfect since different objects can have the same hash code, but it is unlikely of objects of the same type.- Specified by:
setFilterRemoveByHashCode
in interfaceITCPLateralCacheAttributes
- Parameters:
filter
-
-
setSocketTimeOut
- Specified by:
setSocketTimeOut
in interfaceITCPLateralCacheAttributes
- Parameters:
socketTimeOut
- the socketTimeOut to set
-
getSocketTimeOut
- Specified by:
getSocketTimeOut
in interfaceITCPLateralCacheAttributes
- Returns:
- the socketTimeOut
-
setOpenTimeOut
- Specified by:
setOpenTimeOut
in interfaceITCPLateralCacheAttributes
- Parameters:
openTimeOut
- the openTimeOut to set
-
getOpenTimeOut
- Specified by:
getOpenTimeOut
in interfaceITCPLateralCacheAttributes
- Returns:
- the openTimeOut
-
toString
Used to key the instance TODO create another method for this and use toString for debugging only.- Overrides:
toString
in classLateralCacheAttributes
- Returns:
- String
-