Class IRODSQuery

java.lang.Object
org.irods.irods4j.high_level.catalog.IRODSQuery

public class IRODSQuery extends Object
A class providing high-level functions for querying the iRODS catalog.
Since:
0.1.0
  • Constructor Details

    • IRODSQuery

      public IRODSQuery()
  • Method Details

    • getColumnMappings

      public static Map<String,Map<String,String>> getColumnMappings(IRODSApi.RcComm comm) throws IOException, IRODSException
      Returns the column mappings supported by the GenQuery2 API.
      Parameters:
      comm - A connection to an iRODS server.
      Returns:
      A set of mappings between the GenQuery2 columns and database columns.
      Throws:
      IOException - If a network error occurs.
      IRODSException - If the iRODS API operation fails.
      Since:
      0.1.0
    • getGeneratedSQL

      public static String getGeneratedSQL(IRODSApi.RcComm comm, String query) throws IOException, IRODSException
      Parses a GenQuery2 string and returns the generated SQL. No SQL is executed by this function.
      Parameters:
      comm - A connection to an iRODS server.
      query - The GenQuery2 string to execute.
      Returns:
      The SQL generated from the GenQuery2 string.
      Throws:
      IOException - If a network error occurs.
      IRODSException - If the iRODS API operation fails.
      Since:
      0.1.0
    • executeGenQuery2

      public static List<List<String>> executeGenQuery2(IRODSApi.RcComm comm, String query) throws IOException, IRODSException
      Executes a GenQuery2 query and returns the query results. The query is executed against the zone which the connected iRODS server resides.
      Parameters:
      comm - A connection to an iRODS server.
      query - The GenQuery2 string to execute.
      Returns:
      The resultset as a list of rows.
      Throws:
      IOException - If a network error occurs.
      IRODSException - If the iRODS API operation fails.
      Since:
      0.1.0
    • executeGenQuery2

      public static List<List<String>> executeGenQuery2(IRODSApi.RcComm comm, String zone, String query) throws IOException, IRODSException
      Executes a GenQuery2 query and returns the query results. The query is executed against the zone specified.
      Parameters:
      comm - A connection to an iRODS server.
      zone - The zone to execute the query against.
      query - The GenQuery2 string to execute.
      Returns:
      The resultset as a list of rows.
      Throws:
      IOException - If a network error occurs.
      IRODSException - If the iRODS API operation fails.
      Since:
      0.1.0
    • executeGenQuery1

      public static void executeGenQuery1(IRODSApi.RcComm comm, IRODSQuery.GenQuery1QueryArgs queryArgs, Function<List<String>,Boolean> rowHandler) throws IOException, IRODSException
      Executes a GenQuery1 query. This function may result in multiple API calls to the server. To continue processing rows, return true from the rowHandler. To end processing of the rows early, return false from the rowHandler.
      Parameters:
      comm - A connection to an iRODS server.
      queryArgs - The structure describing the query to execute.
      rowHandler - The callback used to process a single row.
      Throws:
      IOException - If a network error occurs.
      IRODSException - If the iRODS API operation fails.
      Since:
      0.1.0
    • executeSpecificQuery

      public static void executeSpecificQuery(IRODSApi.RcComm comm, String zone, String specificQueryName, List<String> bindArgs, Function<List<String>,Boolean> rowHandler) throws IOException, IRODSException
      Executes a SpecificQuery. The query is executed against the zone specified. This function may result in multiple API calls to the server. To continue processing rows, return true from the rowHandler. To end processing of the rows early, return false from the rowHandler.
      Parameters:
      comm - A connection to an iRODS server.
      zone - The zone to execute the query against.
      specificQueryName - The name of the SpecificQuery to execute.
      bindArgs - The list of bind arguments.
      rowHandler - The callback used to process a single row.
      Throws:
      IOException - If a network error occurs.
      IRODSException - If the iRODS API operation fails.
      Since:
      0.1.0
    • executeSpecificQuery

      public static void executeSpecificQuery(IRODSApi.RcComm comm, String specificQueryName, List<String> bindArgs, Function<List<String>,Boolean> rowHandler) throws IOException, IRODSException
      Executes a SpecificQuery. This function may result in multiple API calls to the server. To continue processing rows, return true from the rowHandler. To end processing of the rows early, return false from the rowHandler.
      Parameters:
      comm - A connection to an iRODS server.
      specificQueryName - The name of the SpecificQuery to execute.
      bindArgs - The list of bind arguments.
      rowHandler - The callback used to process a single row.
      Throws:
      IOException - If a network error occurs.
      IRODSException - If the iRODS API operation fails.
      Since:
      0.1.0