1 package org.apache.commons.jcs3.auxiliary.remote.behavior; 2 3 import java.util.List; 4 5 import org.apache.commons.jcs3.auxiliary.remote.RemoteLocation; 6 7 /* 8 * Licensed to the Apache Software Foundation (ASF) under one 9 * or more contributor license agreements. See the NOTICE file 10 * distributed with this work for additional information 11 * regarding copyright ownership. The ASF licenses this file 12 * to you under the Apache License, Version 2.0 (the 13 * "License"); you may not use this file except in compliance 14 * with the License. You may obtain a copy of the License at 15 * 16 * http://www.apache.org/licenses/LICENSE-2.0 17 * 18 * Unless required by applicable law or agreed to in writing, 19 * software distributed under the License is distributed on an 20 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 21 * KIND, either express or implied. See the License for the 22 * specific language governing permissions and limitations 23 * under the License. 24 */ 25 26 /** 27 * This specifies what a remote cache configuration object should look like. 28 */ 29 public interface IRemoteCacheAttributes 30 extends ICommonRemoteCacheAttributes 31 { 32 /** 33 * If RECEIVE is false then the remote cache will not register a listener with the remote 34 * server. This allows you to configure a remote server as a repository from which you can get 35 * and to which you put, but from which you do not receive any notifications. That is, you will 36 * not receive updates or removes. 37 * <p> 38 * If you set this option to false, you should set your local memory size to 0. 39 */ 40 boolean DEFAULT_RECEIVE = true; 41 42 /** 43 * The number of elements the zombie queue will hold. This queue is used to store events if we 44 * loose our connection with the server. 45 */ 46 int DEFAULT_ZOMBIE_QUEUE_MAX_SIZE = 1000; 47 48 /** 49 * Gets the failoverIndex attribute of the IRemoteCacheAttributes object. 50 * <p> 51 * This specifies which server in the list we are listening to if the number is greater than 0 52 * we will try to move to 0 position the primary is added as position 1 if it is present 53 * <p> 54 * @return The failoverIndex value 55 */ 56 int getFailoverIndex(); 57 58 /** 59 * Sets the failoverIndex attribute of the IRemoteCacheAttributes object 60 * <p> 61 * @param p The new failoverIndex value 62 */ 63 void setFailoverIndex( int p ); 64 65 /** 66 * Gets the failovers attribute of the IRemoteCacheAttributes object 67 * <p> 68 * @return The failovers value 69 */ 70 List<RemoteLocation> getFailovers(); 71 72 /** 73 * Sets the failovers attribute of the IRemoteCacheAttributes object 74 * <p> 75 * @param failovers The new failovers value 76 */ 77 void setFailovers( List<RemoteLocation> failovers ); 78 79 /** 80 * Gets the localPort attribute of the IRemoteCacheAttributes object 81 * <p> 82 * @return The localPort value 83 */ 84 int getLocalPort(); 85 86 /** 87 * Sets the localPort attribute of the IRemoteCacheAttributes object 88 * <p> 89 * @param p The new localPort value 90 */ 91 void setLocalPort( int p ); 92 93 /** 94 * Gets the failoverServers attribute of the IRemoteCacheAttributes object 95 * <p> 96 * @return The failoverServers value 97 */ 98 String getFailoverServers(); 99 100 /** 101 * Sets the failoverServers attribute of the IRemoteCacheAttributes object 102 * <p> 103 * @param s The new failoverServers value 104 */ 105 void setFailoverServers( String s ); 106 107 /** 108 * The thread pool the remote cache should use. At first this will only be for gets. 109 * <p> 110 * The default name is "remote_cache_client" 111 * <p> 112 * @return the name of the pool 113 */ 114 String getThreadPoolName(); 115 116 /** 117 * Set the name of the pool to use. Pools should be defined in the cache.ccf. 118 * <p> 119 * @param name 120 */ 121 void setThreadPoolName( String name ); 122 123 /** 124 * -1 and 0 mean no timeout, this is the default if the timeout is -1 or 0, no threadpool will 125 * be used. 126 * <p> 127 * @return the time in millis 128 */ 129 int getGetTimeoutMillis(); 130 131 /** 132 * -1 means no timeout, this is the default if the timeout is -1 or 0, no threadpool will be 133 * used. If the timeout is greater than 0 a threadpool will be used for get requests. 134 * <p> 135 * @param millis 136 */ 137 void setGetTimeoutMillis( int millis ); 138 139 /** 140 * By default this option is true. If you set it to false, you will not receive updates or 141 * removes from the remote server. 142 * <p> 143 * @param receive 144 */ 145 void setReceive( boolean receive ); 146 147 /** 148 * If RECEIVE is false then the remote cache will not register a listener with the remote 149 * server. This allows you to configure a remote server as a repository from which you can get 150 * and to which you put, but from which you do not receive any notifications. That is, you will 151 * not receive updates or removes. 152 * <p> 153 * If you set this option to false, you should set your local memory size to 0. 154 * <p> 155 * The remote cache manager uses this value to decide whether or not to register a listener. 156 * <p> 157 * It makes no sense to configure a cluster remote cache to no receive. 158 * <p> 159 * Since a non-receiving remote cache client will not register a listener, it will not have a 160 * listener id assigned from the server. As such the remote server cannot determine if it is a 161 * cluster or a normal client. It will assume that it is a normal client. 162 * <p> 163 * @return the receive value. 164 */ 165 boolean isReceive(); 166 167 /** 168 * The number of elements the zombie queue will hold. This queue is used to store events if we 169 * loose our connection with the server. 170 * <p> 171 * @param zombieQueueMaxSize The zombieQueueMaxSize to set. 172 */ 173 void setZombieQueueMaxSize( int zombieQueueMaxSize ); 174 175 /** 176 * The number of elements the zombie queue will hold. This queue is used to store events if we 177 * loose our connection with the server. 178 * <p> 179 * @return Returns the zombieQueueMaxSize. 180 */ 181 int getZombieQueueMaxSize(); 182 }