Class TqlResourceImpl

  • All Implemented Interfaces:
    com.artisol.teneo.inquire.api.resources.TqlResource

    public class TqlResourceImpl
    extends AbstractResource
    implements com.artisol.teneo.inquire.api.resources.TqlResource
    • Constructor Detail

      • TqlResourceImpl

        public TqlResourceImpl​(javax.ws.rs.client.WebTarget webTarget,
                               ExecutorService executorService)
    • Method Detail

      • submitQuery

        public TqlResourceImpl.QueryPoller submitQuery​(String ldsName,
                                                       String tql,
                                                       Map<String,​Object> parameters)
                                                throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Executes a TQL asynchronously query returning a TqlResourceImpl.QueryPoller which can be polled to get the latest results and find out when the query has finished.
        Parameters:
        ldsName - The LDS name
        tql - The TQL string to be executed
        parameters - The query parameters to be added to the HTTP request
        Returns:
        A QueryPoller object
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - If there is any problem processing the request
      • submitSolutionRevisionQuery

        public TqlResourceImpl.QueryPoller submitSolutionRevisionQuery​(String ldsName,
                                                                       Map<String,​Object> parameters)
                                                                throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Executes an asynchronous request to get all the solution revisions.
        Parameters:
        ldsName - The LDS name
        parameters - The query parameters to be added to the HTTP request
        Returns:
        A QueryPoller
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - If there is any problem processing the request
      • executeSharedQuery

        public Iterable<Map<String,​Object>> executeSharedQuery​(String ldsName,
                                                                     String identifier,
                                                                     Map<String,​Object> parameters)
                                                              throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Executes a Shared Query synchronously and returns the resulting rows. This query cannot be cancelled.
        Parameters:
        ldsName - The LDS name
        identifier - Either the name or the ID of the shared query
        parameters - The query parameters to be added to the HTTP request
        Returns:
        Query result (List of Maps)
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - If there is any problem processing the request
      • submitSharedQuery

        public TqlResourceImpl.QueryPoller submitSharedQuery​(String ldsName,
                                                             String identifier,
                                                             Map<String,​Object> parameters)
                                                      throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Executes a Shared Query asynchronously and returns a TqlResourceImpl.QueryPoller which can be polled to get the latest results and find out when the query has finished.
        Parameters:
        ldsName - The LDS name
        identifier - Either the name or the ID of the shared query
        parameters - The query parameters to be added to the HTTP request
        Returns:
        A QueryPoller
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - If there is any problem processing the request
      • submitQuery

        public TqlResourceImpl.QueryCancelable submitQuery​(String ldsName,
                                                           String tql,
                                                           Map<String,​Object> parameters,
                                                           com.google.common.util.concurrent.FutureCallback<Iterable<Map<String,​Object>>> callback)
                                                    throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Executes a TQL query asynchronously, returning a TqlResourceImpl.QueryCancelable which can be used to cancel the query. It allows to pass a callback that will be called when query finish or fail.
        Parameters:
        ldsName - The LDS name
        tql - The TQL string to be executed
        parameters - The query parameters to be added to the HTTP request
        callback - The callback to be called when query finish
        Returns:
        A handle to the object for cancelling the request
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - If there is any problem processing the request
      • submitSharedQuery

        public TqlResourceImpl.QueryCancelable submitSharedQuery​(String ldsName,
                                                                 String identifier,
                                                                 Map<String,​Object> parameters,
                                                                 com.google.common.util.concurrent.FutureCallback<Iterable<Map<String,​Object>>> callback)
                                                          throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Executes a Shared Query asynchronously, returning a TqlResourceImpl.QueryCancelable which can be used to cancel the query. It allows to pass a callback that will be called when query finish or fail.
        Parameters:
        ldsName - The LDS name
        identifier - Either the name or the ID of the shared query
        parameters - The query parameters to be added to the HTTP request
        callback - Then callback to be called when query finish
        Returns:
        If there is any problem processing the request
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - If there is any problem processing the request
      • executeQuery

        public Iterable<Map<String,​Object>> executeQuery​(String ldsName,
                                                               String tql,
                                                               Map<String,​Object> parameters)
                                                        throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Executes a TQL query returning the resulting rows. This query cannot be cancelled.
        Parameters:
        ldsName - The LDS name
        tql - The TQL string to be executed
        parameters - The query parameters to be added to the HTTP request
        Returns:
        Query result (An iterable over Maps of the results)
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - If there is any problem processing the request
      • getSolutionRevisions

        public Iterable<Map<String,​Object>> getSolutionRevisions​(String ldsName,
                                                                       Map<String,​Object> parameters)
                                                                throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Executes a TQL query returning the solution revisions. This query cannot be cancelled.
        Parameters:
        ldsName - The LDS name
        parameters - The query parameters to be added to the HTTP request
        Returns:
        Query result (An iterable over Maps of the results)
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - If there is any problem processing the request
      • getSharedQueries

        public List<com.artisol.teneo.inquire.api.models.SharedQuery> getSharedQueries​(String ldsName)
                                                                                throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Fetches the SharedQuery's for a LDS.
        Parameters:
        ldsName - The LDS name
        Returns:
        A List of all the SharedQuerys of the LDS
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - If there is any problem processing the request
      • saveSharedQuery

        public void saveSharedQuery​(String ldsName,
                                    com.artisol.teneo.inquire.api.models.SharedQuery query)
                             throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Persists a SharedQuery. Overwrites any existing SharedQuery of the same name.
        Parameters:
        ldsName - The LDS name
        query - The query to save
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - If there is any problem processing the request
      • deleteSharedQuery

        public void deleteSharedQuery​(String ldsName,
                                      String identifier)
        Deletes a SharedQuery if it exists.
        Parameters:
        ldsName - The LDS name
        identifier - Either the name or the ID of the shared query