/** * Adds the robot to the account store and notifies the listeners. */ private RobotAccountData registerRobot(ParticipantId robotId, String location) throws RobotRegistrationException, PersistenceException { String robotLocation = computeValidateRobotUrl(location); RobotAccountData robotAccount = new RobotAccountDataImpl(robotId, robotLocation, tokenGenerator.generateToken(TOKEN_LENGTH), null, true); accountStore.putAccount(robotAccount); for (Listener listener : listeners) { listener.onRegistrationSuccess(robotAccount); } return robotAccount; }