Exemplo n.º 1
0
 /** Cancels all companions for a given file. */
 private synchronized void cancelCompanions(PnfsId pnfsId, String cause) {
   for (Companion companion : _companions.values()) {
     if (pnfsId.equals(companion.getPnfsId())) {
       companion.cancel(cause);
     }
   }
 }
Exemplo n.º 2
0
 @Override
 @Transactional(readOnly = true)
 public Collection<Pin> getPins(PnfsId pnfsId) {
   PersistenceManager pm = _pmf.getPersistenceManager();
   Query query = pm.newQuery(Pin.class, "_pnfsId == :pnfsId");
   Collection<Pin> pins = (Collection<Pin>) query.execute(pnfsId.toString());
   return pm.detachCopyAll(pins);
 }
Exemplo n.º 3
0
 @Override
 @Transactional(readOnly = true)
 public Pin getPin(PnfsId pnfsId, String requestId) {
   PersistenceManager pm = _pmf.getPersistenceManager();
   Query query = pm.newQuery(Pin.class, "_pnfsId == :pnfsId && _requestId == :requestId");
   query.setUnique(true);
   Pin pin = (Pin) query.execute(pnfsId.toString(), requestId);
   return (pin == null) ? null : pm.detachCopy(pin);
 }
Exemplo n.º 4
0
 @Override
 @Transactional
 public void deletePin(PnfsId pnfsId) {
   PersistenceManager pm = _pmf.getPersistenceManager();
   pm.newQuery(Pin.class, "_pnfsId == :pnfsId").deletePersistentAll(pnfsId.toString());
 }
Exemplo n.º 5
0
 private String toImageName(PnfsId id) {
   return id.toString();
 }