org.opennms.netmgt.provision.persist.foreignsource
Class PluginConfig

java.lang.Object
  extended by org.opennms.netmgt.provision.persist.foreignsource.PluginConfig
All Implemented Interfaces:
Serializable, Comparable<PluginConfig>
Direct Known Subclasses:
DetectorWrapper, PolicyWrapper

public class PluginConfig
extends Object
implements Serializable, Comparable<PluginConfig>

A PluginConfig represents a portion of a configuration that defines a reference to a Java class "plugin" along with a set of parameters used to configure the behavior of that plugin.

Author:
Benjamin Reed, Matt Brozowski
See Also:
Serialized Form

Constructor Summary
PluginConfig()
          Creates an empty plugin configuration.
PluginConfig(PluginConfig pluginConfig)
           
PluginConfig(String name, String clazz)
          Creates a plugin configuration with the given name and class.
 
Method Summary
 void addParameter(String key, String value)
           
 int compareTo(PluginConfig obj)
           
 boolean equals(Object obj)
           
 Set<String> getAvailableParameterKeys()
           
 String getName()
          Get the name of the plugin.
 String getParameter(String key)
           
 Map<String,String> getParameterMap()
           
 Set<PluginParameter> getParameters()
          Get a List of the plugin parameters.
 String getPluginClass()
          Get the name of the plugin's java class.
 int hashCode()
           
 void removeParameters(PluginParameter p)
           
 void setName(String name)
          Sets the name of the plugin.
 void setParameterMap(Map<String,String> parameters)
           
 void setParameters(Set<PluginParameter> list)
           
 void setPluginClass(String clazz)
          Set the name of the plugin's java class.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PluginConfig

public PluginConfig()
Creates an empty plugin configuration.


PluginConfig

public PluginConfig(String name,
                    String clazz)
Creates a plugin configuration with the given name and class.

Parameters:
name - the human-readable name of the plugin
clazz - the name of the plugin's java class

PluginConfig

public PluginConfig(PluginConfig pluginConfig)
Method Detail

getName

public String getName()
Get the name of the plugin.

Returns:
the human-readable name of the plugin

setName

public void setName(String name)
Sets the name of the plugin.

Parameters:
name - the human-readable name to set

getPluginClass

public String getPluginClass()
Get the name of the plugin's java class.

Returns:
the plugin's class name

setPluginClass

public void setPluginClass(String clazz)
Set the name of the plugin's java class.

Parameters:
pluginClass - the plugin class name to set

getParameters

public Set<PluginParameter> getParameters()
Get a List of the plugin parameters.

Returns:
the parameters

setParameters

public void setParameters(Set<PluginParameter> list)
Parameters:
parameters - the parameters to set

getParameterMap

public Map<String,String> getParameterMap()
Returns:
the parameters

setParameterMap

public void setParameterMap(Map<String,String> parameters)
Parameters:
parameters - the parameters to set

getParameter

public String getParameter(String key)
Parameters:
key - the parameter name
Returns:
the parameter value

addParameter

public void addParameter(String key,
                         String value)
Parameters:
key - the parameter name
value - the parameter value

removeParameters

public void removeParameters(PluginParameter p)

getAvailableParameterKeys

public Set<String> getAvailableParameterKeys()

compareTo

public int compareTo(PluginConfig obj)
Specified by:
compareTo in interface Comparable<PluginConfig>

toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2009. All Rights Reserved.