Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| deegree 2.4 (2010/11/11 10:47 build-27-official)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.deegree.portal.standard.security.control
Class ClientHelper

    java.lang.Object
      org.deegree.portal.standard.security.control.ClientHelper

    public class ClientHelper

extends Object

Helper class that performs common security access tasks and checks used in the `Listener` classes.

Version:
  $Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
  Markus Schneider , last edited by: $Author: mschneider $

Field Summary
`static String` | `KEY_PASSWORD`
`static String` | `KEY_USERNAME`
`static String` | `TYPE_FEATURETYPE`
`static String` | `TYPE_LAYER`
`static String` | `TYPE_METADATASCHEMA`

Constructor Summary
`ClientHelper()`

Method Summary
`static SecurityAccess` | `acquireAccess(AbstractListener listener)` Tries to acquire a `SecurityAccess` for the credentials (username, password) stored in the associated `HttpSesssion` of the given `AbstractListener`.
`static SecurityTransaction` | `acquireTransaction(AbstractListener listener)` Tries to acquire a `SecurityTransaction` for the credentials (username, password) stored in the associated `HttpSesssion`.
`static Role` | `checkForAdminOrSubadminRole(SecurityAccess access)` Returns the associated 'Administrator'- or 'SUBADMIN:'-role of the token holder.
`static void` | `checkForAdminRole(SecurityAccess access)` Tests if the given token is associated with the 'Administrator'-role.
`static void` | `checkSubadminRoleValidity(SecurityAccess access)` Tests if the 'SUBADMIN:' and 'Administrator'-roles are all disjoint (so that there are no users that have more than 1 role).
`static Role` | `findAdminForRole(SecurityAccess access, Role role)` Returns the administrator (the 'Administrator'- or a 'SUBADMIN:'-role) for the given role.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### KEY_USERNAME

    public static final String KEY_USERNAME

See Also:
  Constant Field Values

### KEY_PASSWORD

    public static final String KEY_PASSWORD

See Also:
  Constant Field Values

### TYPE_LAYER

    public static final String TYPE_LAYER

See Also:
  Constant Field Values

### TYPE_FEATURETYPE

    public static final String TYPE_FEATURETYPE

See Also:
  Constant Field Values

### TYPE_METADATASCHEMA

    public static final String TYPE_METADATASCHEMA

See Also:
  Constant Field Values

Constructor Detail

### ClientHelper

    public ClientHelper()

Method Detail

### acquireAccess

    public static SecurityAccess acquireAccess(AbstractListener listener)
                                        throws GeneralSecurityException

  Tries to acquire a `SecurityAccess` for the credentials (username, password) stored in the associated `HttpSesssion` of the given `AbstractListener`.

  Parameters:
    `listener` -
  Returns:
    SecurityAccess
  Throws:
    `GeneralSecurityException`

### acquireTransaction

    public static SecurityTransaction acquireTransaction(AbstractListener listener)
                                                  throws GeneralSecurityException

  Tries to acquire a `SecurityTransaction` for the credentials (username, password) stored in the associated `HttpSesssion`.

  Parameters:
    `listener` -
  Returns:
    SecurityTransaction
  Throws:
    `GeneralSecurityException`

### findAdminForRole

    public static Role findAdminForRole(SecurityAccess access,
                                        Role role)
                                 throws GeneralSecurityException

  Returns the administrator (the 'Administrator'- or a 'SUBADMIN:'-role) for the given role.

  Parameters:
    `access` -
    `role` -
  Returns:
    Role
  Throws:
    `GeneralSecurityException`

### checkForAdminOrSubadminRole

    public static Role checkForAdminOrSubadminRole(SecurityAccess access)
                                            throws GeneralSecurityException

  Returns the associated 'Administrator'- or 'SUBADMIN:'-role of the token holder.

  Parameters:
    `access` -
  Returns:
    Role
  Throws:
    `GeneralSecurityException`

### checkForAdminRole

    public static void checkForAdminRole(SecurityAccess access)
                                  throws GeneralSecurityException

  Tests if the given token is associated with the 'Administrator'-role.

  Parameters:
    `access` -
  Throws:
    `GeneralSecurityException,` - this is an UnauthorizedException if the user does not have the 'Administrator'-role
    `GeneralSecurityException`

### checkSubadminRoleValidity

    public static void checkSubadminRoleValidity(SecurityAccess access)
                                          throws GeneralSecurityException

  Tests if the 'SUBADMIN:' and 'Administrator'-roles are all disjoint (so that there are no users that have more than 1 role).

  Parameters:
    `access` -
  Throws:
    `GeneralSecurityException` - if there is a user with more than one role

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| deegree 2.4 (2010/11/11 10:47 build-27-official)
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org