Search in sources :

Example 1 with PinManagerListPinsMessage

use of org.dcache.pinmanager.PinManagerListPinsMessage in project dcache by dCache.

the class DCacheAwareJdbcFs method listPins.

@Override
public List<PinInfo> listPins(FsInode inode) throws ChimeraFsException {
    PnfsId pnfsid = new PnfsId(inode.getId());
    PinManagerListPinsMessage request = new PinManagerListPinsMessage(pnfsid);
    Subject subject = getSubjectFromContext();
    request.setSubject(subject);
    try {
        return pinManagerStub.sendAndWait(request).getInfo().stream().map(DcachePinInfo::new).collect(Collectors.toList());
    } catch (NoRouteToCellException | InterruptedException | CacheException e) {
        throw new InvalidArgumentChimeraException(e.getMessage());
    }
}
Also used : CacheException(diskCacheV111.util.CacheException) PermissionDeniedCacheException(diskCacheV111.util.PermissionDeniedCacheException) PnfsId(diskCacheV111.util.PnfsId) NoRouteToCellException(dmg.cells.nucleus.NoRouteToCellException) PinManagerListPinsMessage(org.dcache.pinmanager.PinManagerListPinsMessage) Subject(javax.security.auth.Subject)

Aggregations

CacheException (diskCacheV111.util.CacheException)1 PermissionDeniedCacheException (diskCacheV111.util.PermissionDeniedCacheException)1 PnfsId (diskCacheV111.util.PnfsId)1 NoRouteToCellException (dmg.cells.nucleus.NoRouteToCellException)1 Subject (javax.security.auth.Subject)1 PinManagerListPinsMessage (org.dcache.pinmanager.PinManagerListPinsMessage)1