@Singleton @Requires(env="digitalocean") public class DigitalOceanMetadataResolver extends Object implements ComputeInstanceMetadataResolver
ComputeInstanceMetadata
for Digital Ocean.Constructor and Description |
---|
DigitalOceanMetadataResolver()
Construct with default settings.
|
DigitalOceanMetadataResolver(DigitalOceanMetadataConfiguration configuration,
com.fasterxml.jackson.core.JsonFactory jsonFactory,
JsonMapper mapper) |
DigitalOceanMetadataResolver(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
DigitalOceanMetadataConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
Optional<ComputeInstanceMetadata> |
resolve(Environment environment)
Resolves
ComputeInstanceMetadata for the current environment if possible. |
@Inject public DigitalOceanMetadataResolver(DigitalOceanMetadataConfiguration configuration, com.fasterxml.jackson.core.JsonFactory jsonFactory, JsonMapper mapper)
configuration
- Digital Ocean Metadata configurationjsonFactory
- Factory to use for json parsingmapper
- Mapper to use for deserializationpublic DigitalOceanMetadataResolver()
public DigitalOceanMetadataResolver(com.fasterxml.jackson.databind.ObjectMapper objectMapper, DigitalOceanMetadataConfiguration configuration)
objectMapper
- To read and write JSONconfiguration
- Digital Ocean Metadata configurationpublic Optional<ComputeInstanceMetadata> resolve(Environment environment)
ComputeInstanceMetadataResolver
ComputeInstanceMetadata
for the current environment if possible.resolve
in interface ComputeInstanceMetadataResolver
environment
- The environmentComputeInstanceMetadata