1 package org.apache.jcs.auxiliary.lateral.socket.tcp.behavior;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.apache.jcs.auxiliary.lateral.behavior.ILateralCacheAttributes;
23
24 /***
25 * This interface defines functions that are particular to the TCP Lateral Cache
26 * plugin. It extends the generic LateralCacheAttributes interface which in turn
27 * extends the AuxiliaryCache interface.
28 * <p>
29 * @author Aaron Smuts
30 */
31 public interface ITCPLateralCacheAttributes
32 extends ILateralCacheAttributes
33 {
34 /***
35 * Sets the tcpServer attribute of the ILateralCacheAttributes object
36 * <p>
37 * @param val
38 * The new tcpServer value
39 */
40 public void setTcpServer( String val );
41
42 /***
43 * Gets the tcpServer attribute of the ILateralCacheAttributes object
44 * <p>
45 * @return The tcpServer value
46 */
47 public String getTcpServer();
48
49 /***
50 * Sets the tcpServers attribute of the ILateralCacheAttributes object
51 * <p>
52 * @param val
53 * The new tcpServers value
54 */
55 public void setTcpServers( String val );
56
57 /***
58 * Gets the tcpServers attribute of the ILateralCacheAttributes object
59 * <p>
60 * @return The tcpServers value
61 */
62 public String getTcpServers();
63
64 /***
65 * Sets the tcpListenerPort attribute of the ILateralCacheAttributes object
66 * <p>
67 * @param val
68 * The new tcpListenerPort value
69 */
70 public void setTcpListenerPort( int val );
71
72 /***
73 * Gets the tcpListenerPort attribute of the ILateralCacheAttributes object
74 * <p>
75 * @return The tcpListenerPort value
76 */
77 public int getTcpListenerPort();
78
79 /***
80 * Can setup UDP Discovery. This only works for TCp laterals right now. It
81 * allows TCP laterals to find each other by broadcasting to a multicast
82 * port.
83 * <p>
84 * @param udpDiscoveryEnabled
85 * The udpDiscoveryEnabled to set.
86 */
87 public void setUdpDiscoveryEnabled( boolean udpDiscoveryEnabled );
88
89 /***
90 * Whether or not TCP laterals can try to find each other by multicast
91 * communication.
92 * <p>
93 * @return Returns the udpDiscoveryEnabled.
94 */
95 public boolean isUdpDiscoveryEnabled();
96
97 /***
98 * The port to use if UDPDiscovery is enabled.
99 * <p>
100 * @return Returns the udpDiscoveryPort.
101 */
102 public int getUdpDiscoveryPort();
103
104 /***
105 * Sets the port to use if UDPDiscovery is enabled.
106 * <p>
107 * @param udpDiscoveryPort
108 * The udpDiscoveryPort to set.
109 */
110 public void setUdpDiscoveryPort( int udpDiscoveryPort );
111
112 /***
113 * The address to broadcast to if UDPDiscovery is enabled.
114 * <p>
115 * @return Returns the udpDiscoveryAddr.
116 */
117 public String getUdpDiscoveryAddr();
118
119 /***
120 * Sets the address to broadcast to if UDPDiscovery is enabled.
121 * <p>
122 * @param udpDiscoveryAddr
123 * The udpDiscoveryAddr to set.
124 */
125 public void setUdpDiscoveryAddr( String udpDiscoveryAddr );
126
127 /***
128 * Is the lateral allowed to try and get from other laterals.
129 * <p>
130 * This replaces the old putOnlyMode
131 * <p>
132 * @param allowGet
133 */
134 public void setAllowGet( boolean allowGet );
135
136 /***
137 * Is the lateral allowed to try and get from other laterals.
138 * <p>
139 * @return true if the lateral will try to get
140 */
141 public boolean isAllowGet();
142
143 /***
144 * Is the lateral allowed to put objects to other laterals.
145 * <p>
146 * @param allowPut
147 */
148 public void setAllowPut( boolean allowPut );
149
150 /***
151 * Is the lateral allowed to put objects to other laterals.
152 * <p>
153 * @return true if puts are allowed
154 */
155 public boolean isAllowPut();
156
157 /***
158 * Should the client send a remove command rather than a put when update is
159 * called. This is a client option, not a receiver option. This allows you
160 * to prevent the lateral from serializing objects.
161 * <p>
162 * @param issueRemoveOnPut
163 */
164 public void setIssueRemoveOnPut( boolean issueRemoveOnPut );
165
166 /***
167 * Should the client send a remove command rather than a put when update is
168 * called. This is a client option, not a receiver option. This allows you
169 * to prevent the lateral from serializing objects.
170 * <p>
171 * @return true if updates will result in a remove command being sent.
172 */
173 public boolean isIssueRemoveOnPut();
174
175 /***
176 * Should the receiver try to match hashcodes. If true, the receiver will
177 * see if the client supplied a hshcode. If it did, then it will try to get
178 * the item locally. If the item exists, then it will compare the hashcode.
179 * if they are the same, it will not remove. This isn't perfect since
180 * different objects can have the same hashcode, but it is unlikely of
181 * objects of the same type.
182 * <p>
183 * @return boolean
184 */
185 public boolean isFilterRemoveByHashCode();
186
187 /***
188 * Should the receiver try to match hashcodes. If true, the receiver will
189 * see if the client supplied a hshcode. If it did, then it will try to get
190 * the item locally. If the item exists, then it will compare the hashcode.
191 * if they are the same, it will not remove. This isn't perfect since
192 * different objects can have the same hashcode, but it is unlikely of
193 * objects of the same type.
194 * <p>
195 * @param filter
196 */
197 public void setFilterRemoveByHashCode( boolean filter );
198
199 }