com.wles.blm
Class BLMApplicationManager

java.lang.Object
  extended bycom.wles.blm.BLMComponentManager
      extended bycom.wles.blm.BLMApplicationManager

public class BLMApplicationManager
extends BLMComponentManager

Manages all the operations on resources. In addition to creating, renaming, removing and reporting functions the class also manages retrieving the engine bound to the specific resource binding nodes. Resource names are specified in a qualified format, the format is //app/policy/resourceA/resourceB/resourceC. Resource names must start with the prefix //app/policy/, which is the root of the resource tree. Use a BLMContextManager to obtain an instance of a BLMApplicationManager.

See Also:
BLMContextManager

Field Summary
static int ATTRIBUTE_QUERY_TYPE_DIRECT
          Attribute query type specifiying the attribute value assinged directly to the resource.
static int ATTRIBUTE_QUERY_TYPE_ENFORCED
          Attribute query type specifiying the attribute value based on resource attribute inheritance.
static int ATTRIBUTE_QUERY_TYPE_INHERITED
          Attribute query type specifiying the attribute value assinged to an ancestor of the resource.
static int BINDING_TYPE_ALL
          Specifies any binding type.
static int BINDING_TYPE_BOUND
          Specifies unbound bindinding type.
static int BINDING_TYPE_UNBOUND
          Specifies bound binding type.
static java.lang.String RESOURCE_TYPE_APPLICATION
          Application resource type, used to designate the logical root of an application.
static java.lang.String RESOURCE_TYPE_BASIC
          Basic resource type, a resoure below a binding node.
static java.lang.String RESOURCE_TYPE_BINDING
          Binding resource type, used to designate a resource which may be bound to an SSM.
static java.lang.String RESOURCE_TYPE_ORGINIZATIONAL
          Orginization resource type is used to designate top level resources.
 
Method Summary
 void copyObjects(java.lang.String nodeName, java.lang.String pasteUnderNodeName)
          Copies resources and their attributes and pastes them under another resource.
 void create(java.lang.String name, boolean isBinding)
          Create a new resource.
 java.lang.String filter(java.lang.String findPattern)
          Finds a set of matching resource names based on a filter pattern.
 boolean find(java.lang.String cID, java.lang.String name)
          Checks for a resource in a resource collection.
 java.lang.String getApplicationNodes(java.lang.String filterString)
          Finds application node resources matching a specified filter pattern.
 java.lang.String getAttributes(java.lang.String name, int attrQueryType)
          Finds the attributes for a resource.
 java.lang.String getBindingNodes(java.lang.String filterString, int bindingType)
          Finds all binding nodes matching a specified filter pattern.
 int getCount(java.lang.String cID)
          Returns the size of the resource or resource attribute collection.
 java.lang.String getDeletedObjects(java.lang.String objectPrefix)
          Finds all resources which have been deleted but the deletion notification has not yet been distributed.
 java.lang.String getDescription(java.lang.String name)
          Get a description for an application resource.
 java.lang.String getDirectDescendantsApplications(java.lang.String name, java.lang.String filterString)
          Finds the resources who are direct decendents of the specified resource.
 java.lang.String getDistributionPointNodes(java.lang.String filterString)
          Find distribution point resources matching a specified filter pattern.
 java.lang.String getNewObjects(java.lang.String objectPrefix)
          Finds all newly created resources which have not yet been deployed.
 java.lang.String[] getReport(java.lang.String cID)
          Returns a report on a a resource collection.
 java.lang.String[] getReport(java.lang.String cID, int iStart, int iCount)
          Returns a report on a subset of a resource collection.
 AttributeElement[] getReportOnAppAttributes(java.lang.String cID)
          Returns a report on a resource attribute collection.
 AttributeElement[] getReportOnAppAttributes(java.lang.String cID, int iStart, int iCount)
          Returns a report on a subset of a resource attribute collection.
 AttributeElement getResourceAttribute(java.lang.String name, java.lang.String attrName, int attrQueryType)
          Gets a resource's attribute value.
 java.lang.String getSSM(java.lang.String resourceName)
          Returns the name of the SSM to which the resource is bound.
 java.lang.String getType(java.lang.String name)
          Gets the type code of the resource
 boolean isApplicationNode(java.lang.String name)
          Determine if the specified resource is an application resource.
 boolean isBindingNode(java.lang.String name)
          Determines if the specified resource is a binding resource.
 boolean isDistributionPoint(java.lang.String name)
          Determines if the specified resource is a distribution point.
 boolean isGuarded(java.lang.String name)
          Checks if the specified resource is bound to an engine.
 boolean isLeaf(java.lang.String name)
          Determines if the specified resource is a leaf, i.e. resource with no defined children.
 boolean isVirtualResourceAllowed(java.lang.String name)
          Determines if the specified resource may have virtual children.
 void release(java.lang.String cID)
          Releases the a resource or resource attribute collection.
 void remove(java.lang.String name)
          Removes a resource from the system.
 void removeCascade(java.lang.String name)
          Removes a resource and all related elements from the system.
 void removeResourceAttribute(java.lang.String name, java.lang.String attrName)
          Removes an attribute assignment from a resource.
 void rename(java.lang.String oldName, java.lang.String newName)
          Renames a resource in the system.
 void setApplicationNode(java.lang.String name, boolean isApplication)
          Specifies a resource as an application, or unset it.
 void setDescription(java.lang.String name, java.lang.String description)
          Adds or resets a description for an application resource.
 void setDistributionPoint(java.lang.String name, boolean isDistributionPoint)
          Specifies a resource as a distribution point, or undeclare it.
 void setResourceAttribute(java.lang.String name, AttributeElement attrElem)
          Creates or reset an attribute value for a resource.
 void setVirtualResourceAllowed(java.lang.String name, boolean allowVirtualChildren)
          Specifies if a resource may have virtual children or not.
 void unsetVirtualResourceAllowed(java.lang.String name)
          Unsets a resources virtual resource setting.
 
Methods inherited from class com.wles.blm.BLMComponentManager
create
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRIBUTE_QUERY_TYPE_DIRECT

public static final int ATTRIBUTE_QUERY_TYPE_DIRECT
Attribute query type specifiying the attribute value assinged directly to the resource.

See Also:
Constant Field Values

ATTRIBUTE_QUERY_TYPE_ENFORCED

public static final int ATTRIBUTE_QUERY_TYPE_ENFORCED
Attribute query type specifiying the attribute value based on resource attribute inheritance.

See Also:
Constant Field Values

ATTRIBUTE_QUERY_TYPE_INHERITED

public static final int ATTRIBUTE_QUERY_TYPE_INHERITED
Attribute query type specifiying the attribute value assinged to an ancestor of the resource.

See Also:
Constant Field Values

BINDING_TYPE_ALL

public static final int BINDING_TYPE_ALL
Specifies any binding type.

See Also:
Constant Field Values

BINDING_TYPE_BOUND

public static final int BINDING_TYPE_BOUND
Specifies unbound bindinding type.

See Also:
Constant Field Values

BINDING_TYPE_UNBOUND

public static final int BINDING_TYPE_UNBOUND
Specifies bound binding type.

See Also:
Constant Field Values

RESOURCE_TYPE_APPLICATION

public static final java.lang.String RESOURCE_TYPE_APPLICATION
Application resource type, used to designate the logical root of an application. Organizational and binding resources may also act as application resources.

See Also:
Constant Field Values

RESOURCE_TYPE_BASIC

public static final java.lang.String RESOURCE_TYPE_BASIC
Basic resource type, a resoure below a binding node.

See Also:
Constant Field Values

RESOURCE_TYPE_BINDING

public static final java.lang.String RESOURCE_TYPE_BINDING
Binding resource type, used to designate a resource which may be bound to an SSM.

See Also:
Constant Field Values

RESOURCE_TYPE_ORGINIZATIONAL

public static final java.lang.String RESOURCE_TYPE_ORGINIZATIONAL
Orginization resource type is used to designate top level resources. i.e. those resources above binding nodes.

See Also:
Constant Field Values
Method Detail

copyObjects

public void copyObjects(java.lang.String nodeName,
                        java.lang.String pasteUnderNodeName)
                 throws com.wles.blm.BLMException
Copies resources and their attributes and pastes them under another resource. Not every node can be copied since the action must not cause resource type conflicts with the existing resources. For instance you cannot paste one binding node beneath another.

Parameters:
nodeName - The resource name to copy, all child resources will be copied as well. Use fully qualified object name.
pasteUnderNodeName - Resource under which to paste the selected resources. Use fully qualified object name.
Throws:
com.wles.blm.BLMException - on failure

create

public void create(java.lang.String name,
                   boolean isBinding)
            throws com.wles.blm.BLMException
Create a new resource. The specified resource's parent resource(s) must already exist to create the child. For example //app/policy/foo must exist in order to create //app/policy/foo/bar

Parameters:
name - Fully qualified name of the resource to be created
isBinding - specify if this is a binding node
Throws:
com.wles.blm.BLMException

filter

public java.lang.String filter(java.lang.String findPattern)
                        throws com.wles.blm.BLMException
Finds a set of matching resource names based on a filter pattern. Returns a resource collection id.

Specified by:
filter in class BLMComponentManager
Parameters:
findPattern - Pattern for the filter eg. "//app/policy/MyApp/*"
Returns:
String unique String id to the collection found
Throws:
com.wles.blm.BLMException
See Also:
getReport(String cID), getReport(String cID, int iStart, int iCount), getCount(String CID), release(String cID), find(String cID, String name)

find

public boolean find(java.lang.String cID,
                    java.lang.String name)
             throws com.wles.blm.BLMException
Checks for a resource in a resource collection. Returns true if given resource is found in the collection

Specified by:
find in class BLMComponentManager
Parameters:
cID - collection ID of the collection
name - fully qualified name of the resource
Returns:
boolean
Throws:
com.wles.blm.BLMException

getApplicationNodes

public java.lang.String getApplicationNodes(java.lang.String filterString)
                                     throws com.wles.blm.BLMException
Finds application node resources matching a specified filter pattern. Returns an resource collection ID.

Parameters:
filterString - filter pattern for resource names
Returns:
String Unique collection id
Throws:
com.wles.blm.BLMException
See Also:
getReport(String cID), getReport(String cID, int iStart, int iCount), getCount(String CID), release(String cID), find(String cID, String name)

getAttributes

public java.lang.String getAttributes(java.lang.String name,
                                      int attrQueryType)
                               throws com.wles.blm.BLMException
Finds the attributes for a resource. attrQueryType may be used to take attribute inheritance into account. Returns an resource attribute collection.

Parameters:
name - Fully qualified name of the resource
attrQueryType - one of ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED
Returns:
String id to the collection found
Throws:
com.wles.blm.BLMException
See Also:
getReportOnAppAttributes(String cID), getReportOnAppAttributes(String cID, int iStart, int iCount), getCount(String cID), release(String cID), ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED

getBindingNodes

public java.lang.String getBindingNodes(java.lang.String filterString,
                                        int bindingType)
                                 throws com.wles.blm.BLMException
Finds all binding nodes matching a specified filter pattern. Returns an resource collection ID.

Parameters:
filterString - filter pattern for resource names
bindingType - either BINDING_TYPE_ALL, BINDING_TYPE_BOUND, BINDING_TYPE_UNBOUND
Returns:
String Unique collection id
Throws:
com.wles.blm.BLMException
See Also:
getReport(String cID), getReport(String cID, int iStart, int iCount), getCount(String CID), release(String cID), find(String cID, String name), BINDING_TYPE_ALL, BINDING_TYPE_BOUND, BINDING_TYPE_UNBOUND

getCount

public int getCount(java.lang.String cID)
             throws com.wles.blm.BLMException
Returns the size of the resource or resource attribute collection.

Specified by:
getCount in class BLMComponentManager
Parameters:
cID - ID of the collection, either resource or resource attribute collection IDs may be used.
Returns:
int size of the collection
Throws:
com.wles.blm.BLMException

getDeletedObjects

public java.lang.String getDeletedObjects(java.lang.String objectPrefix)
                                   throws com.wles.blm.BLMException
Finds all resources which have been deleted but the deletion notification has not yet been distributed. Returns a resource collection ID.

Parameters:
objectPrefix - Prefix of the resources that should be used during the search, e.g. //app/policy/BindingPoint/MyResources. The method will return resources that start with the objectPrefix prefix only.
Returns:
collection ID
Throws:
com.wles.blm.BLMException
See Also:
getReport(String cID), getReport(String cID, int iStart, int iCount), getCount(String CID), release(String cID), find(String cID, String name)

getDescription

public java.lang.String getDescription(java.lang.String name)
                                throws com.wles.blm.BLMException
Get a description for an application resource.

Parameters:
name - Fully qualified name of the resource
Returns:
String The resource description
Throws:
com.wles.blm.BLMException

getDirectDescendantsApplications

public java.lang.String getDirectDescendantsApplications(java.lang.String name,
                                                         java.lang.String filterString)
                                                  throws com.wles.blm.BLMException
Finds the resources who are direct decendents of the specified resource. Returns a resource collection ID.

Parameters:
name - Fully qualified name of the resource
Returns:
String Unique String id to Collection found
Throws:
com.wles.blm.BLMException
See Also:
getReport(String cID), getReport(String cID, int iStart, int iCount), getCount(String CID), release(String cID), find(String cID, String name)

getDistributionPointNodes

public java.lang.String getDistributionPointNodes(java.lang.String filterString)
                                           throws com.wles.blm.BLMException
Find distribution point resources matching a specified filter pattern. Returns a resource collection ID.

Parameters:
filterString - filter pattern for resource names.
Returns:
String Unique collection id
Throws:
com.wles.blm.BLMException
See Also:
getReport(String cID), getReport(String cID, int iStart, int iCount), getCount(String CID), release(String cID), find(String cID, String name)

getNewObjects

public java.lang.String getNewObjects(java.lang.String objectPrefix)
                               throws com.wles.blm.BLMException
Finds all newly created resources which have not yet been deployed. Returns an ID to the collection of resources.

Parameters:
objectPrefix - Prefix of the resources that should be used during the search, e.g. //app/policy/BindingPoint/MyResources. The method will return resources that start with the objectPrefix prefix only.
Returns:
String Unique collection id
Throws:
com.wles.blm.BLMException
See Also:
getReport(String cID), getReport(String cID, int iStart, int iCount), getCount(String CID), release(String cID), find(String cID, String name)

getReport

public java.lang.String[] getReport(java.lang.String cID)
                             throws com.wles.blm.BLMException
Returns a report on a a resource collection.

Parameters:
cID - ID of the collection
Returns:
A String array of resource names from the collection.
Throws:
com.wles.blm.BLMException

getReport

public java.lang.String[] getReport(java.lang.String cID,
                                    int iStart,
                                    int iCount)
                             throws com.wles.blm.BLMException
Returns a report on a subset of a resource collection.

Parameters:
cID - ID of the collection
iStart - Start index in the collection
iCount - Number of objects. Set -1 for all objects.
Returns:
A String array of resource names from the collection.
Throws:
com.wles.blm.BLMException

getReportOnAppAttributes

public AttributeElement[] getReportOnAppAttributes(java.lang.String cID)
                                            throws com.wles.blm.BLMException,
                                                   BadParameterException
Returns a report on a resource attribute collection.

Parameters:
cID - ID of a resource attribute collection
Returns:
an array of AttributeElement objects from the collection
Throws:
com.wles.blm.BLMException
BadParameterException

getReportOnAppAttributes

public AttributeElement[] getReportOnAppAttributes(java.lang.String cID,
                                                   int iStart,
                                                   int iCount)
                                            throws com.wles.blm.BLMException,
                                                   BadParameterException
Returns a report on a subset of a resource attribute collection.

Parameters:
cID - ID of a resource attribute collection
iStart - Start index in the collection
iCount - Number of objects. Set -1 for all objects.
Returns:
an array of AttributeElement objects from the collection
Throws:
com.wles.blm.BLMException
BadParameterException

getResourceAttribute

public AttributeElement getResourceAttribute(java.lang.String name,
                                             java.lang.String attrName,
                                             int attrQueryType)
                                      throws com.wles.blm.BLMException,
                                             BadParameterException
Gets a resource's attribute value. The query type can be specified to take attribute inheritance into account.

Parameters:
name - Fully qualified name of the resource
attrName - Attribute name
attrQueryType - Attribute query type, one of ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED
Returns:
AttributeElement object containing the value. A null is returned if the specified attribute is not defined for this resource.
Throws:
com.wles.blm.BLMException
BadParameterException
See Also:
ATTRIBUTE_QUERY_TYPE_DIRECT, ATTRIBUTE_QUERY_TYPE_INHERITED, ATTRIBUTE_QUERY_TYPE_ENFORCED

getSSM

public java.lang.String getSSM(java.lang.String resourceName)
                        throws com.wles.blm.BLMException
Returns the name of the SSM to which the resource is bound. Use it with resources that are binding points otherwise it returns null.

Parameters:
resourceName - a fully qualified name of the resource
Returns:
SSM name to which the resource is bound or null if the resource is not bound or is not a binding point.
Throws:
com.wles.blm.BLMException

getType

public java.lang.String getType(java.lang.String name)
                         throws com.wles.blm.BLMException
Gets the type code of the resource

Parameters:
name - Fully qualified name of the resource
Returns:
the node type, one of RESOURCE_TYPE_ORGINIZATIONAL, RESOURCE_TYPE_APPLICATION, RESOURCE_TYPE_BINDING, RESOURCE_TYPE_BASIC
Throws:
com.wles.blm.BLMException
See Also:
RESOURCE_TYPE_ORGINIZATIONAL, RESOURCE_TYPE_APPLICATION, RESOURCE_TYPE_BINDING, RESOURCE_TYPE_BASIC

isApplicationNode

public boolean isApplicationNode(java.lang.String name)
                          throws com.wles.blm.BLMException
Determine if the specified resource is an application resource.

Parameters:
name - Fully qualified name of resource
Returns:
true if it is an application resource
Throws:
com.wles.blm.BLMException

isBindingNode

public boolean isBindingNode(java.lang.String name)
                      throws com.wles.blm.BLMException
Determines if the specified resource is a binding resource.

Parameters:
name - Fully qualified name of resource
Returns:
true if the resource is a binding resource
Throws:
com.wles.blm.BLMException

isDistributionPoint

public boolean isDistributionPoint(java.lang.String name)
                            throws com.wles.blm.BLMException
Determines if the specified resource is a distribution point.

Parameters:
name - Fully qualified name of resource
Returns:
true if the resource is a distribution point
Throws:
com.wles.blm.BLMException

isGuarded

public boolean isGuarded(java.lang.String name)
                  throws com.wles.blm.BLMException
Checks if the specified resource is bound to an engine.

Parameters:
name - Fully qualified name of resource
Returns:
true if bound
Throws:
com.wles.blm.BLMException

isLeaf

public boolean isLeaf(java.lang.String name)
               throws com.wles.blm.BLMException
Determines if the specified resource is a leaf, i.e. resource with no defined children.

Parameters:
name - Fully qualified name of resource
Returns:
boolean
Throws:
com.wles.blm.BLMException

isVirtualResourceAllowed

public boolean isVirtualResourceAllowed(java.lang.String name)
                                 throws com.wles.blm.BLMException,
                                        BadParameterException
Determines if the specified resource may have virtual children.

Parameters:
name - Fully qualified name of resource
Returns:
true if the resource is allowed to have virtual children.
Throws:
com.wles.blm.BLMException
BadParameterException

release

public void release(java.lang.String cID)
             throws com.wles.blm.BLMException
Releases the a resource or resource attribute collection. Supplying a null collection id will cause all held collections to be released.

Specified by:
release in class BLMComponentManager
Parameters:
cID - ID of the collection
Returns:
void
Throws:
com.wles.blm.BLMException

remove

public void remove(java.lang.String name)
            throws com.wles.blm.BLMException
Removes a resource from the system.

Specified by:
remove in class BLMComponentManager
Parameters:
name - Fully qualified name of the resource
Throws:
com.wles.blm.BLMException

removeCascade

public void removeCascade(java.lang.String name)
                   throws com.wles.blm.BLMException
Removes a resource and all related elements from the system. This includes associated resource attributes, children, and rules referencing this resource or its childern.

Parameters:
name - Fully qualified name of the resource
Throws:
com.wles.blm.BLMException

removeResourceAttribute

public void removeResourceAttribute(java.lang.String name,
                                    java.lang.String attrName)
                             throws com.wles.blm.BLMException,
                                    BadParameterException
Removes an attribute assignment from a resource.

Parameters:
name - Fully qualified name of the resource
attrName - the name of the attribute to remove
Returns:
void
Throws:
com.wles.blm.BLMException
BadParameterException

rename

public void rename(java.lang.String oldName,
                   java.lang.String newName)
            throws com.wles.blm.BLMException
Renames a resource in the system. Any rules referencing this resource will automatically be updated with the new name.

Specified by:
rename in class BLMComponentManager
Parameters:
oldName - Fully qualified old name of the resource
newName - Fully qualified new name of the resource
Returns:
boolean true = success
Throws:
com.wles.blm.BLMException

setApplicationNode

public void setApplicationNode(java.lang.String name,
                               boolean isApplication)
                        throws com.wles.blm.BLMException
Specifies a resource as an application, or unset it.

Parameters:
name - Fully qualified name of the resource
isApplication - true/false
Returns:
void
Throws:
com.wles.blm.BLMException

setDescription

public void setDescription(java.lang.String name,
                           java.lang.String description)
                    throws com.wles.blm.BLMException
Adds or resets a description for an application resource.

Parameters:
name - Fully qualified name of the resource
description - the resource description. When blank or null any existing description will be deleted.
Returns:
void
Throws:
com.wles.blm.BLMException

setDistributionPoint

public void setDistributionPoint(java.lang.String name,
                                 boolean isDistributionPoint)
                          throws com.wles.blm.BLMException
Specifies a resource as a distribution point, or undeclare it.

Parameters:
name - Fully qualified name of the resource
isDistributionPoint - true/false
Returns:
void
Throws:
com.wles.blm.BLMException

setResourceAttribute

public void setResourceAttribute(java.lang.String name,
                                 AttributeElement attrElem)
                          throws com.wles.blm.BLMException,
                                 BadParameterException
Creates or reset an attribute value for a resource.

Parameters:
name - Fully qualified name of the resource
attrElem - the attribute to create or reset
Returns:
void
Throws:
com.wles.blm.BLMException
BadParameterException

setVirtualResourceAllowed

public void setVirtualResourceAllowed(java.lang.String name,
                                      boolean allowVirtualChildren)
                               throws com.wles.blm.BLMException,
                                      BadParameterException
Specifies if a resource may have virtual children or not. This will override any setting inherited from the resource's ancestors.

Parameters:
name - Fully qualified name of the resource
allowVirtualChildren - true/false
Returns:
void
Throws:
com.wles.blm.BLMException
BadParameterException

unsetVirtualResourceAllowed

public void unsetVirtualResourceAllowed(java.lang.String name)
                                 throws com.wles.blm.BLMException,
                                        BadParameterException
Unsets a resources virtual resource setting. The resource will then rely on the inherited setting from its ancestors to determine if it may have virtual children.

Parameters:
name - Fully qualified name of the resource
Returns:
void
Throws:
com.wles.blm.BLMException
BadParameterException


Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.