/**
   * Returns the authentication data sent by client to the target according to the a list of
   * properties. By default, this method returns checks the variable "challengeScheme", "login",
   * "password" in order to build the ChallengeResponse object. It can be overriden.
   *
   * @param resolver The resolver.
   * @return The target challengeResponse object.
   * @throws ResourceException
   */
  protected ChallengeResponse getTargetChallengeResponse(Resolver<String> resolver)
      throws ResourceException {
    final ChallengeScheme challengeScheme =
        ChallengeScheme.valueOf(resolver.resolve("challengeScheme"));
    final String login = resolver.resolve("login");
    final String password = resolver.resolve("password");

    ChallengeResponse result = null;
    if ((challengeScheme != null) && (login != null) && (password != null)) {
      result = new ChallengeResponse(challengeScheme, login, password);
    }

    return result;
  }
  /**
   * Returns the target method according to a list of properties.
   *
   * @param resolver The resolver.
   * @return The target method.
   */
  protected Method getTargetMethod(Resolver<String> resolver) {
    Method method = Method.valueOf(resolver.resolve("method"));
    if (method == null) {
      method = getTargetMethod();
    }

    return method;
  }
 /**
  * Returns the entity sent to the target. By default, it sends the mail message.
  *
  * @param resolver the resolver.
  * @return The entity to be sent to the target.
  */
 protected Representation getTargetEntity(Resolver<String> resolver) {
   return new StringRepresentation(resolver.resolve("message"));
 }