Package org.hive2hive.core.exceptions

Examples of org.hive2hive.core.exceptions.PutFailedException


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

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


      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

    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

          } 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

          .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

    }

    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

Related Classes of org.hive2hive.core.exceptions.PutFailedException

Copyright © 2018 www.massapicom. 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.