Package org.oa4mp.client.api
Class AbstractOA4MPService
- java.lang.Object
-
- org.oa4mp.client.api.AbstractOA4MPService
-
- Direct Known Subclasses:
OA4MPService
public abstract class AbstractOA4MPService extends Object
Created by Jeff Gaynor
on 11/26/13 at 11:27 AM
-
-
Field Summary
Fields Modifier and Type Field Description protected StringBASE64_URI_CAPUTUsed in making a consistent base 64-based uri from a string.static StringSKIN_PARAMETER
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractOA4MPService(ClientEnvironment environment)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Map<String,String>getAssetParameters(Asset asset)This creates the parameter map for the certificate request.AssetProvidergetAssetProvider()protected AssetStoregetAssetStore()protected Map<String,Object>getATParameters(Asset asset, AuthorizationGrant ag)This creates the parameter map for the access token request.AssetResponsegetCert(String tempToken, edu.uiuc.ncsa.security.core.Identifier identifier)Performs thegetCert(Asset, AuthorizationGrant)and updates the asset associated with the given identifier.protected AssetResponsegetCert(Asset asset, AuthorizationGrant ag)Does the actual work getting the cert.ClientEnvironmentgetEnvironment()protected KeyPairgetNextKeyPair()protected edu.uiuc.ncsa.security.core.Identifiermakeb64Uri(String x)abstract voidpostGetCert(Asset asset, AssetResponse assetResponse)abstract voidpostRequestCert(Asset asset, OA4MPResponse oa4MPResponse)abstract voidpreGetCert(Asset asset, Map parameters)abstract voidpreRequestCert(Asset asset, Map parameters)OA4MPResponserequestCert()This will make the request with whatever defaults are in effect for the client.OA4MPResponserequestCert(edu.uiuc.ncsa.security.core.Identifier identifier)A convenience method to do therequestCert()call and create an asset with the given identifier.OA4MPResponserequestCert(edu.uiuc.ncsa.security.core.Identifier identifier, Map additionalParameters)A convenience method that allows for a map of additional parameters.OA4MPResponserequestCert(Map additionalParameters)Request a certificate from the user portal.protected OA4MPResponserequestCert(Asset asset, Map additionalParameters)voidsetAssetProvider(AssetProvider assetProvider)
-
-
-
Field Detail
-
SKIN_PARAMETER
public static final String SKIN_PARAMETER
- See Also:
- Constant Field Values
-
BASE64_URI_CAPUT
protected String BASE64_URI_CAPUT
Used in making a consistent base 64-based uri from a string.
-
-
Constructor Detail
-
AbstractOA4MPService
protected AbstractOA4MPService(ClientEnvironment environment)
-
-
Method Detail
-
getAssetStore
protected AssetStore getAssetStore()
-
getEnvironment
public ClientEnvironment getEnvironment()
-
postRequestCert
public abstract void postRequestCert(Asset asset, OA4MPResponse oa4MPResponse)
-
postGetCert
public abstract void postGetCert(Asset asset, AssetResponse assetResponse)
-
requestCert
public OA4MPResponse requestCert()
This will make the request with whatever defaults are in effect for the client. You can override these by supplying them as key-value pairs in therequestCert(java.util.Map)call.- Returns:
-
requestCert
public OA4MPResponse requestCert(edu.uiuc.ncsa.security.core.Identifier identifier)
A convenience method to do therequestCert()call and create an asset with the given identifier. This will throw an exception if there is no asset store configured.- Parameters:
identifier-- Returns:
-
getAssetProvider
public AssetProvider getAssetProvider()
-
setAssetProvider
public void setAssetProvider(AssetProvider assetProvider)
-
requestCert
public OA4MPResponse requestCert(edu.uiuc.ncsa.security.core.Identifier identifier, Map additionalParameters)
A convenience method that allows for a map of additional parameters.- Parameters:
identifier-additionalParameters-- Returns:
-
requestCert
public OA4MPResponse requestCert(Map additionalParameters)
Request a certificate from the user portal. This will also generate the private key and cert request. These are not stored by this service. The additionalParameters argument are passed as key/value pairs in the initial request and are not otherwise processed.- Returns:
-
makeb64Uri
protected edu.uiuc.ncsa.security.core.Identifier makeb64Uri(String x)
-
getNextKeyPair
protected KeyPair getNextKeyPair()
-
requestCert
protected OA4MPResponse requestCert(Asset asset, Map additionalParameters)
-
getCert
public AssetResponse getCert(String tempToken, edu.uiuc.ncsa.security.core.Identifier identifier)
Performs thegetCert(Asset, AuthorizationGrant)and updates the asset associated with the given identifier. This throws an exception is there is no asset or if the asset store is not enabled.- Parameters:
tempToken-identifier-- Returns:
-
getATParameters
protected Map<String,Object> getATParameters(Asset asset, AuthorizationGrant ag)
This creates the parameter map for the access token request. Send along anything specific to the protocol in this map.- Parameters:
asset-ag-- Returns:
-
getAssetParameters
protected Map<String,String> getAssetParameters(Asset asset)
This creates the parameter map for the certificate request. Send along anything specific to the protocol in this map.- Parameters:
asset-- Returns:
-
getCert
protected AssetResponse getCert(Asset asset, AuthorizationGrant ag)
Does the actual work getting the cert.- Parameters:
asset-ag-- Returns:
-
-