Package org.waveprotocol.box.server.robots.util.RobotsUtil

Examples of org.waveprotocol.box.server.robots.util.RobotsUtil.RobotRegistrationException


    URI uri;
    try {
      uri = URI.create(location);
    } catch (IllegalArgumentException e) {
      String errorMessage = "Invalid Location specified, please specify a location in URI format.";
      throw new RobotRegistrationException(errorMessage + " " + e.getLocalizedMessage(), e);
    }
    String scheme = uri.getScheme();
    if (scheme == null || (!scheme.equals("http") && !scheme.equals("https"))) {
      scheme = "http";
    }
View Full Code Here


    Preconditions.checkNotNull(robotId);
    Preconditions.checkNotNull(location);
    Preconditions.checkArgument(!location.isEmpty());

    if (accountStore.getAccount(robotId) != null) {
      throw new RobotRegistrationException(robotId.getAddress()
          + " is already in use, please choose another one.");
    }
    return registerRobot(robotId, location);
  }
View Full Code Here

   * @throws RobotRegistrationException if the account is not robot.
   */
  private void throwExceptionIfNotRobot(AccountData existingAccount)
      throws RobotRegistrationException {
    if (!existingAccount.isRobot()) {
      throw new RobotRegistrationException(existingAccount.getId().getAddress()
          + " is not a robot account!");
    }
  }
View Full Code Here

    URI uri;
    try {
      uri = URI.create(location);
    } catch (IllegalArgumentException e) {
      String errorMessage = "Invalid Location specified, please specify a location in URI format.";
      throw new RobotRegistrationException(errorMessage + " " + e.getLocalizedMessage(), e);
    }
    String scheme = uri.getScheme();
    if (scheme == null || (!scheme.equals("http") && !scheme.equals("https"))) {
      scheme = "http";
    }
View Full Code Here

    Preconditions.checkNotNull(robotId);
    Preconditions.checkNotNull(location);
    Preconditions.checkArgument(!location.isEmpty());

    if (accountStore.getAccount(robotId) != null) {
      throw new RobotRegistrationException(robotId.getAddress()
          + " is already in use, please choose another one.");
    }
    return registerRobot(robotId, location);
  }
View Full Code Here

   * @throws RobotRegistrationException if the account is not robot.
   */
  private void throwExceptionIfNotRobot(AccountData existingAccount)
      throws RobotRegistrationException {
    if (!existingAccount.isRobot()) {
      throw new RobotRegistrationException(existingAccount.getId().getAddress()
          + " is not a robot account!");
    }
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.box.server.robots.util.RobotsUtil.RobotRegistrationException

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.