Clover icon

Magnolia Module Memcached 5.5.9

  1. Project Clover database Mon Nov 25 2019 16:56:08 CET
  2. Package info.magnolia.cache.memcached.spy

File MemcachedConnectionFactoryBuilder.java

 

Code metrics

0
0
0
1
192
74
0
-
-
0
-
100% of code in this file is excluded from these metrics.

Classes

Class Line # Actions
MemcachedConnectionFactoryBuilder 51 0 100% 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

1    /**
2    * This file Copyright (c) 2015-2018 Magnolia International
3    * Ltd. (http://www.magnolia-cms.com). All rights reserved.
4    *
5    *
6    * This file is dual-licensed under both the Magnolia
7    * Network Agreement and the GNU General Public License.
8    * You may elect to use one or the other of these licenses.
9    *
10    * This file is distributed in the hope that it will be
11    * useful, but AS-IS and WITHOUT ANY WARRANTY; without even the
12    * implied warranty of MERCHANTABILITY or FITNESS FOR A
13    * PARTICULAR PURPOSE, TITLE, or NONINFRINGEMENT.
14    * Redistribution, except as permitted by whichever of the GPL
15    * or MNA you select, is prohibited.
16    *
17    * 1. For the GPL license (GPL), you can redistribute and/or
18    * modify this file under the terms of the GNU General
19    * Public License, Version 3, as published by the Free Software
20    * Foundation. You should have received a copy of the GNU
21    * General Public License, Version 3 along with this program;
22    * if not, write to the Free Software Foundation, Inc., 51
23    * Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
24    *
25    * 2. For the Magnolia Network Agreement (MNA), this file
26    * and the accompanying materials are made available under the
27    * terms of the MNA which accompanies this distribution, and
28    * is available at http://www.magnolia-cms.com/mna.html
29    *
30    * Any modifications to this file must keep this entire header
31    * intact.
32    *
33    */
34    package info.magnolia.cache.memcached.spy;
35   
36    import java.util.Collection;
37    import java.util.List;
38   
39    import net.spy.memcached.ConnectionFactoryBuilder;
40    import net.spy.memcached.ConnectionObserver;
41    import net.spy.memcached.FailureMode;
42    import net.spy.memcached.HashAlgorithm;
43    import net.spy.memcached.OperationFactory;
44    import net.spy.memcached.auth.AuthDescriptor;
45    import net.spy.memcached.ops.OperationQueueFactory;
46    import net.spy.memcached.transcoders.Transcoder;
47   
48    /**
49    * A Memcached configuration.
50    */
 
51    public class MemcachedConnectionFactoryBuilder extends ConnectionFactoryBuilder {
52   
53    private List<String> servers;
54   
 
55    toggle public List<String> getServers() {
56    return servers;
57    }
58   
 
59    toggle public void setServers(List<String> servers) {
60    this.servers = servers;
61    }
62   
 
63    toggle public void setReadOpQueueFactoryN2B(OperationQueueFactory q) {
64    this.setReadOpQueueFactory(q);
65    }
66   
67    /**
68    * Set the write queue factory.
69    */
 
70    toggle public void setWriteOpQueueFactoryN2B(OperationQueueFactory q) {
71    this.setOpQueueFactory(q);
72    }
73   
74    /**
75    * Set the maximum amount of time (in milliseconds) a client is willing to
76    * wait for space to become available in an output queue.
77    */
 
78    toggle public void setOpQueueMaxBlockTimeN2B(long t) {
79    this.setOpQueueMaxBlockTime(t);
80    }
81   
82    /**
83    * Set the default transcoder.
84    */
 
85    toggle public void setTranscoderN2B(Transcoder<Object> t) {
86    this.setTranscoder(t);
87    }
88   
89    /**
90    * Set the failure mode.
91    */
 
92    toggle public void setFailureModeN2B(FailureMode fm) {
93    this.setFailureMode(fm);
94    }
95   
96    /**
97    * Set the initial connection observers (will observe initial connection).
98    */
 
99    toggle public void setInitialObserversN2B(Collection<ConnectionObserver> obs) {
100    this.setInitialObservers(obs);
101    }
102   
103    /**
104    * Set the operation factory.
105    *
106    * Note that the operation factory is used to also imply the type of nodes to
107    * create.
108    *
109    * @see net.spy.memcached.MemcachedNode
110    */
 
111    toggle public void setOpFactN2B(OperationFactory f) {
112    this.setOpFact(f);
113    }
114   
115    /**
116    * Set the default operation timeout in milliseconds.
117    */
 
118    toggle public void setOpTimeoutN2B(long t) {
119    this.setOpTimeout(t);
120    }
121   
122    /**
123    * Set the daemon state of the IO thread (defaults to true).
124    */
 
125    toggle public void setDaemonN2B(boolean d) {
126    this.setDaemon(d);
127    }
128   
129    /**
130    * Set to false if the default operation optimization is not desirable.
131    */
 
132    toggle public void setShouldOptimizeN2B(boolean o) {
133    this.setShouldOptimize(o);
134    }
135   
136    /**
137    * Set the read buffer size.
138    */
 
139    toggle public void setReadBufferSizeN2B(int to) {
140    this.setReadBufferSize(to);
141    }
142   
143    /**
144    * Set the hash algorithm.
145    */
 
146    toggle public void setHashAlgN2B(HashAlgorithm to) {
147    this.setHashAlg(to);
148    }
149   
150    /**
151    * Set to true if you'd like to enable the Nagle algorithm.
152    */
 
153    toggle public void setUseNagleAlgorithmN2B(boolean to) {
154    this.setUseNagleAlgorithm(to);
155    }
156   
157    /**
158    * Convenience method to specify the protocol to use.
159    */
 
160    toggle public void setProtocolN2B(Protocol prot) {
161    this.setProtocol(prot);
162    }
163   
164    /**
165    * Set the locator type.
166    */
 
167    toggle public void setLocatorTypeN2B(Locator l) {
168    this.setLocatorType(l);
169    }
170   
171    /**
172    * Set the maximum reconnect delay.
173    */
 
174    toggle public void setMaxReconnectDelayN2B(long to) {
175    this.setMaxReconnectDelay(to);
176    }
177   
178    /**
179    * Set the auth descriptor to enable authentication on new connections.
180    */
 
181    toggle public void setAuthDescriptorN2B(AuthDescriptor to) {
182    this.setAuthDescriptor(to);
183    }
184   
185    /**
186    * Set the maximum timeout exception threshold.
187    */
 
188    toggle public void setTimeoutExceptionThresholdN2B(int to) {
189    this.setTimeoutExceptionThreshold(to);
190    }
191   
192    }