Class EndpointReference<T extends ResourceWithEndpoints<?>>

java.lang.Object
com.azure.runtime.host.resources.references.EndpointReference<T>
All Implemented Interfaces:
ManifestExpressionProvider, ValueProvider, ValueWithReferences

public class EndpointReference<T extends ResourceWithEndpoints<?>> extends Object implements ValueProvider, ValueWithReferences, ManifestExpressionProvider
An EndpointReference is a core type used for keeping track of endpoint details in expressions. Simple literal values cannot be used because endpoints are not known until containers are launched.
  • Constructor Details

    • EndpointReference

      public EndpointReference(T owner, EndpointAnnotation endpointAnnotation)
      Creates a new instance of EndpointReference with the specified endpoint name.
      Parameters:
      owner - The resource with endpoints that owns the endpoint reference.
      endpointAnnotation - The endpoint annotation.
    • EndpointReference

      public EndpointReference(T owner, String endpointName)
      Creates a new instance of EndpointReference with the specified endpoint name.
      Parameters:
      owner - The resource with endpoints that owns the endpoint reference.
      endpointName - The name of the endpoint.
  • Method Details

    • getValue

      public String getValue()
      Specified by:
      getValue in interface ValueProvider
    • getValueExpression

      public String getValueExpression()
      Description copied from interface: ManifestExpressionProvider
      Gets the expression that represents a value in manifest.
      Specified by:
      getValueExpression in interface ManifestExpressionProvider
      Returns:
      The expression that represents a value in manifest.
    • getReferences

      public List<Object> getReferences()
      Description copied from interface: ValueWithReferences
      A read-only list of the referenced objects of the value.
      Specified by:
      getReferences in interface ValueWithReferences
      Returns:
      A read-only list of the referenced objects.
    • getContainerHost

      public String getContainerHost()
      Gets the container host for this endpoint.
      Returns:
      The container host.
    • getEndpointName

      public String getEndpointName()
      Gets the name of the endpoint associated with this reference.
      Returns:
      The endpoint name.
    • isExists

      public boolean isExists()
      Gets a value indicating whether the endpoint exists.
      Returns:
      true if the endpoint exists, false otherwise.
    • getHost

      public String getHost()
      Gets the host for this endpoint.
      Returns:
      The host.
    • isAllocated

      public boolean isAllocated()
      Checks if the endpoint is allocated.
      Returns:
      true if the endpoint is allocated, false otherwise.
    • getPort

      public int getPort()
      Gets the port for this endpoint.
      Returns:
      The port.
    • getResource

      public T getResource()
      Gets the resource owner of the endpoint reference.
      Returns:
      The resource owner.
    • getScheme

      public Scheme getScheme()
      Gets the scheme for this endpoint.
      Returns:
      The scheme.
    • getTargetPort

      public Integer getTargetPort()
      Gets the target port for this endpoint. Returns null if the port is dynamically allocated.
      Returns:
      The target port, or null if dynamically allocated.
    • getUrl

      public String getUrl()
      Gets the URL for this endpoint.
      Returns:
      The URL.