eu.scape_project.watch.adaptor.c3po
Class C3POAdaptor

java.lang.Object
  extended by eu.scape_project.watch.adaptor.c3po.C3POAdaptor
All Implemented Interfaces:
AdaptorPluginInterface, PluginInterface

public class C3POAdaptor
extends Object
implements AdaptorPluginInterface

A watch conforming adaptor for a collection profile source called c3po.

Version:
0.0.1
Author:
Petar Petrov

Constructor Summary
C3POAdaptor()
           
 
Method Summary
 ResultInterface execute()
          Fetches all information that this adaptor can obtain from the source.
 ResultInterface execute(Map<Entity,List<Property>> context)
          Executes this plugin and returns a specific ResultInterface implementation.
 String getDescription()
          Retrieves a short human readable description of this plugin.
 String getName()
          Retrieves the name of this plugin.
 List<ConfigParameter> getParameters()
          Retrieves a list with ConfigParameter objects needed/supported by this plugin.
 Map<String,String> getParameterValues()
          Returns a pre-polulated map with the configuration of this plugin.
 PluginType getPluginType()
          Retrieves the type of the plugin.
 String getVersion()
          Retrieves the version of this plugin.
 void init()
          Initializes the plugin.
 void setParameterValues(Map<String,String> values)
          Sets the config parameters.
 void shutdown()
          This method is called exactly once before the system shuts down or when the component decides this plugin is not needed anymore.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

C3POAdaptor

public C3POAdaptor()
Method Detail

init

public void init()
          throws PluginException
Description copied from interface: PluginInterface
Initializes the plugin. This method gets called exactly once by the PluginManager before the plugin gets executed. and initializing itself accordingly.

Specified by:
init in interface PluginInterface
Throws:
PluginException - if something goes wrong during the initialization process.

shutdown

public void shutdown()
              throws PluginException
Description copied from interface: PluginInterface
This method is called exactly once before the system shuts down or when the component decides this plugin is not needed anymore. The plugin is responsible for cleaning up and freeing all neeeded resources.

Specified by:
shutdown in interface PluginInterface
Throws:
PluginException - if something goes wrong.

getName

public String getName()
Description copied from interface: PluginInterface
Retrieves the name of this plugin.

Specified by:
getName in interface PluginInterface
Returns:
the name.

getVersion

public String getVersion()
Description copied from interface: PluginInterface
Retrieves the version of this plugin.

Specified by:
getVersion in interface PluginInterface
Returns:
the version.

getDescription

public String getDescription()
Description copied from interface: PluginInterface
Retrieves a short human readable description of this plugin.

Specified by:
getDescription in interface PluginInterface
Returns:
the description.

getPluginType

public PluginType getPluginType()
Description copied from interface: PluginInterface
Retrieves the type of the plugin.

Specified by:
getPluginType in interface PluginInterface
Returns:
the plugin type.

getParameters

public List<ConfigParameter> getParameters()
Description copied from interface: AdaptorPluginInterface
Retrieves a list with ConfigParameter objects needed/supported by this plugin. Note the not all config parameters have to be requried ( ConfigParameter.isRequired() )

Specified by:
getParameters in interface AdaptorPluginInterface
Returns:
the list with the parameters.

getParameterValues

public Map<String,String> getParameterValues()
Description copied from interface: AdaptorPluginInterface
Returns a pre-polulated map with the configuration of this plugin. The keys are the config parameters and the values are the config values. The plugin can provide default values, but is not expected to.

Specified by:
getParameterValues in interface AdaptorPluginInterface
Returns:
the config of the plugin.

setParameterValues

public void setParameterValues(Map<String,String> values)
                        throws InvalidParameterException
Description copied from interface: AdaptorPluginInterface
Sets the config parameters.

Specified by:
setParameterValues in interface AdaptorPluginInterface
Parameters:
values - sets the values.
Throws:
InvalidParameterException - if some required parameters are not provided, or other problems occur.

execute

public ResultInterface execute()
                        throws PluginException
Description copied from interface: AdaptorPluginInterface
Fetches all information that this adaptor can obtain from the source. To be used carefully as this can be a lot of data that is transfered over the network. Consider using a push adaptor.

Specified by:
execute in interface AdaptorPluginInterface
Returns:
the result of the operation.
Throws:
PluginException - if an error occurrs.

execute

public ResultInterface execute(Map<Entity,List<Property>> context)
                        throws PluginException
Description copied from interface: AdaptorPluginInterface
Executes this plugin and returns a specific ResultInterface implementation. The execution has to be done according to the current parameter setting.

Specified by:
execute in interface AdaptorPluginInterface
Parameters:
context - the configuration map. Determines what should be fetched upon execution.
Returns:
the result of the execution.
Throws:
PluginException - if an error occurs.


Copyright © 2012. All Rights Reserved.