eu.xtreemos.xosd.security.vops.xacml.utils
Class RequestFactory

java.lang.Object
  extended by eu.xtreemos.xosd.security.vops.xacml.utils.RequestFactory

public class RequestFactory
extends java.lang.Object


Field Summary
static java.lang.String ACTION_SUBMIT_JOB
           
static java.lang.String JSDL_RESOURCES_TOTALDISKSPACE_LOWERBOUNDEDRANGE
           
static java.lang.String JSDL_RESOURCES_TOTALDISKSPACE_UPPERBOUNDEDRANGE
           
(package private) static org.apache.log4j.Logger logger
           
static java.lang.String NAMESPACE_NETWORK
           
static java.lang.String NAMESPACE_NETWORK_NETMASK
           
static java.lang.String NAMESPACE_NETWORK_PORTS
           
static java.lang.String NAMESPACE_NETWORK_PROTOCOLS
           
(package private) static com.sun.xacml.ctx.RequestCtx request
           
static java.lang.String xacmlRequestJSDLPrefix
           
static java.util.Hashtable<java.lang.String,java.lang.String> xacmlRequestXPaths
           
 
Constructor Summary
RequestFactory()
           
 
Method Summary
static com.sun.xacml.ctx.RequestCtx AppendAttributes(com.sun.xacml.ctx.RequestCtx request, java.lang.String jsdlFile)
           
static com.sun.xacml.ctx.RequestCtx createRequest(java.util.ArrayList<com.sun.xacml.ctx.Attribute> attrsUsr, java.util.ArrayList<com.sun.xacml.ctx.Attribute> attrsRes, CommunicationAddress resource, java.util.ArrayList<com.sun.xacml.ctx.Attribute> action)
          Deprecated.  
static com.sun.xacml.ctx.RequestCtx createRequest(IAttributes subject, IAttributes resource, IAttributes action)
          Generates request
static com.sun.xacml.ctx.RequestCtx createRequest(java.lang.String userGlobalName, java.lang.String subjectGroupId, CommunicationAddress resource, java.lang.String action)
          Deprecated.  
static java.util.ArrayList<com.sun.xacml.ctx.Attribute> obtainJSDLAttributes(java.util.Hashtable<java.lang.String,java.lang.Object> jsdlHashTable)
          Extracts from JSDL attributes for request.
static java.util.Set setupAction(java.util.ArrayList<com.sun.xacml.ctx.Attribute> requestAction)
          Creates an Action specifying the action-id, an optional attribute.
static java.util.Set setupResource(java.lang.String requestResource)
          Creates a Resource specifying the resource-id, a required attribute.
static java.util.Set setupResourceMap(java.util.ArrayList<com.sun.xacml.ctx.Attribute> alAttributes)
          Creates a Resource specifying the resource-id, a required attribute.
static java.util.Set setupSubjects(java.util.ArrayList<com.sun.xacml.ctx.Attribute> alAttributes)
          Create Subject field in request XML.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_SUBMIT_JOB

public static final java.lang.String ACTION_SUBMIT_JOB
See Also:
Constant Field Values

NAMESPACE_NETWORK

public static final java.lang.String NAMESPACE_NETWORK
See Also:
Constant Field Values

NAMESPACE_NETWORK_NETMASK

public static final java.lang.String NAMESPACE_NETWORK_NETMASK
See Also:
Constant Field Values

NAMESPACE_NETWORK_PROTOCOLS

public static final java.lang.String NAMESPACE_NETWORK_PROTOCOLS
See Also:
Constant Field Values

NAMESPACE_NETWORK_PORTS

public static final java.lang.String NAMESPACE_NETWORK_PORTS
See Also:
Constant Field Values

xacmlRequestXPaths

public static java.util.Hashtable<java.lang.String,java.lang.String> xacmlRequestXPaths

xacmlRequestJSDLPrefix

public static final java.lang.String xacmlRequestJSDLPrefix
See Also:
Constant Field Values

JSDL_RESOURCES_TOTALDISKSPACE_LOWERBOUNDEDRANGE

public static final java.lang.String JSDL_RESOURCES_TOTALDISKSPACE_LOWERBOUNDEDRANGE
See Also:
Constant Field Values

JSDL_RESOURCES_TOTALDISKSPACE_UPPERBOUNDEDRANGE

public static final java.lang.String JSDL_RESOURCES_TOTALDISKSPACE_UPPERBOUNDEDRANGE
See Also:
Constant Field Values

logger

static final org.apache.log4j.Logger logger

request

static com.sun.xacml.ctx.RequestCtx request
Constructor Detail

RequestFactory

public RequestFactory()
Method Detail

createRequest

public static com.sun.xacml.ctx.RequestCtx createRequest(java.lang.String userGlobalName,
                                                         java.lang.String subjectGroupId,
                                                         CommunicationAddress resource,
                                                         java.lang.String action)
Deprecated. 

Generates request

Parameters:
subjectUserId -
subjectGroupId -
resource -
action - What action does user subjectUserId from group subjectGroupId with resource action
Returns:

createRequest

public static com.sun.xacml.ctx.RequestCtx createRequest(java.util.ArrayList<com.sun.xacml.ctx.Attribute> attrsUsr,
                                                         java.util.ArrayList<com.sun.xacml.ctx.Attribute> attrsRes,
                                                         CommunicationAddress resource,
                                                         java.util.ArrayList<com.sun.xacml.ctx.Attribute> action)
                                                  throws java.lang.Exception
Deprecated. 

Generates request

Parameters:
attrs - Attributes and values
resource -
action - What action does user subjectUserId from group subjectGroupId with resource action
Returns:
Throws:
java.lang.Exception

createRequest

public static com.sun.xacml.ctx.RequestCtx createRequest(IAttributes subject,
                                                         IAttributes resource,
                                                         IAttributes action)
                                                  throws java.lang.Exception
Generates request

Parameters:
attrs - Attributes and values
resource -
action - What action does user subjectUserId from group subjectGroupId with resource action
Returns:
Throws:
java.lang.Exception

setupSubjects

public static java.util.Set setupSubjects(java.util.ArrayList<com.sun.xacml.ctx.Attribute> alAttributes)
                                   throws java.net.URISyntaxException
Create Subject field in request XML. TODO: Add parameter of owner of this setup (e.g. admin@xtreemos.eu). TODO: various attributes are possible.

Parameters:
subjectUserId - User's id
subjectGroupId - Group's id
Returns:
Throws:
java.net.URISyntaxException

setupResource

public static java.util.Set setupResource(java.lang.String requestResource)
                                   throws java.net.URISyntaxException
Creates a Resource specifying the resource-id, a required attribute.

Returns:
a Set of Attributes for inclusion in a Request
Throws:
java.net.URISyntaxException - if there is a problem with a URI

setupResourceMap

public static java.util.Set setupResourceMap(java.util.ArrayList<com.sun.xacml.ctx.Attribute> alAttributes)
                                      throws java.net.URISyntaxException
Creates a Resource specifying the resource-id, a required attribute.

Returns:
a Set of Attributes for inclusion in a Request
Throws:
java.net.URISyntaxException - if there is a problem with a URI

setupAction

public static java.util.Set setupAction(java.util.ArrayList<com.sun.xacml.ctx.Attribute> requestAction)
                                 throws java.net.URISyntaxException,
                                        java.lang.Exception
Creates an Action specifying the action-id, an optional attribute.

Returns:
a Set of Attributes for inclusion in a Request
Throws:
java.net.URISyntaxException - if there is a problem with a URI
java.lang.Exception

obtainJSDLAttributes

public static java.util.ArrayList<com.sun.xacml.ctx.Attribute> obtainJSDLAttributes(java.util.Hashtable<java.lang.String,java.lang.Object> jsdlHashTable)
                                                                             throws java.lang.Exception
Extracts from JSDL attributes for request. TODO: move this into its own package (already exists for Resource and Subject)

Parameters:
jsdlHashTable - Input from XMLValidatorAndParser class.
Returns:
Throws:
java.lang.Exception

AppendAttributes

public static com.sun.xacml.ctx.RequestCtx AppendAttributes(com.sun.xacml.ctx.RequestCtx request,
                                                            java.lang.String jsdlFile)
Parameters:
request - request context
jsdlFile - path to jsdl file
Returns: