Package com.ngrok
Class EndpointBuilder<T extends EndpointBuilder<T>>
- java.lang.Object
-
- com.ngrok.MetadataBuilder<T>
-
- com.ngrok.EndpointBuilder<T>
-
- Type Parameters:
T
- the concrete builder impl to return to satisfy the builder pattern
- Direct Known Subclasses:
HttpBuilder
,TcpBuilder
,TlsBuilder
public abstract class EndpointBuilder<T extends EndpointBuilder<T>> extends MetadataBuilder<T>
An abstract builder sharing common attributes of endpoint listener builders.
-
-
Constructor Summary
Constructors Constructor Description EndpointBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
allowCIDR(String allowCIDR)
Adds a CIDR to the list of allowed CIDRs for this endpoint.T
denyCIDR(String denyCIDR)
Adds a CIDR to the list of denied CIDRs for this endpoint.List<String>
getAllowCIDR()
Returns a list of strings representing allowed CIDR addresses for this endpoint.List<String>
getDenyCIDR()
Returns a list of strings representing denied CIDR addresses for this endpoint.Optional<String>
getPolicy()
DEPRECATED: use getTrafficPolicy instead.ProxyProto
getProxyProto()
Returns the proxy protocol for this builder.long
getProxyProtoVersion()
Returns the version of the proxy protocol for this endpoint.Optional<String>
getTrafficPolicy()
Returns the policy for this endpoint.T
policy(String policy)
DEPRECATED: use trafficPolicy instead.T
proxyProto(ProxyProto proxyProto)
Sets the proxy protocol for this endpoint.T
trafficPolicy(String trafficPolicy)
Sets the policy for this endpoint.-
Methods inherited from class com.ngrok.MetadataBuilder
forwardsTo, getForwardsTo, getMetadata, metadata
-
-
-
-
Method Detail
-
allowCIDR
public T allowCIDR(String allowCIDR)
Adds a CIDR to the list of allowed CIDRs for this endpoint.- Parameters:
allowCIDR
- The parameter "allowCIDR" is a string that represents a Classless Inter-Domain Routing (CIDR) notation. It is used to specify a range of IP addresses that are allowed. For example, 10.0.0.0/24- Returns:
- An instance the builder represented by type T
- See Also:
- IP Restrictions in the ngrok docs for additional details.
-
denyCIDR
public T denyCIDR(String denyCIDR)
Adds a CIDR to the list of denied CIDRs for this endpoint.- Parameters:
denyCIDR
- The parameter "denyCIDR" is a string that represents a Classless Inter-Domain Routing (CIDR) notation. It is used to specify a range of IP addresses that should be denied access. For example, 10.0.0.0/24- Returns:
- An instance the builder represented by type T
- See Also:
- IP Restrictions in the ngrok docs for additional details.
-
proxyProto
public T proxyProto(ProxyProto proxyProto)
Sets the proxy protocol for this endpoint.- Parameters:
proxyProto
- the proxy protocol for the builder- Returns:
- An instance the builder represented by type T
-
policy
public T policy(String policy)
DEPRECATED: use trafficPolicy instead.- Parameters:
policy
- the policy for the builder- Returns:
- An instance the builder represented by type T
-
trafficPolicy
public T trafficPolicy(String trafficPolicy)
Sets the policy for this endpoint.- Parameters:
trafficPolicy
- the policy for the builder- Returns:
- An instance the builder represented by type T
-
getAllowCIDR
public List<String> getAllowCIDR()
Returns a list of strings representing allowed CIDR addresses for this endpoint.- Returns:
- the currently set allow CIDR addresses
-
getDenyCIDR
public List<String> getDenyCIDR()
Returns a list of strings representing denied CIDR addresses for this endpoint.- Returns:
- the currently set deny CIDR addresses
-
getProxyProto
public ProxyProto getProxyProto()
Returns the proxy protocol for this builder.- Returns:
- the currently set proxy protocol
-
getProxyProtoVersion
public long getProxyProtoVersion()
Returns the version of the proxy protocol for this endpoint.- Returns:
- the currently set version of the proxy protocol
-
getPolicy
public Optional<String> getPolicy()
DEPRECATED: use getTrafficPolicy instead.- Returns:
- the currently set policy
-
-