View Javadoc

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