Class HttpMacrosUpdater

java.lang.Object
org.sentrysoftware.metricshub.engine.client.http.HttpMacrosUpdater

public class HttpMacrosUpdater extends Object
Utility class for updating HTTP macros in a text string. Replaces known HTTP macros with literal target sequences, such as username, password, authentication-token, base64-password, base64-auth, and sha256-auth.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    update(String text, String username, char[] password, String authenticationToken, @NonNull String hostname)
    Replaces each known HTTP macro in the given text with the literal target sequences:
    username, password, authentication-token, base64-password, base64-auth and sha256-auth

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HttpMacrosUpdater

      public HttpMacrosUpdater()
  • Method Details

    • update

      public static String update(String text, String username, char[] password, String authenticationToken, @NonNull @NonNull String hostname)
      Replaces each known HTTP macro in the given text with the literal target sequences:
      username, password, authentication-token, base64-password, base64-auth and sha256-auth
      Parameters:
      text - The text we wish to update
      username - The HTTP username
      password - The HTTP password
      authenticationToken - The HTTP Authentication Token
      hostname - The remote hostname
      Returns:
      String value