Examples of PutFailedException


Examples of org.hive2hive.core.exceptions.PutFailedException

    boolean success = dataManager.put(parameters);
    putPerformed = true;

    if (!success) {
      throw new PutFailedException();
    }
  }
View Full Code Here

Examples of org.hive2hive.core.exceptions.PutFailedException

      encrypted.setTimeToLive(userProfileTask.getTimeToLive());
      boolean success = dataManager.putUserProfileTask(userId, contentKey, encrypted, protectionKey);
      putPerformed = true;

      if (!success) {
        throw new PutFailedException();
      }
    } catch (IOException | DataLengthException | InvalidKeyException | IllegalStateException
        | InvalidCipherTextException | IllegalBlockSizeException | BadPaddingException e) {
      throw new PutFailedException("Meta document could not be encrypted");
    } catch (NoPeerConnectionException e) {
      throw new PutFailedException(e.getMessage());
    }
  }
View Full Code Here

Examples of org.hive2hive.core.exceptions.PutFailedException

    if (modifying != null && modifying.equals(pid)) {
      modifying.setUserProfile(profile);
      modifying.readyToPut();
      modifying.waitForPut();
    } else {
      throw new PutFailedException("Not allowed to put anymore");
    }
  }
View Full Code Here

Examples of org.hive2hive.core.exceptions.PutFailedException

          } else if (!modifying.isAborted()) {
            // request is not ready to put and has not been aborted
            logger.warn("Process {} never finished doing modifications. Abort the put request.",
                modifying.getPid());
            modifying.abort();
            modifying.setPutError(new PutFailedException("Too long modification. Only " + MAX_MODIFICATION_TIME
                + "ms are allowed."));
            modifying.notifyPut();
          }
        }
      }
View Full Code Here

Examples of org.hive2hive.core.exceptions.PutFailedException

          .setData(encryptedUserProfile).setProtectionKeys(entry.getUserProfile().getProtectionKeys())
          .setTTL(entry.getUserProfile().getTimeToLive());

      boolean success = dataManager.put(parameters);
      if (!success) {
        entry.setPutError(new PutFailedException("Put failed."));
      } else {
        // cache user profile
        cachedUserProfile = entry.getUserProfile();
        cachedUserProfile.setBasedOnKey(encryptedUserProfile.getBasedOnKey());
        cachedUserProfile.setVersionKey(encryptedUserProfile.getVersionKey());
      }
    } catch (DataLengthException | IllegalStateException | InvalidCipherTextException | IOException e) {
      logger.error("Cannot encrypt the user profile. reason = '{}'", e.getMessage());
      entry.setPutError(new PutFailedException(String.format("Cannot encrypt the user profile. reason = '%s'",
          e.getMessage())));
    } finally {
      entry.notifyPut();
    }
  }
View Full Code Here

Examples of org.hive2hive.core.exceptions.PutFailedException

    }

    try {
      putWaiter.await();
    } catch (InterruptedException e) {
      putFailedException = new PutFailedException("Could not wait to put the user profile");
    }

    if (putFailedException != null) {
      throw putFailedException;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.