001    package org.apache.jcs.auxiliary.lateral.behavior;
002    
003    /*
004     * Licensed to the Apache Software Foundation (ASF) under one
005     * or more contributor license agreements.  See the NOTICE file
006     * distributed with this work for additional information
007     * regarding copyright ownership.  The ASF licenses this file
008     * to you under the Apache License, Version 2.0 (the
009     * "License"); you may not use this file except in compliance
010     * with the License.  You may obtain a copy of the License at
011     *
012     *   http://www.apache.org/licenses/LICENSE-2.0
013     *
014     * Unless required by applicable law or agreed to in writing,
015     * software distributed under the License is distributed on an
016     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017     * KIND, either express or implied.  See the License for the
018     * specific language governing permissions and limitations
019     * under the License.
020     */
021    
022    import java.io.Serializable;
023    
024    import org.apache.jcs.auxiliary.AuxiliaryCacheAttributes;
025    
026    /**
027     * This interface defines configuration options common to lateral cache plugins.
028     * <p>
029     * TODO it needs to be trimmed down. The old version had features for every lateral. Now, the
030     * individual laterals have their own specific attributes interfaces.
031     */
032    public interface ILateralCacheAttributes
033        extends Serializable, AuxiliaryCacheAttributes
034    {
035        /** HTTP type */
036        final static int HTTP = 1;
037    
038        /** UDP type */
039        final static int UDP = 2;
040    
041        /** TCP type */
042        final static int TCP = 3;
043    
044        /** XMLRPC type */
045        final static int XMLRPC = 4;
046    
047        /**
048         * The number of elements the zombie queue will hold. This queue is used to store events if we
049         * loose our connection with the server.
050         */
051        public static final int DEFAULT_ZOMBIE_QUEUE_MAX_SIZE = 1000;
052        
053        /**
054         * Sets the httpServer attribute of the ILateralCacheAttributes object
055         * <p>
056         * @param val The new httpServer value
057         */
058        public void setHttpServer( String val );
059    
060        /**
061         * Gets the httpServer attribute of the ILateralCacheAttributes object
062         * <p>
063         * @return The httpServer value
064         */
065        public String getHttpServer();
066    
067        /**
068         * Sets the httpListenerPort attribute of the ILateralCacheAttributes object
069         * <p>
070         * @param val The new tcpListenerPort value
071         */
072        public void setHttpListenerPort( int val );
073    
074        /**
075         * Gets the httpListenerPort attribute of the ILateralCacheAttributes object
076         * <p>
077         * @return The httpListenerPort value
078         */
079        public int getHttpListenerPort();
080    
081        /**
082         * Sets the httpServers attribute of the LateralCacheAttributes object
083         * <p>
084         * @param val The new httpServers value
085         */
086        public void setHttpServers( String val );
087    
088        /**
089         * Gets the httpSrvers attribute of the LateralCacheAttributes object
090         * <p>
091         * @return The httpServers value
092         */
093        public String getHttpServers();
094    
095        /**
096         * Sets the udpMulticastAddr attribute of the ILateralCacheAttributes object
097         * <p>
098         * @param val The new udpMulticastAddr value
099         */
100        public void setUdpMulticastAddr( String val );
101    
102        /**
103         * Gets the udpMulticastAddr attribute of the ILateralCacheAttributes object
104         * <p>
105         * @return The udpMulticastAddr value
106         */
107        public String getUdpMulticastAddr();
108    
109        /**
110         * Sets the udpMulticastPort attribute of the ILateralCacheAttributes object
111         * <p>
112         * @param val The new udpMulticastPort value
113         */
114        public void setUdpMulticastPort( int val );
115    
116        /**
117         * Gets the udpMulticastPort attribute of the ILateralCacheAttributes object
118         * <p>
119         * @return The udpMulticastPort value
120         */
121        public int getUdpMulticastPort();
122    
123        /**
124         * Sets the transmissionType attribute of the ILateralCacheAttributes object
125         * <p>
126         * @param val The new transmissionType value
127         */
128        public void setTransmissionType( int val );
129    
130        /**
131         * Gets the transmissionType attribute of the ILateralCacheAttributes object
132         * <p>
133         * @return The transmissionType value
134         */
135        public int getTransmissionType();
136    
137        /**
138         * Sets the transmissionTypeName attribute of the ILateralCacheAttributes object
139         * <p>
140         * @param val The new transmissionTypeName value
141         */
142        public void setTransmissionTypeName( String val );
143    
144        /**
145         * Gets the transmissionTypeName attribute of the ILateralCacheAttributes object
146         * <p>
147         * @return The transmissionTypeName value
148         */
149        public String getTransmissionTypeName();
150    
151        /**
152         * Sets the putOnlyMode attribute of the ILateralCacheAttributes. When this is true the lateral
153         * cache will only issue put and remove order and will not try to retrieve elements from other
154         * lateral caches.
155         * <p>
156         * @param val The new transmissionTypeName value
157         */
158        public void setPutOnlyMode( boolean val );
159    
160        /**
161         * @return The outgoingOnlyMode value. Stops gets from going remote.
162         */
163        public boolean getPutOnlyMode();
164    
165        /**
166         * @param receive The receive to set.
167         */
168        public void setReceive( boolean receive );
169    
170        /**
171         * Should a listener be created. By default this is true.
172         * <p>
173         * If this is false the lateral will connect to others but it will not create a listener to
174         * receive.
175         * <p>
176         * It is possible if two laterals are misconfigured that lateral A may have a region R1 that is
177         * not configured for the lateral but another is. And if cache B has region R1 configured for
178         * lateral distribution, A will get messages for R1 but not send them.
179         * <p>
180         * @return true if we should have a listener connection
181         */
182        public boolean isReceive();
183        
184        /**
185         * The number of elements the zombie queue will hold. This queue is used to store events if we
186         * loose our connection with the server.
187         * <p>
188         * @param zombieQueueMaxSize The zombieQueueMaxSize to set.
189         */
190        public void setZombieQueueMaxSize( int zombieQueueMaxSize );
191    
192        /**
193         * The number of elements the zombie queue will hold. This queue is used to store events if we
194         * loose our connection with the server.
195         * <p>
196         * @return Returns the zombieQueueMaxSize.
197         */
198        public int getZombieQueueMaxSize();      
199    }