This project has retired. For details please refer to its Attic page.
AbstractCookieSettings xref
View Javadoc

1   package org.apache.archiva.redback.policy;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import javax.inject.Inject;
23  import javax.inject.Named;
24  
25  import org.apache.archiva.redback.configuration.UserConfiguration;
26  
27  /**
28   * Base class for cookie settings. These will only differ by their configuration keys.
29   *
30   * @todo not sure if having the domain and path in the general configuration is a good idea - this is probably something
31   * customised once for all cookies and applications. Should it be in a sharead configuration file, under a sharead key,
32   * or perhaps even configured at the application server level? (ie, in Naming).
33   */
34  public abstract class AbstractCookieSettings
35      implements CookieSettings
36  {
37      @Inject @Named(value="userConfiguration#default")
38      protected UserConfiguration config;
39  
40      /**
41       * Timeout (in minutes) for the sign on cookie.
42       */
43      protected int cookieTimeout;
44  
45      /**
46       * The domain for the cookie.
47       */
48      protected String domain;
49  
50      /**
51       * The path for the cookie.
52       */
53      protected String path;
54  
55      public int getCookieTimeout()
56      {
57          return cookieTimeout;
58      }
59  
60      public String getDomain()
61      {
62          return domain;
63      }
64  
65      public String getPath()
66      {
67          return path;
68      }
69  
70  }