Module com.azure.runtime.host
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 Summary
ConstructorDescriptionEndpointReference
(T owner, EndpointAnnotation endpointAnnotation) Creates a new instance of EndpointReference with the specified endpoint name.EndpointReference
(T owner, String endpointName) Creates a new instance of EndpointReference with the specified endpoint name. -
Method Summary
Modifier and TypeMethodDescriptionGets the container host for this endpoint.Gets the name of the endpoint associated with this reference.getHost()
Gets the host for this endpoint.int
getPort()
Gets the port for this endpoint.A read-only list of the referenced objects of the value.Gets the resource owner of the endpoint reference.Gets the scheme for this endpoint.Gets the target port for this endpoint.getUrl()
Gets the URL for this endpoint.getValue()
Gets the expression that represents a value in manifest.boolean
Checks if the endpoint is allocated.boolean
isExists()
Gets a value indicating whether the endpoint exists.
-
Constructor Details
-
EndpointReference
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
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
- Specified by:
getValue
in interfaceValueProvider
-
getValueExpression
Description copied from interface:ManifestExpressionProvider
Gets the expression that represents a value in manifest.- Specified by:
getValueExpression
in interfaceManifestExpressionProvider
- Returns:
- The expression that represents a value in manifest.
-
getReferences
Description copied from interface:ValueWithReferences
A read-only list of the referenced objects of the value.- Specified by:
getReferences
in interfaceValueWithReferences
- Returns:
- A read-only list of the referenced objects.
-
getContainerHost
Gets the container host for this endpoint.- Returns:
- The container host.
-
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
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
Gets the resource owner of the endpoint reference.- Returns:
- The resource owner.
-
getScheme
Gets the scheme for this endpoint.- Returns:
- The scheme.
-
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
Gets the URL for this endpoint.- Returns:
- The URL.
-