org.systinet.wasp.admin.security
Class PermissionHelper

java.lang.Object
  extended byorg.systinet.wasp.admin.security.PermissionHelper

public class PermissionHelper
extends java.lang.Object

This class helps to convert objects (their representaion) into identificators which are used to grant permissions and to convert identificators back to objects.

Since:
4.0
Component:
Core-Services

Nested Class Summary
static class PermissionHelper.Holder
          This class is used as holder of object representation during decoding of it from identificator.
 
Constructor Summary
PermissionHelper()
           
 
Method Summary
protected static PermissionHelper.Holder decode(java.lang.String id)
          Decodes string into tripple .
static PermissionHelper.Holder decodeMethodId(java.lang.String methodId)
          Returns holder which contains representaion of the method of specified identification.
static PermissionHelper.Holder decodePackageId(java.lang.String packageId)
          Returns holder which contains representaion of the package of specified identification.
static java.lang.String decodeServiceEndpointId(java.lang.String context, java.lang.String serviceEndpointId)
          Returns endpoint of the service endpoint specified by its identification and context (simply cuts context from the endpoint id).
static PermissionHelper.Holder decodeServiceInstanceId(java.lang.String serviceInstanceId)
          Returns holder which contains representaion of the service instance of specified identification.
protected static java.lang.String encode(java.lang.String context, java.lang.String targetNS, java.lang.String name)
          Encodes tripple into one string.
static java.lang.String getMethodId(java.lang.String wsdlTargetNamespace, java.lang.String operationName)
          Returns identification of the specified method.
static java.lang.String getPackageId(Package pckg)
          Returns identification of the specified package.
static java.lang.String getPackageId(java.lang.String context, java.lang.String targetNS, java.lang.String name)
          Returns identification of the specified package.
static java.lang.String getServiceEndpointId(java.lang.String context, ServiceEndpoint serviceEndpoint)
          Returns identification of the specified service instance.
static java.lang.String getServiceEndpointId(java.lang.String context, java.lang.String endpointPath)
          Returns identification of the specified service endpoint.
static java.lang.String getServiceInstanceId(java.lang.String context, ServiceInstance serviceInstance)
          Returns identification of the specified service instance.
static java.lang.String getServiceInstanceId(java.lang.String context, java.lang.String targetNS, java.lang.String name)
          Returns identification of the specified service instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PermissionHelper

public PermissionHelper()
Method Detail

encode

protected static java.lang.String encode(java.lang.String context,
                                         java.lang.String targetNS,
                                         java.lang.String name)
Encodes tripple into one string.

Parameters:
context - context of the object.
targetNS - target namespace of the object.
name - name of the object.

decode

protected static PermissionHelper.Holder decode(java.lang.String id)
Decodes string into tripple .

Parameters:
id - identificator to decode.
Returns:
holder which contains the tripple.

getPackageId

public static java.lang.String getPackageId(Package pckg)
Returns identification of the specified package.

Parameters:
pckg - package.
Returns:
identification of the specified package.

getPackageId

public static java.lang.String getPackageId(java.lang.String context,
                                            java.lang.String targetNS,
                                            java.lang.String name)
Returns identification of the specified package.

Parameters:
context - context of the package.
targetNS - target namespace of the package.
name - name of the package.
Returns:
identification of the specified package

getServiceInstanceId

public static java.lang.String getServiceInstanceId(java.lang.String context,
                                                    ServiceInstance serviceInstance)
Returns identification of the specified service instance.

Parameters:
context - context of the service instance.
serviceInstance - service instance.
Returns:
identification of the specified service instance.

getServiceInstanceId

public static java.lang.String getServiceInstanceId(java.lang.String context,
                                                    java.lang.String targetNS,
                                                    java.lang.String name)
Returns identification of the specified service instance.

Parameters:
context - context of the service instance.
targetNS - target namespace of the service instance.
name - name of the service instance.
Returns:
identification of the specified service instance.

getServiceEndpointId

public static java.lang.String getServiceEndpointId(java.lang.String context,
                                                    ServiceEndpoint serviceEndpoint)
Returns identification of the specified service instance.

Parameters:
context - context of the service instance.
serviceEndpoint - service endpoint.
Returns:
identification of the specified service endpoint.

getServiceEndpointId

public static java.lang.String getServiceEndpointId(java.lang.String context,
                                                    java.lang.String endpointPath)
Returns identification of the specified service endpoint.

Parameters:
context - context of the service endpoint.
endpointPath - path of the service endpoint.
Returns:
identification of the specified service endpoint.

getMethodId

public static java.lang.String getMethodId(java.lang.String wsdlTargetNamespace,
                                           java.lang.String operationName)
Returns identification of the specified method.

Parameters:
wsdlTargetNamespace - target namespace of the WSDL where the method is described.
operationName - name of the method (operation in WSDL).
Returns:
identification of the specified method.

decodePackageId

public static PermissionHelper.Holder decodePackageId(java.lang.String packageId)
Returns holder which contains representaion of the package of specified identification.

Parameters:
packageId - identification of the package.
Returns:
holder which contains representaion of the package of specified identification (context, target namespace, name).

decodeServiceInstanceId

public static PermissionHelper.Holder decodeServiceInstanceId(java.lang.String serviceInstanceId)
Returns holder which contains representaion of the service instance of specified identification.

Parameters:
serviceInstanceId - identification of the service instance.
Returns:
holder which contains representaion of the service instance of specified identification (context, target namespace, name).

decodeServiceEndpointId

public static java.lang.String decodeServiceEndpointId(java.lang.String context,
                                                       java.lang.String serviceEndpointId)
Returns endpoint of the service endpoint specified by its identification and context (simply cuts context from the endpoint id).

Parameters:
context - context of the service endpoint.
serviceEndpointId - identification of the service endpoint.
Returns:
endpoint path of the service endpoint.

decodeMethodId

public static PermissionHelper.Holder decodeMethodId(java.lang.String methodId)
Returns holder which contains representaion of the method of specified identification.

Parameters:
methodId - identification of the method
Returns:
holder which contains representaion of the method of specified identification (context - null, target namespace from WSDL, name ).