com.almende.eve.agent
Interface AgentInterface

All Known Subinterfaces:
TestAgentInterface
All Known Implementing Classes:
Agent, CalcAgent, ChatAgent, EchoAgent, LogAgent, ManagementAgent, TestAgent

public interface AgentInterface


Method Summary
 String getDescription()
          Retrieve a description of the agents functionality
 String getId()
          Retrieve the agents id
 List<Object> getMethods(Boolean asJSON)
          Retrieve a list with all the available methods.
 String getType()
          Retrieve the agents type (its simple class name)
 List<String> getUrls()
          Retrieve an array with the agents urls (can be one or multiple), and depends on the configured transport services.
 String getVersion()
          Retrieve the agents version number
 String onSubscribe(String event, String callbackUrl, String callbackMethod)
          Subscribe to an event.
 void onUnsubscribe(String subscriptionId, String event, String callbackUrl, String callbackMethod)
          Let an other agent unsubscribe from one of this agents events - If subscriptionId is provided, the subscription with this id will be deleted - If the parameter callbackUrl and optionally event and/or callbackMethod, all subscriptions with matching parameters will be deleted.
 

Method Detail

getId

String getId()
Retrieve the agents id

Returns:
id

getType

String getType()
Retrieve the agents type (its simple class name)

Returns:
version

getVersion

String getVersion()
Retrieve the agents version number

Returns:
version

getDescription

String getDescription()
Retrieve a description of the agents functionality

Returns:
description

getUrls

List<String> getUrls()
Retrieve an array with the agents urls (can be one or multiple), and depends on the configured transport services.

Returns:
urls

getMethods

List<Object> getMethods(Boolean asJSON)
Retrieve a list with all the available methods.

Parameters:
asJSON - If true, result is in a JSON format easily parsable by a machine. If false (default), the returned list contains human readable strings.
Returns:
methods

onSubscribe

String onSubscribe(String event,
                   String callbackUrl,
                   String callbackMethod)
Subscribe to an event. The provided callback url and method will be invoked when the event is triggered. The callback method is called with parameters: - {String} subscriptionId The id of the subscription - {String} event Name of the triggered event - {String} agent Url of the triggered agent - {Object} params Event specific parameters. See also Agent.trigger(event, params).

Parameters:
event -
callbackUrl -
callbackMethod -
Returns:
subscriptionId

onUnsubscribe

void onUnsubscribe(String subscriptionId,
                   String event,
                   String callbackUrl,
                   String callbackMethod)
Let an other agent unsubscribe from one of this agents events - If subscriptionId is provided, the subscription with this id will be deleted - If the parameter callbackUrl and optionally event and/or callbackMethod, all subscriptions with matching parameters will be deleted. (if only callbackUrl is provided, all subscriptions from this agent will be deleted).

Parameters:
subscriptionId -
event -
callbackUrl -
callbackMethod -


Copyright © 2013 Almende BV. All Rights Reserved.