Package org.lilyproject.repository.api

Examples of org.lilyproject.repository.api.LTable


    @PUT
    @Produces("application/json")
    @Consumes("application/json")
    public Response put(@PathParam("id") String id, Record record, @Context UriInfo uriInfo) {
        LRepository repository = getRepository(uriInfo);
        LTable table = getTable(uriInfo);
        return put(id, record, uriInfo, repository, table);
    }
View Full Code Here


    @POST
    @Produces("application/json")
    @Consumes("application/json")
    public Response post(@PathParam("id") String id, PostAction<Record> postAction, @Context UriInfo uriInfo) {
        LRepository repository = getRepository(uriInfo);
        LTable table = getTable(uriInfo);
        return post(id, postAction, uriInfo, repository, table);
    }
View Full Code Here

    }

    @DELETE
    public Response delete(@PathParam("id") String id, @Context UriInfo uriInfo) {
        LRepository repository = getRepository(uriInfo);
        LTable table = getTable(uriInfo);
        return delete(id, repository, table);
    }
View Full Code Here

        final RecordScan scan = new RecordScan();
        scan.setStartRecordId(newDep.id.getMaster());
        scan.setRecordFilter(new RecordVariantFilter(newDep.id.getMaster(), varProps));
        LRepository repository = indexUpdateBuilder.getRepository();
        LTable table = repository.getTable(indexUpdateBuilder.getTable());
        final IdRecordScanner scanner = table.getScannerWithIds(scan);
        IdRecord next;
        while ((next = scanner.next()) != null) {
            try {
                final Record record = VersionTag.getIdRecord(next, indexUpdateBuilder.getVTag(), table, repository);
                result.add(record);
View Full Code Here

            @DefaultValue("1") @QueryParam("start-index") Long startIndex,
            @DefaultValue("10") @QueryParam("max-results") Long maxResults,
            @Context UriInfo uriInfo) {

        LRepository repository = getRepository(uriInfo);
        LTable table = getTable(uriInfo);
        List<QName> fieldQNames = ResourceClassUtil.parseFieldList(uriInfo);

        RecordId recordId = repository.getIdGenerator().fromString(id);
        List<Record> records;
        try {
            records = table.readVersions(recordId, startIndex, startIndex + maxResults - 1, fieldQNames);
            return EntityList.create(records, uriInfo);
        } catch (RecordNotFoundException e) {
            throw new ResourceException(e, NOT_FOUND.getStatusCode());
        } catch (Exception e) {
            throw new ResourceException("Error loading record versions.", e, INTERNAL_SERVER_ERROR.getStatusCode());
View Full Code Here

    @Produces("application/json")
    public Entity<Record> get(@PathParam("id") String id, @PathParam("version") Long version,
            @Context UriInfo uriInfo) {

        LRepository repository = getRepository(uriInfo);
        LTable table = getTable(uriInfo);
        RecordId recordId = repository.getIdGenerator().fromString(id);

        try {
            return Entity.create(table.read(recordId, version), uriInfo);
        } catch (RecordNotFoundException e) {
            throw new ResourceException(e, NOT_FOUND.getStatusCode());
        } catch (VersionNotFoundException e) {
            throw new ResourceException(e, NOT_FOUND.getStatusCode());
        } catch (Exception e) {
View Full Code Here

    @Produces("application/json")
    public Entity<Record> get(@PathParam("id") String id, @PathParam("vtag") String vtag, @Context UriInfo uriInfo) {
        List<QName> fieldQNames = ResourceClassUtil.parseFieldList(uriInfo);

        LRepository repository = getRepository(uriInfo);
        LTable table = getTable(uriInfo);
        RecordId recordId = repository.getIdGenerator().fromString(id);
        Record record;
        try {
            record = VersionTag.getRecord(recordId, vtag, fieldQNames, table, repository);
            if (record == null) {
View Full Code Here

            System.out.println("----------------------------------------------------------------------");
            System.out.println("Importing " + arg + " to " + tableName + " table of repository " + repositoryName);
            InputStream is = new FileInputStream(arg);
            try {
                LRepository repository = lilyClient.getRepository(repositoryName);
                LTable table = repository.getTable(tableName);
                ImportListener importListener;
                if (cmd.hasOption(quietOption.getOpt())) {
                    importListener = new DefaultImportListener(System.out, EntityType.RECORD);
                } else {
                    importListener = new DefaultImportListener();
View Full Code Here

    @Override
    public void follow(IndexUpdateBuilder indexUpdateBuilder, FollowCallback callback)
            throws RepositoryException, IOException, InterruptedException {
        LRepository repository = indexUpdateBuilder.getRepository();
        LTable table = repository.getTable(indexUpdateBuilder.getTable());
        IdGenerator idGenerator = repository.getIdGenerator();
        RecordContext ctx = indexUpdateBuilder.getRecordContext();

        Set<String> currentDimensions = Sets.newHashSet(ctx.dep.id.getVariantProperties().keySet());
        currentDimensions.addAll(ctx.dep.moreDimensionedVariants);
View Full Code Here

            List links = IndexerUtils.flatList(ctx.record, fieldType);
            for (Link link: (List<Link>)links) {
                RecordId linkedRecordId = link.resolve(ctx.contextRecord, idGenerator);
                Record linkedRecord = null;
                String tableName = link.getTable() != null ? link.getTable() : indexUpdateBuilder.getTable();
                LTable table = repository.getTable(tableName);
                try {
                    linkedRecord = VersionTag.getIdRecord(linkedRecordId, indexUpdateBuilder.getVTag(), table, repository);
                } catch (RecordNotFoundException rnfe) {
                    // ok, continue with null value
                } catch (VersionNotFoundException e) {
View Full Code Here

TOP

Related Classes of org.lilyproject.repository.api.LTable

Copyright © 2018 www.massapicom. 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.