java.lang.Object
org.gcube.informationsystem.resourceregistry.api.rest.ServiceInstance

public abstract class ServiceInstance extends Object
Derives the public base URL of the D4Science URL-shortening/redirect service for a given infrastructure Context scope, following the url.<root>.d4science.org per-infrastructure naming convention (the production root infrastructure uses the bare BASE_URL with no root-specific subdomain segment).
Author:
Luca Frosini (ISTI - CNR)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Base URL of the D4Science URL-shortening/redirect service for the production infrastructure.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Gets the service URL for the Context scope of the caller's current security token, as provided by SecretManagerProvider.
    static String
    Gets the service URL for the infrastructure that owns the given Context scope.

    Methods inherited from class java.lang.Object

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

    • BASE_URL

      public static final String BASE_URL
      Base URL of the D4Science URL-shortening/redirect service for the production infrastructure.
      See Also:
  • Constructor Details

    • ServiceInstance

      public ServiceInstance()
  • Method Details

    • getServiceURL

      public static String getServiceURL()
      Gets the service URL for the Context scope of the caller's current security token, as provided by SecretManagerProvider.
      Returns:
      the service URL for the caller's current Context scope
    • getServiceURL

      public static String getServiceURL(String context)
      Gets the service URL for the infrastructure that owns the given Context scope.
      Parameters:
      context - the fully qualified Context scope (e.g. /root-infrastructure/vo)
      Returns:
      BASE_URL for the production root infrastructure, or the equivalent URL for the root infrastructure identified by context