Examples of GraphGenerator


Examples of com.impetus.kundera.graph.GraphGenerator

            throw new IllegalArgumentException(
                    "Entity object is invalid, operation failed. Please check previous log message for details");
        }

        // Create an object graph of the entity object.
        ObjectGraph graph = new GraphGenerator().generateGraph(e, this);
        // Call persist on each node in object graph.
        Node node = graph.getHeadNode();
        try
        {
            // Get write lock before writing object required for transaction.
View Full Code Here

Examples of com.impetus.kundera.graph.GraphGenerator

        }

        EntityMetadata metadata = getMetadata(e.getClass());

        // Create an object graph of the entity object
        ObjectGraph graph = new GraphGenerator().generateGraph(e, this, new ManagedState());

        Node node = graph.getHeadNode();

        try
        {
View Full Code Here

Examples of com.impetus.kundera.graph.GraphGenerator

        }

        EntityMetadata m = getMetadata(e.getClass());

        // Create an object graph of the entity object to be merged
        ObjectGraph graph = new GraphGenerator().generateGraph(e, this);

        // Call merge on each node in object graph
        Node node = graph.getHeadNode();

        try
View Full Code Here

Examples of org.apache.oozie.util.GraphGenerator

            response.setContentType(RestConstants.PNG_IMAGE_CONTENT_TYPE);
            try {
                String showKill = request.getParameter(RestConstants.JOB_SHOW_KILL_PARAM);
                boolean sK = showKill != null && (showKill.equalsIgnoreCase("yes") || showKill.equals("1") || showKill.equalsIgnoreCase("true"));

                new GraphGenerator(
                        getWorkflowJobDefinition(request, response),
                        (JsonWorkflowJob)getWorkflowJob(request, response),
                        sK).write(response.getOutputStream());
            }
            catch (Exception e) {
View Full Code Here

Examples of org.apache.oozie.util.GraphGenerator

            response.setContentType(RestConstants.PNG_IMAGE_CONTENT_TYPE);
            try {
                String showKill = request.getParameter(RestConstants.JOB_SHOW_KILL_PARAM);
                boolean sK = showKill != null && (showKill.equalsIgnoreCase("yes") || showKill.equals("1") || showKill.equalsIgnoreCase("true"));

                new GraphGenerator(
                        getWorkflowJobDefinition(request, response),
                        (JsonWorkflowJob)getWorkflowJob(request, response),
                        sK).write(response.getOutputStream());
            }
            catch (Exception e) {
View Full Code Here

Examples of org.apache.oozie.util.GraphGenerator

                response.setContentType(RestConstants.PNG_IMAGE_CONTENT_TYPE);

                String showKill = request.getParameter(RestConstants.JOB_SHOW_KILL_PARAM);
                boolean sK = showKill != null && (showKill.equalsIgnoreCase("yes") || showKill.equals("1") || showKill.equalsIgnoreCase("true"));

                new GraphGenerator(
                        getWorkflowJobDefinition(request, response),
                        (WorkflowJobBean)getWorkflowJob(request, response),
                        sK).write(response.getOutputStream());

            }
View Full Code Here

Examples of org.apache.oozie.util.GraphGenerator

            response.setContentType(RestConstants.PNG_IMAGE_CONTENT_TYPE);
            try {
                String showKill = request.getParameter(RestConstants.JOB_SHOW_KILL_PARAM);
                boolean sK = showKill != null && (showKill.equalsIgnoreCase("yes") || showKill.equals("1") || showKill.equalsIgnoreCase("true"));

                new GraphGenerator(
                        getWorkflowJobDefinition(request, response),
                        (JsonWorkflowJob)getWorkflowJob(request, response),
                        sK).write(response.getOutputStream());
            }
            catch (Exception e) {
View Full Code Here

Examples of org.geotools.graph.build.GraphGenerator

     *  </p>
     */

  public List<AttributeType> sort() {
    //build a directed graph representing dependencies among types
    GraphGenerator gg = new BasicDirectedGraphGenerator();
   
    for (Iterator itr = types.values().iterator(); itr.hasNext();) {
      AttributeType type = (AttributeType) itr.next();
      AttributeType superType =  type.getSuper();
     
      if (superType != null) {
        //add edge type -> parent
        gg.add(new Object[]{type,superType});
      }
     
      if (type instanceof ComplexType) {
        ComplexType cType = (ComplexType) type;
       
        //add an edge for each descriptor
        Collection atts = cType.getDescriptors();
        for (Iterator aitr = atts.iterator(); aitr.hasNext();) {
          PropertyDescriptor ad = (PropertyDescriptor) aitr.next();
          gg.add(new Object[]{type,ad.getType()});
        }
      }
    }
   
    Graph graph = gg.getGraph();
   
    //test the graph for cycles
    CycleDetector cycleDetector = new DirectedCycleDetector(graph);
    if (cycleDetector.containsCycle()) {
      logger.info("Cycle found");
View Full Code Here

Examples of org.geotools.graph.build.GraphGenerator

   *
   * @see org.geotools.graph.io.GraphReaderWriter#read()
   */
  public Graph read() throws Exception {
    //get underlying generator
    GraphGenerator generator = (GraphGenerator)getProperty(GENERATOR);
   
    //create database connection
    Connection conn = getConnection();
   
    //query database to obtain graph information
    Statement st = conn.createStatement();
    ResultSet rs = st.executeQuery(getQuery());
//    System.out.println(getQuery());
   
    while(rs.next()) {
      generator.add(readInternal(rs));   
    }
   
    //close database connection
    rs.close();
    st.close();
    conn.close();
   
    return(generator.getGraph());
  }
View Full Code Here

Examples of org.geotools.graph.build.GraphGenerator

   *
   * @see GraphGenerator#read()
   */
  public Graph read() throws Exception {
    //get the underlying generator
    GraphGenerator generator = (GraphGenerator)getProperty(GENERATOR);
   
    //create in the file reader
    BufferedReader in = new BufferedReader(
      new FileReader(
        (String)getProperty(FILENAME)
      )
    );
       
    //read the delimiter property
    String delim = (String)getProperty(DELIMITER);
    delim = delim != null ? delim : ",";
   
    //read file line by line passing each line to template method
    String line;
    while((line = in.readLine()) != null) {
      StringTokenizer st = new StringTokenizer(line,delim);
      generator.add(readInternal(st));
    }
   
    return(generator.getGraph());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.