Class AAgent

  • All Implemented Interfaces:
    Agent
    Direct Known Subclasses:
    MemoryAgent, RemoteAgent, SquidAgent

    public abstract class AAgent
    extends java.lang.Object
    implements Agent
    Class representing an Agent in the Ocean Ecosystem Agents are addressed with a W3C DID
    Version:
    0.5
    Author:
    Mike
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> getDDO()
      Gets the DDO for the agent
      DID getDID()
      Gets the DID for an Agent
      java.lang.String getEndpoint​(java.lang.String type)
      Returns the serviceEndpoint for the specified service type.
      java.util.Map<java.lang.String,​java.lang.Object> refreshDDO()
      Fetches the latest DDO from Universal Resolver if not cached
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getDID

        public DID getDID()
        Description copied from interface: Agent
        Gets the DID for an Agent
        Specified by:
        getDID in interface Agent
        Returns:
        DID The DID that can be used to address this agent in the Ocean Ecosystem
      • getDDO

        public java.util.Map<java.lang.String,​java.lang.Object> getDDO()
        Description copied from interface: Agent
        Gets the DDO for the agent
        Specified by:
        getDDO in interface Agent
        Returns:
        The DDO of the agent as a metadata Map
      • refreshDDO

        public java.util.Map<java.lang.String,​java.lang.Object> refreshDDO()
        Fetches the latest DDO from Universal Resolver if not cached
        Returns:
        JSONObject
      • getEndpoint

        public java.lang.String getEndpoint​(java.lang.String type)
        Returns the serviceEndpoint for the specified service type. Searched the agent's DDO for the appropriate service.
        Parameters:
        type - The type of the service to find
        Returns:
        The service endpoint, or null if not found