Ejemplo n.º 1
0
 @Override
 public FileAttributes setFileAttributes(
     Subject subject, PnfsId id, FileAttributes attr, Set<FileAttribute> acquire)
     throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   return pnfs.setFileAttributes(id, attr, acquire);
 }
Ejemplo n.º 2
0
 @Override
 public FileAttributes deleteEntry(
     Subject subject, Set<FileType> allowed, String path, Set<FileAttribute> attr)
     throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   return pnfs.deletePnfsEntry(null, path, allowed, attr);
 }
Ejemplo n.º 3
0
 @Override
 public void rename(
     Subject subject, PnfsId id, String sourcePath, String newName, boolean overwrite)
     throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   pnfs.renameEntry(id, sourcePath, newName, overwrite);
 }
Ejemplo n.º 4
0
 @Override
 public PnfsId createDirectory(Subject subject, String path, FileAttributes attributes)
     throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   attributes.setFileType(DIR);
   PnfsCreateEntryMessage returnMsg = pnfs.createPnfsDirectory(path, attributes);
   return returnMsg.getPnfsId();
 }
Ejemplo n.º 5
0
  @Override
  public PnfsId createSymLink(Subject subject, String path, String dest, FileAttributes attributes)
      throws CacheException {
    PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());

    PnfsCreateEntryMessage returnMsg = pnfs.createSymLink(path, dest, attributes);

    return returnMsg.getPnfsId();
  }
Ejemplo n.º 6
0
 @Override
 public FileAttributes commitUpload(
     Subject subject,
     FsPath uploadPath,
     FsPath pnfsPath,
     Set<CreateOption> options,
     Set<FileAttribute> attributes)
     throws CacheException {
   PnfsCommitUpload msg =
       new PnfsCommitUpload(
           subject, Restrictions.none(), uploadPath, pnfsPath, options, attributes);
   return _pnfs.request(msg).getFileAttributes();
 }
Ejemplo n.º 7
0
 @Override
 public FileAttributes createFile(
     Subject subject,
     String path,
     FileAttributes assignAttributes,
     Set<FileAttribute> requestedAttributes)
     throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   assignAttributes.setFileType(REGULAR);
   PnfsCreateEntryMessage message =
       new PnfsCreateEntryMessage(path, assignAttributes, requestedAttributes);
   return pnfs.request(message).getFileAttributes();
 }
Ejemplo n.º 8
0
 @Override
 public Collection<FileAttributes> cancelUpload(
     Subject subject,
     FsPath uploadPath,
     FsPath path,
     Set<FileAttribute> requested,
     String explanation)
     throws CacheException {
   return _pnfs
       .request(
           new PnfsCancelUpload(
               subject, Restrictions.none(), uploadPath, path, requested, explanation))
       .getDeletedFiles();
 }
Ejemplo n.º 9
0
 @Override
 public FsPath createUploadPath(
     Subject subject,
     FsPath path,
     FsPath rootPath,
     Long size,
     AccessLatency al,
     RetentionPolicy rp,
     String spaceToken,
     Set<CreateOption> options)
     throws CacheException {
   PnfsCreateUploadPath msg =
       new PnfsCreateUploadPath(
           subject, Restrictions.none(), path, rootPath, size, al, rp, spaceToken, options);
   return _pnfs.request(msg).getUploadPath();
 }
Ejemplo n.º 10
0
 @Override
 public void list(
     Subject subject,
     String path,
     Glob glob,
     Range<Integer> range,
     Set<FileAttribute> attrs,
     ListHandler handler)
     throws CacheException {
   try (DirectoryStream stream =
       _handler.list(subject, Restrictions.none(), FsPath.create(path), glob, range, attrs)) {
     for (DirectoryEntry entry : stream) {
       handler.addEntry(entry.getName(), entry.getFileAttributes());
     }
   } catch (InterruptedException e) {
     throw new TimeoutCacheException(e.getMessage());
   }
 }
Ejemplo n.º 11
0
 @Override
 public String pnfsidToPath(Subject subject, PnfsId id) throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   return pnfs.getPathByPnfsId(id).toString();
 }
Ejemplo n.º 12
0
 @Override
 public List<String> getCacheLocation(Subject subject, PnfsId id) throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   return pnfs.getCacheLocations(id);
 }
Ejemplo n.º 13
0
 @Override
 public void clearCacheLocation(Subject subject, PnfsId id, String pool, boolean removeIfLast)
     throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   pnfs.request(new PnfsClearCacheLocationMessage(id, pool, removeIfLast));
 }
Ejemplo n.º 14
0
 @Override
 public void addCacheLocation(Subject subject, PnfsId id, String pool) throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   pnfs.addCacheLocation(id, pool);
 }
Ejemplo n.º 15
0
 @Override
 public void removeChecksum(Subject subject, PnfsId id, ChecksumType type) throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   pnfs.removeChecksum(id, type);
 }
Ejemplo n.º 16
0
 @Override
 public void removeFileAttribute(Subject subject, PnfsId id, String attribute)
     throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   pnfs.notify(new PnfsFlagMessage(id, attribute, REMOVE));
 }
Ejemplo n.º 17
0
 @Override
 public PnfsId getParentOf(Subject subject, PnfsId id) throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   return pnfs.getParentOf(id);
 }
Ejemplo n.º 18
0
 @Override
 public PnfsId pathToPnfsid(Subject subject, String path, boolean followLinks)
     throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   return pnfs.getPnfsIdByPath(path, followLinks);
 }