verinec.adaptation
Interface IDistributor

All Known Implementing Classes:
DistCisco, DistCP, DistNone, DistSsh, DistWMI

public interface IDistributor

Methods that all distributors must have.

Version:
$Revision: 824 $
Author:
david.buchmann at unifr.ch

Method Summary
 void distribute(Element config)
          Perform the actual distribution work.
 String execute(Element command)
          Execute a command in a way suitable for this target.
 void setTarget(Element target)
          Initialize a distributor with a given target.
 

Method Detail

setTarget

void setTarget(Element target)
               throws VerinecException
Initialize a distributor with a given target. The target's type defines the attributes that will be processed.

Parameters:
target - The tr:target element of the service configuration to be distributed.
Throws:
VerinecException - if the target is not usable for this distributor.

distribute

void distribute(Element config)
                throws VerinecException
Perform the actual distribution work. Some distributors may only work for some sort of configuration data. (result-file, SNMP batch, etc.).

Parameters:
config - The configuration data to distribute (i.e. a result-file tag)
Throws:
VerinecException - if the config is not usable for this distributor.

execute

String execute(Element command)
               throws VerinecException
Execute a command in a way suitable for this target. The command contains just an execute attribute, which is to be run on the target system. In the future, there might be also special forms of command for special tasks.

Parameters:
command - A command element of the pre- or post-process for the configuration.
Returns:
Null if successful, a String containing the error message on failure of the executed program if the command has continueOnError. (Otherwise an execption is thrown on error.)
Throws:
VerinecException - If the command execution fails (and continueOnError is false) or if the underlying communication protocol fails.

Copyright © 2005 Verinec, DIUF