org.rhq.core.domain.plugin
Class PluginKey

java.lang.Object
  extended by org.rhq.core.domain.plugin.PluginKey
All Implemented Interfaces:
Serializable

public class PluginKey
extends Object
implements Serializable

Encapsulates informaton that can uniquely identify a plugin.

See Also:
Serialized Form

Constructor Summary
protected PluginKey()
           
  PluginKey(Plugin plugin)
          Create a plugin key that identifies the given agent plugin.
  PluginKey(PluginDeploymentType deployment, String pluginType, String pluginName)
           
  PluginKey(ServerPlugin plugin)
          Create a plugin key that identifies the given server plugin.
 
Method Summary
static PluginKey createAgentPluginKey(String pluginName)
          Creates a plugin key that identifies an agent plugin.
static PluginKey createServerPluginKey(String pluginType, String pluginName)
          Creates a plugin key that identifies a server plugin.
 boolean equals(Object obj)
           
 PluginDeploymentType getDeployment()
           
 String getPluginName()
           
 String getPluginType()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PluginKey

protected PluginKey()

PluginKey

public PluginKey(Plugin plugin)
Create a plugin key that identifies the given agent plugin.

Parameters:
plugin - agent plugin

PluginKey

public PluginKey(ServerPlugin plugin)
Create a plugin key that identifies the given server plugin.

Parameters:
plugin - server plugin

PluginKey

public PluginKey(PluginDeploymentType deployment,
                 String pluginType,
                 String pluginName)
Method Detail

createAgentPluginKey

public static PluginKey createAgentPluginKey(String pluginName)
Creates a plugin key that identifies an agent plugin. There is only one plugin container that runs in the agent, thus there is only one "type" of an agent plugin. Therefore, getPluginType() on the returned object will return null to signify this.

Parameters:
pluginName - the name of the plugin
Returns:
the plugin key for the agent plugin

createServerPluginKey

public static PluginKey createServerPluginKey(String pluginType,
                                              String pluginName)
Creates a plugin key that identifies a server plugin. All server plugins must have a type and a name.

Parameters:
pluginType - the type of plugin - must not be null or an empty string
pluginName - the name of the plugin
Returns:
the plugin key for the server plugin

getDeployment

public PluginDeploymentType getDeployment()

getPluginName

public String getPluginName()

getPluginType

@Nullable
public String getPluginType()

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


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