1 package org.apache.commons.jcs3.auxiliary.lateral.socket.tcp.behavior; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import org.apache.commons.jcs3.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 */ 29 public interface ITCPLateralCacheAttributes 30 extends ILateralCacheAttributes 31 { 32 /** 33 * Sets the tcpServer attribute of the ILateralCacheAttributes object 34 * <p> 35 * @param val 36 * The new tcpServer value 37 */ 38 void setTcpServer( String val ); 39 40 /** 41 * Gets the tcpServer attribute of the ILateralCacheAttributes object 42 * <p> 43 * @return The tcpServer value 44 */ 45 String getTcpServer(); 46 47 /** 48 * Sets the tcpServers attribute of the ILateralCacheAttributes object 49 * <p> 50 * @param val 51 * The new tcpServers value 52 */ 53 void setTcpServers( String val ); 54 55 /** 56 * Gets the tcpServers attribute of the ILateralCacheAttributes object 57 * <p> 58 * @return The tcpServers value 59 */ 60 String getTcpServers(); 61 62 /** 63 * Sets the tcpListenerPort attribute of the ILateralCacheAttributes object 64 * <p> 65 * @param val 66 * The new tcpListenerPort value 67 */ 68 void setTcpListenerPort( int val ); 69 70 /** 71 * Gets the tcpListenerPort attribute of the ILateralCacheAttributes object 72 * <p> 73 * @return The tcpListenerPort value 74 */ 75 int getTcpListenerPort(); 76 77 /** 78 * Sets the tcpListenerHost attribute of the ILateralCacheAttributes object 79 * <p> 80 * @param val 81 * The new tcpListenerHost value 82 */ 83 void setTcpListenerHost( String val ); 84 85 /** 86 * Gets the tcpListenerHost attribute of the ILateralCacheAttributes object 87 * <p> 88 * @return The tcpListenerHost value 89 */ 90 String getTcpListenerHost(); 91 92 /** 93 * Can setup UDP Discovery. This only works for TCp laterals right now. It 94 * allows TCP laterals to find each other by broadcasting to a multicast 95 * port. 96 * <p> 97 * @param udpDiscoveryEnabled 98 * The udpDiscoveryEnabled to set. 99 */ 100 void setUdpDiscoveryEnabled( boolean udpDiscoveryEnabled ); 101 102 /** 103 * Whether or not TCP laterals can try to find each other by multicast 104 * communication. 105 * <p> 106 * @return Returns the udpDiscoveryEnabled. 107 */ 108 boolean isUdpDiscoveryEnabled(); 109 110 /** 111 * The port to use if UDPDiscovery is enabled. 112 * <p> 113 * @return Returns the udpDiscoveryPort. 114 */ 115 int getUdpDiscoveryPort(); 116 117 /** 118 * Sets the port to use if UDPDiscovery is enabled. 119 * <p> 120 * @param udpDiscoveryPort 121 * The udpDiscoveryPort to set. 122 */ 123 void setUdpDiscoveryPort( int udpDiscoveryPort ); 124 125 /** 126 * The address to broadcast to if UDPDiscovery is enabled. 127 * <p> 128 * @return Returns the udpDiscoveryAddr. 129 */ 130 String getUdpDiscoveryAddr(); 131 132 /** 133 * Sets the address to broadcast to if UDPDiscovery is enabled. 134 * <p> 135 * @param udpDiscoveryAddr 136 * The udpDiscoveryAddr to set. 137 */ 138 void setUdpDiscoveryAddr( String udpDiscoveryAddr ); 139 140 /** 141 * The time-to-live for the UDP multicast packets 142 * <p> 143 * @return Returns the udpTTL. 144 * @since 3.1 145 */ 146 int getUdpTTL(); 147 148 /** 149 * Sets the time-to-live for the UDP multicast packet 150 * <p> 151 * @param udpTTL The udpTTL to set. 152 * @since 3.1 153 */ 154 void setUdpTTL( final int udpTTL ); 155 156 /** 157 * Is the lateral allowed to try and get from other laterals. 158 * <p> 159 * This replaces the old putOnlyMode 160 * <p> 161 * @param allowGet 162 */ 163 void setAllowGet( boolean allowGet ); 164 165 /** 166 * Is the lateral allowed to try and get from other laterals. 167 * <p> 168 * @return true if the lateral will try to get 169 */ 170 boolean isAllowGet(); 171 172 /** 173 * Is the lateral allowed to put objects to other laterals. 174 * <p> 175 * @param allowPut 176 */ 177 void setAllowPut( boolean allowPut ); 178 179 /** 180 * Is the lateral allowed to put objects to other laterals. 181 * <p> 182 * @return true if puts are allowed 183 */ 184 boolean isAllowPut(); 185 186 /** 187 * Should the client send a remove command rather than a put when update is 188 * called. This is a client option, not a receiver option. This allows you 189 * to prevent the lateral from serializing objects. 190 * <p> 191 * @param issueRemoveOnPut 192 */ 193 void setIssueRemoveOnPut( boolean issueRemoveOnPut ); 194 195 /** 196 * Should the client send a remove command rather than a put when update is 197 * called. This is a client option, not a receiver option. This allows you 198 * to prevent the lateral from serializing objects. 199 * <p> 200 * @return true if updates will result in a remove command being sent. 201 */ 202 boolean isIssueRemoveOnPut(); 203 204 /** 205 * Should the receiver try to match hash codes. If true, the receiver will 206 * see if the client supplied a hash code. If it did, then it will try to get 207 * the item locally. If the item exists, then it will compare the hash code. 208 * if they are the same, it will not remove. This isn't perfect since 209 * different objects can have the same hash code, but it is unlikely of 210 * objects of the same type. 211 * <p> 212 * @return boolean 213 */ 214 boolean isFilterRemoveByHashCode(); 215 216 /** 217 * Should the receiver try to match hash codes. If true, the receiver will 218 * see if the client supplied a hash code. If it did, then it will try to get 219 * the item locally. If the item exists, then it will compare the hash code. 220 * if they are the same, it will not remove. This isn't perfect since 221 * different objects can have the same hash code, but it is unlikely of 222 * objects of the same type. 223 * <p> 224 * @param filter 225 */ 226 void setFilterRemoveByHashCode( boolean filter ); 227 228 /** 229 * @param socketTimeOut the socketTimeOut to set 230 */ 231 void setSocketTimeOut( int socketTimeOut ); 232 233 /** 234 * @return the socketTimeOut 235 */ 236 int getSocketTimeOut(); 237 238 /** 239 * @param openTimeOut the openTimeOut to set 240 */ 241 void setOpenTimeOut( int openTimeOut ); 242 243 /** 244 * @return the openTimeOut 245 */ 246 int getOpenTimeOut(); 247 }