Package org.apache.jackrabbit.core.data

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


                throw new DataStoreException("Unsupported stream store algorithm: " + storeStream);
            }
            // UPDATE DATASTORE SET DATA=? WHERE ID=?
            conHelper.exec(updateDataSQL, wrapper, tempId);
            long length = in.getByteCount();
            DataIdentifier identifier = new DataIdentifier(digest.digest());
            usesIdentifier(identifier);
            String id = identifier.toString();
            long newModified;
            while (true) {
                newModified = System.currentTimeMillis();
                if (checkExisting(tempId, length, identifier)) {
                    touch(identifier, newModified);
View Full Code Here


            // SELECT ID FROM DATASTORE
            rs = conHelper.query(selectAllSQL);
            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

            }
            // UPDATE DATASTORE SET DATA=? WHERE ID=?
            conn.executeStmt(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=?)
            PreparedStatement prep = conn.executeStmt(updateSQL, new Object[]{
                    id, new Long(length), new Long(now),
View Full Code Here

            PreparedStatement prep = conn.executeStmt(selectAllSQL, new Object[0]);
            rs = prep.getResultSet();
            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

        return new BLOBInDataStore(store, identifier);
    }

    static BLOBInDataStore getInstance(DataStore store, InputStream in) throws DataStoreException {
        DataRecord rec = store.addRecord(in);
        DataIdentifier identifier = rec.getIdentifier();
        return new BLOBInDataStore(store, identifier);
    }
View Full Code Here

            case PropertyType.BINARY:
                InternalValue result;
                BLOBFileValue blob = null;
                if (value instanceof BinaryValueImpl) {
                    BinaryValueImpl bin = (BinaryValueImpl) value;
                    DataIdentifier identifier = bin.getDataIdentifier();
                    if (identifier != null) {
                        // access the record to ensure it is not garbage collected
                        if (store.getRecordIfStored(identifier) != null) {
                            // it exists - so we don't need to stream it again
                            // but we need to create a new object because the original
View Full Code Here

    }

    public Value createValue(Binary binary) {
        try {
            if (binary instanceof BLOBInDataStore) {
                DataIdentifier identifier = ((BLOBInDataStore) binary).getDataIdentifier();
                InternalValue value = InternalValue.getInternalValue(identifier, store);
                if (value != null) {
                    // if the value is already in this data store
                    return new BinaryValueImpl(value.getBLOBFileValue());
                }
View Full Code Here

        return PREFIX + identifier;
    }

    static BLOBInDataStore getInstance(DataStore store, String s) {
        String id = s.substring(PREFIX.length());
        DataIdentifier identifier = new DataIdentifier(id);
        return new BLOBInDataStore(store, identifier);
    }
View Full Code Here

        return new DataStoreIterator(dataStore.getAllIdentifiers());
    }

    @Override
    public boolean deleteChunk(String blobId) throws Exception {
        ((MultiDataStoreAware) dataStore).deleteRecord(new DataIdentifier(blobId));
        return true;
    }
View Full Code Here

        }

        Long length = null;
        try {
            if (dataStore instanceof CachingDataStore) {
                length = ((CachingDataStore) dataStore).getLength(new DataIdentifier(blobId));
            } else {
                length = dataStore.getRecord(new DataIdentifier(blobId)).getLength();
            }
            return length;
        } catch (DataStoreException e) {
            throw new IOException("Could not get length of blob for id " + blobId, e);
        }
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.