Class Bindings
java.lang.Object
org.springframework.cloud.bindings.Bindings
A representation of a collection of bindings as defined by the
Kubernetes Service Binding Specification.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBindings()Creates a newBindingsinstance, using the$SERVICE_BINDING_ROOTenvironment variable or the$CNB_BINDINGSenvironment variable if it does not exist to determine the file system root.Creates a newBindingsinstance, using the specifiedpath.Creates a newBindingsinstance using the specified content. -
Method Summary
Modifier and TypeMethodDescriptionfilterBindings(String type) Returns zero or moreBindings with a given type.filterBindings(String type, String provider) Return zero or moreBindings with a given type and provider.findBinding(String name) Returns aBindingwith a given name.Returns all theBindings that were found during construction.
-
Field Details
-
CNB_BINDINGS
The name of the environment variable to read to determine the bindings file system root. Specified by the Cloud Native Buildpacks Specification- See Also:
-
SERVICE_BINDING_ROOT
The name of the environment variable to read to determine the bindings file system root. Specified by the Kubernetes Service Binding Specification.- See Also:
-
-
Constructor Details
-
Bindings
public Bindings()Creates a newBindingsinstance, using the$SERVICE_BINDING_ROOTenvironment variable or the$CNB_BINDINGSenvironment variable if it does not exist to determine the file system root. If neither the$SERVICE_BINDING_ROOTnor$CNB_BINDINGSenvironment variables are set, an emptyBindingsis returned. If the directory does not exist, an emptyBindingsis returned. -
Bindings
Creates a newBindingsinstance, using the specifiedpath. If the directory does not exist, an emptyBindingsis returned.- Parameters:
path- the path to populate theBindingsfrom.
-
Bindings
Creates a newBindingsinstance using the specified content.- Parameters:
bindings- theBindings.
-
-
Method Details
-
getBindings
Returns all theBindings that were found during construction.- Returns:
- all the
Bindings that were found during construction.
-
findBinding
Returns aBindingwith a given name.- Parameters:
name- the name of theBindingto find.- Returns:
- the
Bindingwith a given name if it exists,nullotherwise.
-
filterBindings
Returns zero or moreBindings with a given type. Equivalent tofilterBindings(String, String).- Parameters:
type- the type of theBindingto find.- Returns:
- the collection of
Bindings with a given type.
-
filterBindings
Return zero or moreBindings with a given type and provider. Iftypeorproviderarenull, the result is not filtered on that argument.- Parameters:
type- the type ofBindingto find.provider- the provider ofBindingto find- Returns:
- the collection of
Bindings with a given type and provider.
-