public interface AgentEndpoint extends Agent
AgentEndpoint
defines the interface for classes that can receive a PriceUpdate
and send a Bid
, based on the Price
of that PriceUpdate
. An AgentEndpoint
can be linked with zero or one
MatcherEndpoint
instances. These are linked by a Session
.Modifier and Type | Interface and Description |
---|---|
static interface |
AgentEndpoint.Status
The
AgentEndpoint.Status object describes the current status and configuration of an AgentEndpoint . |
Modifier and Type | Method and Description |
---|---|
void |
connectToMatcher(Session session)
Connects this
AgentEndpoint instance to a MatcherEndpoint . |
java.lang.String |
getDesiredParentId() |
AgentEndpoint.Status |
getStatus() |
void |
handlePriceUpdate(PriceUpdate priceUpdate)
|
void |
matcherEndpointDisconnected(Session session)
|
getAgentId, setContext
java.lang.String getDesiredParentId()
Agent
.AgentEndpoint.Status getStatus()
getStatus
in interface Agent
Agent.Status
of the Agent
. This returns a snapshot of the state that won't change.
If used at a later time, the snapshot should be refreshed.void connectToMatcher(Session session)
AgentEndpoint
instance to a MatcherEndpoint
.session
- the Session
that will link this AgentEndpoint
with a MatcherEndpoint
.void matcherEndpointDisconnected(Session session)
session
- the Session
that used to link the MatcherEndpoint
with this AgentEndpoint
.void handlePriceUpdate(PriceUpdate priceUpdate)
priceUpdate
- The new Price
, wrapped in a PriceUpdate
, along with the id of the Bid
it was
based on.