From c1b922496359669c815efc11e9c6ec722288598c Mon Sep 17 00:00:00 2001 From: John Mazzitelli Date: Fri, 2 Oct 2009 12:10:57 -0400 Subject: remove the duplicate package --- .../org/rhq/plugins/puppet/PuppetComponent.java | 115 +++++++++++++++++++++ .../org/rhq/plugins/puppet/PuppetDiscovery.java | 50 +++++++++ .../rhq/plugins/puppet/puppet/PuppetComponent.java | 115 --------------------- .../rhq/plugins/puppet/puppet/PuppetDiscovery.java | 50 --------- 4 files changed, 165 insertions(+), 165 deletions(-) create mode 100644 src/main/java/org/rhq/plugins/puppet/PuppetComponent.java create mode 100644 src/main/java/org/rhq/plugins/puppet/PuppetDiscovery.java delete mode 100644 src/main/java/org/rhq/plugins/puppet/puppet/PuppetComponent.java delete mode 100644 src/main/java/org/rhq/plugins/puppet/puppet/PuppetDiscovery.java diff --git a/src/main/java/org/rhq/plugins/puppet/PuppetComponent.java b/src/main/java/org/rhq/plugins/puppet/PuppetComponent.java new file mode 100644 index 0000000..05993e2 --- /dev/null +++ b/src/main/java/org/rhq/plugins/puppet/PuppetComponent.java @@ -0,0 +1,115 @@ + +package org.rhq.plugins.puppet.puppet; + +import java.util.HashSet; +import java.util.Set; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; +import org.rhq.core.domain.measurement.AvailabilityType; +import org.rhq.core.pluginapi.inventory.CreateChildResourceFacet; +import org.rhq.core.pluginapi.inventory.CreateResourceReport; +import org.rhq.core.pluginapi.inventory.DeleteResourceFacet; +import org.rhq.core.pluginapi.inventory.ResourceComponent; +import org.rhq.core.pluginapi.inventory.ResourceContext; +import org.rhq.core.pluginapi.operation.OperationContext; +import org.rhq.core.pluginapi.operation.OperationFacet; +import org.rhq.core.pluginapi.operation.OperationResult; + + +public class PuppetComponent implements ResourceComponent +, OperationFacet +, CreateChildResourceFacet +, DeleteResourceFacet +{ + private final Log log = LogFactory.getLog(this.getClass()); + + private static final int CHANGEME = 1; // TODO remove or change this + + + + + /** + * Return availability of this resource + * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability() + */ + public AvailabilityType getAvailability() { + // TODO supply real implementation + return AvailabilityType.UP; + } + + + /** + * Start the resource connection + * @see org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext) + */ + public void start(ResourceContext context) throws InvalidPluginConfigurationException, Exception { + + Configuration conf = context.getPluginConfiguration(); + // TODO add code to start the resource / connection to it + + + } + + + /** + * Tear down the rescource connection + * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop() + */ + public void stop() { + + + } + + + + + + public void startOperationFacet(OperationContext context) { + + } + + + /** + * Invokes the passed operation on the managed resource + * @param name Name of the operation + * @param params The method parameters + * @return An operation result + * @see org.rhq.core.pluginapi.operation.OperationFacet + */ + public OperationResult invokeOperation(String name, Configuration params) throws Exception { + + OperationResult res = new OperationResult(); + if ("dummyOperation".equals(name)) { + // TODO implement me + + } + return res; + } + + + + /** + * Create a child resource + * @see org.rhq.core.pluginapi.inventory.CreateChildResourceFacet + */ + public CreateResourceReport createResource(CreateResourceReport report) + { + // TODO supply code to create a child resource + + return null; // TODO change this + } + + /** + * Delete a child resource + * @see org.rhq.core.pluginapi.inventory.DeleteResourceFacet + */ + public void deleteResource() throws Exception + { + // TODO supply code to delete a child resource + } + +} \ No newline at end of file diff --git a/src/main/java/org/rhq/plugins/puppet/PuppetDiscovery.java b/src/main/java/org/rhq/plugins/puppet/PuppetDiscovery.java new file mode 100644 index 0000000..5d2255e --- /dev/null +++ b/src/main/java/org/rhq/plugins/puppet/PuppetDiscovery.java @@ -0,0 +1,50 @@ +package org.rhq.plugins.puppet.puppet; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.rhq.core.domain.configuration.Configuration; +import org.rhq.core.domain.configuration.Property; +import org.rhq.core.domain.configuration.PropertySimple; +import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; +import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; +import org.rhq.core.pluginapi.inventory.ProcessScanResult; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; +import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; + + +/** + * Discovery class + */ +public class PuppetDiscovery implements ResourceDiscoveryComponent { + + + private final Log log = LogFactory.getLog(this.getClass()); + + + /** + * Run the discovery + */ + public Set discoverResources(ResourceDiscoveryContext discoveryContext) throws Exception { + + Set discoveredResources = new HashSet(); + + /** + * TODO : do your discovery here + * A discovered resource must have a unique key, that must + * stay the same when the resource is discovered the next + * time + */ + DiscoveredResourceDetails detail = null; // new DiscoveredResourceDetails( ); + + + // Add to return values + discoveredResources.add(detail); + log.info("Discovered new ... TODO "); // TODO change + + return discoveredResources; + + } +} \ No newline at end of file diff --git a/src/main/java/org/rhq/plugins/puppet/puppet/PuppetComponent.java b/src/main/java/org/rhq/plugins/puppet/puppet/PuppetComponent.java deleted file mode 100644 index 05993e2..0000000 --- a/src/main/java/org/rhq/plugins/puppet/puppet/PuppetComponent.java +++ /dev/null @@ -1,115 +0,0 @@ - -package org.rhq.plugins.puppet.puppet; - -import java.util.HashSet; -import java.util.Set; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; -import org.rhq.core.domain.measurement.AvailabilityType; -import org.rhq.core.pluginapi.inventory.CreateChildResourceFacet; -import org.rhq.core.pluginapi.inventory.CreateResourceReport; -import org.rhq.core.pluginapi.inventory.DeleteResourceFacet; -import org.rhq.core.pluginapi.inventory.ResourceComponent; -import org.rhq.core.pluginapi.inventory.ResourceContext; -import org.rhq.core.pluginapi.operation.OperationContext; -import org.rhq.core.pluginapi.operation.OperationFacet; -import org.rhq.core.pluginapi.operation.OperationResult; - - -public class PuppetComponent implements ResourceComponent -, OperationFacet -, CreateChildResourceFacet -, DeleteResourceFacet -{ - private final Log log = LogFactory.getLog(this.getClass()); - - private static final int CHANGEME = 1; // TODO remove or change this - - - - - /** - * Return availability of this resource - * @see org.rhq.core.pluginapi.inventory.ResourceComponent#getAvailability() - */ - public AvailabilityType getAvailability() { - // TODO supply real implementation - return AvailabilityType.UP; - } - - - /** - * Start the resource connection - * @see org.rhq.core.pluginapi.inventory.ResourceComponent#start(org.rhq.core.pluginapi.inventory.ResourceContext) - */ - public void start(ResourceContext context) throws InvalidPluginConfigurationException, Exception { - - Configuration conf = context.getPluginConfiguration(); - // TODO add code to start the resource / connection to it - - - } - - - /** - * Tear down the rescource connection - * @see org.rhq.core.pluginapi.inventory.ResourceComponent#stop() - */ - public void stop() { - - - } - - - - - - public void startOperationFacet(OperationContext context) { - - } - - - /** - * Invokes the passed operation on the managed resource - * @param name Name of the operation - * @param params The method parameters - * @return An operation result - * @see org.rhq.core.pluginapi.operation.OperationFacet - */ - public OperationResult invokeOperation(String name, Configuration params) throws Exception { - - OperationResult res = new OperationResult(); - if ("dummyOperation".equals(name)) { - // TODO implement me - - } - return res; - } - - - - /** - * Create a child resource - * @see org.rhq.core.pluginapi.inventory.CreateChildResourceFacet - */ - public CreateResourceReport createResource(CreateResourceReport report) - { - // TODO supply code to create a child resource - - return null; // TODO change this - } - - /** - * Delete a child resource - * @see org.rhq.core.pluginapi.inventory.DeleteResourceFacet - */ - public void deleteResource() throws Exception - { - // TODO supply code to delete a child resource - } - -} \ No newline at end of file diff --git a/src/main/java/org/rhq/plugins/puppet/puppet/PuppetDiscovery.java b/src/main/java/org/rhq/plugins/puppet/puppet/PuppetDiscovery.java deleted file mode 100644 index 5d2255e..0000000 --- a/src/main/java/org/rhq/plugins/puppet/puppet/PuppetDiscovery.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.rhq.plugins.puppet.puppet; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.Property; -import org.rhq.core.domain.configuration.PropertySimple; -import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails; -import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException; -import org.rhq.core.pluginapi.inventory.ProcessScanResult; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent; -import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext; - - -/** - * Discovery class - */ -public class PuppetDiscovery implements ResourceDiscoveryComponent { - - - private final Log log = LogFactory.getLog(this.getClass()); - - - /** - * Run the discovery - */ - public Set discoverResources(ResourceDiscoveryContext discoveryContext) throws Exception { - - Set discoveredResources = new HashSet(); - - /** - * TODO : do your discovery here - * A discovered resource must have a unique key, that must - * stay the same when the resource is discovered the next - * time - */ - DiscoveredResourceDetails detail = null; // new DiscoveredResourceDetails( ); - - - // Add to return values - discoveredResources.add(detail); - log.info("Discovered new ... TODO "); // TODO change - - return discoveredResources; - - } -} \ No newline at end of file -- cgit