Package org.gcube.event.publisher
Class AbstractHTTPWithJWTTokenAuthEventSender
java.lang.Object
org.gcube.event.publisher.AbstractHTTPWithJWTTokenAuthEventSender
- All Implemented Interfaces:
EventSender
- Direct Known Subclasses:
HTTPWithOIDCAuthEventSender
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclass -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractHTTPWithJWTTokenAuthEventSender(URL baseEndpointURL, String clientId, String clientSecret, URL tokenURL) AbstractHTTPWithJWTTokenAuthEventSender(URL baseEndpointURL, String clientId, String clientSecret, URL tokenURL, int connectionTimeout, int readTimeout) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract org.gcube.oidc.rest.JWTTokenintintReturn the last retrieve HTTP response code.intReturn the last send HTTP response code.intprotected URLorg.json.simple.JSONObjectRetrieves the instance of the provided workflow instance.voidSends an event.sendAndGetResult(Event event) Send an event and get results.voidsetConnectionTimeout(int connectionTimeout) voidsetReadTimeout(int readTimeout)
-
Field Details
-
log
protected static final org.slf4j.Logger log -
baseEndpointURL
-
clientId
-
clientSecret
-
tokenURL
-
connectionTimeout
protected int connectionTimeout -
readTimeout
protected int readTimeout -
lastHTTPPost
-
lastHTTPGet
-
-
Constructor Details
-
AbstractHTTPWithJWTTokenAuthEventSender
-
AbstractHTTPWithJWTTokenAuthEventSender
-
-
Method Details
-
getReadTimeout
public int getReadTimeout() -
setReadTimeout
public void setReadTimeout(int readTimeout) -
getConnectionTimeout
public int getConnectionTimeout() -
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout) -
send
Description copied from interface:EventSenderSends an event.- Specified by:
sendin interfaceEventSender- Parameters:
event- the event to send
-
getLastSendHTTPResponseCode
public int getLastSendHTTPResponseCode()Description copied from interface:EventSenderReturn the last send HTTP response code.- Specified by:
getLastSendHTTPResponseCodein interfaceEventSender- Returns:
- the HTTP response code or -1 if an error occurred before the call (e.g. during the authorization or connection)
-
sendAndGetResult
Description copied from interface:EventSenderSend an event and get results.- Specified by:
sendAndGetResultin interfaceEventSender- Parameters:
event- the event to send- Returns:
- the result of the call
-
retrive
Description copied from interface:EventSenderRetrieves the instance of the provided workflow instance.- Specified by:
retrivein interfaceEventSender- Parameters:
id- the workflow instance id- Returns:
-
getLastRetrieveHTTPResponseCode
public int getLastRetrieveHTTPResponseCode()Description copied from interface:EventSenderReturn the last retrieve HTTP response code.- Specified by:
getLastRetrieveHTTPResponseCodein interfaceEventSender- Returns:
- the HTTP response code or -1 if an error occurred before the call (e.g. during the authorization or connection)
-
getTokenURL
-
getAuthorizationToken
protected abstract org.gcube.oidc.rest.JWTToken getAuthorizationToken() throws org.gcube.oidc.rest.OpenIdConnectRESTHelperException- Throws:
org.gcube.oidc.rest.OpenIdConnectRESTHelperException
-