View Javadoc

1   /*
2    * Copyright 2013 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 io.netty.handler.codec.spdy;
17  
18  import java.util.Set;
19  
20  /**
21   * A SPDY Protocol SETTINGS Frame
22   */
23  public interface SpdySettingsFrame extends SpdyFrame {
24  
25      int SETTINGS_MINOR_VERSION                  = 0;
26      int SETTINGS_UPLOAD_BANDWIDTH               = 1;
27      int SETTINGS_DOWNLOAD_BANDWIDTH             = 2;
28      int SETTINGS_ROUND_TRIP_TIME                = 3;
29      int SETTINGS_MAX_CONCURRENT_STREAMS         = 4;
30      int SETTINGS_CURRENT_CWND                   = 5;
31      int SETTINGS_DOWNLOAD_RETRANS_RATE          = 6;
32      int SETTINGS_INITIAL_WINDOW_SIZE            = 7;
33      int SETTINGS_CLIENT_CERTIFICATE_VECTOR_SIZE = 8;
34  
35      /**
36       * Returns a {@code Set} of the setting IDs.
37       * The set's iterator will return the IDs in ascending order.
38       */
39      Set<Integer> ids();
40  
41      /**
42       * Returns {@code true} if the setting ID has a value.
43       */
44      boolean isSet(int id);
45  
46      /**
47       * Returns the value of the setting ID.
48       * Returns -1 if the setting ID is not set.
49       */
50      int getValue(int id);
51  
52      /**
53       * Sets the value of the setting ID.
54       * The ID cannot be negative and cannot exceed 16777215.
55       */
56      SpdySettingsFrame setValue(int id, int value);
57  
58      /**
59       * Sets the value of the setting ID.
60       * Sets if the setting should be persisted (should only be set by the server).
61       * Sets if the setting is persisted (should only be set by the client).
62       * The ID cannot be negative and cannot exceed 16777215.
63       */
64      SpdySettingsFrame setValue(int id, int value, boolean persistVal, boolean persisted);
65  
66      /**
67       * Removes the value of the setting ID.
68       * Removes all persistence information for the setting.
69       */
70      SpdySettingsFrame removeValue(int id);
71  
72      /**
73       * Returns {@code true} if this setting should be persisted.
74       * Returns {@code false} if this setting should not be persisted
75       *         or if the setting ID has no value.
76       */
77      boolean isPersistValue(int id);
78  
79      /**
80       * Sets if this setting should be persisted.
81       * Has no effect if the setting ID has no value.
82       */
83      SpdySettingsFrame setPersistValue(int id, boolean persistValue);
84  
85      /**
86       * Returns {@code true} if this setting is persisted.
87       * Returns {@code false} if this setting should not be persisted
88       *         or if the setting ID has no value.
89       */
90      boolean isPersisted(int id);
91  
92      /**
93       * Sets if this setting is persisted.
94       * Has no effect if the setting ID has no value.
95       */
96      SpdySettingsFrame setPersisted(int id, boolean persisted);
97  
98      /**
99       * Returns {@code true} if previously persisted settings should be cleared.
100      */
101     boolean clearPreviouslyPersistedSettings();
102 
103     /**
104      * Sets if previously persisted settings should be cleared.
105      */
106     SpdySettingsFrame setClearPreviouslyPersistedSettings(boolean clear);
107 }