Examples of DataStore


Examples of org.apache.wink.example.qadefect.legacy.DataStore

            logger.error("The content of the defect is missing");
            throw new WebApplicationException(Response.Status.BAD_REQUEST);
        }

        // add the defect to the defects store and set it a new ID
        DataStore store = DataStore.getInstance();
        String id = store.getDefectUniqueId();
        DefectBean defect = asset.getDefect();
        defect.setId(id);
        store.putDefect(id, defect);

        // return the defect and set the status code to created (201)
        URI location = uriInfo.getAbsolutePathBuilder().segment(id).build();
        return Response.created(location).entity(asset).build();
    }
View Full Code Here

Examples of org.apache.wink.example.qadefect.legacy.DataStore

    @Produces( {MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON,
        MediaType.APPLICATION_XML, MediaType.TEXT_HTML})
    public DefectAsset getDefect(@PathParam("defect") String defectId) {
        // fetch the defect bean from the store, throw 404 in case it does not
        // exist
        DataStore store = DataStore.getInstance();
        DefectBean defect = store.getDefect(defectId);
        if (defect == null) {
            logger.info("Defect {} does not exist", defectId);
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }
View Full Code Here

Examples of org.apache.wink.example.qadefect.legacy.DataStore

    @Path(DEFECT_ATTACHMENT_PATH)
    @GET
    @Produces( {MediaTypeUtils.IMAGE_JPEG})
    public InputStream getDefectAttachement(@PathParam("defect") String defectId) {

        DataStore store = DataStore.getInstance();

        // create data object (populated with store data)
        DefectBean defect = store.getDefect(defectId);
        if (defect == null) {
            logger.info("Defect {} does not exist", defectId);
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }
View Full Code Here

Examples of org.apache.wink.example.qadefect.legacy.DataStore

        MediaType.APPLICATION_XML})
    public DefectAsset updateDefect(DefectAsset asset,
                                    @Context LinkBuilders linkProcessor,
                                    @PathParam("defect") String defectId) {

        DataStore store = DataStore.getInstance();
        // verify Defect exist in the store, return 404 otherwise
        DefectBean bean = store.getDefect(defectId);
        if (bean == null) {
            logger.info("Defect {} does not exist", defectId);
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }

        // set Id in the resources data for cases that element <id> is missing
        // in the request body
        DefectBean defect = asset.getDefect();
        defect.setId(defectId);

        // update defect legacy bean to the store
        store.putDefect(defectId, defect);
        return asset;
    }
View Full Code Here

Examples of org.apache.wink.example.qadefect.legacy.DataStore

    @Path(DEFECT_PATH)
    @DELETE
    @Produces( {MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON,
        MediaType.APPLICATION_XML})
    public DefectAsset deleteDefect(@PathParam("defect") String defectId) {
        DataStore store = DataStore.getInstance();
        DefectBean defect = store.getDefect(defectId);
        store.removeDefect(defectId);
        return new DefectAsset(defect);
    }
View Full Code Here

Examples of org.apache.wink.example.simpledefects.legacy.DataStore

     * @return response with requested resource representation
     */
    @GET
    @Produces( {MediaType.APPLICATION_ATOM_XML, MediaType.APPLICATION_JSON})
    public DefectsAsset getDefects() {
        DataStore store = DataStore.getInstance();
        Collection<DefectBean> defects = store.getDefects();
        DefectsAsset asset = new DefectsAsset(defects);
        return asset;
    }
View Full Code Here

Examples of org.eclipse.bpmn2.DataStore

    public void testDataStoreUnmarshalling() throws Exception {
        Bpmn2JsonUnmarshaller unmarshaller = new Bpmn2JsonUnmarshaller();
        Definitions definitions = ((Definitions) unmarshaller.unmarshall(getTestJsonFile("dataStore.json"), "").getContents().get(0));
        assertTrue(definitions.getRootElements().size() == 1);
        assertTrue(definitions.getRootElements().iterator().next() instanceof DataStore);
        DataStore da = (DataStore) definitions.getRootElements().iterator().next();
        assertEquals("data store", da.getName());
        definitions.eResource().save(System.out, Collections.emptyMap());
    }
View Full Code Here

Examples of org.eobjects.analyzer.connection.Datastore

  public void close() {
    SqlDatabaseUtils.safeClose(null, _insertStatement);

    DatastoreOutputWriterFactory.release(this);

    Datastore datastore = new JdbcDatastore(_datastoreName, _jdbcUrl, DRIVER_CLASS_NAME, "SA", "");
    _datastoreCreationDelegate.createDatastore(datastore);
  }
View Full Code Here

Examples of org.eobjects.analyzer.connection.Datastore

    assertNotNull(preferences);

    List<Datastore> datastores = preferences.getUserDatastores();
    assertEquals(2, datastores.size());

    Datastore datastore;
    datastore = datastores.get(0);
    assertEquals("JdbcDatastore[name=orderdb,url=jdbc:hsqldb:res:orderdb;readonly=true]", datastore.toString());
    assertEquals(null, datastore.getDescription());

    datastore = datastores.get(1);
    assertEquals("CsvDatastore[name=foobar, filename=C:\\foobar.txt, quoteChar='\"', separatorChar=',', encoding=UTF-8]", datastore.toString());
    assertEquals("C:\\foobar.txt", ((CsvDatastore) datastore).getFilename());
    assertEquals(null, datastore.getDescription());

    List<Dictionary> dictionaries = preferences.getUserDictionaries();
    assertEquals(1, dictionaries.size());

    assertEquals("SimpleDictionary[name=my dictionary]", dictionaries.get(0).toString());
View Full Code Here

Examples of org.eobjects.analyzer.connection.Datastore

    LookAndFeelManager.getInstance().init();

    // run a small job
    AnalyzerBeansConfiguration conf = new JaxbConfigurationReader().create(new File(DataCleanerHome.get(), "conf.xml"));
    final AnalysisJobBuilder ajb = new AnalysisJobBuilder(conf);
    Datastore ds = conf.getDatastoreCatalog().getDatastore("orderdb");
    DataContextProvider dcp = ds.getDataContextProvider();
    SchemaNavigator sn = dcp.getSchemaNavigator();
    ajb.setDatastore(ds);
    ajb.addSourceColumns(sn.convertToTable("PUBLIC.TRIAL_BALANCE").getColumns());
    ajb.addRowProcessingAnalyzer(ValueDistributionAnalyzer.class).addInputColumns(ajb.getSourceColumns());
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.