Ejemplo n.º 1
0
  @Override
  public ACLEntry getACLEntry(long fileId, String entity) throws DatabaseException {

    try {

      byte[] key = BabuDBStorageHelper.createACLPrefixKey(fileId, entity);
      byte[] value = database.lookup(ACL_INDEX, key, null).get();

      return value == null ? null : new BufferBackedACLEntry(key, value);

    } catch (Exception exc) {
      throw new DatabaseException(exc);
    }
  }
Ejemplo n.º 2
0
  @Override
  public DatabaseResultSet<ACLEntry> getACL(long fileId) throws DatabaseException {

    try {

      byte[] prefix = BabuDBStorageHelper.createACLPrefixKey(fileId, null);
      ResultSet<byte[], byte[]> it = database.prefixLookup(ACL_INDEX, prefix, null).get();

      return new ACLIterator(it);

    } catch (Exception exc) {
      throw new DatabaseException(exc);
    }
  }