Class AzureStorageBlobReactiveService
java.lang.Object
it.pagopa.swclient.mil.azureservices.storageblob.service.AzureStorageBlobReactiveService
This service is a kind of wrapper of
AzureStorageBlobReactiveClient
which implements:
- the retrieving, caching (done by means of
AzureIdentityReactiveService
) and renewal (when it expires or when used the resource API returns 401 or 403) of the access token from Microsoft Entra ID that will be used with Azure Storage Blob (by means ofAzureStorageBlobReactiveClient
).
- Author:
- Antonio Tarricone
-
Field Summary
Modifier and TypeFieldDescriptionprivate String
Cached access token.(package private) AzureStorageBlobReactiveClient
REST client to use Azure Storage Blob.private AzureIdentityReactiveService
Service to retrieve the access token from Microsoft Entra ID. -
Constructor Summary
ConstructorDescriptionAzureStorageBlobReactiveService
(AzureIdentityReactiveService identityService) Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) Object
authenticate
(jakarta.interceptor.InvocationContext context) This method decorates the others:io.smallrye.mutiny.Uni
<jakarta.ws.rs.core.Response> Returns a blob with the given file name.io.smallrye.mutiny.Uni
<jakarta.ws.rs.core.Response> Returns a blob with the given file name and path.io.smallrye.mutiny.Uni
<jakarta.ws.rs.core.Response> Returns a blob with the given file name and path.io.smallrye.mutiny.Uni
<jakarta.ws.rs.core.Response> Returns a blob with the given file name and path.io.smallrye.mutiny.Uni
<jakarta.ws.rs.core.Response> Returns a blob with the given file name and path.io.smallrye.mutiny.Uni
<jakarta.ws.rs.core.Response> getBlob
(String segment1, String segment2, String segment3, String segment4, String segment5, String filename) Returns a blob with the given file name and path.io.smallrye.mutiny.Uni
<jakarta.ws.rs.core.Response> getBlob
(String segment1, String segment2, String segment3, String segment4, String segment5, String segment6, String filename) Returns a blob with the given file name and path.private io.smallrye.mutiny.Uni
<Object> proceed
(jakarta.interceptor.InvocationContext context) TransformsException
inRuntimeException
to allow handling with Mutiny.
-
Field Details
-
identityService
Service to retrieve the access token from Microsoft Entra ID.
- See Also:
-
blobClient
REST client to use Azure Storage Blob.
- See Also:
-
accessTokenValue
Cached access token.
-
-
Constructor Details
-
AzureStorageBlobReactiveService
Constructor.
- Parameters:
identityService
-AzureIdentityReactiveService
-
-
Method Details
-
proceed
Transforms
Exception
inRuntimeException
to allow handling with Mutiny.- Parameters:
context
-InvocationContext
- Returns:
- Object returned by the target method.
-
authenticate
This method decorates the others:
- retrieving the access token from Microsoft Entra ID by means of
AzureIdentityReactiveService
; - renewing of the access token from Microsoft Entra ID the invoked target API returns 401 or 403.
- Parameters:
context
-InvocationContext
- Returns:
- Object returned by the target method.
- retrieving the access token from Microsoft Entra ID by means of
-
getBlob
Returns a blob with the given file name.
- Parameters:
filename
- The name of file to retrieve.- Returns:
- If the file is retrieved successfully, the response body contains it.
-
getBlob
public io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response> getBlob(String segment1, String filename) Returns a blob with the given file name and path.
- Parameters:
segment1
- Segment of the path to file to retrieve.filename
- The name of file to retrieve.- Returns:
- If the file is retrieved successfully, the response body contains it.
-
getBlob
public io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response> getBlob(String segment1, String segment2, String filename) Returns a blob with the given file name and path.
- Parameters:
segment1
- Segment of the path to file to retrieve.segment2
- Segment of the path to file to retrieve.filename
- The name of file to retrieve.- Returns:
- If the file is retrieved successfully, the response body contains it.
-
getBlob
public io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response> getBlob(String segment1, String segment2, String segment3, String filename) Returns a blob with the given file name and path.
- Parameters:
segment1
- Segment of the path to file to retrieve.segment2
- Segment of the path to file to retrieve.segment3
- Segment of the path to file to retrieve.filename
- The name of file to retrieve.- Returns:
- If the file is retrieved successfully, the response body contains it.
-
getBlob
public io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response> getBlob(String segment1, String segment2, String segment3, String segment4, String filename) Returns a blob with the given file name and path.
- Parameters:
segment1
- Segment of the path to file to retrieve.segment2
- Segment of the path to file to retrieve.segment3
- Segment of the path to file to retrieve.segment4
- Segment of the path to file to retrieve.filename
- The name of file to retrieve.- Returns:
- If the file is retrieved successfully, the response body contains it.
-
getBlob
public io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response> getBlob(String segment1, String segment2, String segment3, String segment4, String segment5, String filename) Returns a blob with the given file name and path.
- Parameters:
segment1
- Segment of the path to file to retrieve.segment2
- Segment of the path to file to retrieve.segment3
- Segment of the path to file to retrieve.segment4
- Segment of the path to file to retrieve.segment5
- Segment of the path to file to retrieve.filename
- The name of file to retrieve.- Returns:
- If the file is retrieved successfully, the response body contains it.
-
getBlob
public io.smallrye.mutiny.Uni<jakarta.ws.rs.core.Response> getBlob(String segment1, String segment2, String segment3, String segment4, String segment5, String segment6, String filename) Returns a blob with the given file name and path.
- Parameters:
segment1
- Segment of the path to file to retrieve.segment2
- Segment of the path to file to retrieve.segment3
- Segment of the path to file to retrieve.segment4
- Segment of the path to file to retrieve.segment5
- Segment of the path to file to retrieve.segment6
- Segment of the path to file to retrieve.filename
- The name of file to retrieve.- Returns:
- If the file is retrieved successfully, the response body contains it.
-