org.gcube.common.core.security.impl
Class GCUBECredentialAdder

java.lang.Object
  extended by org.gcube.common.core.security.impl.GCUBECredentialAdder
All Implemented Interfaces:
GCUBEClientSecurityManager, GCUBESecurityManager

public class GCUBECredentialAdder
extends Object
implements GCUBEClientSecurityManager


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.gcube.common.core.security.GCUBESecurityManager
GCUBESecurityManager.AuthMethod, GCUBESecurityManager.AuthMode, GCUBESecurityManager.DelegationMode
 
Field Summary
 
Fields inherited from interface org.gcube.common.core.security.GCUBEClientSecurityManager
IDENTITY
 
Constructor Summary
GCUBECredentialAdder()
           
 
Method Summary
 void disableSecurityStatusEnforcement()
          the security status is established by the configuration file of the GHN in client mode
 void forceSecurityDisabled()
          forces the security to not run in spite of the client configuration files
 void forceSecurityEnabled()
          forces the security to run in spite of the client configuration files
 SecurityCredentials getClientBaseCredentials()
          Provides the default credentials of the security manager (they could be the credentials of the GHN in client mode, but this is not mandatory)
 SecurityCredentials getCredentials()
          It returns the credentials for outgoing calls currently set in the current thread.
 boolean isSecurityEnabled()
          Indicates whether the manager is operating in a secure context.
 void setAuthMethod(GCUBESecurityManager.AuthMethod m)
          Adds an authentication method to be used in this security context
 void setDefaultIdentityParameter(String identity)
          Sets a single default identity parameter
 void setIdentityParameters(Map<String,String> parameters)
          Sets a map of identity parameters
 void setSecurity(Remote s, GCUBESecurityManager.AuthMode e, GCUBESecurityManager.DelegationMode d)
          If security is enabled, sets the desired level of encryption and the mode of credential delegation on the stub of a remote porttype.
 void useCredentials(GSSCredential credentials)
          Deprecated. 
 void useCredentials(SecurityCredentials credentials)
          If security is enabled, it sets given credentials for outgoing calls in the current thread.
 void useCredentials(Thread thread, SecurityCredentials... credentials)
          If security is enabled, it sets given credentials for outgoing calls in a given thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GCUBECredentialAdder

public GCUBECredentialAdder()
Method Detail

setIdentityParameters

public void setIdentityParameters(Map<String,String> parameters)
                           throws Exception
Description copied from interface: GCUBEClientSecurityManager
Sets a map of identity parameters

Specified by:
setIdentityParameters in interface GCUBEClientSecurityManager
Parameters:
parameters - the identity parameters
Throws:
Exception - if something doesn't work in the configuration

setDefaultIdentityParameter

public void setDefaultIdentityParameter(String identity)
                                 throws Exception
Description copied from interface: GCUBEClientSecurityManager
Sets a single default identity parameter

Specified by:
setDefaultIdentityParameter in interface GCUBEClientSecurityManager
Parameters:
identity - the identity
Throws:
Exception - if something doesn't work in the configuration

forceSecurityEnabled

public void forceSecurityEnabled()
Description copied from interface: GCUBEClientSecurityManager
forces the security to run in spite of the client configuration files

Specified by:
forceSecurityEnabled in interface GCUBEClientSecurityManager

forceSecurityDisabled

public void forceSecurityDisabled()
Description copied from interface: GCUBEClientSecurityManager
forces the security to not run in spite of the client configuration files

Specified by:
forceSecurityDisabled in interface GCUBEClientSecurityManager

disableSecurityStatusEnforcement

public void disableSecurityStatusEnforcement()
Description copied from interface: GCUBEClientSecurityManager
the security status is established by the configuration file of the GHN in client mode

Specified by:
disableSecurityStatusEnforcement in interface GCUBEClientSecurityManager

getClientBaseCredentials

public SecurityCredentials getClientBaseCredentials()
Description copied from interface: GCUBEClientSecurityManager
Provides the default credentials of the security manager (they could be the credentials of the GHN in client mode, but this is not mandatory)

Specified by:
getClientBaseCredentials in interface GCUBEClientSecurityManager
Returns:
the default credentials

isSecurityEnabled

public boolean isSecurityEnabled()
Description copied from interface: GCUBESecurityManager
Indicates whether the manager is operating in a secure context. If not, invoking its methods will have no effect.

Specified by:
isSecurityEnabled in interface GCUBESecurityManager
Returns:
true if security is enabled, false otherwise.

useCredentials

@Deprecated
public void useCredentials(GSSCredential credentials)
                    throws Exception
Deprecated. 

Specified by:
useCredentials in interface GCUBESecurityManager
Parameters:
credentials - the credentials.
Throws:
Exception - if security is enabled, but credentials are corrupt.

useCredentials

public void useCredentials(SecurityCredentials credentials)
                    throws Exception
Description copied from interface: GCUBESecurityManager
If security is enabled, it sets given credentials for outgoing calls in the current thread. It has no effect otherwise.

Specified by:
useCredentials in interface GCUBESecurityManager
Parameters:
credentials - the credentials.
Throws:
Exception - if security is enabled, but credentials are corrupt.

useCredentials

public void useCredentials(Thread thread,
                           SecurityCredentials... credentials)
                    throws Exception
Description copied from interface: GCUBESecurityManager
If security is enabled, it sets given credentials for outgoing calls in a given thread.

Specified by:
useCredentials in interface GCUBESecurityManager
Parameters:
thread - the thread.
credentials - (optional) the credentials. If omitted, it delegates the credentials used for the current thread to the given thread.
Throws:
Exception - if security is enabled, but credentials are corrupt.

getCredentials

public SecurityCredentials getCredentials()
Description copied from interface: GCUBESecurityManager
It returns the credentials for outgoing calls currently set in the current thread.

Specified by:
getCredentials in interface GCUBESecurityManager
Returns:
the credentials.

setSecurity

public void setSecurity(Remote s,
                        GCUBESecurityManager.AuthMode e,
                        GCUBESecurityManager.DelegationMode d)
                 throws Exception
Description copied from interface: GCUBESecurityManager
If security is enabled, sets the desired level of encryption and the mode of credential delegation on the stub of a remote porttype. It has no effect otherwise.

Specified by:
setSecurity in interface GCUBESecurityManager
Parameters:
s - the stub.
e - the encryption level.
d - the delegation mode.
Throws:
Exception - if the settings could not be enforced.

setAuthMethod

public void setAuthMethod(GCUBESecurityManager.AuthMethod m)
Description copied from interface: GCUBESecurityManager
Adds an authentication method to be used in this security context

Specified by:
setAuthMethod in interface GCUBESecurityManager
Parameters:
m - the authentication method


Copyright © 2013. All Rights Reserved.