public class NetStorageSender extends HttpSenderBase
See HttpSenderBase
for more arguments and parameters!
AuthAlias:
If you do not want to specify the nonce and the accesstoken used to authenticate with Akamai, you can use the authalias property. The username represents the nonce and the password the accesstoken.
upload
action are: md5, sha1, sha256 and mtime.Modifier and Type | Class and Description |
---|---|
static class |
NetStorageSender.Action |
HttpSenderBase.HttpMethod
Modifier and Type | Field and Description |
---|---|
static String |
DESTINATION_PARAM_KEY |
static String |
FILE_PARAM_KEY |
static String |
HASHVALUE_PARAM_KEY |
static String |
MTIME_PARAM_KEY |
CORRELATION_ID_HEADER, headerParamsSet, MESSAGE_ID_HEADER, parametersToSkipWhenEmptySet, requestOrBodyParamsSet, staticUri, urlParameter
parameterNamesMustBeUnique, paramList
Constructor and Description |
---|
NetStorageSender() |
Modifier and Type | Method and Description |
---|---|
void |
configure()
configure() is called once at startup of the framework in the configure method of the owner of this sender. |
Message |
extractResult(HttpResponseHandler responseHandler,
PipeLineSession session)
Custom implementation to extract the response and format it to a String result.
|
org.apache.http.client.methods.HttpRequestBase |
getMethod(URI uri,
Message message,
ParameterValueList parameters,
PipeLineSession session)
Custom implementation to create a
HttpRequest object. |
String |
getPhysicalDestinationName() |
String |
getResponseBodyAsString(HttpResponseHandler responseHandler,
boolean throwIOExceptionWhenParsingResponse)
When an exception occurs and the response cannot be parsed, we do not want to throw a 'missing response' exception.
|
NetStorageCmsSigner.SignType |
getSignType() |
protected URI |
getURI(String path)
Builds the URI with the rootDirectory, optional CpCode and makes sure the
path never ends with a slash '/'.
|
SenderResult |
sendMessage(Message message,
PipeLineSession session)
Send a message to some destination (as configured in the Sender object).
|
void |
setAccessToken(String accessToken)
Login is done via a Nonce and AccessToken
|
void |
setAction(NetStorageSender.Action action)
NetStorage action to be used
|
void |
setActionVersion(int actionVersion)
At the time of writing, NetStorage only supports version 1
|
void |
setAuthAlias(String authAlias)
Alias used to obtain credentials for nonce (username) and accesstoken (password)
|
void |
setCpCode(String cpCode)
NetStorage CP Code of the storage group
|
void |
setHashAlgorithm(HashAlgorithm hashAlgorithm)
Only works in combination with the UPLOAD action.
|
void |
setNonce(String nonce)
Login is done via a Nonce and AccessToken
|
void |
setRootDir(String rootDir)
Root directory (appended to the url + cpCode)
|
void |
setSignVersion(int signVersion)
Version to validate queries made to NetStorage backend.
|
void |
setUrl(String url)
The destination URL for the Akamai NetStorage.
|
appendParameters, areCookiesDisabled, close, getPort, getSSLConnectionSocketFactory, open, prefillProxyAuthCache, setAllowSelfSignedCertificates, setAuthDomain, setAuthenticatedTokenRequest, setCertificate, setCertificateAuthAlias, setCertificatePassword, setCertificateType, setCharSet, setClientAlias, setClientId, setClientSecret, setConnectionIdleTimeout, setConnectionTimeToLive, setContentType, setDisableCookies, setFollowRedirects, setHeadersParams, setIgnoreCertificateExpiredException, setIgnoreRedirects, setKeyManagerAlgorithm, setKeystore, setKeystoreAlias, setKeystoreAliasAuthAlias, setKeystoreAliasPassword, setKeystoreAuthAlias, setKeystorePassword, setKeystoreType, setMaxConnections, setMaxExecuteRetries, setMethodType, setParametersToSkipWhenEmpty, setPassword, setProtocol, setProxyAuthAlias, setProxyHost, setProxyPassword, setProxyPort, setProxyRealm, setProxyUsername, setProxyUserName, setResultStatusCodeSessionKey, setScope, setStaleChecking, setStaleTimeout, setStyleSheetName, setTimeout, setTokenEndpoint, setTokenExpiry, setTrustManagerAlgorithm, setTruststore, setTruststoreAuthAlias, setTruststorePassword, setTruststoreType, setUrlParam, setUsername, setUserName, setVerifyHostname, setXhtml, validateResponseCode
addParameter, checkStringAttributeOrParameter, consumesSessionVariable, getParameterList, getParameterOverriddenAttributeValue, getParameterOverriddenAttributeValue, getParameterValueList
createBean, getLogPrefix, getName, isSynchronous, setApplicationContext, setName
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDomain
getKeyManagerAlgorithm, getKeystore, getKeystoreAlias, getKeystoreAliasAuthAlias, getKeystoreAliasPassword, getKeystoreAuthAlias, getKeystorePassword, getKeystoreType
getApplicationContext, getName
getConfigurationClassLoader
setApplicationContext
getTrustManagerAlgorithm, getTruststore, getTruststoreAuthAlias, getTruststorePassword, getTruststoreType, isAllowSelfSignedCertificates, isIgnoreCertificateExpiredException, isVerifyHostname
isSynchronous, sendMessageOrThrow
getName, setName
public static final String DESTINATION_PARAM_KEY
public static final String FILE_PARAM_KEY
public static final String MTIME_PARAM_KEY
public static final String HASHVALUE_PARAM_KEY
public void configure() throws ConfigurationException
ISender
configure()
is called once at startup of the framework in the configure method of the owner of this sender.
Purpose of this method is to check whether the static configuration of the sender is correct.
As much as possible class-instantiating should take place in the configure()
or open()
method, to improve performance.configure
in interface IConfigurable
configure
in interface ISender
configure
in class HttpSenderBase
ConfigurationException
protected URI getURI(String path) throws URISyntaxException
getURI
in class HttpSenderBase
path
- to append to the rootURISyntaxException
public SenderResult sendMessage(Message message, PipeLineSession session) throws SenderException, TimeoutException
ISender
configure()
method is called.
The following table shows the difference between synchronous and a-synchronous senders:
synchronous | a-synchronous | |
---|---|---|
ISender.isSynchronous() returns | true | false |
return value of sendMessage() is | the reply-message | the messageId of the message sent |
the correlationID specified with sendMessage() | may be ignored | is sent with the message |
a {link TimeOutException} | may be thrown if a timeout occurs waiting for a reply | should not be expected |
Multiple objects may try to call this method at the same time, from different threads.
Implementations of this method should therefore be thread-safe, or synchronized
.
sendMessage
in interface ISender
sendMessage
in class HttpSenderBase
SenderException
TimeoutException
public org.apache.http.client.methods.HttpRequestBase getMethod(URI uri, Message message, ParameterValueList parameters, PipeLineSession session) throws SenderException
HttpSenderBase
HttpRequest
object.getMethod
in class HttpSenderBase
uri
- endpoint to send the message tomessage
- to be sentparameters
- ParameterValueList that contains all the senders parameterssession
- PipeLineSession to retrieve or store data from, or NULL when not setHttpRequest
objectSenderException
public Message extractResult(HttpResponseHandler responseHandler, PipeLineSession session) throws SenderException, IOException
HttpSenderBase
response
will be read or will be closed
.extractResult
in class HttpSenderBase
responseHandler
- HttpResponseHandler
that contains the response informationsession
- PipeLineSession
which may be nullSenderException
IOException
public String getResponseBodyAsString(HttpResponseHandler responseHandler, boolean throwIOExceptionWhenParsingResponse) throws IOException
IOException
public void setHashAlgorithm(HashAlgorithm hashAlgorithm)
public void setAction(NetStorageSender.Action action)
public void setActionVersion(int actionVersion)
public void setCpCode(String cpCode)
public void setUrl(String url)
setUrl
in class HttpSenderBase
public void setNonce(String nonce)
nonce
- to use when logging inpublic void setSignVersion(int signVersion)
signVersion
- supports 3 types; 3:MD5, 4:SHA1, 5: SHA256public NetStorageCmsSigner.SignType getSignType()
public void setAccessToken(String accessToken)
accessToken
- to use when logging inpublic String getPhysicalDestinationName()
getPhysicalDestinationName
in interface HasPhysicalDestination
getPhysicalDestinationName
in class HttpSenderBase
public void setRootDir(String rootDir)
public void setAuthAlias(String authAlias)
setAuthAlias
in class HttpSenderBase
Copyright © 2023 Frank!Framework. All rights reserved.