001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyrighted [year] [name of copyright owner]".
013 *
014 * Copyright © 2012-2015 ForgeRock AS. All rights reserved.
015 */
016
017package org.forgerock.json.resource;
018
019import java.util.List;
020import java.util.Map;
021
022import org.forgerock.http.routing.Version;
023import org.forgerock.json.JsonPointer;
024import org.forgerock.json.JsonValue;
025import org.forgerock.util.i18n.PreferredLocales;
026
027/**
028 * A request to read a single identified JSON resource.
029 */
030public interface ReadRequest extends Request {
031
032    @Override
033    <R, P> R accept(final RequestVisitor<R, P> v, final P p);
034
035
036    @Override
037    ReadRequest addField(JsonPointer... fields);
038
039
040    @Override
041    ReadRequest addField(String... fields);
042
043
044    @Override
045    String getAdditionalParameter(String name);
046
047
048    @Override
049    Map<String, String> getAdditionalParameters();
050
051
052    @Override
053    List<JsonPointer> getFields();
054
055
056    @Override
057    PreferredLocales getPreferredLocales();
058
059
060    @Override
061    RequestType getRequestType();
062
063    @Override
064    String getResourcePath();
065
066    @Override
067    ResourcePath getResourcePathObject();
068
069    @Override
070    Version getResourceVersion();
071
072    @Override
073    ReadRequest setAdditionalParameter(String name, String value) throws BadRequestException;
074
075    @Override
076    ReadRequest setPreferredLocales(PreferredLocales preferredLocales);
077
078    @Override
079    ReadRequest setResourcePath(ResourcePath path);
080
081    @Override
082    ReadRequest setResourcePath(String path);
083
084    @Override
085    ReadRequest setResourceVersion(Version resourceVersion);
086
087    @Override
088    JsonValue toJsonValue();
089}