org.apache.jcs.auxiliary.lateral.socket.tcp
Class TCPLateralCacheAttributes

java.lang.Object
  extended by org.apache.jcs.auxiliary.AbstractAuxiliaryCacheAttributes
      extended by org.apache.jcs.auxiliary.lateral.LateralCacheAttributes
          extended by org.apache.jcs.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:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.jcs.auxiliary.AbstractAuxiliaryCacheAttributes
cacheName, eventQueuePoolName, eventQueueType, name
 
Fields inherited from interface org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes
DEFAULT_ZOMBIE_QUEUE_MAX_SIZE, HTTP, TCP, UDP, XMLRPC
 
Fields inherited from interface org.apache.jcs.auxiliary.AuxiliaryCacheAttributes
POOLED_QUEUE_TYPE, SINGLE_QUEUE_TYPE
 
Constructor Summary
TCPLateralCacheAttributes()
           
 
Method Summary
 AuxiliaryCacheAttributes copy()
          Returns a clone of the attributes.
 int getOpenTimeOut()
           
 int getSocketTimeOut()
           
 int getTcpListenerPort()
          Gets the tcpListenerPort attribute of the ILateralCacheAttributes object
 String getTcpServer()
          Gets the tcpServer attribute of the ILateralCacheAttributes object
 String getTcpServers()
          Gets the tcpServers attribute of the ILateralCacheAttributes object
 String getUdpDiscoveryAddr()
          The address to broadcast to if UDPDiscovery is enabled.
 int getUdpDiscoveryPort()
          The port to use if UDPDiscovery is enabled.
 boolean isAllowGet()
          Is the lateral allowed to try and get from other laterals.
 boolean isAllowPut()
          Is the lateral allowed to put objects to other laterals.
 boolean isFilterRemoveByHashCode()
          Should the receiver try to match hashcodes.
 boolean isIssueRemoveOnPut()
          Should the client send a remove command rather than a put when update is called.
 boolean isUdpDiscoveryEnabled()
          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 hashcodes.
 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 setTcpListenerPort(int val)
          Sets the tcpListenerPort attribute of the ILateralCacheAttributes object
 void setTcpServer(String val)
          Sets the tcpServer attribute of the ILateralCacheAttributes object
 void setTcpServers(String val)
          Sets the tcpServers attribute of the ILateralCacheAttributes object
 void 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.
 String toString()
          Used to key the instance TODO create another method for this and use toString for debugging only.
 
Methods inherited from class org.apache.jcs.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.jcs.auxiliary.AbstractAuxiliaryCacheAttributes
getCacheName, getEventQueuePoolName, getEventQueueType, getName, setCacheName, setEventQueuePoolName, setEventQueueType, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes
getHttpListenerPort, getHttpServer, getHttpServers, getPutOnlyMode, getTransmissionType, getTransmissionTypeName, getUdpMulticastAddr, getUdpMulticastPort, getZombieQueueMaxSize, isReceive, setHttpListenerPort, setHttpServer, setHttpServers, setPutOnlyMode, setReceive, setTransmissionType, setTransmissionTypeName, setUdpMulticastAddr, setUdpMulticastPort, setZombieQueueMaxSize
 
Methods inherited from interface org.apache.jcs.auxiliary.AuxiliaryCacheAttributes
getCacheName, getEventQueuePoolName, getEventQueueType, getName, setCacheName, setEventQueuePoolName, setEventQueueType, setName
 

Constructor Detail

TCPLateralCacheAttributes

public TCPLateralCacheAttributes()
Method Detail

setTcpServer

public void setTcpServer(String val)
Sets the tcpServer attribute of the ILateralCacheAttributes object

Specified by:
setTcpServer in interface ITCPLateralCacheAttributes
Parameters:
val - The new tcpServer value

getTcpServer

public String getTcpServer()
Gets the tcpServer attribute of the ILateralCacheAttributes object

Specified by:
getTcpServer in interface ITCPLateralCacheAttributes
Returns:
The tcpServer value

setTcpServers

public void setTcpServers(String val)
Sets the tcpServers attribute of the ILateralCacheAttributes object

Specified by:
setTcpServers in interface ITCPLateralCacheAttributes
Parameters:
val - The new tcpServers value

getTcpServers

public String getTcpServers()
Gets the tcpServers attribute of the ILateralCacheAttributes object

Specified by:
getTcpServers in interface ITCPLateralCacheAttributes
Returns:
The tcpServers value

setTcpListenerPort

public void setTcpListenerPort(int val)
Sets the tcpListenerPort attribute of the ILateralCacheAttributes object

Specified by:
setTcpListenerPort in interface ITCPLateralCacheAttributes
Parameters:
val - The new tcpListenerPort value

getTcpListenerPort

public int getTcpListenerPort()
Gets the tcpListenerPort attribute of the ILateralCacheAttributes object

Specified by:
getTcpListenerPort in interface ITCPLateralCacheAttributes
Returns:
The tcpListenerPort value

setUdpDiscoveryEnabled

public void setUdpDiscoveryEnabled(boolean udpDiscoveryEnabled)
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 interface ITCPLateralCacheAttributes
Parameters:
udpDiscoveryEnabled - The udpDiscoveryEnabled to set.

isUdpDiscoveryEnabled

public boolean isUdpDiscoveryEnabled()
Whether or not TCP laterals can try to find each other by multicast communication.

Specified by:
isUdpDiscoveryEnabled in interface ITCPLateralCacheAttributes
Returns:
Returns the udpDiscoveryEnabled.

getUdpDiscoveryPort

public int getUdpDiscoveryPort()
The port to use if UDPDiscovery is enabled.

Specified by:
getUdpDiscoveryPort in interface ITCPLateralCacheAttributes
Returns:
Returns the udpDiscoveryPort.

setUdpDiscoveryPort

public void setUdpDiscoveryPort(int udpDiscoveryPort)
Sets the port to use if UDPDiscovery is enabled.

Specified by:
setUdpDiscoveryPort in interface ITCPLateralCacheAttributes
Parameters:
udpDiscoveryPort - The udpDiscoveryPort to set.

getUdpDiscoveryAddr

public String getUdpDiscoveryAddr()
The address to broadcast to if UDPDiscovery is enabled.

Specified by:
getUdpDiscoveryAddr in interface ITCPLateralCacheAttributes
Returns:
Returns the udpDiscoveryAddr.

setUdpDiscoveryAddr

public void setUdpDiscoveryAddr(String udpDiscoveryAddr)
Sets the address to broadcast to if UDPDiscovery is enabled.

Specified by:
setUdpDiscoveryAddr in interface ITCPLateralCacheAttributes
Parameters:
udpDiscoveryAddr - The udpDiscoveryAddr to set.

setAllowGet

public void setAllowGet(boolean allowGet)
Is the lateral allowed to try and get from other laterals.

This replaces the old putOnlyMode

Specified by:
setAllowGet in interface ITCPLateralCacheAttributes
Parameters:
allowGet -

isAllowGet

public boolean isAllowGet()
Is the lateral allowed to try and get from other laterals.

Specified by:
isAllowGet in interface ITCPLateralCacheAttributes
Returns:
true if the lateral will try to get

setAllowPut

public void setAllowPut(boolean allowPut)
Is the lateral allowed to put objects to other laterals.

Specified by:
setAllowPut in interface ITCPLateralCacheAttributes
Parameters:
allowPut -

isAllowPut

public boolean isAllowPut()
Is the lateral allowed to put objects to other laterals.

Specified by:
isAllowPut in interface ITCPLateralCacheAttributes
Returns:
true if puts are allowed

setIssueRemoveOnPut

public void setIssueRemoveOnPut(boolean issueRemoveOnPut)
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 interface ITCPLateralCacheAttributes
Parameters:
issueRemoveOnPut -

isIssueRemoveOnPut

public boolean 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 interface ITCPLateralCacheAttributes
Returns:
true if updates will result in a remove command being sent.

copy

public AuxiliaryCacheAttributes copy()
Description copied from class: LateralCacheAttributes
Returns a clone of the attributes.

Specified by:
copy in interface AuxiliaryCacheAttributes
Overrides:
copy in class LateralCacheAttributes
Returns:
AuxiliaryCacheAttributes

isFilterRemoveByHashCode

public boolean isFilterRemoveByHashCode()
Should the receiver try to match hashcodes. If true, the receiver will see if the client supplied a hshcode. If it did, then it will try to get the item locally. If the item exists, then it will compare the hashcode. if they are the same, it will not remove. This isn't perfect since different objects can have the same hashcode, but it is unlikely of objects of the same type.

Specified by:
isFilterRemoveByHashCode in interface ITCPLateralCacheAttributes
Returns:
boolean

setFilterRemoveByHashCode

public void setFilterRemoveByHashCode(boolean filter)
Should the receiver try to match hashcodes. If true, the receiver will see if the client supplied a hshcode. If it did, then it will try to get the item locally. If the item exists, then it will compare the hashcode. if they are the same, it will not remove. This isn't perfect since different objects can have the same hashcode, but it is unlikely of objects of the same type.

Specified by:
setFilterRemoveByHashCode in interface ITCPLateralCacheAttributes
Parameters:
filter -

setSocketTimeOut

public void setSocketTimeOut(int socketTimeOut)
Specified by:
setSocketTimeOut in interface ITCPLateralCacheAttributes
Parameters:
socketTimeOut - the socketTimeOut to set

getSocketTimeOut

public int getSocketTimeOut()
Specified by:
getSocketTimeOut in interface ITCPLateralCacheAttributes
Returns:
the socketTimeOut

setOpenTimeOut

public void setOpenTimeOut(int openTimeOut)
Specified by:
setOpenTimeOut in interface ITCPLateralCacheAttributes
Parameters:
openTimeOut - the openTimeOut to set

getOpenTimeOut

public int getOpenTimeOut()
Specified by:
getOpenTimeOut in interface ITCPLateralCacheAttributes
Returns:
the openTimeOut

toString

public String toString()
Used to key the instance TODO create another method for this and use toString for debugging only.

Overrides:
toString in class LateralCacheAttributes
Returns:
String


Copyright © 2002-2012 Apache Software Foundation. All Rights Reserved.