fipaos.tutorial.emarkets.agent.seller
Class SellerAgent

fipaos.agent.FIPAOSAgent
  |
  +--fipaos.tutorial.emarkets.agent.SubscribingAgent
        |
        +--fipaos.tutorial.emarkets.agent.seller.SellerAgent
Direct Known Subclasses:
ComponentSellerAgent, ManufacturerSellerAgent

public abstract class SellerAgent
extends SubscribingAgent
implements EscrowProtocolInitiatorAbility, NegotiationProtocolInitiatorAbility, SellerAbility

This class represents an agent that wishes to sell goods in an e-marketplace


Inner classes inherited from class fipaos.agent.FIPAOSAgent
FIPAOSAgent.TopLevelHandlerTask

Fields inherited from class fipaos.agent.FIPAOSAgent
_registered_with, _state

Constructor Summary
SellerAgent(String platform_profile, String name, String owner, String type)
          Constructs a SellerAgent

Method Summary
 voiddealWithEscrowProtocolFailure(Object failure)
          Callback to signal that the escrow agent found errors between our escrow message and a message sent by a buyer that we made deals with
 voiddealWithEscrowProtocolInform(Object inform)
          Callback to indicate that an escrow message we sent to the escrow agent was successfully validated against an equivalent message sent by a buyer that we made deals with
 voiddealWithFIPASubscribeInform(Object notification)
          Callback to signal that the agent we are subscribed with has sent us a notification
 voiddealWithFIPASubscribeRefuse(Object content)
          Callback to show that our attempt to subscribe to an agent was refused
 voiddealWithNegotiationProtocolPropose(Object[] propose)
          Callback to signal that a buyer has made a proposal in response to our CFP message
 voiddoneEmarketsTimerTask(Object obj)
          Signals that the time by which proposals to a CFP must be received has arrived
 voiddoneEscrowProtocolInitiatorHandlerTask(Task t)
          Callback to indicate that the task used to communicate with the escrow agent has completed
 voiddoneNegotiationProtocolInitiatorHandlerTask(Task t)
          Callback to signal that the negotiation task used to communicate with a buyer has completed
 intgetCredits()
           
 intgetItems()
           
 intgetTargetCredits()
           
 voidGUIClosed()
          Invoked when the seller GUI is closed.
 synchronized voidshutdown()
          Attempts to unsubscribe from the market manager before shutting down the agent

Methods inherited from class fipaos.tutorial.emarkets.agent.SubscribingAgent
addAgent, doneFIPASubscribeInitiatorHandlerTask, doneFIPASubscribeInitiatorHandlerTask, getSubscribedWith, searchForAgents, subscribe, subscriberGUIClosed, unsubscribe

Methods inherited from class fipaos.agent.FIPAOSAgent
activate, forward, forward, getAID, getCurrentConversation, getHAP, getLocalAMS, getLocalAMSAID, getLocalDF, getLocalDFAID, getNewConversation, getOwnership, getPlatformProfile, getProfile, getState, isShutdown, notify, notify, notifyDone, notifyError, notifyMessageInEndedConversation, notifyMessageUndeliverable, notifyTimeout, sendNotUnderstood, sendNotUnderstood, setMessageSender, waitForPushLock

Constructor Detail

SellerAgent

public SellerAgent(String platform_profile, String name, String owner, String type)
Constructs a SellerAgent
Parameters:
platform_profile - The location of the platform profile
name - The agent name
owner - The owner of this agent
Method Detail

dealWithEscrowProtocolFailure

public void dealWithEscrowProtocolFailure(Object failure)
Callback to signal that the escrow agent found errors between our escrow message and a message sent by a buyer that we made deals with
Parameters:
failure - The content of the failure message

dealWithEscrowProtocolInform

public void dealWithEscrowProtocolInform(Object inform)
Callback to indicate that an escrow message we sent to the escrow agent was successfully validated against an equivalent message sent by a buyer that we made deals with
Parameters:
inform - The content of the inform message

dealWithFIPASubscribeInform

public void dealWithFIPASubscribeInform(Object notification)
Callback to signal that the agent we are subscribed with has sent us a notification
Parameters:
content - The content of the inform message

dealWithFIPASubscribeRefuse

public void dealWithFIPASubscribeRefuse(Object content)
Callback to show that our attempt to subscribe to an agent was refused
Parameters:
content - The content of the refuse message

dealWithNegotiationProtocolPropose

public void dealWithNegotiationProtocolPropose(Object[] propose)
Callback to signal that a buyer has made a proposal in response to our CFP message
Parameters:
propose - The content of the propose message

doneEmarketsTimerTask

public void doneEmarketsTimerTask(Object obj)
Signals that the time by which proposals to a CFP must be received has arrived
Parameters:
obj - The id that was passed into the EmarketsTimerTask that has just completed

doneEscrowProtocolInitiatorHandlerTask

public void doneEscrowProtocolInitiatorHandlerTask(Task t)
Callback to indicate that the task used to communicate with the escrow agent has completed
Parameters:
t - The task that has completed

doneNegotiationProtocolInitiatorHandlerTask

public void doneNegotiationProtocolInitiatorHandlerTask(Task t)
Callback to signal that the negotiation task used to communicate with a buyer has completed
Parameters:
t - The task that has just completed

getCredits

public int getCredits()

getItems

public int getItems()

getTargetCredits

public int getTargetCredits()

GUIClosed

public void GUIClosed()
Invoked when the seller GUI is closed.

shutdown

public synchronized void shutdown()
Attempts to unsubscribe from the market manager before shutting down the agent

Association Links

to Class java.util.Hashtable

A hashtable of escrow messages. One for each buyer that we are trading with. The agent_id of the buyer (as a String) is used as the key

to Class java.util.Hashtable

A hashtable used to store the current bid state of each of the buyers we are trading with. Key is a stringified buyer agent id

to Class java.util.Hashtable

A hashtable used to store the proposals made by each of the buyers we are trading with. This allows us to make a counterproposal once all buyer bids are received. Key is a stringified buyer agent id

to Class java.util.Hashtable

A hashtable used to store the negotiation handler tasks needed to communicate with each of the buyers we are trading with. Key is a stringified buyer agent id

to Class java.util.Vector

A Vector of stringified buyer ids that represent the buyer agents we are trading with

to Class java.lang.String

The identifier of the current emarket

to Class fipaos.tutorial.emarkets.message.SellerEmarketMessage

The emarket message sent to this seller by the market manager to inform it of the buyers it has been paired with.