Search in sources :

Example 1 with AssetProvider

use of edu.uiuc.ncsa.myproxy.oa4mp.client.storage.AssetProvider in project OA4MP by ncsa.

the class AbstractOA4MPService method requestCert.

/**
 * A convenience method that allows for a map of additional parameters.
 *
 * @param identifier
 * @param additionalParameters
 * @return
 */
public OA4MPResponse requestCert(Identifier identifier, Map additionalParameters) {
    if (additionalParameters == null) {
        additionalParameters = new HashMap();
    }
    AssetProvider assetProvider = getEnvironment().getAssetProvider();
    Asset asset = null;
    if (identifier == null) {
        // no id
        asset = assetProvider.get(false);
    } else {
        asset = assetProvider.get(identifier);
    }
    OA4MPResponse response = requestCert(asset, additionalParameters);
    asset.setPrivateKey(response.getPrivateKey());
    asset.setRedirect(response.getRedirect());
    getAssetStore().save(asset);
    return response;
}
Also used : HashMap(java.util.HashMap) AssetProvider(edu.uiuc.ncsa.myproxy.oa4mp.client.storage.AssetProvider)

Aggregations

AssetProvider (edu.uiuc.ncsa.myproxy.oa4mp.client.storage.AssetProvider)1 HashMap (java.util.HashMap)1