nenok.net.processor
Interface Processor

All Superinterfaces:
Remote
All Known Implementing Classes:
ProcessorImpl

public interface Processor
extends Remote

The interface of a processor in a Nenok federation.

Version:
1.2
Author:
Marc Pouly

Method Summary
 void delete(DefaultLocator loc)
          Deletes a stored valuation from this processor.
 Locator execute(Task task)
          Executes a given task on this processor.
 boolean exists(net.jini.id.Uuid envID)
          Is the valuation with the given envelope ID stored on this processor.
 String getCodebase()
           
 net.jini.id.Uuid getPID()
           
 void reset()
          Deletes all stored valuations.
 Valuation retrieve(DefaultLocator loc)
          Retrieves a stored valuation from this processor.
 Locator store(Envelope env)
          Stores a valuation wrapped in an envelope on this processor.
 Locator store(Valuation val)
          Stores a valuation on this processor.
 Locator[] store(Valuation[] vals)
          Stores a set of valuations on this processor.
 

Method Detail

store

Locator store(Envelope env)
              throws RemoteException
Stores a valuation wrapped in an envelope on this processor.

Parameters:
env - The envelope with the valuation to store.
Returns:
The locator of the stored valuation (envelope).
Throws:
RemoteException - Locator methods all throw remote exceptions.

store

Locator store(Valuation val)
              throws RemoteException
Stores a valuation on this processor.

Parameters:
val - The valuation to store.
Returns:
The locator of the stored valuation.
Throws:
RemoteException - Locator methods all throw remote exceptions.

store

Locator[] store(Valuation[] vals)
                throws RemoteException
Stores a set of valuations on this processor.

Parameters:
vals - The valuations to store.
Returns:
The locators of the stored valuations. Locator i references valuation i.
Throws:
RemoteException - Locator methods all throw remote exceptions.

retrieve

Valuation retrieve(DefaultLocator loc)
                   throws RemoteException
Retrieves a stored valuation from this processor. This method call does not remove the corresponding locator from the internal store.

Parameters:
loc - The locator identifying the valuation.
Returns:
The valuation referenced by the locator or null.
Throws:
RemoteException - Locator methods all throw remote exceptions.

exists

boolean exists(net.jini.id.Uuid envID)
               throws RemoteException
Is the valuation with the given envelope ID stored on this processor.

Parameters:
envID - The valuation's envelope ID.
Returns:
true, if the valuation exists.
Throws:
RemoteException - Locator methods all throw remote exceptions.

delete

void delete(DefaultLocator loc)
            throws RemoteException
Deletes a stored valuation from this processor.

Parameters:
loc - The locator referencing the valuation to delete.
Throws:
RemoteException - Locator methods all throw remote exceptions.

reset

void reset()
           throws RemoteException
Deletes all stored valuations.

Throws:
RemoteException - Locator methods all throw remote exceptions.

execute

Locator execute(Task task)
                throws RemoteException,
                       VAException
Executes a given task on this processor. Tasks are encapsulated valuation algebra operations (COMMAND DESIGN PATTERN).

Parameters:
task - The task to execute.
Returns:
The locator of the task's result.
Throws:
RemoteException - Locator methods all throw remote exceptions.
VAException - Exception caused by undefined valuation algera operations.

getPID

net.jini.id.Uuid getPID()
                        throws RemoteException
Returns:
The identifier of this processor.
Throws:
RemoteException - Locator methods all throw remote exceptions.

getCodebase

String getCodebase()
                   throws RemoteException
Returns:
The codebase of this processor at start time.
Throws:
RemoteException - Locator methods all throw remote exceptions.