Package org.apache.jackrabbit.core.data

Examples of org.apache.jackrabbit.core.data.DataIdentifier


            }
            // UPDATE DATASTORE SET DATA=? WHERE ID=?
            conHelper.exec(updateDataSQL, new Object[]{wrapper, tempId});
            now = System.currentTimeMillis();
            long length = in.getPosition();
            DataIdentifier identifier = new DataIdentifier(digest.digest());
            usesIdentifier(identifier);
            id = identifier.toString();
            // UPDATE DATASTORE SET ID=?, LENGTH=?, LAST_MODIFIED=?
            // WHERE ID=?
            // AND NOT EXISTS(SELECT ID FROM DATASTORE WHERE ID=?)
            int count = conHelper.update(updateSQL, new Object[]{
                    id, new Long(length), new Long(now),
View Full Code Here


            // SELECT ID FROM DATASTORE
            rs = conHelper.exec(selectAllSQL, new Object[0], false, 0);
            while (rs.next()) {
                String id = rs.getString(1);
                if (!id.startsWith(TEMP_PREFIX)) {
                    DataIdentifier identifier = new DataIdentifier(id);
                    list.add(identifier);
                }
            }
            return list.iterator();
        } catch (Exception e) {
View Full Code Here

            ObjectListing prevObjectListing = s3service.listObjects(bucket);
            while (true) {
                for (S3ObjectSummary s3ObjSumm : prevObjectListing.getObjectSummaries()) {
                    String id = getIdentifierName(s3ObjSumm.getKey());
                    if (id != null) {
                        ids.add(new DataIdentifier(id));
                    }
                }
                if (!prevObjectListing.isTruncated()) break;
                prevObjectListing = s3service.listNextBatchOfObjects(prevObjectListing);
            }
View Full Code Here

                getClass().getClassLoader());
            ObjectListing prevObjectListing = s3service.listObjects(bucket);
            while (true) {
                List<DeleteObjectsRequest.KeyVersion> deleteList = new ArrayList<DeleteObjectsRequest.KeyVersion>();
                for (S3ObjectSummary s3ObjSumm : prevObjectListing.getObjectSummaries()) {
                    DataIdentifier identifier = new DataIdentifier(
                        getIdentifierName(s3ObjSumm.getKey()));
                    long lastModified = s3ObjSumm.getLastModified().getTime();
                    LOG.debug("Identifier [{}]'s lastModified = [{}]", identifier, lastModified);
                    if (!store.isInUse(identifier) && lastModified < min) {
                        LOG.debug("add id [{}] to delete lists",  s3ObjSumm.getKey());
View Full Code Here

        super(blob);
        this.blob = blob;
    }

    public String getContentIdentity() {
        DataIdentifier id = blob.getDataIdentifier();
        return id == null ? null : id.toString();
    }
View Full Code Here

    @Override
    public Value createValue(Binary binary) {
        try {
            if (binary instanceof BLOBInDataStore) {
                BLOBInDataStore blob = (BLOBInDataStore) binary;
                DataIdentifier identifier = blob.getDataIdentifier();
                InternalValue value;
                if (blob.usesDataStore(store)) {
                    value = InternalValue.getInternalValue(identifier, store, false);
                } else {
                    value = InternalValue.getInternalValue(identifier, store, true);
View Full Code Here

            ObjectListing prevObjectListing = s3service.listObjects(bucket);
            while (true) {
                for (S3ObjectSummary s3ObjSumm : prevObjectListing.getObjectSummaries()) {
                    String id = getIdentifierName(s3ObjSumm.getKey());
                    if (id != null) {
                        ids.add(new DataIdentifier(id));
                    }
                }
                if (!prevObjectListing.isTruncated()) break;
                prevObjectListing = s3service.listNextBatchOfObjects(prevObjectListing);
            }
View Full Code Here

                getClass().getClassLoader());
            ObjectListing prevObjectListing = s3service.listObjects(bucket);
            while (true) {
                List<DeleteObjectsRequest.KeyVersion> deleteList = new ArrayList<DeleteObjectsRequest.KeyVersion>();
                for (S3ObjectSummary s3ObjSumm : prevObjectListing.getObjectSummaries()) {
                    DataIdentifier identifier = new DataIdentifier(
                        getIdentifierName(s3ObjSumm.getKey()));
                    long lastModified = s3ObjSumm.getLastModified().getTime();
                    LOG.debug("Identifier [{}]'s lastModified = [{}]", identifier, lastModified);
                    if (!store.isInUse(identifier) && lastModified < min) {
                        LOG.debug("add id [{}] to delete lists",  s3ObjSumm.getKey());
View Full Code Here

        switch (value.getType()) {
            case PropertyType.BINARY:
                BLOBFileValue blob = null;
                if (value instanceof BinaryValueImpl) {
                    BinaryValueImpl bin = (BinaryValueImpl) value;
                    DataIdentifier identifier = bin.getDataIdentifier();
                    if (identifier != null) {
                        if (bin.usesDataStore(store)) {
                            // access the record to ensure it is not garbage collected
                            store.getRecord(identifier);
                            blob = BLOBInDataStore.getInstance(store, identifier);
View Full Code Here

    @Override
    public List<DataIdentifier> deleteAllOlderThan(final long min) {
        log("deleteAllOlderThan " + min);
        List<DataIdentifier> tobeDeleted = new ArrayList<DataIdentifier>();
        for (Map.Entry<DataIdentifier, Long> entry : timeMap.entrySet()) {
            DataIdentifier identifier = entry.getKey();
            long timestamp = entry.getValue();
            if (timestamp < min) {
                tobeDeleted.add(identifier);
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.data.DataIdentifier

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.