01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.geronimo.clustering.wadi;
17:
18: import java.io.Serializable;
19: import java.net.URI;
20:
21: /**
22: *
23: * @version $Rev$ $Date$
24: */
25: public class WADISessionManagerConfigInfo implements Serializable {
26: private final URI serviceSpaceURI;
27: private final int sweepInterval;
28: private final int numPartitions;
29: private final int sessionTimeoutSeconds;
30: private final boolean disableReplication;
31: private final boolean deltaReplication;
32:
33: public WADISessionManagerConfigInfo(URI serviceSpaceURI,
34: int sweepInterval, int numPartitions,
35: int sessionTimeoutSeconds, boolean disableReplication,
36: boolean deltaReplication) {
37: if (null == serviceSpaceURI) {
38: throw new IllegalArgumentException(
39: "serviceSpaceURI is required");
40: } else if (1 > sweepInterval) {
41: throw new IllegalArgumentException(
42: "sweepInterval must be greater than 0");
43: } else if (1 > numPartitions) {
44: throw new IllegalArgumentException(
45: "numPartitions must be greater than 0");
46: } else if (1 > sessionTimeoutSeconds) {
47: throw new IllegalArgumentException(
48: "sessionTimeoutSeconds must be greater than 0");
49: }
50: this .serviceSpaceURI = serviceSpaceURI;
51: this .sweepInterval = sweepInterval;
52: this .numPartitions = numPartitions;
53: this .sessionTimeoutSeconds = sessionTimeoutSeconds;
54: this .disableReplication = disableReplication;
55: this .deltaReplication = deltaReplication;
56: }
57:
58: public int getNumPartitions() {
59: return numPartitions;
60: }
61:
62: public URI getServiceSpaceURI() {
63: return serviceSpaceURI;
64: }
65:
66: public int getSessionTimeoutSeconds() {
67: return sessionTimeoutSeconds;
68: }
69:
70: public int getSweepInterval() {
71: return sweepInterval;
72: }
73:
74: public boolean isDisableReplication() {
75: return disableReplication;
76: }
77:
78: public boolean isDeltaReplication() {
79: return deltaReplication;
80: }
81:
82: }
|