net.sourceforge.sconman
Interface IAgent

All Known Implementing Classes:
AbstractAgent, FileAdderAgent, MailAdderAgent, OldContentsSweeper

public interface IAgent

An agent is an active entity associated to a Project that does periodic maintenance tasks.

Implementations of this class do specific actions, as populating the repository from files on disc or in a mailbox, removing old and unused contents, or just moving contents that match a query to a specific category.

Author:
mikeshadow

Method Summary
 java.lang.String getName()
          Returns agent id
 long getPeriod()
          Returns the time between two consecutive task executions, in miliseconds.
 void run(Project prj)
          Method to be called every getPeriod() miliseconds.
 void setActor(User actor)
          Sets the actor that will be used to do actions
 void setName(java.lang.String name)
          Sets the agent id.
 void setPeriod(long period)
          Sets the time lapse between two consecutive task executions, in miliseconds.
 

Method Detail

getName

java.lang.String getName()
Returns agent id

Returns:
The agent id

setName

void setName(java.lang.String name)
Sets the agent id. This method will be called by the engine.

Parameters:
id - The new agent id

getPeriod

long getPeriod()
Returns the time between two consecutive task executions, in miliseconds. If the task is executed only once, 0 will be returned.

Returns:
The time period for execution

setPeriod

void setPeriod(long period)
Sets the time lapse between two consecutive task executions, in miliseconds. Set this value to 0 if the task must be executed only once.

Parameters:
period - Time period for execution

run

void run(Project prj)
Method to be called every getPeriod() miliseconds. This method performs the agent task.

Parameters:
prj - The project this agent is working on

setActor

void setActor(User actor)
Sets the actor that will be used to do actions

Parameters:
actor -


Copyright null null. All Rights Reserved.