org.rhq.enterprise.server.resource
Interface ResourceFactoryManagerRemote

All Known Subinterfaces:
WebservicesRemote

public interface ResourceFactoryManagerRemote


Method Summary
 void createPackageBackedResource(Subject subject, int parentResourceId, int newResourceTypeId, String newResourceName, Configuration pluginConfiguration, String packageName, String packageVersion, Integer architectureId, Configuration deploymentTimeConfiguration, byte[] packageBits)
          Creates a new physical resource.
 void createResource(Subject subject, int parentResourceId, int resourceTypeId, String resourceName, Configuration pluginConfiguration, Configuration resourceConfiguration)
          Creates a new physical resource.
 void deleteResource(Subject subject, int resourceId)
          Deletes a physical resource from the agent machine.
 

Method Detail

createResource

void createResource(Subject subject,
                    int parentResourceId,
                    int resourceTypeId,
                    String resourceName,
                    Configuration pluginConfiguration,
                    Configuration resourceConfiguration)
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.

Parameters:
subject - 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

createPackageBackedResource

void createPackageBackedResource(Subject subject,
                                 int parentResourceId,
                                 int newResourceTypeId,
                                 String newResourceName,
                                 Configuration pluginConfiguration,
                                 String packageName,
                                 String packageVersion,
                                 Integer architectureId,
                                 Configuration deploymentTimeConfiguration,
                                 byte[] packageBits)
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.

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
packageVersion - 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

deleteResource

void deleteResource(Subject subject,
                    int resourceId)
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.

Parameters:
subject - user requesting the creation
resourceId - resource being deleted


Copyright © 2008-2009 RHQ Project Advisory Board (Red Hat, Inc.). All Rights Reserved.