Record Class S3Config
- Record Components:
endpoint- URL do endpoint S3.region- região S3 (deve bater com o servidor; defaultgarage).accessKeyId- access key id (GARAGE_ACCESS_KEY_ID).secretAccessKey- secret access key (GARAGE_SECRET_ACCESS_KEY).bucket- bucket dedicado deste app.criarBucket- setrue, cria o bucket no startup quando ausente.
garage.*. O prefixo
nomeia o produto (Garage) que a casa opera; a API por baixo é a do S3 (AWS SDK v2), então a
lib segue swappável a qualquer backend S3-compatível.
Os nomes casam com as envs que o broker da Central injeta no recurso, e o Micronaut as liga
direto, sem linha no application.yml do app: GARAGE_ACCESS_KEY_ID →
garage.access-key-id → accessKeyId(), GARAGE_SECRET_ACCESS_KEY →
garage.secret-access-key → secretAccessKey().
Os nomes antigos (garage.access-key/garage.secret-key) seguem lidos pelo
S3ClientFactory enquanto houver deploy com eles (dual-read) — ver o CHANGELOG do
módulo. Por isso os dois componentes da credencial aceitam null: quem cobra a ausência
dos dois pares é o S3ClientFactory, e só quando o ArmazenamentoModo grava ou lê do
Garage.
Apps com backend nomeado (que não querem o prefixo global garage.*) sobrescrevem
o bean via @Factory + @Replaces(S3Config.class), lendo o próprio prefixo — ver
README.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns the value of theaccessKeyIdrecord component.bucket()Returns the value of thebucketrecord component.booleanReturns the value of thecriarBucketrecord component.endpoint()Returns the value of theendpointrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.region()Returns the value of theregionrecord component.@Nullable StringReturns the value of thesecretAccessKeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
S3Config
public S3Config(String endpoint, @Bindable(defaultValue="garage") String region, @Nullable @Nullable String accessKeyId, @Nullable @Nullable String secretAccessKey, String bucket, @Bindable(defaultValue="false") boolean criarBucket) Creates an instance of aS3Configrecord class.- Parameters:
endpoint- the value for theendpointrecord componentregion- the value for theregionrecord componentaccessKeyId- the value for theaccessKeyIdrecord componentsecretAccessKey- the value for thesecretAccessKeyrecord componentbucket- the value for thebucketrecord componentcriarBucket- the value for thecriarBucketrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
endpoint
-
region
-
accessKeyId
Returns the value of theaccessKeyIdrecord component.- Returns:
- the value of the
accessKeyIdrecord component
-
secretAccessKey
Returns the value of thesecretAccessKeyrecord component.- Returns:
- the value of the
secretAccessKeyrecord component
-
bucket
-
criarBucket
@Bindable(defaultValue="false") public boolean criarBucket()Returns the value of thecriarBucketrecord component.- Returns:
- the value of the
criarBucketrecord component
-