src/org/apache/commons/jcs3/auxiliary/remote/http/server/RemoteHttpCacheServerAttributes.java
raw symbols SCIP| 1 | package org.apache.commons.jcs3.auxiliary.remote.http.server; |
| 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.AbstractAuxiliaryCacheAttributes; |
| 23 | |
| 24 | /** |
| 25 | * Configuration for the RemoteHttpCacheServer. Most of these properties are used only by the |
| 26 | * service. |
| 27 | */ |
| 28 | public class RemoteHttpCacheServerAttributes |
| 29 | extends AbstractAuxiliaryCacheAttributes |
| 30 | { |
| 31 | /** Don't change. */ |
| 32 | private static final long serialVersionUID = -3987239306108780496L; |
| 33 | |
| 34 | /** Can a cluster remote put to other remotes */ |
| 35 | private boolean localClusterConsistency = true; |
| 36 | |
| 37 | /** Can a cluster remote get from other remotes */ |
| 38 | private boolean allowClusterGet = true; |
| 39 | |
| 40 | /** |
| 41 | * Should cluster updates be propagated to the locals |
| 42 | * <p> |
| 43 | * @return The localClusterConsistency value |
| 44 | */ |
| 45 | public boolean isLocalClusterConsistency() |
| 46 | { |
| 47 | return localClusterConsistency; |
| 48 | } |
| 49 | |
| 50 | /** |
| 51 | * Should cluster updates be propagated to the locals |
| 52 | * <p> |
| 53 | * @param r The new localClusterConsistency value |
| 54 | */ |
| 55 | public void setLocalClusterConsistency( final boolean r ) |
| 56 | { |
| 57 | this.localClusterConsistency = r; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Should gets from non-cluster clients be allowed to get from other remote auxiliaries. |
| 62 | * <p> |
| 63 | * @return The localClusterConsistency value |
| 64 | */ |
| 65 | public boolean isAllowClusterGet() |
| 66 | { |
| 67 | return allowClusterGet; |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * Should we try to get from other cluster servers if we don't find the items locally. |
| 72 | * <p> |
| 73 | * @param r The new localClusterConsistency value |
| 74 | */ |
| 75 | public void setAllowClusterGet( final boolean r ) |
| 76 | { |
| 77 | allowClusterGet = r; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * @return String details |
| 82 | */ |
| 83 | @Override |
| 84 | public String toString() |
| 85 | { |
| 86 | final StringBuilder buf = new StringBuilder(); |
| 87 | buf.append( "\nRemoteHttpCacheServiceAttributes" ); |
| 88 | buf.append( "\n cacheName = [" + this.getCacheName() + "]" ); |
| 89 | buf.append( "\n allowClusterGet = [" + this.isAllowClusterGet() + "]" ); |
| 90 | buf.append( "\n localClusterConsistency = [" + this.isLocalClusterConsistency() + "]" ); |
| 91 | buf.append( "\n eventQueueType = [" + this.getEventQueueType() + "]" ); |
| 92 | buf.append( "\n eventQueuePoolName = [" + this.getEventQueuePoolName() + "]" ); |
| 93 | return buf.toString(); |
| 94 | } |
| 95 | } |