public class EntitlementUtil extends Object
Constructor and Description |
---|
EntitlementUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
addFilesystemPolicy(PolicyDTO policyDTO,
org.wso2.carbon.registry.core.Registry registry,
boolean promote)
This method persists a new XACML policy, which was read from filesystem,
in the registry
|
static void |
addPolicyToPDP(PolicyStoreDTO policyStoreDTO) |
static void |
addSamplePolicies(org.wso2.carbon.registry.core.Registry registry) |
static org.wso2.balana.ctx.AbstractRequestCtx |
createRequestContext(List<AttributeDTO> attributeDTOs)
This creates the XACML 3.0 Request context from AttributeDTO object model
|
static String |
createSimpleXACMLRequest(String subject,
String resource,
String action,
String environment)
Creates Simple XACML request using given attribute value.Here category, attribute ids and datatypes are
taken as default values.
|
static org.wso2.balana.xacml3.Attributes |
getAttributes(AttributeDTO attributeDataDTO) |
static org.wso2.balana.attr.AttributeValue |
getAttributeValue(String value,
String type)
Return the Attribute Value Object for given string value and data type
|
static EntitlementBaseCache<IdentityCacheKey,IdentityCacheEntry> |
getCommonCache(String name)
Return an instance of a named cache that is common to all tenants.
|
static org.wso2.balana.AbstractPolicy |
getPolicy(String policy) |
static PolicyDTO |
getPolicy(String policyId,
org.wso2.carbon.registry.core.Registry registry)
Gets policy dto for a given policy id
|
static org.wso2.balana.combine.PolicyCombiningAlgorithm |
getPolicyCombiningAlgorithm(String uri)
Creates PolicyCombiningAlgorithm object based on policy combining url
|
static String |
getPolicyVersion(String policy) |
static boolean |
isPolicyExists(String policyId,
org.wso2.carbon.registry.core.Registry registry)
This method checks whether there is a policy having the same policyId as the given policyId is in the registry
|
static void |
setAttributesAsProperties(AttributeDTO[] attributeDTOs,
org.wso2.carbon.registry.core.Resource resource)
This helper method creates properties object which contains the policy meta data.
|
static boolean |
validatePolicy(PolicyDTO policy)
Validates the given policy XML files against the standard XACML policies.
|
public static EntitlementBaseCache<IdentityCacheKey,IdentityCacheEntry> getCommonCache(String name)
name
- the name of the cache.public static org.wso2.balana.attr.AttributeValue getAttributeValue(String value, String type) throws EntitlementException
value
- attribute value as a String objecttype
- attribute data type name as String objectEntitlementException
- throwspublic static org.wso2.balana.ctx.AbstractRequestCtx createRequestContext(List<AttributeDTO> attributeDTOs)
attributeDTOs
- AttributeDTO objects as ListEntitlementException
- throws, if failspublic static boolean validatePolicy(PolicyDTO policy)
policy
- Policy to validatepublic static org.wso2.balana.xacml3.Attributes getAttributes(AttributeDTO attributeDataDTO)
public static org.wso2.balana.combine.PolicyCombiningAlgorithm getPolicyCombiningAlgorithm(String uri) throws EntitlementException
uri
- policy combining url as StringEntitlementException
- throws if unsupported algorithmpublic static String createSimpleXACMLRequest(String subject, String resource, String action, String environment)
subject
- user or roleresource
- resource nameaction
- action nameenvironment
- environment namepublic static void addSamplePolicies(org.wso2.carbon.registry.core.Registry registry)
public static boolean isPolicyExists(String policyId, org.wso2.carbon.registry.core.Registry registry) throws EntitlementException
policyId
- registry
- EntitlementException
public static boolean addFilesystemPolicy(PolicyDTO policyDTO, org.wso2.carbon.registry.core.Registry registry, boolean promote) throws EntitlementException
policyDTO
- PolicyDTO objectregistry
- Registrypromote
- where policy must be promote PDP or notEntitlementException
- throws if policy with same id is existpublic static org.wso2.balana.AbstractPolicy getPolicy(String policy)
public static PolicyDTO getPolicy(String policyId, org.wso2.carbon.registry.core.Registry registry) throws EntitlementException
policyId
- policy idregistry
- RegistryEntitlementException
public static void addPolicyToPDP(PolicyStoreDTO policyStoreDTO) throws EntitlementException
policyStoreDTO
- EntitlementException
public static void setAttributesAsProperties(AttributeDTO[] attributeDTOs, org.wso2.carbon.registry.core.Resource resource)
attributeDTOs
- List of AttributeDTOresource
- registry resourceCopyright © 2016 WSO2. All rights reserved.