com.bea.ales.management
Class ResourceManager

java.lang.Object
  |
  +--com.bea.ales.management.ResourceManager

public class ResourceManager
extends java.lang.Object

This class manages resources. It provides methods to create, delete, rename and find resources.


Field Summary
static int BINDING_TYPE_ALL
          Specifies any binding type.
static int BINDING_TYPE_BOUND
          Specifies unbound binding type.
static int BINDING_TYPE_UNBOUND
          Specifies bound binding type.
 
Method Summary
 Resource create(java.lang.String resourceName)
          Create the resource by fully qualified name.
 Resource create(java.lang.String resourceName, java.lang.String description, boolean isBinding, boolean isDistPoint, boolean isAllowVirtualResource)
          Create resource by fully qualified name.
 Resource get(java.lang.String resourceName)
          Get a resource by fully qualified name.
 ResourceQueryResult getBindingNodes(java.lang.String queryString, int bindingType)
          Find all binding resources in the system which has the specified binding type and matches the given the filter string.
 ResourceQueryResult getDistributionPoints(java.lang.String queryString)
          Find all distribution points in the system which matches the given the filter string.
 Resource getParent(java.lang.String childResName)
          Get the parent for the specified resource.
 void remove(Resource res, boolean isCascade)
          Remove the resource and all its children.
 void remove(java.lang.String resourceName, boolean isCascade)
          Remove the resource by fully qualified name and all its children .
 void rename(Resource res, java.lang.String newRelativeName)
          Rename the resource to the given name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BINDING_TYPE_ALL

public static final int BINDING_TYPE_ALL
Specifies any binding type.

BINDING_TYPE_BOUND

public static final int BINDING_TYPE_BOUND
Specifies unbound binding type.

BINDING_TYPE_UNBOUND

public static final int BINDING_TYPE_UNBOUND
Specifies bound binding type.
Method Detail

create

public Resource create(java.lang.String resourceName)
                throws ManagementException
Create the resource by fully qualified name. Fully qualified names is //resources/. isBinding, isDistributionPoint, and isAllowVirtualResource for the resource are set to false by default.

Parameters:
resourceName - the fully qualified resource name.
Returns:
the resource object created.
Throws:
ManagementException - if the operation fails.

create

public Resource create(java.lang.String resourceName,
                       java.lang.String description,
                       boolean isBinding,
                       boolean isDistPoint,
                       boolean isAllowVirtualResource)
                throws ManagementException
Create resource by fully qualified name. Fully qualified names in the entitlements UI are //resources/

Parameters:
resourceName - the fully qualified resource name.
description - description for the resource.
isBinding - This parameter is only useful for DefaultApp, it will be ignored with other application. For default application, true if the resource is a binding node, or false if not.
isDistPoint - true if the resource is a distribution point, or false if not.
isAllowVirtualResource - true if the resource is virtual resource, or false if not.
Returns:
the resource instance created
Throws:
ManagementException - if the operation fails. *

get

public Resource get(java.lang.String resourceName)
             throws ManagementException
Get a resource by fully qualified name. Fully qualified names is like //resources/.

Parameters:
resourceName - the fully qualified name of the resource.
Returns:
the resource object found, or null if not found.
Throws:
ManagementException - if the operation fails.

remove

public void remove(java.lang.String resourceName,
                   boolean isCascade)
            throws ManagementException
Remove the resource by fully qualified name and all its children . Fully qualified names are like //resources/.

Parameters:
resourceName - the fully qualified name of the resource to be removed.
isCacade - true for removing the resource and all its related policies, or false for only removing resource
Throws:
ManagementException - if the operation fails.

remove

public void remove(Resource res,
                   boolean isCascade)
            throws ManagementException
Remove the resource and all its children.

Parameters:
res - the resource instance to be removed
isCacade - true for removing the resource and all its related policies, or false for only removing resource
Throws:
ManagementException - if the operation fails.

rename

public void rename(Resource res,
                   java.lang.String newRelativeName)
            throws ManagementException
Rename the resource to the given name.

Parameters:
res - the resource instance to be renamed
newRelativeName - the new relative name for the resource

getParent

public Resource getParent(java.lang.String childResName)
                   throws ManagementException
Get the parent for the specified resource.

Parameters:
childResName - fully qualified resource name of the child.
Returns:
parent the resource for the parent resource.

getBindingNodes

public ResourceQueryResult getBindingNodes(java.lang.String queryString,
                                           int bindingType)
                                    throws ManagementException
Find all binding resources in the system which has the specified binding type and matches the given the filter string.

Parameters:
queryString - the pattern that the resources matches.
bindingType - one of the following value BINDING_TYPE_ALL and BINDING_TYPE_UNBOUND or BINDING_TYPE_BOUND
Returns:
the ResourceQueryResult instance which contains the resources found.
Throws:
ManagementException - if the operation fails.

getDistributionPoints

public ResourceQueryResult getDistributionPoints(java.lang.String queryString)
                                          throws ManagementException
Find all distribution points in the system which matches the given the filter string.

Parameters:
queryString - the pattern that the resources matches.
Returns:
the ResourceQueryResult instance which contains the resources found.
Throws:
ManagementException - if the operation fails.


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