View Javadoc

1   //
2   //  ========================================================================
3   //  Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
4   //  ------------------------------------------------------------------------
5   //  All rights reserved. This program and the accompanying materials
6   //  are made available under the terms of the Eclipse Public License v1.0
7   //  and Apache License v2.0 which accompanies this distribution.
8   //
9   //      The Eclipse Public License is available at
10  //      http://www.eclipse.org/legal/epl-v10.html
11  //
12  //      The Apache License v2.0 is available at
13  //      http://www.opensource.org/licenses/apache2.0.php
14  //
15  //  You may elect to redistribute this code under either of these licenses.
16  //  ========================================================================
17  //
18  
19  package org.eclipse.jetty.spdy.api;
20  
21  import java.util.concurrent.TimeUnit;
22  
23  public class SettingsInfo extends Info
24  {
25      public static final byte CLEAR_PERSISTED = 1;
26  
27      private final Settings settings;
28      private final boolean clearPersisted;
29  
30      public SettingsInfo(Settings settings)
31      {
32          this(0, TimeUnit.SECONDS, settings, false);
33      }
34  
35      public SettingsInfo(long timeout, TimeUnit unit, Settings settings, boolean clearPersisted)
36      {
37          super(timeout, unit);
38          this.settings = settings;
39          this.clearPersisted = clearPersisted;
40      }
41  
42      public SettingsInfo(Settings settings, boolean clearPersisted)
43      {
44          this(0, TimeUnit.SECONDS, settings, clearPersisted);
45      }
46  
47      public boolean isClearPersisted()
48      {
49          return clearPersisted;
50      }
51  
52      public byte getFlags()
53      {
54          return isClearPersisted() ? CLEAR_PERSISTED : 0;
55      }
56  
57      public Settings getSettings()
58      {
59          return settings;
60      }
61  }