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)
          Constructor for PluginConfig.
PluginConfig(String name, String clazz)
          Creates a plugin configuration with the given name and class.
 
Method Summary
 void addParameter(String key, String value)
          addParameter
 int compareTo(PluginConfig obj)
          compareTo
 void deleteParameters(PluginParameter p)
          removeParameters
 boolean equals(Object obj)
          
 Set<String> getAvailableParameterKeys()
          getAvailableParameterKeys
 String getName()
          Get the name of the plugin.
 String getParameter(String key)
          getParameter
 Map<String,String> getParameterMap()
          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 setName(String name)
          Sets the name of the plugin.
 void setParameterMap(Map<String,String> parameters)
          setParameterMap
 void setParameters(Set<PluginParameter> list)
          setParameters
 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)

Constructor for PluginConfig.

Parameters:
pluginConfig - a PluginConfig object.
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:
clazz - a String object.

getParameters

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

Returns:
the parameters

setParameters

public void setParameters(Set<PluginParameter> list)

setParameters

Parameters:
list - a Set object.

getParameterMap

public Map<String,String> getParameterMap()

getParameterMap

Returns:
the parameters

setParameterMap

public void setParameterMap(Map<String,String> parameters)

setParameterMap

Parameters:
parameters - the parameters to set

getParameter

public String getParameter(String key)

getParameter

Parameters:
key - the parameter name
Returns:
the parameter value

addParameter

public void addParameter(String key,
                         String value)

addParameter

Parameters:
key - the parameter name
value - the parameter value

deleteParameters

public void deleteParameters(PluginParameter p)

removeParameters

Parameters:
p - a PluginParameter object.

getAvailableParameterKeys

public Set<String> getAvailableParameterKeys()

getAvailableParameterKeys

Returns:
a Set object.

compareTo

public int compareTo(PluginConfig obj)

compareTo

Specified by:
compareTo in interface Comparable<PluginConfig>
Parameters:
obj - a PluginConfig object.
Returns:
a int.

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 © 2011. All Rights Reserved.