org.rhq.enterprise.server.resource
Class ResourceFactoryManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.resource.ResourceFactoryManagerBean
All Implemented Interfaces:
ResourceFactoryManagerLocal, ResourceFactoryManagerRemote

public class ResourceFactoryManagerBean
extends Object
implements ResourceFactoryManagerLocal, ResourceFactoryManagerRemote

Bean to handle interaction with the resource factory subsystem of the plugin container. !! Warning, the factory interface is there to remove managed things from disk. Use caution when using this and don't confuse it with removing something from the system inventory. !!

Author:
Jason Dobies

Constructor Summary
ResourceFactoryManagerBean()
           
 
Method Summary
 void checkForTimedOutRequests()
          Will check to see if any in progress resource creation jobs are taking too long to finish and if so marks them as failed.
 void completeCreateResource(CreateResourceResponse response)
          For documentation, see ResourceFactoryServerService.completeCreateResource(org.rhq.core.clientapi.agent.inventory.CreateResourceResponse) .
 void completeDeleteResourceRequest(DeleteResourceResponse response)
          For documentation, see ResourceFactoryServerService.completeDeleteResourceRequest(org.rhq.core.clientapi.agent.inventory.DeleteResourceResponse) .
 org.rhq.core.domain.resource.CreateResourceHistory createPackageBackedResource(org.rhq.core.domain.auth.Subject subject, int parentResourceId, int newResourceTypeId, String newResourceName, org.rhq.core.domain.configuration.Configuration pluginConfiguration, String packageName, String packageVersionNumber, Integer architectureId, org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration, byte[] packageBits)
           
 org.rhq.core.domain.resource.CreateResourceHistory createPackageBackedResource(org.rhq.core.domain.auth.Subject subject, int parentResourceId, int newResourceTypeId, String newResourceName, org.rhq.core.domain.configuration.Configuration pluginConfiguration, String packageName, String packageVersionNumber, Integer architectureId, org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration, byte[] packageBits, Integer timeout)
          Creates a new physical resource.
 org.rhq.core.domain.resource.CreateResourceHistory createPackageBackedResourceViaPackageVersion(org.rhq.core.domain.auth.Subject subject, int parentResourceId, int newResourceTypeId, String newResourceName, org.rhq.core.domain.configuration.Configuration pluginConfiguration, org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration, int packageVersionId)
           
 org.rhq.core.domain.resource.CreateResourceHistory createPackageBackedResourceViaPackageVersion(org.rhq.core.domain.auth.Subject subject, int parentResourceId, int newResourceTypeId, String newResourceName, org.rhq.core.domain.configuration.Configuration pluginConfiguration, org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration, int packageVersionId, Integer timeout)
          Creates a new physical resource.
 org.rhq.core.domain.resource.CreateResourceHistory createResource(org.rhq.core.domain.auth.Subject user, int parentResourceId, int resourceTypeId, String resourceName, org.rhq.core.domain.configuration.Configuration pluginConfiguration, org.rhq.core.domain.configuration.Configuration resourceConfiguration)
           
 org.rhq.core.domain.resource.CreateResourceHistory createResource(org.rhq.core.domain.auth.Subject user, int parentResourceId, int resourceTypeId, String resourceName, org.rhq.core.domain.configuration.Configuration pluginConfiguration, org.rhq.core.domain.configuration.Configuration resourceConfiguration, Integer timeout)
          Creates a new physical resource.
 org.rhq.core.domain.resource.CreateResourceHistory createResource(org.rhq.core.domain.auth.Subject user, int parentResourceId, int newResourceTypeId, String newResourceName, org.rhq.core.domain.configuration.Configuration pluginConfiguration, String packageName, String packageVersionNumber, Integer architectureId, org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration, InputStream packageBitStream)
          Creates a new physical resource.
 org.rhq.core.domain.resource.CreateResourceHistory createResource(org.rhq.core.domain.auth.Subject user, int parentResourceId, int newResourceTypeId, String newResourceName, org.rhq.core.domain.configuration.Configuration pluginConfiguration, String packageName, String packageVersionNumber, Integer architectureId, org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration, InputStream packageBitStream, Map<String,String> packageUploadDetails)
           
 org.rhq.core.domain.resource.CreateResourceHistory createResource(org.rhq.core.domain.auth.Subject user, int parentResourceId, int newResourceTypeId, String newResourceName, org.rhq.core.domain.configuration.Configuration pluginConfiguration, String packageName, String packageVersionNumber, Integer architectureId, org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration, InputStream packageBitStream, Map<String,String> packageUploadDetails, Integer timeout)
           
 org.rhq.core.domain.resource.DeleteResourceHistory deleteResource(org.rhq.core.domain.auth.Subject subject, int resourceId)
          Deletes a physical resource from the agent machine.
 List<org.rhq.core.domain.resource.DeleteResourceHistory> deleteResources(org.rhq.core.domain.auth.Subject user, int[] resourceIds)
          Deletes physical resources from the agent machine.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.CreateResourceHistory> findCreateChildResourceHistory(org.rhq.core.domain.auth.Subject subject, int parentResourceId, Long beginDate, Long endDate, org.rhq.core.domain.util.PageControl pageControl)
          Returns a pagination enabled list of requests for the creation of new child resources to the specified parent.
 org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.DeleteResourceHistory> findDeleteChildResourceHistory(org.rhq.core.domain.auth.Subject subject, int parentResourceId, Long beginDate, Long endDate, org.rhq.core.domain.util.PageControl pageControl)
          Returns a pagination enabled list of requests to delete a child resource on the specified parent.
 int getCreateChildResourceHistoryCount(int parentResourceId, Long beginDate, Long endDate)
          Returns the number of requests to create a new child resource under the specified parent known to the system.
 org.rhq.core.domain.resource.CreateResourceHistory getCreateHistoryItem(int historyItemId)
          Returns the history item corresponding to the specified ID.
 int getDeleteChildResourceHistoryCount(int parentResourceId, Long beginDate, Long endDate)
          Returns the number of requests to delete a child resource from the specified parent resource.
 org.rhq.core.domain.resource.CreateResourceHistory persistCreateHistory(org.rhq.core.domain.auth.Subject user, int parentResourceId, int resourceTypeId, String createResourceName, org.rhq.core.domain.configuration.Configuration configuration)
          Persists a record in the resource history to indicate a request has been made to create a configuration-backed resource.
 org.rhq.core.domain.resource.CreateResourceHistory persistCreateHistory(org.rhq.core.domain.auth.Subject user, int parentResourceId, int resourceTypeId, String createResourceName, org.rhq.core.domain.content.PackageVersion packageVersion, org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration)
          Persists a record in the resource history to indicate a request has been made to create an package-backed resource.
 org.rhq.core.domain.resource.DeleteResourceHistory persistDeleteHistory(org.rhq.core.domain.auth.Subject user, int resourceId)
          Persists a record in the resource history to indicate a request has been made to delete a resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceFactoryManagerBean

public ResourceFactoryManagerBean()
Method Detail

completeCreateResource

public void completeCreateResource(CreateResourceResponse response)
Description copied from interface: ResourceFactoryManagerLocal
For documentation, see ResourceFactoryServerService.completeCreateResource(org.rhq.core.clientapi.agent.inventory.CreateResourceResponse) .

Specified by:
completeCreateResource in interface ResourceFactoryManagerLocal

completeDeleteResourceRequest

public void completeDeleteResourceRequest(DeleteResourceResponse response)
Description copied from interface: ResourceFactoryManagerLocal
For documentation, see ResourceFactoryServerService.completeDeleteResourceRequest(org.rhq.core.clientapi.agent.inventory.DeleteResourceResponse) .

Specified by:
completeDeleteResourceRequest in interface ResourceFactoryManagerLocal

checkForTimedOutRequests

public void checkForTimedOutRequests()
Description copied from interface: ResourceFactoryManagerLocal
Will check to see if any in progress resource creation jobs are taking too long to finish and if so marks them as failed. This method will be perodically called by the server.

Specified by:
checkForTimedOutRequests in interface ResourceFactoryManagerLocal

persistCreateHistory

public org.rhq.core.domain.resource.CreateResourceHistory persistCreateHistory(org.rhq.core.domain.auth.Subject user,
                                                                               int parentResourceId,
                                                                               int resourceTypeId,
                                                                               String createResourceName,
                                                                               org.rhq.core.domain.configuration.Configuration configuration)
Description copied from interface: ResourceFactoryManagerLocal
Persists a record in the resource history to indicate a request has been made to create a configuration-backed resource.

Specified by:
persistCreateHistory in interface ResourceFactoryManagerLocal
Parameters:
user - user performing the create
parentResourceId - parent resource under which the resource should be created
resourceTypeId - type of resource being created
createResourceName - name of the resource being created
configuration - resource configuration of the new resource
Returns:
persisted history entity (i.e. ID will be populated)

persistCreateHistory

public org.rhq.core.domain.resource.CreateResourceHistory persistCreateHistory(org.rhq.core.domain.auth.Subject user,
                                                                               int parentResourceId,
                                                                               int resourceTypeId,
                                                                               String createResourceName,
                                                                               org.rhq.core.domain.content.PackageVersion packageVersion,
                                                                               org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration)
Description copied from interface: ResourceFactoryManagerLocal
Persists a record in the resource history to indicate a request has been made to create an package-backed resource.

Specified by:
persistCreateHistory in interface ResourceFactoryManagerLocal
Parameters:
user - user performing the create
parentResourceId - parent resource under which the resource should be created
resourceTypeId - type of resource being created
createResourceName - name of the resource being created
packageVersion - package version being installed
deploymentTimeConfiguration - configuration of the package used when installing
Returns:
persisted history entity (i.e. ID will be populated)

persistDeleteHistory

public org.rhq.core.domain.resource.DeleteResourceHistory persistDeleteHistory(org.rhq.core.domain.auth.Subject user,
                                                                               int resourceId)
Description copied from interface: ResourceFactoryManagerLocal
Persists a record in the resource history to indicate a request has been made to delete a resource.

Specified by:
persistDeleteHistory in interface ResourceFactoryManagerLocal
Parameters:
user - use performing the delete
resourceId - resource being deleted
Returns:
persisted history entity (i.e. ID will be populated)

getCreateHistoryItem

public org.rhq.core.domain.resource.CreateResourceHistory getCreateHistoryItem(int historyItemId)
Description copied from interface: ResourceFactoryManagerLocal
Returns the history item corresponding to the specified ID.

Specified by:
getCreateHistoryItem in interface ResourceFactoryManagerLocal
Parameters:
historyItemId - identifies the history item to return
Returns:
history item for the id; null if the id does not have a corresponding item

getCreateChildResourceHistoryCount

public int getCreateChildResourceHistoryCount(int parentResourceId,
                                              Long beginDate,
                                              Long endDate)
Description copied from interface: ResourceFactoryManagerLocal
Returns the number of requests to create a new child resource under the specified parent known to the system. These requests may be completed or still in progress; it represents the history of creation attempts for this parent resource.

Specified by:
getCreateChildResourceHistoryCount in interface ResourceFactoryManagerLocal
Parameters:
parentResourceId - resource to check for child resource creation requests
beginDate - filter used to show only results occurring after this epoch millis parameter, nullable
endDate - filter used to show only results occurring before this epoch millis parameter, nullable
Returns:
number of requests in the resource creation history for the specified parent

findCreateChildResourceHistory

public org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.CreateResourceHistory> findCreateChildResourceHistory(org.rhq.core.domain.auth.Subject subject,
                                                                                                                            int parentResourceId,
                                                                                                                            Long beginDate,
                                                                                                                            Long endDate,
                                                                                                                            org.rhq.core.domain.util.PageControl pageControl)
Description copied from interface: ResourceFactoryManagerRemote
Returns a pagination enabled list of requests for the creation of new child resources to the specified parent. These requests may be completed or still in progress; it represents the history of creation attempts for this parent resource.

Specified by:
findCreateChildResourceHistory in interface ResourceFactoryManagerLocal
Specified by:
findCreateChildResourceHistory in interface ResourceFactoryManagerRemote
Parameters:
subject - the user making the request
parentResourceId - resource to check for child resource creations
beginDate - filter used to show only results occurring after this epoch millis parameter, nullable
endDate - filter used to show only results occurring before this epoch millis parameter, nullable
pageControl - control for pagination
Returns:
list of requests

getDeleteChildResourceHistoryCount

public int getDeleteChildResourceHistoryCount(int parentResourceId,
                                              Long beginDate,
                                              Long endDate)
Description copied from interface: ResourceFactoryManagerLocal
Returns the number of requests to delete a child resource from the specified parent resource. These requests may be complete or still in progress; it represents the history of all delete attempts of child resources to this resource.

Specified by:
getDeleteChildResourceHistoryCount in interface ResourceFactoryManagerLocal
Parameters:
parentResourceId - resource to check for child resource delete requests
beginDate - filter used to show only results occurring after this epoch millis parameter, nullable
endDate - filter used to show only results occurring before this epoch millis parameter, nullable
Returns:
number of delete requests for child resources

findDeleteChildResourceHistory

public org.rhq.core.domain.util.PageList<org.rhq.core.domain.resource.DeleteResourceHistory> findDeleteChildResourceHistory(org.rhq.core.domain.auth.Subject subject,
                                                                                                                            int parentResourceId,
                                                                                                                            Long beginDate,
                                                                                                                            Long endDate,
                                                                                                                            org.rhq.core.domain.util.PageControl pageControl)
Description copied from interface: ResourceFactoryManagerRemote
Returns a pagination enabled list of requests to delete a child resource on the specified parent. These requests may be complete or still in progress; it represents the history of all delete attempts of child resources to this resource.

Specified by:
findDeleteChildResourceHistory in interface ResourceFactoryManagerLocal
Specified by:
findDeleteChildResourceHistory in interface ResourceFactoryManagerRemote
Parameters:
subject - the user making the request
parentResourceId - resource to check for deleted child resources
beginDate - filter used to show only results occurring after this epoch millis parameter, nullable
pageControl - control for pagination
Returns:
list of requests

createResource

public org.rhq.core.domain.resource.CreateResourceHistory createResource(org.rhq.core.domain.auth.Subject user,
                                                                         int parentResourceId,
                                                                         int newResourceTypeId,
                                                                         String newResourceName,
                                                                         org.rhq.core.domain.configuration.Configuration pluginConfiguration,
                                                                         String packageName,
                                                                         String packageVersionNumber,
                                                                         Integer architectureId,
                                                                         org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration,
                                                                         InputStream packageBitStream)
Description copied from interface: ResourceFactoryManagerLocal
Creates a new physical resource. The resource will be created as a child of the specified parent. In other words, the resource component of the indicated parent will be used to create the new resource. This call should only be made for resource types that are defined with a create/delete policy of CreateDeletePolicy.BOTH or CreateDeletePolicy.CREATE_ONLY. If this call is made for a resource type that cannot be created based on this policy, the plugin container will throw an exception. This call should only be made for resource types that are defined with a creation data type of ResourceCreationDataType.CONTENT. If this call is made for a resource type that cannot be created via an package, the plugin container will throw an exception.

Specified by:
createResource in interface ResourceFactoryManagerLocal
Parameters:
user - user requesting the creation
parentResourceId - parent resource under which the new resource should be created
newResourceTypeId - identifies the type of resource being created
newResourceName - name of the resource being created
pluginConfiguration - optional plugin configuration that may be needed in order to create the new resource
packageName - name of the package that will be created as a result of this resource create
packageVersionNumber - machine formatted identifier of the specific version of the package
architectureId - ID of the architecture of the package, null indicates NoArch (any)
deploymentTimeConfiguration - dictates how the package will be deployed
packageBitStream - content of the package to create

createResource

public org.rhq.core.domain.resource.CreateResourceHistory createResource(org.rhq.core.domain.auth.Subject user,
                                                                         int parentResourceId,
                                                                         int newResourceTypeId,
                                                                         String newResourceName,
                                                                         org.rhq.core.domain.configuration.Configuration pluginConfiguration,
                                                                         String packageName,
                                                                         String packageVersionNumber,
                                                                         Integer architectureId,
                                                                         org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration,
                                                                         InputStream packageBitStream,
                                                                         Map<String,String> packageUploadDetails)
Specified by:
createResource in interface ResourceFactoryManagerLocal

createResource

public org.rhq.core.domain.resource.CreateResourceHistory createResource(org.rhq.core.domain.auth.Subject user,
                                                                         int parentResourceId,
                                                                         int newResourceTypeId,
                                                                         String newResourceName,
                                                                         org.rhq.core.domain.configuration.Configuration pluginConfiguration,
                                                                         String packageName,
                                                                         String packageVersionNumber,
                                                                         Integer architectureId,
                                                                         org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration,
                                                                         InputStream packageBitStream,
                                                                         Map<String,String> packageUploadDetails,
                                                                         Integer timeout)

createResource

public org.rhq.core.domain.resource.CreateResourceHistory createResource(org.rhq.core.domain.auth.Subject user,
                                                                         int parentResourceId,
                                                                         int resourceTypeId,
                                                                         String resourceName,
                                                                         org.rhq.core.domain.configuration.Configuration pluginConfiguration,
                                                                         org.rhq.core.domain.configuration.Configuration resourceConfiguration)
Specified by:
createResource in interface ResourceFactoryManagerLocal
See Also:
ResourceFactoryManagerRemote#createResource(Subject,int,int,String,Configuration,Configuration)

createResource

public org.rhq.core.domain.resource.CreateResourceHistory createResource(org.rhq.core.domain.auth.Subject user,
                                                                         int parentResourceId,
                                                                         int resourceTypeId,
                                                                         String resourceName,
                                                                         org.rhq.core.domain.configuration.Configuration pluginConfiguration,
                                                                         org.rhq.core.domain.configuration.Configuration resourceConfiguration,
                                                                         Integer timeout)
Description copied from interface: ResourceFactoryManagerRemote
Creates a new physical resource. The resource will be created as a child of the specified parent. In other words, the resource component of the indicated parent will be used to create the new resource. This call should only be made for resource types that are defined with a create/delete policy of CreateDeletePolicy.BOTH or CreateDeletePolicy.CREATE_ONLY. If this call is made for a resource type that cannot be created based on this policy, the plugin container will throw an exception. This call should only be made for resource types that are defined with a creation data type of ResourceCreationDataType.CONFIGURATION. If this call is made for a resource type that cannot be created via a configuration, the plugin container will throw an exception.

Specified by:
createResource in interface ResourceFactoryManagerLocal
Specified by:
createResource in interface ResourceFactoryManagerRemote
Parameters:
user - user requesting the creation
parentResourceId - parent resource under which the new resource should be created
resourceTypeId - type of resource to create
resourceName - name of the resource being created
pluginConfiguration - optional plugin configuration that may be needed in order to create the new resource
resourceConfiguration - resource configuration for the new resource
timeout - number of milliseconds before the agent suffers a timeout when creating the resource. If null uses default.
See Also:
ResourceFactoryManagerRemote#createResource(Subject,int,int,String,Configuration,Configuration,Integer)

createPackageBackedResource

public org.rhq.core.domain.resource.CreateResourceHistory createPackageBackedResource(org.rhq.core.domain.auth.Subject subject,
                                                                                      int parentResourceId,
                                                                                      int newResourceTypeId,
                                                                                      String newResourceName,
                                                                                      org.rhq.core.domain.configuration.Configuration pluginConfiguration,
                                                                                      String packageName,
                                                                                      String packageVersionNumber,
                                                                                      Integer architectureId,
                                                                                      org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration,
                                                                                      byte[] packageBits,
                                                                                      Integer timeout)
Description copied from interface: ResourceFactoryManagerRemote
Creates a new physical resource. The resource will be created as a child of the specified parent. In other words, the resource component of the indicated parent will be used to create the new resource. This call should only be made for resource types that are defined with a create/delete policy of CreateDeletePolicy.BOTH or CreateDeletePolicy.CREATE_ONLY. If this call is made for a resource type that cannot be created based on this policy, the plugin container will throw an exception. This call should only be made for resource types that are defined with a creation data type of ResourceCreationDataType.CONTENT. If this call is made for a resource type that cannot be created via an package, the plugin container will throw an exception.

Specified by:
createPackageBackedResource in interface ResourceFactoryManagerLocal
Specified by:
createPackageBackedResource in interface ResourceFactoryManagerRemote
Parameters:
subject - user requesting the creation
parentResourceId - parent resource under which the new resource should be created
newResourceTypeId - identifies the type of resource being created
newResourceName - Ignored, pass null. This is determined from the package.
pluginConfiguration - optional plugin configuration that may be needed in order to create the new resource
packageName - name of the package that will be created as a result of this resource create
packageVersionNumber - The string version of the package. If null will be set to system timestamp (long)
architectureId - Id of the target architecture of the package, null indicates NoArch (any).
deploymentTimeConfiguration - dictates how the package will be deployed
packageBits - content of the package to create
timeout - number of milliseconds before the agent suffers a timeout when creating the resource. If null uses default.
See Also:
ResourceFactoryManagerRemote#createPackageBackedResource(Subject,int,int,String,Configuration,String,String,Integer,Configuration,byte[],Integer)

createPackageBackedResource

public org.rhq.core.domain.resource.CreateResourceHistory createPackageBackedResource(org.rhq.core.domain.auth.Subject subject,
                                                                                      int parentResourceId,
                                                                                      int newResourceTypeId,
                                                                                      String newResourceName,
                                                                                      org.rhq.core.domain.configuration.Configuration pluginConfiguration,
                                                                                      String packageName,
                                                                                      String packageVersionNumber,
                                                                                      Integer architectureId,
                                                                                      org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration,
                                                                                      byte[] packageBits)
Specified by:
createPackageBackedResource in interface ResourceFactoryManagerLocal
See Also:
ResourceFactoryManagerRemote#createPackageBackedResource(Subject,int,int,String,Configuration,String,String,Integer,Configuration,byte[])

createPackageBackedResourceViaPackageVersion

public org.rhq.core.domain.resource.CreateResourceHistory createPackageBackedResourceViaPackageVersion(org.rhq.core.domain.auth.Subject subject,
                                                                                                       int parentResourceId,
                                                                                                       int newResourceTypeId,
                                                                                                       String newResourceName,
                                                                                                       org.rhq.core.domain.configuration.Configuration pluginConfiguration,
                                                                                                       org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration,
                                                                                                       int packageVersionId)
Specified by:
createPackageBackedResourceViaPackageVersion in interface ResourceFactoryManagerLocal
See Also:
ResourceFactoryManagerRemote#createPackageBackedResourceViaPackageVersion(Subject, int, int, String, Configuration, Configuration, int)

createPackageBackedResourceViaPackageVersion

public org.rhq.core.domain.resource.CreateResourceHistory createPackageBackedResourceViaPackageVersion(org.rhq.core.domain.auth.Subject subject,
                                                                                                       int parentResourceId,
                                                                                                       int newResourceTypeId,
                                                                                                       String newResourceName,
                                                                                                       org.rhq.core.domain.configuration.Configuration pluginConfiguration,
                                                                                                       org.rhq.core.domain.configuration.Configuration deploymentTimeConfiguration,
                                                                                                       int packageVersionId,
                                                                                                       Integer timeout)
Description copied from interface: ResourceFactoryManagerRemote
Creates a new physical resource. The resource will be created as a child of the specified parent. In other words, the resource component of the indicated parent will be used to create the new resource. This call should only be made for resource types that are defined with a create/delete policy of CreateDeletePolicy.BOTH or CreateDeletePolicy.CREATE_ONLY. If this call is made for a resource type that cannot be created based on this policy, the plugin container will throw an exception. This call should only be made for resource types that are defined with a creation data type of ResourceCreationDataType.CONTENT. If this call is made for a resource type that cannot be created via an package, the plugin container will throw an exception.

Specified by:
createPackageBackedResourceViaPackageVersion in interface ResourceFactoryManagerLocal
Specified by:
createPackageBackedResourceViaPackageVersion in interface ResourceFactoryManagerRemote
Parameters:
subject - user requesting the creation
parentResourceId - parent resource under which the new resource should be created
newResourceTypeId - identifies the type of resource being created
newResourceName - Ignored, pass null. This is determined from the package.
pluginConfiguration - optional plugin configuration that may be needed in order to create the new resource
deploymentTimeConfiguration - dictates how the package will be deployed
packageVersionId - An existing package version to back this resource
timeout - number of milliseconds before the agent suffers a timeout when creating the resource. If null uses default.
See Also:
ResourceFactoryManagerRemote#createPackageBackedResourceViaPackageVersion(Subject, int, int, String, Configuration, Configuration, int, Integer)

deleteResources

public List<org.rhq.core.domain.resource.DeleteResourceHistory> deleteResources(org.rhq.core.domain.auth.Subject user,
                                                                                int[] resourceIds)
Description copied from interface: ResourceFactoryManagerRemote
Deletes physical resources from the agent machine. After this call, the resource will no longer be accessible not only to JON, but in general. It is up to the plugin to determine how to complete the delete, but a deleted resource will no longer be returned from resource discoveries.

Specified by:
deleteResources in interface ResourceFactoryManagerLocal
Specified by:
deleteResources in interface ResourceFactoryManagerRemote
Parameters:
user - user requesting the deletion. must have resource delete perm on the resources.
resourceIds - the resources being deleted
See Also:
ResourceFactoryManagerRemote.deleteResources(Subject,int[])

deleteResource

public org.rhq.core.domain.resource.DeleteResourceHistory deleteResource(org.rhq.core.domain.auth.Subject subject,
                                                                         int resourceId)
Description copied from interface: ResourceFactoryManagerRemote
Deletes a physical resource from the agent machine. After this call, the resource will no longer be accessible not only to JON, but in general. It is up to the plugin to determine how to complete the delete, but a deleted resource will no longer be returned from resource discoveries.

Specified by:
deleteResource in interface ResourceFactoryManagerLocal
Specified by:
deleteResource in interface ResourceFactoryManagerRemote
Parameters:
subject - user requesting the deletion. must have resource delete perm on the resource.
resourceId - resource being deleted
See Also:
ResourceFactoryManagerRemote.deleteResource(Subject,int)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.