Class HardLink

java.lang.Object
com.jbstrap.core.HardLink

public final class HardLink extends Object

The HardLink solution for the JBStrap framework

With a HardLink, a URL can be created, that points to a specific point in the application. This URL can also hold additional information. For example, a HardLink could be sent as an e-mail, that would direct the user to a specific point in the application. The application's entry point can read and use the information stored in the URL.

This solution enables you to directly reference the contents of a Record or validate email addresses. It also may be used for the activation following the registration.

HardLink API
Since:
4.0
Author:
JBStrap
  • Method Details

    • getParams

      public static Map<String,Object> getParams(String link)

      The process for reading and decoding information stored in the HardLink.

      If the HardLink contains parameters, this method can read them and return them in a Map. If the HardLink didn't contain any parameters, or was corrupted, the method will return with null

      Parameters:
      link - The HardLink URL
      Returns:
      Map containing the parameters stored in the link. The Map key is the parameter name, and the value is the parameter value. If the HardLink didn't contain any parameters, or was corrupted, the method will return with null
    • getHardLink

      public static String getHardLink(String pageId, Parameters params)

      Generates a HardLink according to the specified parameters

      The method creates a HardLink according to the specified parameters, that points to a specific point in the application. This information contains the parameters, and is encrypted

      Parameters:
      pageId - The ID where we want the HardLink to point to
      params - The parameters stored in the HardLink, or null if we don't want to use any parameters
      Returns:
      The generated HardLink URL
      Throws:
      IllegalArgumentException - If the specified pageID isn't found, or there was an error during the generation of the URL.
      NullPointerException - If the Application's basic URL (baseURL) was not defined