drm.core
Interface Observer

All Known Implementing Classes:
ContributorAgent, Node

public interface Observer

Defines functionality necessary to read information from a collective. Implementros of this interface do not contribute anyting but can follow what's going on.

See Also:
Collective

Method Summary
 void collectiveUpdated(ContributionBox peer)
          Called when new contributions arrived.
 IRequest fireMessage(Address recipient, java.lang.String type, java.lang.Object content)
          The observer must provide this method to allow requesting information.
 Address[] getPeerAddresses()
          Called when no peers are accessable or no peers are known.
 

Method Detail

collectiveUpdated

public void collectiveUpdated(ContributionBox peer)
Called when new contributions arrived. The parameter is the contribution of the peer which sent the update. Therefore it is the freshest contribution.

getPeerAddresses

public Address[] getPeerAddresses()
Called when no peers are accessable or no peers are known. Without peers to talk to the interface cannot fulfill its duties. This method should return a list of living (or possibly living) peer addresses.

fireMessage

public IRequest fireMessage(Address recipient,
                            java.lang.String type,
                            java.lang.Object content)
The observer must provide this method to allow requesting information.