org.opentox.toxotis.util.aa.policy
Class PolicyRule

java.lang.Object
  extended by org.opentox.toxotis.util.aa.policy.PolicyRule
All Implemented Interfaces:
IPolicyRule

public class PolicyRule
extends Object
implements IPolicyRule

A Rule in a policy that defined the behavior of the SSO service when permission is asked on a target URI for some method. Specifies where POST, GET, PUT and DELETE should be allowed or denied on certain individual users or groups of users.

Author:
Pantelis Sopasakis, Charalampos Chomenides

Constructor Summary
PolicyRule(String name)
           
 
Method Summary
 String getName()
          Name of the rule.
 String getServiceName()
          Name of the service.
 String getTargetUri()
          URI of the resource for which the rule is written.
 boolean isAllowDelete()
          Whether the DELETE method is allowed
 boolean isAllowGet()
          Whether the GET method is allowed
 boolean isAllowPost()
          Whether the POST method is allowed
 boolean isAllowPut()
          Whether the PUT method is allowed
 IPolicyRule setAllowances(boolean get, boolean post, boolean put, boolean delete)
          A method to easily set which HTTP methods are allowed and which not.
 IPolicyRule setAllowDelete(boolean allowDelete)
          Set the access regime for the DELETE method.
 IPolicyRule setAllowGet(boolean allowGet)
          Set the access regime for the GET method.
 IPolicyRule setAllowPost(boolean allowPost)
          Set the access regime for the POST method.
 IPolicyRule setAllowPut(boolean allowPut)
          Set the access regime for the PUT method.
 IPolicyRule setName(String name)
          Specify the name of the rule.
 IPolicyRule setServiceName(String serviceName)
          Setter method for the service name.
 IPolicyRule setTargetUri(String targetUri)
          Setter method for the URI of the target resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolicyRule

public PolicyRule(String name)
Method Detail

setAllowances

public IPolicyRule setAllowances(boolean get,
                                 boolean post,
                                 boolean put,
                                 boolean delete)
Description copied from interface: IPolicyRule
A method to easily set which HTTP methods are allowed and which not.

Specified by:
setAllowances in interface IPolicyRule
Parameters:
get - Whether GET is allowed.
post - Whether POST is allowed.
put - Whether PUT is allowed.
delete - Whether DELETE is allowed.
Returns:
The current modifiable policy rule object with updated rules per method.

isAllowDelete

public boolean isAllowDelete()
Description copied from interface: IPolicyRule
Whether the DELETE method is allowed

Specified by:
isAllowDelete in interface IPolicyRule
Returns:
true if a DELETE is allowed and false otherwise.

setAllowDelete

public IPolicyRule setAllowDelete(boolean allowDelete)
Description copied from interface: IPolicyRule
Set the access regime for the DELETE method.

Specified by:
setAllowDelete in interface IPolicyRule
Parameters:
allowDelete - Whether the DELETE method is allowed
Returns:
The current modifiable policy rule object with updated rule for the DELETE method.

isAllowGet

public boolean isAllowGet()
Description copied from interface: IPolicyRule
Whether the GET method is allowed

Specified by:
isAllowGet in interface IPolicyRule
Returns:
true if a GET is allowed and false otherwise.

setAllowGet

public IPolicyRule setAllowGet(boolean allowGet)
Description copied from interface: IPolicyRule
Set the access regime for the GET method.

Specified by:
setAllowGet in interface IPolicyRule
Returns:
The current modifiable policy rule object with updated rule for the GET method.

isAllowPost

public boolean isAllowPost()
Description copied from interface: IPolicyRule
Whether the POST method is allowed

Specified by:
isAllowPost in interface IPolicyRule
Returns:
true if a POST is allowed and false otherwise.

setAllowPost

public IPolicyRule setAllowPost(boolean allowPost)
Description copied from interface: IPolicyRule
Set the access regime for the POST method.

Specified by:
setAllowPost in interface IPolicyRule
Returns:
The current modifiable policy rule object with updated rule for the POST method.

isAllowPut

public boolean isAllowPut()
Description copied from interface: IPolicyRule
Whether the PUT method is allowed

Specified by:
isAllowPut in interface IPolicyRule
Returns:
true if a PUT is allowed and false otherwise.

setAllowPut

public IPolicyRule setAllowPut(boolean allowPut)
Description copied from interface: IPolicyRule
Set the access regime for the PUT method.

Specified by:
setAllowPut in interface IPolicyRule
Returns:
The current modifiable policy rule object with updated rule for the PUT method.

getName

public String getName()
Description copied from interface: IPolicyRule
Name of the rule.

Specified by:
getName in interface IPolicyRule
Returns:
Name of the policy rule as String.

setName

public IPolicyRule setName(String name)
Description copied from interface: IPolicyRule
Specify the name of the rule.

Specified by:
setName in interface IPolicyRule
Parameters:
name - Name of the rule as a String.
Returns:
The current modifiable policy rule object with updated name.

getServiceName

public String getServiceName()
Description copied from interface: IPolicyRule
Name of the service.

Specified by:
getServiceName in interface IPolicyRule
Returns:
Service name as String.

setServiceName

public IPolicyRule setServiceName(String serviceName)
Description copied from interface: IPolicyRule
Setter method for the service name.

Specified by:
setServiceName in interface IPolicyRule
Parameters:
serviceName - The service name as a String.
Returns:
The current modifiable policy rule object with updated service name.

getTargetUri

public String getTargetUri()
Description copied from interface: IPolicyRule
URI of the resource for which the rule is written.

Specified by:
getTargetUri in interface IPolicyRule
Returns:
The URI of the target resource as a String.

setTargetUri

public IPolicyRule setTargetUri(String targetUri)
Description copied from interface: IPolicyRule
Setter method for the URI of the target resource.

Specified by:
setTargetUri in interface IPolicyRule
Parameters:
targetUri - The URI of the resource for which the rule is written.
Returns:
The current modifiable policy rule object with updated target URI.


Copyright © 2011-2012 OpenTox. All Rights Reserved.