View Javadoc
1   package org.apache.commons.jcs.auxiliary.lateral.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.jcs.auxiliary.AuxiliaryCacheAttributes;
23  
24  /**
25   * This interface defines configuration options common to lateral cache plugins.
26   * <p>
27   * TODO it needs to be trimmed down. The old version had features for every lateral. Now, the
28   * individual laterals have their own specific attributes interfaces.
29   */
30  public interface ILateralCacheAttributes
31      extends AuxiliaryCacheAttributes
32  {
33      enum Type
34      {
35          /** HTTP type */
36          HTTP, // 1
37  
38          /** UDP type */
39          UDP, // 2
40  
41          /** TCP type */
42          TCP, // 3
43  
44          /** XMLRPC type */
45          XMLRPC // 4
46      }
47  
48      /**
49       * The number of elements the zombie queue will hold. This queue is used to store events if we
50       * loose our connection with the server.
51       */
52      int DEFAULT_ZOMBIE_QUEUE_MAX_SIZE = 1000;
53  
54      /**
55       * Sets the httpServer attribute of the ILateralCacheAttributes object
56       * <p>
57       * @param val The new httpServer value
58       */
59      void setHttpServer( String val );
60  
61      /**
62       * Gets the httpServer attribute of the ILateralCacheAttributes object
63       * <p>
64       * @return The httpServer value
65       */
66      String getHttpServer();
67  
68      /**
69       * Sets the httpListenerPort attribute of the ILateralCacheAttributes object
70       * <p>
71       * @param val The new tcpListenerPort value
72       */
73      void setHttpListenerPort( int val );
74  
75      /**
76       * Gets the httpListenerPort attribute of the ILateralCacheAttributes object
77       * <p>
78       * @return The httpListenerPort value
79       */
80      int getHttpListenerPort();
81  
82      /**
83       * Sets the httpServers attribute of the LateralCacheAttributes object
84       * <p>
85       * @param val The new httpServers value
86       */
87      void setHttpServers( String val );
88  
89      /**
90       * Gets the httpSrvers attribute of the LateralCacheAttributes object
91       * <p>
92       * @return The httpServers value
93       */
94      String getHttpServers();
95  
96      /**
97       * Sets the udpMulticastAddr attribute of the ILateralCacheAttributes object
98       * <p>
99       * @param val The new udpMulticastAddr value
100      */
101     void setUdpMulticastAddr( String val );
102 
103     /**
104      * Gets the udpMulticastAddr attribute of the ILateralCacheAttributes object
105      * <p>
106      * @return The udpMulticastAddr value
107      */
108     String getUdpMulticastAddr();
109 
110     /**
111      * Sets the udpMulticastPort attribute of the ILateralCacheAttributes object
112      * <p>
113      * @param val The new udpMulticastPort value
114      */
115     void setUdpMulticastPort( int val );
116 
117     /**
118      * Gets the udpMulticastPort attribute of the ILateralCacheAttributes object
119      * <p>
120      * @return The udpMulticastPort value
121      */
122     int getUdpMulticastPort();
123 
124     /**
125      * Sets the transmissionType attribute of the ILateralCacheAttributes object
126      * <p>
127      * @param val The new transmissionType value
128      */
129     void setTransmissionType( Type val );
130 
131     /**
132      * Gets the transmissionType attribute of the ILateralCacheAttributes object
133      * <p>
134      * @return The transmissionType value
135      */
136     Type getTransmissionType();
137 
138     /**
139      * Sets the transmissionTypeName attribute of the ILateralCacheAttributes object
140      * <p>
141      * @param val The new transmissionTypeName value
142      */
143     void setTransmissionTypeName( String val );
144 
145     /**
146      * Gets the transmissionTypeName attribute of the ILateralCacheAttributes object
147      * <p>
148      * @return The transmissionTypeName value
149      */
150     String getTransmissionTypeName();
151 
152     /**
153      * Sets the putOnlyMode attribute of the ILateralCacheAttributes. When this is true the lateral
154      * cache will only issue put and remove order and will not try to retrieve elements from other
155      * lateral caches.
156      * <p>
157      * @param val The new transmissionTypeName value
158      */
159     void setPutOnlyMode( boolean val );
160 
161     /**
162      * @return The outgoingOnlyMode value. Stops gets from going remote.
163      */
164     boolean getPutOnlyMode();
165 
166     /**
167      * @param receive The receive to set.
168      */
169     void setReceive( boolean receive );
170 
171     /**
172      * Should a listener be created. By default this is true.
173      * <p>
174      * If this is false the lateral will connect to others but it will not create a listener to
175      * receive.
176      * <p>
177      * It is possible if two laterals are misconfigured that lateral A may have a region R1 that is
178      * not configured for the lateral but another is. And if cache B has region R1 configured for
179      * lateral distribution, A will get messages for R1 but not send them.
180      * <p>
181      * @return true if we should have a listener connection
182      */
183     boolean isReceive();
184 
185     /**
186      * The number of elements the zombie queue will hold. This queue is used to store events if we
187      * loose our connection with the server.
188      * <p>
189      * @param zombieQueueMaxSize The zombieQueueMaxSize to set.
190      */
191     void setZombieQueueMaxSize( int zombieQueueMaxSize );
192 
193     /**
194      * The number of elements the zombie queue will hold. This queue is used to store events if we
195      * loose our connection with the server.
196      * <p>
197      * @return Returns the zombieQueueMaxSize.
198      */
199     int getZombieQueueMaxSize();
200 }