edu.uiuc.ncsa.myproxy.oa4mp.client
Class ClientEnvironment

java.lang.Object
  extended by edu.uiuc.ncsa.security.core.util.AbstractEnvironment
      extended by edu.uiuc.ncsa.myproxy.oa4mp.client.ClientEnvironment
All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Logable

public class ClientEnvironment
extends edu.uiuc.ncsa.security.core.util.AbstractEnvironment

Environment under which a client instance runs. Generally this is called by the loader and populated from the configuration file.

Created by Jeff Gaynor
on May 16, 2011 at 3:27:56 PM


Field Summary
protected  URI accessTokenUri
           
protected  URI authorizationUri
           
protected  URI callback
           
static String CALLBACK_URI_KEY
           
static String CERT_LIFETIME_KEY
          This is used in requests as the key for the cert lifetime parameter.
static String CERT_REQUEST_KEY
          This is used in requests as the key for the cert request parameter
static String FORM_ENCODING
           
protected  URI initializeUri
           
protected  String privKeyString
           
protected  URI resourceServerUri
           
protected  String skin
           
static String TOKEN
           
 
Fields inherited from class edu.uiuc.ncsa.security.core.util.AbstractEnvironment
constants
 
Constructor Summary
ClientEnvironment(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger, Map<String,String> constants, URI accessTokenUri, URI authorizationUri, URI callback, URI initializeUri, URI resourceServerUri, long certLifetime, String clientId, PrivateKey privateKey, PublicKey publicKey, String skin, boolean enableAssetCleanup, long maxAssetLifetime, javax.inject.Provider<edu.uiuc.ncsa.security.delegation.storage.Client> clientProvider, javax.inject.Provider<edu.uiuc.ncsa.security.delegation.token.TokenForge> tokenForgeProvider, javax.inject.Provider<edu.uiuc.ncsa.security.delegation.client.DelegationService> delegationServiceProvider, javax.inject.Provider<AssetStore> assetStoreProvider)
          Main constructor called by the loader.
ClientEnvironment(URI accessTokenUri, URI authorizationUri, URI callback, long certLifetime, String clientId, edu.uiuc.ncsa.security.delegation.client.DelegationService delegationService, URI initializeUri, PrivateKey privateKey, PublicKey publicKey, URI resourceServerUri, edu.uiuc.ncsa.security.delegation.token.TokenForge tokenForge, AssetStore assetStore)
          Used mostly for testing.
 
Method Summary
 URI getAccessTokenUri()
          The endpoint for this client for retrieving an access token.
 AssetStore getAssetStore()
          Returns the configured AssetStore for this environment or null if there is none.
 URI getAuthorizationUri()
          The endpoint for this client allowing authorization of the user.
 URI getCallback()
          The callback for this environment.
NOTE Generally this is specified in the configuration file and is the same for every request.
 long getCertLifetime()
          The certificate lifetime request.
 edu.uiuc.ncsa.security.delegation.storage.Client getClient()
          A Client object representing the instance of this service.
 String getClientId()
          The identifier for this client to the given server.
 edu.uiuc.ncsa.security.delegation.client.DelegationService getDelegationService()
          The OA4MPService, fully configured and operational.
 URI getInitializeUri()
          The endpoint for this client that starts delegation.
 long getMaxAssetLifetime()
           
 PrivateKey getPrivateKey()
          The private key for this client.
protected  String getPrivKeyString()
          Internal call to convert the private key.
 PublicKey getPublicKey()
          The generated public key for this client.
 URI getResourceServerUri()
          The endpoint for this client for getting the resource (i.e., certificate chain).
 String getSkin()
          Optional skinning option.
 edu.uiuc.ncsa.security.delegation.token.TokenForge getTokenForge()
          Internal call to the forge (a type of factory) that processing tokens returned from the server.
 boolean hasAssetStore()
          Returns true if a store has been configured for this environment and false otherwise.
 boolean isEnableAssetCleanup()
           
 void setCallback(URI callback)
           
 void setCertLifetime(long newCertLifetime)
           
 
Methods inherited from class edu.uiuc.ncsa.security.core.util.AbstractEnvironment
debug, error, getConstants, getMyLogger, info, isDebugOn, setDebugOn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CALLBACK_URI_KEY

public static final String CALLBACK_URI_KEY
See Also:
Constant Field Values

TOKEN

public static final String TOKEN
See Also:
Constant Field Values

FORM_ENCODING

public static final String FORM_ENCODING
See Also:
Constant Field Values

accessTokenUri

protected URI accessTokenUri

authorizationUri

protected URI authorizationUri

initializeUri

protected URI initializeUri

resourceServerUri

protected URI resourceServerUri

CERT_REQUEST_KEY

public static final String CERT_REQUEST_KEY
This is used in requests as the key for the cert request parameter

See Also:
Constant Field Values

CERT_LIFETIME_KEY

public static final String CERT_LIFETIME_KEY
This is used in requests as the key for the cert lifetime parameter.

See Also:
Constant Field Values

callback

protected URI callback

privKeyString

protected String privKeyString

skin

protected String skin
Constructor Detail

ClientEnvironment

public ClientEnvironment(URI accessTokenUri,
                         URI authorizationUri,
                         URI callback,
                         long certLifetime,
                         String clientId,
                         edu.uiuc.ncsa.security.delegation.client.DelegationService delegationService,
                         URI initializeUri,
                         PrivateKey privateKey,
                         PublicKey publicKey,
                         URI resourceServerUri,
                         edu.uiuc.ncsa.security.delegation.token.TokenForge tokenForge,
                         AssetStore assetStore)
Used mostly for testing.

Parameters:
accessTokenUri -
authorizationUri -
callback -
certLifetime -
clientId -
delegationService -
initializeUri -
privateKey -
publicKey -
resourceServerUri -
tokenForge -
assetStore -

ClientEnvironment

public ClientEnvironment(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger,
                         Map<String,String> constants,
                         URI accessTokenUri,
                         URI authorizationUri,
                         URI callback,
                         URI initializeUri,
                         URI resourceServerUri,
                         long certLifetime,
                         String clientId,
                         PrivateKey privateKey,
                         PublicKey publicKey,
                         String skin,
                         boolean enableAssetCleanup,
                         long maxAssetLifetime,
                         javax.inject.Provider<edu.uiuc.ncsa.security.delegation.storage.Client> clientProvider,
                         javax.inject.Provider<edu.uiuc.ncsa.security.delegation.token.TokenForge> tokenForgeProvider,
                         javax.inject.Provider<edu.uiuc.ncsa.security.delegation.client.DelegationService> delegationServiceProvider,
                         javax.inject.Provider<AssetStore> assetStoreProvider)
Main constructor called by the loader.

Parameters:
logger -
constants -
accessTokenUri -
authorizationUri -
callback -
initializeUri -
resourceServerUri -
certLifetime -
clientId -
privateKey -
publicKey -
clientProvider -
tokenForgeProvider -
delegationServiceProvider -
assetStoreProvider -
Method Detail

hasAssetStore

public boolean hasAssetStore()
Returns true if a store has been configured for this environment and false otherwise. Check this before using the store.

Returns:

getAssetStore

public AssetStore getAssetStore()
Returns the configured AssetStore for this environment or null if there is none.

Returns:
See Also:
hasAssetStore()

getAccessTokenUri

public URI getAccessTokenUri()
The endpoint for this client for retrieving an access token.

Returns:

getAuthorizationUri

public URI getAuthorizationUri()
The endpoint for this client allowing authorization of the user.

Returns:

getInitializeUri

public URI getInitializeUri()
The endpoint for this client that starts delegation.

Returns:

getResourceServerUri

public URI getResourceServerUri()
The endpoint for this client for getting the resource (i.e., certificate chain).

Returns:

getTokenForge

public edu.uiuc.ncsa.security.delegation.token.TokenForge getTokenForge()
Internal call to the forge (a type of factory) that processing tokens returned from the server. This is public merely because of java package limitations and generally is of no interest to developers.

Returns:

getDelegationService

public edu.uiuc.ncsa.security.delegation.client.DelegationService getDelegationService()
The OA4MPService, fully configured and operational.

Returns:

getCallback

public URI getCallback()
The callback for this environment.
NOTE Generally this is specified in the configuration file and is the same for every request. However, if a client wishes to have a different callback uri per request, simply reset this before each request as needed using the setCallback(java.net.URI).

Returns:

setCallback

public void setCallback(URI callback)

getClientId

public String getClientId()
The identifier for this client to the given server. This is read from the configuration file and should not be changed.

Returns:

getPrivateKey

public PrivateKey getPrivateKey()
The private key for this client. This is specified in the configuration file and is used for signing request, not for certificate requests. it is paired with the getPublicKey()

Returns:

getPublicKey

public PublicKey getPublicKey()
The generated public key for this client. This was supplied to the server at registration time. It is normally read from a configuration file.

Returns:

getPrivKeyString

protected String getPrivKeyString()
Internal call to convert the private key.

Returns:

getClient

public edu.uiuc.ncsa.security.delegation.storage.Client getClient()
A Client object representing the instance of this service.

Returns:

getCertLifetime

public long getCertLifetime()
The certificate lifetime request. This is usually the same for every request and is specified in the client configuration file. It may be reset per request using the setCertLifetime(long)

Returns:

setCertLifetime

public void setCertLifetime(long newCertLifetime)

getSkin

public String getSkin()
Optional skinning option. If the server supports a customized look and feel for a client, that will be used when this parameter is supplied.

Returns:

getMaxAssetLifetime

public long getMaxAssetLifetime()

isEnableAssetCleanup

public boolean isEnableAssetCleanup()


Copyright © 2013. All Rights Reserved.