/**
   * This method returns a list of the methods.
   *
   * @param session The session to retrieve the list of methods from.
   * @return The list of methods.
   * @throws com.rift.coad.daemon.jython.JythonDaemonException
   */
  private List<DataMapperMethod> listMethods(Session session) throws JythonDaemonException {
    try {
      List<SPARQLResultRow> entries =
          session
              .createSPARQLQuery(
                  "SELECT ?s WHERE { "
                      + "?s a <http://www.coadunation.net/schema/rdf/1.0/datamapper#DataMapperMethod> ."
                      + "?s <http://www.coadunation.net/schema/rdf/1.0/datamapper#DataMapperMethodServiceId> ?ServiceId ."
                      + "FILTER (?ServiceId = ${ServiceId})}")
              .setString("ServiceId", Constants.SERVICE_ID)
              .execute();
      List<DataMapperMethod> methods = new ArrayList<DataMapperMethod>();
      for (SPARQLResultRow row : entries) {
        methods.add(row.get(0).cast(DataMapperMethod.class));
      }

      return methods;
    } catch (Exception ex) {
      log.error("Failed to retrieve a list of all the registered methods : " + ex.getMessage(), ex);
      throw new JythonDaemonException(
          "Failed to retrieve a list of all the registered methods : " + ex.getMessage(), ex);
    }
  }