How to Support Manual Add in RHQ Agent Plugins

SampleDiscoveryComponent.java

package br.eti.fernandoribeiro.sample;

import java.util.HashSet;
import java.util.Set;

import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
import org.rhq.core.pluginapi.inventory.ManualAddFacet;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
import org.rhq.plugins.platform.PlatformComponent;

public final class SampleDiscoveryComponent implements ResourceDiscoveryComponent<PlatformComponent>, ManualAddFacet<PlatformComponent> {

  @Override
  public DiscoveredResourceDetails discoverResource(final Configuration pluginConfiguration, final ResourceDiscoveryContext<PlatformComponent> context) {
    return null;
  }

}

rhq-plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<rhq:plugin description="Sample Plugin" displayName="Sample" name="Sample" package="br.eti.fernandoribeiro.sample" version="1.0" xmlns:rhq="urn:xmlns:rhq-plugin" xmlns:c="urn:xmlns:rhq-configuration">
  <rhq:server class="SampleComponent" description="A sample component" discovery="SampleDiscoveryComponent" name="SampleComponent" supportsManualAdd="true">
    ...
  </rhq:server>
</rhq:plugin>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s