org.idoox.wasp
Class WaspSecurity.WaspSecurityImpl

java.lang.Object
  extended byorg.idoox.wasp.WaspSecurity.SPI
      extended byorg.idoox.wasp.WaspSecurity.WaspSecurityImpl
Enclosing class:
WaspSecurity

public static class WaspSecurity.WaspSecurityImpl
extends WaspSecurity.SPI

Default implementation of WaspSecurity SPI. No security is maintained by this class, this class is used if no security is installed.


Field Summary
 
Fields inherited from class org.idoox.wasp.WaspSecurity.SPI
STRAR_0
 
Constructor Summary
WaspSecurity.WaspSecurityImpl()
          Unmodifiable empty map, this map can be safely reused and returned by extenders.
 
Method Summary
protected  Credentials acquireClientCredentials(java.lang.String userName, java.lang.String password, java.lang.String authenticationMechanism)
          Always throws NoSuchProviderException.
protected  Credentials acquireServerCredentials(java.lang.String userName, java.lang.String password, java.lang.String authenticationMechanism)
          Always throws NoSuchProviderException.
protected  void checkPermission(java.security.Permission perm)
          Always silently returns.
protected  java.lang.String[] getAcceptingProviders(ServiceEndpointContext serviceEndpointContext)
          Always returns an empty array.
protected  java.lang.String[] getAnRequirementsForEndpoint(java.lang.String serverURL, java.lang.String serviceEndpointPath, boolean isGetTransportMethod)
          Always returns an empty array.
protected  Credentials[] getCredentials(ServiceClient serviceClient)
          Always returns null.
protected  java.security.PermissionCollection getDefaultPrincipalPermissions()
          Returns readonly java.security.Permissions with java.security.AllPermission.
protected  java.lang.String getInitiatingProvider(ServiceClient serviceClient)
          Always returns null.
protected  java.lang.String getInitiatingProvider(ServiceEndpointContext serviceEndpointContext)
          Always returns null.
protected  java.util.Map getInstalledSecurityInfo()
          Returns unmodifiable Map with both WaspSecurity.AUTHENTICATION_SUPPORTED and WaspSecurity.AUTHORIZATION_SUPPORTED set to "false".
protected  javax.security.auth.Subject getInvokerSubject()
          Always returns null.
protected  Configurable getProviderProperties(ServiceClient serviceClient, java.lang.String providerName)
          Returns properties of security providers that are determined by the given instance of Configurable.
protected  Configurable getProviderProperties(ServiceEndpointContext serviceEndpointContext, java.lang.String providerName)
          Always returns null.
protected  java.lang.Class getProviderPropertiesIface(java.lang.String providerName)
          Returns configuration class of the given provider.
protected  boolean isAuthorizationRequired(ServiceEndpointContext serviceEndpointContext)
          Always throws NoSuchProviderException.
protected  java.util.Properties modifyLookupProperties(java.util.Properties props)
          Always returns the same properties as received.
protected  void resetCredentials()
          Always silently returns.
protected  void setAcceptingProviders(ServiceEndpointContext serviceEndpointContext, java.lang.String[] providerNames)
          If the providersNames array is null or empty, it silently returns, otherwise it throws NoSuchProviderException.
protected  void setAuthorizationRequired(ServiceEndpointContext serviceEndpointContext, boolean required)
          Always throws NoSuchProviderException.
protected  void setCredentials(ServiceClient serviceClient, Credentials[] creds)
          Always silently returns.
protected  void setCredentials(ServiceEndpointContext serviceEndpointContext, Credentials[] creds)
          Always silently returns.
protected  void setInitiatingProvider(ServiceClient serviceClient, java.lang.String providerName)
          If the providersName is null, it silently returns, otherwise it throws NoSuchProviderException.
protected  void setInitiatingProvider(ServiceEndpointContext serviceEndpointContext, java.lang.String providerName)
          If the providersName is null, it silently returns, otherwise it throws NoSuchProviderException.
protected  void setProviderProperties(ServiceClient serviceClient, Configurable config, java.lang.String providerName)
          Silently returns.
protected  void setProviderProperties(ServiceClient serviceClient, java.util.Map properties)
          Always silently returns.
protected  void setProviderProperties(ServiceEndpointContext serviceEndpointContext, Configurable config, java.lang.String providerName)
          Silently returns.
protected  void setProviderProperties(ServiceEndpointContext serviceEndpointContext, java.util.Map properties)
          Always silently returns.
 
Methods inherited from class org.idoox.wasp.WaspSecurity.SPI
getAnRequirementsForEndpoint, getInvokerFirstPrincipal, getInvokerPrincipals, isAppCredentialsSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WaspSecurity.WaspSecurityImpl

public WaspSecurity.WaspSecurityImpl()
Unmodifiable empty map, this map can be safely reused and returned by extenders.

Method Detail

getInstalledSecurityInfo

protected java.util.Map getInstalledSecurityInfo()
Returns unmodifiable Map with both WaspSecurity.AUTHENTICATION_SUPPORTED and WaspSecurity.AUTHORIZATION_SUPPORTED set to "false".

Specified by:
getInstalledSecurityInfo in class WaspSecurity.SPI
Returns:
installed security info

getDefaultPrincipalPermissions

protected java.security.PermissionCollection getDefaultPrincipalPermissions()
                                                                     throws java.security.AccessControlException
Returns readonly java.security.Permissions with java.security.AllPermission.

Specified by:
getDefaultPrincipalPermissions in class WaspSecurity.SPI
Returns:
default principal permissions
Throws:
java.security.AccessControlException
java.security.AccessControlException - never thrown by this implementation

getAcceptingProviders

protected java.lang.String[] getAcceptingProviders(ServiceEndpointContext serviceEndpointContext)
Always returns an empty array.

Specified by:
getAcceptingProviders in class WaspSecurity.SPI
Parameters:
serviceEndpointContext - whatever instance you want or null
Returns:
STRAR_0

modifyLookupProperties

protected java.util.Properties modifyLookupProperties(java.util.Properties props)
Always returns the same properties as received.

Specified by:
modifyLookupProperties in class WaspSecurity.SPI
Parameters:
props - current lookup properties, can be null
Returns:
the props parameter

getInvokerSubject

protected javax.security.auth.Subject getInvokerSubject()
Always returns null.

Specified by:
getInvokerSubject in class WaspSecurity.SPI
Returns:
null
See Also:
WaspSecurity.SPI.getInvokerFirstPrincipal(), WaspSecurity.SPI.getInvokerPrincipals()

setAuthorizationRequired

protected void setAuthorizationRequired(ServiceEndpointContext serviceEndpointContext,
                                        boolean required)
                                 throws java.security.NoSuchProviderException
Always throws NoSuchProviderException.

Specified by:
setAuthorizationRequired in class WaspSecurity.SPI
Parameters:
serviceEndpointContext - not used
required - not used
Throws:
java.security.NoSuchProviderException - if current WSO2 SOA Enablement Server Security cannot control authorization settings

isAuthorizationRequired

protected boolean isAuthorizationRequired(ServiceEndpointContext serviceEndpointContext)
                                   throws java.security.NoSuchProviderException
Always throws NoSuchProviderException.

Specified by:
isAuthorizationRequired in class WaspSecurity.SPI
Parameters:
serviceEndpointContext - not used
Returns:
never returns, always throws NoSuchProviderException
Throws:
java.security.NoSuchProviderException - if current WSO2 SOA Enablement Server Security cannot control authorization settings

setAcceptingProviders

protected void setAcceptingProviders(ServiceEndpointContext serviceEndpointContext,
                                     java.lang.String[] providerNames)
                              throws java.security.NoSuchProviderException
If the providersNames array is null or empty, it silently returns, otherwise it throws NoSuchProviderException.

Specified by:
setAcceptingProviders in class WaspSecurity.SPI
Parameters:
serviceEndpointContext - not used
providerNames - must be null or empty to silently return
Throws:
java.security.NoSuchProviderException - current WSO2 SOA Enablement Server Security cannot control authorization settings

setInitiatingProvider

protected void setInitiatingProvider(ServiceEndpointContext serviceEndpointContext,
                                     java.lang.String providerName)
                              throws java.security.NoSuchProviderException
If the providersName is null, it silently returns, otherwise it throws NoSuchProviderException.

Specified by:
setInitiatingProvider in class WaspSecurity.SPI
Parameters:
serviceEndpointContext - not used
providerName - must be null to silently return
Throws:
java.security.NoSuchProviderException - Current WSO2 SOA Enablement Server Security cannot control authorization settings!

setCredentials

protected void setCredentials(ServiceEndpointContext serviceEndpointContext,
                              Credentials[] creds)
Always silently returns.

Specified by:
setCredentials in class WaspSecurity.SPI
Parameters:
serviceEndpointContext - not used
creds - not used

acquireClientCredentials

protected Credentials acquireClientCredentials(java.lang.String userName,
                                               java.lang.String password,
                                               java.lang.String authenticationMechanism)
                                        throws java.security.NoSuchProviderException
Always throws NoSuchProviderException.

Specified by:
acquireClientCredentials in class WaspSecurity.SPI
Parameters:
userName - not used
password - not used
authenticationMechanism - not used
Returns:
never returns, always throws NoSuchProviderException
Throws:
java.security.NoSuchProviderException - if current WSO2 SOA Enablement Server Security cannot create credentials

acquireServerCredentials

protected Credentials acquireServerCredentials(java.lang.String userName,
                                               java.lang.String password,
                                               java.lang.String authenticationMechanism)
                                        throws java.security.NoSuchProviderException
Always throws NoSuchProviderException.

Specified by:
acquireServerCredentials in class WaspSecurity.SPI
Parameters:
userName - not used
password - not used
authenticationMechanism - not used
Returns:
never returns, always throws NoSuchProviderException
Throws:
java.security.NoSuchProviderException - if current WSO2 SOA Enablement Server Security cannot create credentials

getCredentials

protected Credentials[] getCredentials(ServiceClient serviceClient)
Always returns null.

Specified by:
getCredentials in class WaspSecurity.SPI
Parameters:
serviceClient - not used
Returns:
null

setCredentials

protected void setCredentials(ServiceClient serviceClient,
                              Credentials[] creds)
Always silently returns.

Specified by:
setCredentials in class WaspSecurity.SPI
Parameters:
serviceClient - not used
creds - not used
See Also:
WaspSecurity.SPI.setInitiatingProvider(ServiceClient,String)

setInitiatingProvider

protected void setInitiatingProvider(ServiceClient serviceClient,
                                     java.lang.String providerName)
                              throws java.security.NoSuchProviderException
If the providersName is null, it silently returns, otherwise it throws NoSuchProviderException.

Specified by:
setInitiatingProvider in class WaspSecurity.SPI
Parameters:
serviceClient - not used
providerName - must be null to silently return
Throws:
java.security.NoSuchProviderException - if current WSO2 SOA Enablement Server Security cannot control authorization settings

setProviderProperties

protected void setProviderProperties(ServiceClient serviceClient,
                                     java.util.Map properties)
Always silently returns.

Specified by:
setProviderProperties in class WaspSecurity.SPI
Parameters:
serviceClient - not used
properties - not used

setProviderProperties

protected void setProviderProperties(ServiceEndpointContext serviceEndpointContext,
                                     java.util.Map properties)
Always silently returns.

Specified by:
setProviderProperties in class WaspSecurity.SPI
Parameters:
serviceEndpointContext - not used
properties - not used

getProviderProperties

protected Configurable getProviderProperties(ServiceEndpointContext serviceEndpointContext,
                                             java.lang.String providerName)
Always returns null.

Specified by:
getProviderProperties in class WaspSecurity.SPI
Parameters:
serviceEndpointContext - not used
providerName - not used
Returns:
null

setProviderProperties

protected void setProviderProperties(ServiceEndpointContext serviceEndpointContext,
                                     Configurable config,
                                     java.lang.String providerName)
                              throws java.security.NoSuchProviderException
Silently returns.

Specified by:
setProviderProperties in class WaspSecurity.SPI
Parameters:
serviceEndpointContext - not used
config - not used
providerName - not used
Throws:
java.security.NoSuchProviderException - never thrown

getProviderProperties

protected Configurable getProviderProperties(ServiceClient serviceClient,
                                             java.lang.String providerName)
Description copied from class: WaspSecurity.SPI
Returns properties of security providers that are determined by the given instance of Configurable. The config object is then narrowed to corresponding configuration interface. This method is usually used for configuration, integration,... In most cases, users needn't to use this method.

Specified by:
getProviderProperties in class WaspSecurity.SPI
Parameters:
serviceClient - service client, cannot be null
providerName - name of the security provider to get the properties
Returns:
Configurable instance

setProviderProperties

protected void setProviderProperties(ServiceClient serviceClient,
                                     Configurable config,
                                     java.lang.String providerName)
                              throws java.security.NoSuchProviderException
Silently returns.

Specified by:
setProviderProperties in class WaspSecurity.SPI
Parameters:
serviceClient - not used
config - not used
providerName - not used
Throws:
java.security.NoSuchProviderException - never thrown

resetCredentials

protected void resetCredentials()
Always silently returns.

Specified by:
resetCredentials in class WaspSecurity.SPI

getAnRequirementsForEndpoint

protected java.lang.String[] getAnRequirementsForEndpoint(java.lang.String serverURL,
                                                          java.lang.String serviceEndpointPath,
                                                          boolean isGetTransportMethod)
                                                   throws WebServiceLookupException
Always returns an empty array.

Specified by:
getAnRequirementsForEndpoint in class WaspSecurity.SPI
Parameters:
serverURL - not used
serviceEndpointPath - not used
isGetTransportMethod - not used
Returns:
STRAR_0
Throws:
WebServiceLookupException - unable to lookup the service providing endpoint security information

getInitiatingProvider

protected java.lang.String getInitiatingProvider(ServiceClient serviceClient)
Always returns null.

Specified by:
getInitiatingProvider in class WaspSecurity.SPI
Parameters:
serviceClient - not used
Returns:
null

getInitiatingProvider

protected java.lang.String getInitiatingProvider(ServiceEndpointContext serviceEndpointContext)
Always returns null.

Specified by:
getInitiatingProvider in class WaspSecurity.SPI
Parameters:
serviceEndpointContext - not used
Returns:
null

checkPermission

protected void checkPermission(java.security.Permission perm)
                        throws java.security.AccessControlException
Always silently returns.

Specified by:
checkPermission in class WaspSecurity.SPI
Parameters:
perm - not used
Throws:
java.security.AccessControlException - never thrown

getProviderPropertiesIface

protected java.lang.Class getProviderPropertiesIface(java.lang.String providerName)
                                              throws java.security.NoSuchProviderException
Returns configuration class of the given provider. If the provider hasn't any configuration class, this method returns null. This class is used mainly by management services.

Specified by:
getProviderPropertiesIface in class WaspSecurity.SPI
Parameters:
providerName - a given provider name
Returns:
configuration class of the given provider
Throws:
java.security.NoSuchProviderException - never thrown