public class BaseServiceImpl extends BaseSpringApiServiceImpl implements LockssConfigurableService
BaseSpringApiServiceImpl.MapMessageListener| Modifier and Type | Field and Description |
|---|---|
protected long |
connectionTimeout |
static long |
DEFAULT_CONNECTION_TIMEOUT |
static long |
DEFAULT_READ_TIMEOUT |
static String |
DEFAULT_REPO_NAMESPACE |
static String |
PARAM_CONNECTION_TIMEOUT
Connection timeout.
|
static String |
PARAM_READ_TIMEOUT
Read timeout.
|
static String |
PARAM_REPO_NAMESPACE
Repository namespace.
|
static String |
PREFIX |
protected long |
readTimeout |
protected String |
repoNamespace |
protected org.springframework.web.client.RestTemplate |
restTemplate |
DEFAULT_CONFIG_WAIT_TIME, DEFAULT_READY_WAIT_TIME, JMS_BOTH, JMS_RECEIVE, JMS_SEND, jmsConsumer, jmsProducer, PARAM_CONFIG_WAIT_TIME, PARAM_READY_WAIT_TIME| Constructor and Description |
|---|
BaseServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
protected <T> org.springframework.http.ResponseEntity<String> |
callRestServiceEndpoint(String serviceUrl,
String endPointPath,
Map<String,String> uriVariables,
Map<String,String> queryParams,
org.springframework.http.HttpMethod httpMethod,
T body,
String exceptionMessage)
Makes a call to a REST service endpoint.
|
protected <T> org.springframework.http.ResponseEntity<String> |
callRestServiceUri(String uriString,
Map<String,String> uriVariables,
Map<String,String> queryParams,
org.springframework.http.HttpMethod httpMethod,
org.springframework.http.HttpHeaders requestHeaders,
T body,
String exceptionMessage)
Makes a call to a REST service URI.
|
protected <T> org.springframework.http.ResponseEntity<String> |
callRestServiceUri(String uriString,
Map<String,String> uriVariables,
Map<String,String> queryParams,
org.springframework.http.HttpMethod httpMethod,
T body,
String exceptionMessage)
Makes a call to a REST service URI.
|
protected org.springframework.http.HttpHeaders |
getAuthHeaders() |
protected Long |
getConnectionTimeout()
Provides the configured connection timeout in milliseconds.
|
protected <T> MultipartResponse |
getMultipartResponse(String serviceUrl,
String endPointPath,
Map<String,String> uriVariables,
Map<String,String> queryParams,
org.springframework.http.HttpHeaders requestHeaders,
org.springframework.http.HttpMethod httpMethod,
T body)
Makes a call to a REST service endpoint that returns a multipart response.
|
protected Long |
getReadTimeout()
Provides the configured read timeout in milliseconds.
|
protected static String |
getRequestorIpAddress()
Provides the requestor IP of the current SOAP request message
|
protected RestLockssRepository |
getRestLockssRepository()
Provides access to the REST Repository service.
|
protected org.lockss.app.ServiceBinding |
getServiceBinding(org.lockss.app.ServiceDescr sd) |
String |
getServiceEndpoint(org.lockss.app.ServiceDescr sd) |
protected static String |
getSoapRequestAuthorizationHeader()
Provides the Authorization header in the current SOAP request message, if any.
|
protected static String[] |
getSoapRequestCredentials()
Provides the credentials in the current SOAP request message, if any.
|
protected static StringBuilder |
separatedString(Collection c,
String separatorFirst,
String separatorInner,
String separatorLast,
StringBuilder sb)
Concatenate elements of collection into string, adding separators, delimiting each element
|
void |
setConfig(org.lockss.config.Configuration newConfig,
org.lockss.config.Configuration prevConfig,
org.lockss.config.Configuration.Differences changedKeys) |
configMgrCreated, getClassName, getConfigWaitTime, getJMSManager, getPluginManager, getReadyWaitTime, getRunningLockssDaemon, getWaitTime, jmsSetUpDone, jsonResponse, receiveMessage, registerConfigCallback, setUpJms, setUpJms, setUpJms, stopJms, stringResponse, waitConfig, waitConfig, waitReady, waitReadypublic static final String PREFIX
public static final String PARAM_REPO_NAMESPACE
public static final String DEFAULT_REPO_NAMESPACE
public static final String PARAM_CONNECTION_TIMEOUT
public static final long DEFAULT_CONNECTION_TIMEOUT
public static final String PARAM_READ_TIMEOUT
public static final long DEFAULT_READ_TIMEOUT
@Autowired protected org.springframework.web.client.RestTemplate restTemplate
protected long connectionTimeout
protected long readTimeout
protected String repoNamespace
protected org.lockss.app.ServiceBinding getServiceBinding(org.lockss.app.ServiceDescr sd)
public String getServiceEndpoint(org.lockss.app.ServiceDescr sd)
protected Long getConnectionTimeout()
protected Long getReadTimeout()
protected org.springframework.http.HttpHeaders getAuthHeaders()
protected static String getSoapRequestAuthorizationHeader()
protected static String getRequestorIpAddress()
protected RestLockssRepository getRestLockssRepository() throws MalformedURLException
MalformedURLException - if there are problems with the REST Repository service URL.protected static String[] getSoapRequestCredentials()
protected <T> org.springframework.http.ResponseEntity<String> callRestServiceEndpoint(String serviceUrl, String endPointPath, Map<String,String> uriVariables, Map<String,String> queryParams, org.springframework.http.HttpMethod httpMethod, T body, String exceptionMessage) throws LockssRestException
serviceUrl - A String with the URL of the service.endPointPath - A String with the URI path to the endpoint.uriVariables - A MapqueryParams - A MaphttpMethod - An HttpMethod with HTTP method used to make the call to the REST service.body - A T with the contents of the body to be included with the request, if any.exceptionMessage - A String with the message to be returned with any exception.LockssRestException - if any problems arise in the call to the REST service.protected <T> org.springframework.http.ResponseEntity<String> callRestServiceUri(String uriString, Map<String,String> uriVariables, Map<String,String> queryParams, org.springframework.http.HttpMethod httpMethod, T body, String exceptionMessage) throws LockssRestException
uriString - A String with the URI of the request to the REST service.uriVariables - A MapqueryParams - A MaphttpMethod - An HttpMethod with HTTP method used to make the call to the REST service.body - A T with the contents of the body to be included with the request, if any.exceptionMessage - A String with the message to be returned with any exception.LockssRestException - if any problems arise in the call to the REST service.protected <T> org.springframework.http.ResponseEntity<String> callRestServiceUri(String uriString, Map<String,String> uriVariables, Map<String,String> queryParams, org.springframework.http.HttpMethod httpMethod, org.springframework.http.HttpHeaders requestHeaders, T body, String exceptionMessage) throws LockssRestException
uriString - A String with the URI of the request to the REST service.uriVariables - A MapqueryParams - A MaphttpMethod - An HttpMethod with HTTP method used to make the call to the REST service.requestHeaders - An HttpHeaders with HTTP request headers used to make the call to the
REST service.body - A T with the contents of the body to be included with the request, if any.exceptionMessage - A String with the message to be returned with any exception.LockssRestException - if any problems arise in the call to the REST service.protected <T> MultipartResponse getMultipartResponse(String serviceUrl, String endPointPath, Map<String,String> uriVariables, Map<String,String> queryParams, org.springframework.http.HttpHeaders requestHeaders, org.springframework.http.HttpMethod httpMethod, T body) throws IOException, javax.mail.MessagingException
serviceUrl - A String with the URL of the service.endPointPath - A String with the URI path to the endpoint.uriVariables - A MapqueryParams - A MaprequestHeaders - An HttpHeaders with HTTP request headers used to make the call to the
REST service.httpMethod - An HttpMethod with HTTP method used to make the call to the REST service.body - A T with the contents of the body to be included with the request, if any.LockssRestException - if any problems arise in the call to the REST service.IOExceptionjavax.mail.MessagingExceptionprotected static StringBuilder separatedString(Collection c, String separatorFirst, String separatorInner, String separatorLast, StringBuilder sb)
c - - Collection of object (on which toString() will be called)separatorFirst - - String to place before first elementseparatorInner - - String with which to separate elementsseparatorLast - - String to place after last elementsb - - StringBuilder to write result intopublic void setConfig(org.lockss.config.Configuration newConfig,
org.lockss.config.Configuration prevConfig,
org.lockss.config.Configuration.Differences changedKeys)
setConfig in interface LockssConfigurableServiceCopyright © 2000–2023 LOCKSS Program. All rights reserved.