java.lang.Object
org.gcube.vremanagement.executor.client.query.Discover

public abstract class Discover extends Object
Finds the Smart Executor instances in the Resource Registry, in the Context of the current request: the access points of the active Smart Executor EServices, optionally only of those that activate an active RunningPlugin with a given name.
Author:
Luca Frosini (ISTI - CNR)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final String
    The only state in which an EService or a RunningPlugin receives requests.
    protected static final String
    The same, only for the EServices that activate a RunningPlugin with a name and a state.
    protected static final String
    Access points of the EServices with a group, a name and a state.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static List<String>
    getAddresses(String queryTemplate, org.gcube.com.fasterxml.jackson.databind.node.ObjectNode params)
    Runs a Query Template and keeps the endpoints of the access points of the REST application of the Smart Executor: an EService has one access point per servlet.
    static List<String>
    Returns the addresses of every active Smart Executor instance.
    static List<String>
    Returns the addresses of the Smart Executor instances that run a plugin.
    protected static org.gcube.com.fasterxml.jackson.databind.node.ObjectNode
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SERVICE_QUERY_TEMPLATE

      protected static final String SERVICE_QUERY_TEMPLATE
      Access points of the EServices with a group, a name and a state.
      See Also:
    • PLUGIN_QUERY_TEMPLATE

      protected static final String PLUGIN_QUERY_TEMPLATE
      The same, only for the EServices that activate a RunningPlugin with a name and a state.
      See Also:
    • ACTIVE

      protected static final String ACTIVE
      The only state in which an EService or a RunningPlugin receives requests.
      See Also:
  • Constructor Details

    • Discover

      public Discover()
  • Method Details

    • getInstancesAddress

      public static List<String> getInstancesAddress(String pluginName) throws org.gcube.vremanagement.executor.exception.ExecutorException
      Returns the addresses of the Smart Executor instances that run a plugin.
      Parameters:
      pluginName - the name of the plugin, its Maven artifactId
      Returns:
      the addresses, never empty
      Throws:
      org.gcube.vremanagement.executor.exception.ExecutorException - if the Resource Registry cannot be queried or no instance runs the plugin
    • getInstancesAddress

      public static List<String> getInstancesAddress() throws org.gcube.vremanagement.executor.exception.ExecutorException
      Returns the addresses of every active Smart Executor instance.
      Returns:
      the addresses; empty when there is none
      Throws:
      org.gcube.vremanagement.executor.exception.ExecutorException - if the Resource Registry cannot be queried
    • getServiceParams

      protected static org.gcube.com.fasterxml.jackson.databind.node.ObjectNode getServiceParams()
    • getAddresses

      protected static List<String> getAddresses(String queryTemplate, org.gcube.com.fasterxml.jackson.databind.node.ObjectNode params) throws org.gcube.vremanagement.executor.exception.ExecutorException
      Runs a Query Template and keeps the endpoints of the access points of the REST application of the Smart Executor: an EService has one access point per servlet.
      Throws:
      org.gcube.vremanagement.executor.exception.ExecutorException