Class UriService

java.lang.Object
org.forgerock.openig.tools.am.UriService

public class UriService extends Object
Computes AM endpoint URIs, based on path normalizer, realm and a base Uri.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UriService(RealmNormalizer normalizer, Realm realm, URI baseUri)
    Constructs a new URI service.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the base URI for this server.
    Build the endpoint URI for an endpoint located in the /json namespace.
    json(String endpoint)
    Build the endpoint URI for an endpoint located in the /json namespace.
    Build the endpoint URI for an endpoint located in the /json namespace.
    jsonUri(String endpoint)
    Build the endpoint URI for an endpoint located in the /json namespace.
    oauth2(String endpoint)
    Build the endpoint URI for an endpoint located in the /oauth2 namespace.
    oauth2Uri(String endpoint)
    Build the endpoint URI for an endpoint located in the /oauth2 namespace.
    sts()
    Returns the transformation endpoint located in the /rest-sts namespace.
    sts(String endpoint)
    Returns the transformation endpoint located in the /rest-sts namespace.
    stsUri(String endpoint)
    Returns the URI of the transformation endpoint located in the /rest-sts namespace.
    uma(String endpoint)
    Build the endpoint URI for an endpoint located in the /uma namespace.
    umaUri(String endpoint)
    Build the endpoint URI for an endpoint located in the /uma namespace.
    Build a websocket URI, based on this server's baseUri.

    Methods inherited from class java.lang.Object

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

    • UriService

      public UriService(RealmNormalizer normalizer, Realm realm, URI baseUri)
      Constructs a new URI service.
      Parameters:
      normalizer - Realm normalizer (never null)
      realm - AM realm (never null)
      baseUri - AM server base URI (never null)
  • Method Details

    • getBaseUri

      public URI getBaseUri()
      Return the base URI for this server.
      Returns:
      the base URI for this server.
    • websocketUri

      public URI websocketUri(String path)
      Build a websocket URI, based on this server's baseUri.

      If server URI is secure (https), then the returned websocket uri will also use the secure websocket scheme (wss), returns ws scheme instead.

      Parameters:
      path - URL path to the web-socket endpoint
      Returns:
      an absolute websocket URI.
    • json

      public String json()
      Build the endpoint URI for an endpoint located in the /json namespace.
      Returns:
      an absolute endpoint URI.
    • json

      public String json(String endpoint)
      Build the endpoint URI for an endpoint located in the /json namespace.
      Parameters:
      endpoint - endpoint name, such as policies or /serverinfo/version. The endpoint MUST be a proper encoded path.
      Returns:
      an absolute endpoint URI.
    • jsonUri

      public URI jsonUri()
      Build the endpoint URI for an endpoint located in the /json namespace.
      Returns:
      an absolute endpoint URI.
    • jsonUri

      public URI jsonUri(String endpoint)
      Build the endpoint URI for an endpoint located in the /json namespace.
      Parameters:
      endpoint - endpoint name, such as policies or /serverinfo/version. The endpoint MUST be a proper encoded path.
      Returns:
      an absolute endpoint URI
    • oauth2

      public String oauth2(String endpoint)
      Build the endpoint URI for an endpoint located in the /oauth2 namespace.
      Parameters:
      endpoint - endpoint name, such as .well-known/openid-configuration or /authorize. The endpoint MUST be a proper encoded path.
      Returns:
      an absolute endpoint URI
    • oauth2Uri

      public URI oauth2Uri(String endpoint)
      Build the endpoint URI for an endpoint located in the /oauth2 namespace.
      Parameters:
      endpoint - endpoint name, such as .well-known/openid-configuration or /authorize. The endpoint MUST be a proper encoded path.
      Returns:
      an absolute endpoint URI.
    • uma

      public String uma(String endpoint)
      Build the endpoint URI for an endpoint located in the /uma namespace.
      Parameters:
      endpoint - endpoint name, such as .well-known/uma-configuration or /authz_request. The endpoint MUST be a proper encoded path.
      Returns:
      an absolute endpoint URI.
    • sts

      public String sts()
      Returns the transformation endpoint located in the /rest-sts namespace.
      Returns:
      the transformation endpoint located in the /rest-sts namespace.
    • sts

      public String sts(String endpoint)
      Returns the transformation endpoint located in the /rest-sts namespace.
      Parameters:
      endpoint - The endpoint name, such as rest-sts/username-transformer. The endpoint MUST be a proper encoded path.
      Returns:
      the transformation endpoint located in the /rest-sts namespace.
    • stsUri

      public URI stsUri(String endpoint)
      Returns the URI of the transformation endpoint located in the /rest-sts namespace.
      Parameters:
      endpoint - The endpoint name, such as rest-sts/username-transformer. The endpoint MUST be a proper encoded path.
      Returns:
      an absolute endpoint URI.
    • umaUri

      public URI umaUri(String endpoint)
      Build the endpoint URI for an endpoint located in the /uma namespace.
      Parameters:
      endpoint - endpoint name, such as .well-known/uma-configuration or /authz_request. The endpoint MUST be a proper encoded path.
      Returns:
      an absolute endpoint URI.