Ejemplo n.º 1
0
 public static void releaseSpace(
     Subject subject,
     String spaceToken,
     Long spaceToReleaseInBytes,
     SrmReleaseSpaceCallback callback,
     CellStub spaceManagerStub,
     Executor executor) {
   LOGGER.trace(
       "SrmReleaseSpaceCompanion.releaseSpace({}, token {}, spaceToReleaseInBytes {})",
       subject.getPrincipals(),
       spaceToken,
       spaceToReleaseInBytes);
   try {
     long token = Long.parseLong(spaceToken);
     SrmReleaseSpaceCompanion companion = new SrmReleaseSpaceCompanion(callback);
     Release release = new Release(token, spaceToReleaseInBytes);
     release.setSubject(subject);
     CellStub.addCallback(spaceManagerStub.send(release), companion, executor);
   } catch (NumberFormatException e) {
     callback.invalidRequest("No such space");
   }
 }
Ejemplo n.º 2
0
 @Override
 public void success(Release releaseResponse) {
   callback.success(
       Long.toString(releaseResponse.getSpaceToken()), releaseResponse.getRemainingSizeInBytes());
 }