org.apache.jackrabbit.core.data.DataStore.getRecord()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(182)

本文整理了Java中org.apache.jackrabbit.core.data.DataStore.getRecord()方法的一些代码示例,展示了DataStore.getRecord()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DataStore.getRecord()方法的具体详情如下:
包路径:org.apache.jackrabbit.core.data.DataStore
类名称:DataStore
方法名:getRecord

DataStore.getRecord介绍

[英]Returns the identified data record. The given identifier should be the identifier of a previously saved data record. Since records are never removed, there should never be cases where the identified record is not found. Abnormal cases like that are treated as errors and handled by throwing an exception.
[中]返回标识的数据记录。给定的标识符应该是以前保存的数据记录的标识符。因为记录永远不会被删除,所以在任何情况下都不应该找不到已识别的记录。像这样的异常情况被视为错误,并通过抛出异常来处理。

代码示例

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-core

private DataRecord getDataRecord() throws DataStoreException {
  // may not keep the record, otherwise garbage collection doesn't work
  return store.getRecord(identifier);
}

代码示例来源:origin: apache/jackrabbit-oak

@Nullable
    @Override
    public DataRecord apply(@Nullable DataIdentifier input) {
      try {
        return delegate.getRecord(input);
      } catch (DataStoreException e) {
        log.warn("Error occurred while fetching DataRecord for identifier {}", input, e);
      }
      return null;
    }
});

代码示例来源:origin: org.apache.jackrabbit/oak-blob-plugins

@Nullable
    @Override
    public DataRecord apply(@Nullable DataIdentifier input) {
      try {
        return delegate.getRecord(input);
      } catch (DataStoreException e) {
        log.warn("Error occurred while fetching DataRecord for identifier {}", input, e);
      }
      return null;
    }
});

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Nullable @Override
    public DataRecord apply(@Nullable DataIdentifier input) {
      try {
        return delegate.getRecord(input);
      } catch (DataStoreException e) {
        log.warn("Error occurred while fetching DataRecord for identifier {}", input, e);
      }
      return null;
    }
});

代码示例来源:origin: apache/jackrabbit-oak

private DataRecord getDelegateRecord() throws DataStoreException {
    //Lazily load the delegateRecord to avoid FS access
    if (delegateRecord == null) {
      delegateRecord = getDelegate().getRecord(getIdentifier());
    }
    return delegateRecord;
  }
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public DataRecord getRecordForId(DataIdentifier identifier) throws DataStoreException {
  if (delegate instanceof SharedDataStore) {
    return ((SharedDataStore) delegate).getRecordForId(identifier);
  }
  return delegate.getRecord(identifier);
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public DataRecord getRecordForId(DataIdentifier identifier) throws DataStoreException {
  if (delegate instanceof SharedDataStore) {
    return ((SharedDataStore) delegate).getRecordForId(identifier);
  }
  return delegate.getRecord(identifier);
}

代码示例来源:origin: org.apache.jackrabbit/oak-blob-plugins

@Override
public DataRecord getRecordForId(DataIdentifier identifier) throws DataStoreException {
  if (delegate instanceof SharedDataStore) {
    return ((SharedDataStore) delegate).getRecordForId(identifier);
  }
  return delegate.getRecord(identifier);
}

代码示例来源:origin: org.apache.jackrabbit/oak-upgrade

private DataRecord getDelegateRecord() throws DataStoreException {
    //Lazily load the delegateRecord to avoid FS access
    if (delegateRecord == null) {
      delegateRecord = getDelegate().getRecord(getIdentifier());
    }
    return delegateRecord;
  }
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
protected DataRecord doGetRecord(DataStore ds, DataIdentifier identifier) throws DataStoreException {
  return ds.getRecord(identifier);
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
protected DataRecord doGetRecord(DataStore ds, DataIdentifier identifier) throws DataStoreException {
  return ds.getRecord(identifier);
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
protected DataRecord doGetRecord(DataStore ds, DataIdentifier identifier) throws DataStoreException {
  return ds.getRecord(identifier);
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
protected DataRecord doGetRecord(DataStore ds, DataIdentifier identifier) throws DataStoreException {
  return ds.getRecord(identifier);
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

protected DataRecord getDataRecord(String blobId) throws DataStoreException {
  DataRecord id;
  if (InMemoryDataRecord.isInstance(blobId)) {
    id = InMemoryDataRecord.getInstance(blobId);
  } else {
    id = delegate.getRecord(new DataIdentifier(blobId));
  }
  checkNotNull(id, "No DataRecord found for blobId [%s]", blobId);
  return id;
}

代码示例来源:origin: org.apache.jackrabbit/oak-blob-plugins

protected DataRecord getDataRecord(String blobId) throws DataStoreException {
  DataRecord id;
  if (InMemoryDataRecord.isInstance(blobId)) {
    id = InMemoryDataRecord.getInstance(blobId);
  } else {
    id = delegate.getRecord(new DataIdentifier(blobId));
  }
  checkNotNull(id, "No DataRecord found for blobId [%s]", blobId);
  return id;
}

代码示例来源:origin: apache/jackrabbit-oak

protected DataRecord getDataRecord(String blobId) throws DataStoreException {
  DataRecord id;
  if (InMemoryDataRecord.isInstance(blobId)) {
    id = InMemoryDataRecord.getInstance(blobId);
  } else {
    id = delegate.getRecord(new DataIdentifier(blobId));
  }
  checkNotNull(id, "No DataRecord found for blobId [%s]", blobId);
  return id;
}

代码示例来源:origin: apache/jackrabbit-oak

@Override
public DataRecord getRecord(DataIdentifier identifier) throws DataStoreException {
  if (isInMemoryRecord(identifier)) {
    return getDataRecord(identifier.toString());
  }
  return delegate.getRecord(identifier);
}

代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak

@Override
public DataRecord getRecord(DataIdentifier identifier) throws DataStoreException {
  if (isInMemoryRecord(identifier)) {
    return getDataRecord(identifier.toString());
  }
  return delegate.getRecord(identifier);
}

代码示例来源:origin: org.apache.jackrabbit/oak-blob-plugins

@Override
public DataRecord getRecord(DataIdentifier identifier) throws DataStoreException {
  if (isInMemoryRecord(identifier)) {
    return getDataRecord(identifier.toString());
  }
  return delegate.getRecord(identifier);
}

代码示例来源:origin: apache/jackrabbit-oak

/**
 * Test {@link DataStore#getRecord(DataIdentifier)} and assert length and
 * inputstream.
 */
protected void doGetRecordTest() throws Exception {
  byte[] data = new byte[dataLength];
  randomGen.nextBytes(data);
  DataRecord rec = ds.addRecord(new ByteArrayInputStream(data));
  rec = ds.getRecord(rec.getIdentifier());
  Assert.assertEquals(data.length, rec.getLength());
  assertRecord(data, rec);
}

相关文章