KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > clustering > wadi > WADISessionManagerConfigInfo


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * 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  */

17 package org.apache.geronimo.clustering.wadi;
18
19 import java.io.Serializable JavaDoc;
20 import java.net.URI JavaDoc;
21
22 /**
23  *
24  * @version $Rev$ $Date$
25  */

26 public class WADISessionManagerConfigInfo implements Serializable JavaDoc {
27     private final URI JavaDoc serviceSpaceURI;
28     private final int sweepInterval;
29     private final int numPartitions;
30     private final int sessionTimeoutSeconds;
31     
32     public WADISessionManagerConfigInfo(URI JavaDoc serviceSpaceURI, int sweepInterval, int numPartitions,
33             int sessionTimeoutSeconds) {
34         if (null == serviceSpaceURI) {
35             throw new IllegalArgumentException JavaDoc("serviceSpaceURI is required");
36         } else if (1 > sweepInterval) {
37             throw new IllegalArgumentException JavaDoc("sweepInterval must be greater than 0");
38         } else if (1 > numPartitions) {
39             throw new IllegalArgumentException JavaDoc("numPartitions must be greater than 0");
40         } else if (1 > sessionTimeoutSeconds) {
41             throw new IllegalArgumentException JavaDoc("sessionTimeoutSeconds must be greater than 0");
42         }
43         this.serviceSpaceURI = serviceSpaceURI;
44         this.sweepInterval = sweepInterval;
45         this.numPartitions = numPartitions;
46         this.sessionTimeoutSeconds = sessionTimeoutSeconds;
47     }
48
49     public int getNumPartitions() {
50         return numPartitions;
51     }
52
53     public URI JavaDoc getServiceSpaceURI() {
54         return serviceSpaceURI;
55     }
56
57     public int getSessionTimeoutSeconds() {
58         return sessionTimeoutSeconds;
59     }
60
61     public int getSweepInterval() {
62         return sweepInterval;
63     }
64     
65 }
66
Popular Tags