public class InfoFactory
extends java.lang.Object
The objects are in-memory representations of PolicyStore artifacts. The objects do not represent an object in the persistent store. To identify a persisted object, query the store for the required object. Validation is not performed while creating the in-memory object to ensure if the object exists in the persistent store or not.
| Constructor and Description |
|---|
InfoFactory() |
| Modifier and Type | Method and Description |
|---|---|
static PermissionEntry |
newPermissionEntry(java.lang.String permClass, java.lang.String targetName, java.lang.String actions)
Constructs an in-memory representation of a Permission Entry Object.
|
static PermissionEntry |
newPermissionEntry(java.lang.String resourceTypeName, java.lang.String permClass, java.lang.String targetName, java.lang.String actions)
Constructs an in-memory representation of a Permission Entry Object.
|
static PermissionEntry |
newPermissionEntry(java.lang.String displayName, java.lang.String description, java.lang.String permClass, java.lang.String targetName, java.lang.String actions)
Constructs an in-memory representation of a Permission Entry Object.
|
static PermissionSetEntry |
newPermissionSet(java.lang.String name, java.lang.String displayName, java.lang.String description, java.util.Set<ResourceActionsEntry> resourceActions)
Creates a PermissionSetEntry in memory.
|
static PrincipalEntry |
newPrincipalEntry(java.lang.String principalClass, java.lang.String name)
Creates a PrincipalEntry given the principalClass, type and name.
|
static ResourceActionsEntry |
newResourceActionsEntry(ResourceEntry resource, java.util.Set<java.lang.String> actions)
Construct a ResourceActionsEntry
|
static ResourceActionsEntry |
newResourceActionsEntry(java.lang.String resourceType, java.lang.String resourceName, java.util.Set<java.lang.String> actions, java.lang.String appid)
Construct a ResourceActionsEntry
|
static ResourceEntry |
newResourceEntry(java.lang.String displayName, java.lang.String descr, java.lang.String type, java.lang.String name)
Creates a ResourceEntry in memory.
|
static ResourceTypeEntry |
newResourceTypeEntry(java.lang.String name, java.lang.String displayName, java.lang.String descr, java.lang.String provider, java.lang.String matcher, java.util.Set<java.lang.String> allowedActions, java.lang.String delimiter)
Creates a ResourceTypeEntry in memory.
|
static RoleCategoryEntry |
newRoleCategoryEntry(java.lang.String name, java.lang.String displayName, java.lang.String descr)
Creates a RoleCategoryEntry in memory.
|
public static PrincipalEntry newPrincipalEntry(java.lang.String principalClass, java.lang.String name) throws JpsException
principalClass - Java class that implements the Principalname - Name of the PrincipalJpsException - if an error is raised while trying to create the object.public static PermissionEntry newPermissionEntry(java.lang.String permClass, java.lang.String targetName, java.lang.String actions) throws JpsException
permClass - the Java class implementing the Permission.targetName - the target of the permission.actions - a comma separated list of actions.JpsException - if an error occurs while creating the entry.public static PermissionEntry newPermissionEntry(java.lang.String resourceTypeName, java.lang.String permClass, java.lang.String targetName, java.lang.String actions) throws JpsException
permClass - the Java class implementing the permissiontargetName - the target of the permissionactions - a comma separated list of actionsresourceTypeName - the name of the resource type associated with this permissionJpsExceptionpublic static PermissionEntry newPermissionEntry(java.lang.String displayName, java.lang.String description, java.lang.String permClass, java.lang.String targetName, java.lang.String actions) throws JpsException
displayName - the display name for this permission.description - the description for this permission.permClass - the Java class implementing the Permission.targetName - the target of the permission.actions - a comma separated list of actions.JpsException - if an error occurs while creating the entry.public static ResourceEntry newResourceEntry(java.lang.String displayName, java.lang.String descr, java.lang.String type, java.lang.String name) throws JpsException
displayName: - Display name of type, if any.descr - Description of type, if any.type - Type of this resource instance.name - Name of actual resource(s) this ResourceEntry points to.JpsException - if an error occurs while creating the entry.public static ResourceTypeEntry newResourceTypeEntry(java.lang.String name, java.lang.String displayName, java.lang.String descr, java.lang.String provider, java.lang.String matcher, java.util.Set<java.lang.String> allowedActions, java.lang.String delimiter) throws JpsException
name - Name of resource type. Required.displayName - Display name of type, if any.descr - Description of type, if any.provider - Resource provider class name. If null, the default resource provider will be used.matcher - Java Permission that protects the Resource.allowedActions - Set of actions allowed on a resource of this type. Can be null. Delimiter should not be a part of any action string. Every individual action string should represent a single action.delimiter - Delimiter used for multiple actions of this resource type. Can be null. If it is null, then it will be defaulted to ','.JpsException - if name provided is null or if an error occurs while creating the entry.public static ResourceActionsEntry newResourceActionsEntry(ResourceEntry resource, java.util.Set<java.lang.String> actions) throws JpsException
resource - the resource (required)actions - the actions.JpsException - if there is an error while creating the ResourceActionsEntry.public static ResourceActionsEntry newResourceActionsEntry(java.lang.String resourceType, java.lang.String resourceName, java.util.Set<java.lang.String> actions, java.lang.String appid) throws JpsException
resourceType - type of the resource, cannot be null.resourceName - name of the resource, cannot be null.actions - set of actions (should be a subset of all actions of the resource type. can be null.appid - name of application policy to associate with the resource, cannot be null. The value is ignored when creating a PermissionSet and it is utilized by the PolicyStore.checkBulkAuthorization(javax.security.auth.Subject, java.util.Set) APIJpsException - if there is an error while creating the ResourceActionsEntry.
This ResourceActionsEntry will not have a display name and description associated with the resource.
public static PermissionSetEntry newPermissionSet(java.lang.String name, java.lang.String displayName, java.lang.String description, java.util.Set<ResourceActionsEntry> resourceActions) throws JpsException
name - Name of resource type. Required.displayName - Display name of type, if any.description - Description of type, if any.resourceActions - set of ResourceActions.JpsException - if name provided is null or if an error occurs while creating the entry.public static RoleCategoryEntry newRoleCategoryEntry(java.lang.String name, java.lang.String displayName, java.lang.String descr) throws JpsException
name - Name of role category. Required.displayName - Display name of category, if any.descr - Description of category, if any.JpsException - if name provided is null or if an error occurs while creating the entry.