Package software.amazon.awssdk.profiles
Interface ProfileFileSupplier
- All Superinterfaces:
Supplier<ProfileFile>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Encapsulates the logic for supplying either a single or multiple ProfileFile instances.
Each call to the Supplier.get()
method will result in either a new or previously supplied profile based on the
implementation's rules.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProfileFileSupplier
aggregate
(ProfileFileSupplier... suppliers) Creates aProfileFileSupplier
by combining theProfileFile
objects from multipleProfileFileSupplier
s.static ProfileFileSupplier
Creates aProfileFileSupplier
capable of producing multiple profile objects by aggregating the default credentials and configuration files as determined byProfileFileLocation.credentialsFileLocation()
abdProfileFileLocation.configurationFileLocation()
.static ProfileFileSupplier
fixedProfileFile
(ProfileFile profileFile) Creates aProfileFileSupplier
that produces an existing profile.static ProfileFileSupplier
reloadWhenModified
(Path path, ProfileFile.Type type) Creates aProfileFileSupplier
capable of producing multiple profile objects from a file.
-
Method Details
-
defaultSupplier
Creates aProfileFileSupplier
capable of producing multiple profile objects by aggregating the default credentials and configuration files as determined byProfileFileLocation.credentialsFileLocation()
abdProfileFileLocation.configurationFileLocation()
. This supplier will return a new ProfileFile instance only once either disk file has been modified. Multiple calls to the supplier while both disk files are unchanged will return the same object.- Returns:
- Implementation of
ProfileFileSupplier
that is capable of supplying a new aggregate profile when either file has been modified.
-
reloadWhenModified
Creates aProfileFileSupplier
capable of producing multiple profile objects from a file. This supplier will return a new ProfileFile instance only once the disk file has been modified. Multiple calls to the supplier while the disk file is unchanged will return the same object.- Parameters:
path
- Path to the file to read from.type
- The type of file. SeeProfileFile.Type
for possible values.- Returns:
- Implementation of
ProfileFileSupplier
that is capable of supplying a new profile when the file has been modified.
-
fixedProfileFile
Creates aProfileFileSupplier
that produces an existing profile.- Parameters:
profileFile
- Profile object to supply.- Returns:
- Implementation of
ProfileFileSupplier
that is capable of supplying a single profile.
-
aggregate
Creates aProfileFileSupplier
by combining theProfileFile
objects from multipleProfileFileSupplier
s. Objects are passed intoProfileFile.Aggregator
.- Parameters:
suppliers
- Array ofProfileFileSupplier
objects.ProfileFile
objects are passed toProfileFile.Aggregator.addFile(ProfileFile)
in the same argument order as the supplier that generated it.- Returns:
- Implementation of
ProfileFileSupplier
aggregating results from the supplier objects.
-