Skip navigation links

Oracle Fusion Middleware Java API Reference for the Oracle Access Management OAuth Service
11g Release 2 Patch Set 3 (11.1.2.3)

E59498-01


oracle.security.idaas.oauth.sdk.request
Class OAuthRestRequest

java.lang.Object
  extended by oracle.security.idaas.oauth.sdk.request.OAuthRestRequest

Direct Known Subclasses:
AccessTokenValidationRequest, OAuthTokenRequest, RevocationRequest

public class OAuthRestRequest
extends java.lang.Object

Generic class managing header and query parameters to be used in an OAuth Request.


Constructor Summary

OAuthRestRequest()
          Prepares a basic header including only: "Content-Type:application/x-www-form-urlencoded;charset=UTF-8"
OAuthRestRequest(java.util.Map<java.lang.String,java.lang.String> header, java.util.Map<java.lang.String,java.lang.String> query)
          Uses the given parameters to build the header and data parts of the request.

  Method Summary

 void addHeader(java.lang.String key, java.lang.String value)
          Adds or replaces a parameter in the header using the given key and value.
 void addQuery(java.lang.String key, java.lang.String value)
          Adds or replaces a parameter in the query/data using the given key and value.
 void clearAll()
          Cleans the header and query maps.
 void clearHeader()
          Cleans only the header map.
 void clearQuery()
          Cleans only the query map.
 java.util.Map<java.lang.String,java.lang.String> getHeader()
          Returns the header parameters.
 java.lang.String getHeader(java.lang.String key)
          Returns the value of the given key.
 java.lang.String getQuery()
          Returns an HTTP query formatted string.
 java.lang.String getQuery(java.lang.String key)
          Returns the value of the given key.
 java.util.Map<java.lang.String,java.lang.String> getQueryMap()
          Return the Query as Map
protected  boolean isNullOrEmpty(java.lang.String str)
          Returns true when the given String is null or empty.
 void setHeader(java.util.Map<java.lang.String,java.lang.String> header)
          Replaces the all the header by the given one.
 void setQuery(java.util.Map<java.lang.String,java.lang.String> query)
          Replaces the query map by the given one.

  Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

OAuthRestRequest

public OAuthRestRequest()
Prepares a basic header including only:

OAuthRestRequest

public OAuthRestRequest(java.util.Map<java.lang.String,java.lang.String> header,
                        java.util.Map<java.lang.String,java.lang.String> query)
Uses the given parameters to build the header and data parts of the request.
Parameters:
header - set of parameters to fit into the request header
query - set of parameters to fit into the data part

Method Detail

addHeader

public void addHeader(java.lang.String key,
                      java.lang.String value)
Adds or replaces a parameter in the header using the given key and value.
Parameters:
key - of the attribute
value - of the attribute

getHeader

public java.lang.String getHeader(java.lang.String key)
Returns the value of the given key.
Parameters:
key - of the attribute
Returns:
the value

addQuery

public void addQuery(java.lang.String key,
                     java.lang.String value)
Adds or replaces a parameter in the query/data using the given key and value.
Parameters:
key - of the attribute
value - of the attribute

getQuery

public java.lang.String getQuery(java.lang.String key)
Returns the value of the given key.
Parameters:
key - of the attribute
Returns:
the value

getQueryMap

public java.util.Map<java.lang.String,java.lang.String> getQueryMap()
Return the Query as Map
Returns:
query set

getQuery

public java.lang.String getQuery()
Returns an HTTP query formatted string.
Returns:
the query string

clearAll

public void clearAll()
Cleans the header and query maps.

clearHeader

public void clearHeader()
Cleans only the header map.

clearQuery

public void clearQuery()
Cleans only the query map.

getHeader

public java.util.Map<java.lang.String,java.lang.String> getHeader()
Returns the header parameters.
Returns:
header

setHeader

public void setHeader(java.util.Map<java.lang.String,java.lang.String> header)
Replaces the all the header by the given one.
Parameters:
header - name value pairs

setQuery

public void setQuery(java.util.Map<java.lang.String,java.lang.String> query)
Replaces the query map by the given one.
Parameters:
query - name value pairs

isNullOrEmpty

protected boolean isNullOrEmpty(java.lang.String str)
Returns true when the given String is null or empty.
Parameters:
str - string to verify
Returns:
true if the string is valid

Skip navigation links

Copyright (c) 2014, 2015,
Oracle and/or its affiliates. All Rights Reserved.