View Javadoc

1   /*
2    * Copyright 2012 The Netty Project
3    *
4    * The Netty Project licenses this file to you under the Apache License,
5    * version 2.0 (the "License"); you may not use this file except in compliance
6    * with the License. You may obtain a copy of the License at:
7    *
8    *   http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations
14   * under the License.
15   */
16  package org.jboss.netty.handler.codec.spdy;
17  
18  import java.util.Set;
19  
20  /**
21   * A SPDY Protocol SETTINGS Control Frame
22   */
23  public interface SpdySettingsFrame {
24  
25      int SETTINGS_UPLOAD_BANDWIDTH               = 1;
26      int SETTINGS_DOWNLOAD_BANDWIDTH             = 2;
27      int SETTINGS_ROUND_TRIP_TIME                = 3;
28      int SETTINGS_MAX_CONCURRENT_STREAMS         = 4;
29      int SETTINGS_CURRENT_CWND                   = 5;
30      int SETTINGS_DOWNLOAD_RETRANS_RATE          = 6;
31      int SETTINGS_INITIAL_WINDOW_SIZE            = 7;
32      int SETTINGS_CLIENT_CERTIFICATE_VECTOR_SIZE = 8;
33  
34      /**
35       * @deprecated Use {@link #getIds()} instead.
36       */
37      @Deprecated
38      Set<Integer> getIDs();
39  
40      /**
41       * Returns a {@code Set} of the setting IDs.
42       * The set's iterator will return the IDs in ascending order.
43       */
44      Set<Integer> getIds();
45  
46      /**
47       * Returns {@code true} if the setting ID has a value.
48       */
49      boolean isSet(int id);
50  
51      /**
52       * Returns the value of the setting ID.
53       * Returns -1 if the setting ID is not set.
54       */
55      int getValue(int id);
56  
57      /**
58       * Sets the value of the setting ID.
59       * The ID must be positive and cannot exceed 16777215.
60       */
61      void setValue(int id, int value);
62  
63      /**
64       * Sets the value of the setting ID.
65       * Sets if the setting should be persisted (should only be set by the server).
66       * Sets if the setting is persisted (should only be set by the client).
67       * The ID must be positive and cannot exceed 16777215.
68       */
69      void setValue(int id, int value, boolean persistVal, boolean persisted);
70  
71      /**
72       * Removes the value of the setting ID.
73       * Removes all persistance information for the setting.
74       */
75      void removeValue(int id);
76  
77      /**
78       * @deprecated Use {@link #isPersistValue(int)} instead.
79       */
80      @Deprecated
81      boolean persistValue(int id);
82  
83      /**
84       * Returns {@code true} if this setting should be persisted.
85       * Returns {@code false} if this setting should not be persisted
86       *         or if the setting ID has no value.
87       */
88      boolean isPersistValue(int id);
89  
90      /**
91       * Sets if this setting should be persisted.
92       * Has no effect if the setting ID has no value.
93       */
94      void setPersistValue(int id, boolean persistValue);
95  
96      /**
97       * Returns {@code true} if this setting is persisted.
98       * Returns {@code false} if this setting should not be persisted
99       *         or if the setting ID has no value.
100      */
101     boolean isPersisted(int id);
102 
103     /**
104      * Sets if this setting is persisted.
105      * Has no effect if the setting ID has no value.
106      */
107     void setPersisted(int id, boolean persisted);
108 
109     /**
110      * Returns {@code true} if previously persisted settings should be cleared.
111      */
112     boolean clearPreviouslyPersistedSettings();
113 
114     /**
115      * Sets if previously persisted settings should be cleared.
116      */
117     void setClearPreviouslyPersistedSettings(boolean clear);
118 }