예제 #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);
 }
예제 #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);
 }
예제 #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);
 }
예제 #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();
 }
예제 #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();
  }
예제 #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();
 }
예제 #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();
 }
예제 #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();
 }
예제 #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();
 }
예제 #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());
   }
 }
예제 #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();
 }
예제 #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);
 }
예제 #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));
 }
예제 #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);
 }
예제 #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);
 }
예제 #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));
 }
예제 #17
0
 @Override
 public PnfsId getParentOf(Subject subject, PnfsId id) throws CacheException {
   PnfsHandler pnfs = new PnfsHandler(_pnfs, subject, Restrictions.none());
   return pnfs.getParentOf(id);
 }
예제 #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);
 }