View Javadoc
1   /*
2    * The contents of this file are subject to the terms of the Common Development and
3    * Distribution License (the License). You may not use this file except in compliance with the
4    * License.
5    *
6    * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
7    * specific language governing permission and limitations under the License.
8    *
9    * When distributing Covered Software, include this CDDL Header Notice in each file and include
10   * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
11   * Header, with the fields enclosed by brackets [] replaced by your own identifying
12   * information: "Portions Copyrighted [year] [name of copyright owner]".
13   *
14   * Copyright © 2012-2015 ForgeRock AS. All rights reserved.
15   */
16  
17  package org.forgerock.json.resource;
18  
19  import java.util.List;
20  import java.util.Map;
21  
22  import org.forgerock.http.routing.Version;
23  import org.forgerock.json.JsonPointer;
24  import org.forgerock.json.JsonValue;
25  import org.forgerock.util.i18n.PreferredLocales;
26  
27  /**
28   * A request to read a single identified JSON resource.
29   */
30  public interface ReadRequest extends Request {
31  
32      @Override
33      <R, P> R accept(final RequestVisitor<R, P> v, final P p);
34  
35  
36      @Override
37      ReadRequest addField(JsonPointer... fields);
38  
39  
40      @Override
41      ReadRequest addField(String... fields);
42  
43  
44      @Override
45      String getAdditionalParameter(String name);
46  
47  
48      @Override
49      Map<String, String> getAdditionalParameters();
50  
51  
52      @Override
53      List<JsonPointer> getFields();
54  
55  
56      @Override
57      PreferredLocales getPreferredLocales();
58  
59  
60      @Override
61      RequestType getRequestType();
62  
63      @Override
64      String getResourcePath();
65  
66      @Override
67      ResourcePath getResourcePathObject();
68  
69      @Override
70      Version getResourceVersion();
71  
72      @Override
73      ReadRequest setAdditionalParameter(String name, String value) throws BadRequestException;
74  
75      @Override
76      ReadRequest setPreferredLocales(PreferredLocales preferredLocales);
77  
78      @Override
79      ReadRequest setResourcePath(ResourcePath path);
80  
81      @Override
82      ReadRequest setResourcePath(String path);
83  
84      @Override
85      ReadRequest setResourceVersion(Version resourceVersion);
86  
87      @Override
88      JsonValue toJsonValue();
89  }