OAuth2Request.java revision 64606cc3bf5fe6a06e153104fe9555e96c0492c7
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2014-2015 ForgeRock AS.
*/
/**
* An abstraction of the actual request so as to allow the core of the OAuth2 provider to be agnostic of the library
* used to translate the HTTP request.
*
* @since 12.0.0
*/
public abstract class OAuth2Request {
/**
* Gets the actual underlying request.
*
* @param <T> The type of the underlying request.
* @return The underlying request.
*/
public abstract <T> T getRequest();
/**
* Gets the specified parameter from the request.
* <br/>
* It is up to the implementation to determine how and where it gets the parameter from on the request, i.e.
* query parameters, request attributes, etc.
*
* @param name The name of the parameter.
* @param <T> The type of the parameter.
* @return The parameter value.
*/
/**
* Gets the body of the request.
* <br/>
* Note: reading of the body maybe a one time only operation, so the implementation needs to cache the content
* of the body so multiple calls to this method do not behave differently.
* <br/>
* This method should only ever be called for access and refresh token request and requests to the userinfo and
* tokeninfo endpoints.
*
* @return The body of the request.
*/
/**
* Set a Token that is in play for this request.
* @param tokenClass The token type.
* @param token The token instance.
* @param <T> The type of token.
*/
}
/**
* Set a Token that is in play for this request.
* @param tokenClass The token type.
* @param <T> The type of token.
* @return The token instance.
*/
}
/**
* Sets the user's session for this request.
*
* @param sessionId The user's session.
*/
}
/**
* Gets the user's session for this request.
*
* @return The user's session.
*/
public String getSession() {
return sessionId;
}
/**
* Get the request locale.
* @return The Locale object.
*/
}