コード例 #1
0
  @Override
  public GetServiceDetailResponseDocument getServiceDetail(
      GetServiceDetailRequestDocument getServiceDetailRequest) {
    log.info(getServiceDetailRequest);
    GetServiceDetailResponseDocument getServiceDetailResponseDocument = null;

    try {
      getServiceDetailResponseDocument = querier.getServiceDetail(getServiceDetailRequest);
    } catch (QueryException qe) {
      log.error("Failed to query getServiceDetail");
    }

    return getServiceDetailResponseDocument;
  }
コード例 #2
0
  @Override
  public FindServiceResponseDocument findService(FindServiceRequestDocument findServiceRequest) {
    log.info(findServiceRequest);

    FindServiceResponseDocument findServiceResponseDocument = null;

    try {
      findServiceResponseDocument = querier.findService(findServiceRequest);
    } catch (QueryException qe) {
      log.error("Failed to query findService");
    }

    return findServiceResponseDocument;
  }
コード例 #3
0
  @Override
  public GetWorkflowGraphResponseDocument getWorkflowGraph(
      GetWorkflowGraphRequestDocument getWorkflowGraphRequest) {

    log.info(getWorkflowGraphRequest);
    GetWorkflowGraphResponseDocument getWorkflowGraphResponseDocument = null;

    try {
      getWorkflowGraphResponseDocument = querier.getWorkflowGraph(getWorkflowGraphRequest);
    } catch (QueryException qe) {
      log.error("Failed to query getWorkflowGraph");
    }

    return getWorkflowGraphResponseDocument;
  }
コード例 #4
0
  @Override
  public FindAbstractMethodResponseDocument findAbstractMethod(
      FindAbstractMethodRequestDocument findAbstractMethodRequest) {
    log.info(findAbstractMethodRequest);

    FindAbstractMethodResponseDocument findAbstractMethodResponseDocument = null;

    try {
      findAbstractMethodResponseDocument = querier.findAbstractMethod(findAbstractMethodRequest);
    } catch (QueryException qe) {
      log.error("Failed to query findAbstractMethod");
    }

    return findAbstractMethodResponseDocument;
  }
コード例 #5
0
  @Override
  public CompareWorkflowGraphsResponseDocument compareWorkflowGraphs(
      CompareWorkflowGraphsRequestDocument compareWorkflowGraphsRequest) {
    log.info(compareWorkflowGraphsRequest);

    CompareWorkflowGraphsResponseDocument compareWorkflowGraphsResponseDocument = null;

    try {
      compareWorkflowGraphsResponseDocument =
          querier.compareWorkflowGraphs(compareWorkflowGraphsRequest);
    } catch (QueryException qe) {
      log.error("Failed to query compareWorkflowGraphs");
    }

    return compareWorkflowGraphsResponseDocument;
  }
コード例 #6
0
  @Override
  public GetProvenanceHistoryResponseDocument getProvenanceHistory(
      GetProvenanceHistoryRequestDocument getProvenanceHistoryRequest) {
    // TODO Auto-generated method stub
    log.info(getProvenanceHistoryRequest);

    GetProvenanceHistoryResponseDocument getProvenanceHistoryResponseDocument = null;

    try {
      getProvenanceHistoryResponseDocument =
          querier.getProvenanceHistory(getProvenanceHistoryRequest);
    } catch (QueryException qe) {
      log.error("Failed to query getProvenanceHistory");
    }

    return getProvenanceHistoryResponseDocument;
  }
コード例 #7
0
  public static String queryProvenance(QueryImplementer querier, XmlObject query) {
    try {
      QueryTypeEnum QueryType = QueryTypeEnum.determineQueryTypeFromXmlBeansDocument(query);
      switch (QueryType) {
        case COMPARE_WORKFLOW_GRAPHS:
          CompareWorkflowGraphsResponseDocument compareWorkflowGraphsResponseDocument = null;

          try {
            compareWorkflowGraphsResponseDocument =
                querier.compareWorkflowGraphs((CompareWorkflowGraphsRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in compareWorkflowGraphs().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return compareWorkflowGraphsResponseDocument.xmlText(
              new XmlOptions().setSavePrettyPrint());

        case FIND_ABSTRACT_DATA_PRODUCT:
          FindAbstractDataProductResponseDocument findAbstractDataProductResponseDocument = null;

          try {
            findAbstractDataProductResponseDocument =
                querier.findAbstractDataProduct((FindAbstractDataProductRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in findAbstractDataProduct().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return findAbstractDataProductResponseDocument.xmlText(
              new XmlOptions().setSavePrettyPrint());

        case FIND_ABSTRACT_METHOD:
          FindAbstractMethodResponseDocument findAbstractMethodResponseDocument = null;

          try {
            findAbstractMethodResponseDocument =
                querier.findAbstractMethod((FindAbstractMethodRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in findAbstractMethod().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return findAbstractMethodResponseDocument.xmlText(new XmlOptions().setSavePrettyPrint());

        case FIND_ABSTRACT_SERVICE:
          FindAbstractServiceResponseDocument findAbstractServiceResponseDocument = null;

          try {
            findAbstractServiceResponseDocument =
                querier.findAbstractService((FindAbstractServiceRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in findAbstractService().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return findAbstractServiceResponseDocument.xmlText(new XmlOptions().setSavePrettyPrint());

        case FIND_DATA_PRODUCT:
          FindDataProductResponseDocument findDataProductResponseDocument = null;

          try {
            findDataProductResponseDocument =
                querier.findDataProduct((FindDataProductRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in findDataProduct().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return findDataProductResponseDocument.xmlText(new XmlOptions().setSavePrettyPrint());

        case FIND_METHOD_INVOCATION:
          FindMethodInvocationResponseDocument findMethodInvocationResponseDocument = null;

          try {
            findMethodInvocationResponseDocument =
                querier.findMethodInvocation((FindMethodInvocationRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in findMethodInvocation().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return findMethodInvocationResponseDocument.xmlText(
              new XmlOptions().setSavePrettyPrint());

        case FIND_SERVICE:
          FindServiceResponseDocument findServiceResponseDocument = null;

          try {
            findServiceResponseDocument = querier.findService((FindServiceRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in findService().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return findServiceResponseDocument.xmlText(new XmlOptions().setSavePrettyPrint());

        case GET_ABSTRACT_DATA_PRODUCT_DETAIL:
          GetAbstractDataProductDetailResponseDocument
              getAbstractDataProductDetailResponseDocument = null;

          try {
            getAbstractDataProductDetailResponseDocument =
                querier.getAbstractDataProductDetail(
                    (GetAbstractDataProductDetailRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in getAbstractDataProductDetail().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return getAbstractDataProductDetailResponseDocument.xmlText(
              new XmlOptions().setSavePrettyPrint());

        case GET_ABSTRACT_METHOD_DETAIL:
          GetAbstractMethodDetailResponseDocument getAbstractMethodDetailResponseDocument = null;

          try {
            getAbstractMethodDetailResponseDocument =
                querier.getAbstractMethodDetail((GetAbstractMethodDetailRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in getAbstractMethodDetail().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return getAbstractMethodDetailResponseDocument.xmlText(
              new XmlOptions().setSavePrettyPrint());

        case GET_ABSTRACT_SERVICE_DETAIL:
          GetAbstractServiceDetailResponseDocument getAbstractServiceDetailResponseDocument = null;

          try {
            getAbstractServiceDetailResponseDocument =
                querier.getAbstractServiceDetail((GetAbstractServiceDetailRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in getAbstractServiceDetail().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return getAbstractServiceDetailResponseDocument.xmlText(
              new XmlOptions().setSavePrettyPrint());

        case GET_ANNOTATION_DETAIL:
          GetAnnotationDetailResponseDocument getAnnotationDetailResponseDocument = null;

          try {
            getAnnotationDetailResponseDocument =
                querier.getAnnotationDetail((GetAnnotationDetailRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in getAnnotationDetail().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return getAnnotationDetailResponseDocument.xmlText(new XmlOptions().setSavePrettyPrint());

        case GET_CLIENT_DETAIL:
          GetClientDetailResponseDocument getClientDetailResponseDocument = null;

          try {
            getClientDetailResponseDocument =
                querier.getClientDetail((GetClientDetailRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in getClientDetail()");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return getClientDetailResponseDocument.xmlText(new XmlOptions().setSavePrettyPrint());

        case GET_DATA_PRODUCT_DETAIL:
          GetDataProductDetailResponseDocument getDataProductDetailResponseDocument = null;

          try {
            getDataProductDetailResponseDocument =
                querier.getDataProductDetail((GetDataProductDetailRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in getDataProductDetail().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return getDataProductDetailResponseDocument.xmlText(
              new XmlOptions().setSavePrettyPrint());

        case GET_SERVICE_DETAIL:
          GetServiceDetailResponseDocument getServiceDetailResponseDocument = null;

          try {
            getServiceDetailResponseDocument =
                querier.getServiceDetail((GetServiceDetailRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in getServiceDetail().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return getServiceDetailResponseDocument.xmlText(new XmlOptions().setSavePrettyPrint());

        case GET_METHOD_INVOCATION_DETAIL:
          GetMethodInvocationDetailResponseDocument getMethodInvocationDetailResponseDocument =
              null;

          try {
            getMethodInvocationDetailResponseDocument =
                querier.getMethodInvocationDetail((GetMethodInvocationDetailRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in getMethodInvocationDetail().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }

          return getMethodInvocationDetailResponseDocument.xmlText(
              new XmlOptions().setSavePrettyPrint());

        case GET_WORKFLOW_GRAPH:
          /*
          String instanceID = ((GetOPMDocument)query).getGetOPM().getIn();
          Connection connection = null;
          OpmGraphDocument opmGraphDoc = null;
          try {
              connection = DBConnectionPool.getInstance().getEntry();
              opmGraphDoc = QueryByWorkflowURIUtil.getOPMGraphDocument(connection, instanceID);
          } finally {
              if (connection != null) {
                  DBConnectionPool.getInstance().releaseEntry(connection);
              }
          }
          return opmGraphDoc.xmlText(new XmlOptions().setSavePrettyPrint());
          */

          GetWorkflowGraphResponseDocument getWorkflowGraphResponseDocument = null;

          try {
            getWorkflowGraphResponseDocument =
                querier.getWorkflowGraph((GetWorkflowGraphRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in getWorkflowGraph().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }
          return getWorkflowGraphResponseDocument.xmlText(new XmlOptions().setSavePrettyPrint());

        case GET_PROVENANCE_HISTORY:
          GetProvenanceHistoryResponseDocument getProvenanceHistoryResponseDocument = null;
          try {
            getProvenanceHistoryResponseDocument =
                querier.getProvenanceHistory((GetProvenanceHistoryRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in getProvenanceHistory().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }
          return getProvenanceHistoryResponseDocument.xmlText(
              new XmlOptions().setSavePrettyPrint());

        case GET_NODE_COUNT_OF_GRAPH:
          GetNodeCountOfGraphResponseDocument getNodeCountOfGraphResponseDocument = null;
          try {
            getNodeCountOfGraphResponseDocument =
                querier.getNodeCountOfGraph((GetNodeCountOfGraphRequestDocument) query);
          } catch (QueryException qe) {
            l.error("Error in getNodeCountOfGraph().");
            l.error(qe.getMessage());
            return ERROR_STRING + ": " + qe.getMessage();
          }
          return getNodeCountOfGraphResponseDocument.xmlText(new XmlOptions().setSavePrettyPrint());

        case UNKNOWN_TYPES:
          l.error("Unknown query type.");
          return "Unknown Query";
        default:
          l.error("Unknown query type.");
          return "Unknown Query";
      }
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return "[Exception in queryProvenance]" + e.getMessage();
    }
  }