Package org.lockss.laaws.config.impl
Class ConfigApiServiceImpl
java.lang.Object
org.lockss.spring.base.BaseSpringApiServiceImpl
org.lockss.laaws.config.impl.ConfigApiServiceImpl
- All Implemented Interfaces:
ConfigApiDelegate
@Service
public class ConfigApiServiceImpl
extends BaseSpringApiServiceImpl
implements ConfigApiDelegate
Service for accessing the system configuration.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lockss.spring.base.BaseSpringApiServiceImpl
BaseSpringApiServiceImpl.MapMessageListener -
Field Summary
Fields inherited from class org.lockss.spring.base.BaseSpringApiServiceImpl
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longProvides the build timestamp.org.springframework.http.ResponseEntity<OffsetDateTime>Provides the timestamp of the last time the configuration was updated.Provides the URLs from which the configuration was loaded.org.springframework.http.ResponseEntityProvides the platform configuration.org.springframework.http.ResponseEntitygetSectionConfig(String sectionName, String ifMatch, String ifModifiedSince, String ifNoneMatch, String ifUnmodifiedSince) Provides the configuration file for a section given the section name.org.springframework.http.ResponseEntitygetUrlConfig(String url, String ifMatch, String ifModifiedSince, String ifNoneMatch, String ifUnmodifiedSince) Provides the configuration file for a given URL.org.springframework.http.ResponseEntityputConfig(String sectionName, org.springframework.web.multipart.MultipartFile configFile, String ifMatch, String ifModifiedSince, String ifNoneMatch, String ifUnmodifiedSince) Stores the configuration file for a section given the section name.org.springframework.http.ResponseEntity<Void>Requests a reload of the configuration.protected voidprotected voidsetLastModified(org.springframework.http.HttpHeaders hdrs, String last) protected StringvalidateSectionName(String sectionName, org.lockss.util.AccessType access) Provides a validated canonical version of the passed section name.Methods inherited from class org.lockss.spring.base.BaseSpringApiServiceImpl
configMgrCreated, getClassName, getConfigWaitTime, getJMSManager, getPluginManager, getReadyWaitTime, getRunningLockssDaemon, getStateManager, getWaitTime, jmsSetUpDone, jsonResponse, receiveMessage, registerConfigCallback, setUpJms, setUpJms, setUpJms, stopJms, stringResponse, waitConfig, waitConfig, waitReady, waitReadyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.lockss.laaws.config.api.ConfigApiDelegate
getAcceptHeader, getObjectMapper, getRequest
-
Constructor Details
-
ConfigApiServiceImpl
public ConfigApiServiceImpl()
-
-
Method Details
-
getSectionConfig
public org.springframework.http.ResponseEntity getSectionConfig(String sectionName, String ifMatch, String ifModifiedSince, String ifNoneMatch, String ifUnmodifiedSince) Provides the configuration file for a section given the section name.- Specified by:
getSectionConfigin interfaceConfigApiDelegate- Parameters:
sectionName- A String with the section name.accept- A String with the value of the "Accept" request header.ifMatch- A Listwith the "If-Match" request header, containing an asterisk or values equivalent to the "If-Unmodified-Since" request header but with a granularity of 1 ms. ifModifiedSince- A String with "If-Modified-Since" request header.ifNoneMatch- A Listwith the "If-None-Match" request header, containing an asterisk or values equivalent to the "If-Modified-Since" request header but with a granularity of 1 ms. ifUnmodifiedSince- A String with the "If-Unmodified-Since" request header.- Returns:
- a
ResponseEntity<MultiValueMap<String, Object>>with the section configuration file contents. - See Also:
-
getUrlConfig
public org.springframework.http.ResponseEntity getUrlConfig(String url, String ifMatch, String ifModifiedSince, String ifNoneMatch, String ifUnmodifiedSince) Provides the configuration file for a given URL.- Specified by:
getUrlConfigin interfaceConfigApiDelegate- Parameters:
url- A String with the url.accept- A String with the value of the "Accept" request header.ifMatch- A Listwith the "If-Match" request header, containing an asterisk or values equivalent to the "If-Unmodified-Since" request header but with a granularity of 1 ms. ifModifiedSince- A String with "If-Modified-Since" request header.ifNoneMatch- A Listwith the "If-None-Match" request header, containing an asterisk or values equivalent to the "If-Modified-Since" request header but with a granularity of 1 ms. ifUnmodifiedSince- A String with the "If-Unmodified-Since" request header.- Returns:
- a
ResponseEntity<MultiValueMap<String, Object>>with the section configuration file. - See Also:
-
getLastUpdateTime
Provides the timestamp of the last time the configuration was updated.- Specified by:
getLastUpdateTimein interfaceConfigApiDelegate- Returns:
- a
ResponseEntity<Date>with the timestamp. - See Also:
-
getLoadedUrlList
Provides the URLs from which the configuration was loaded.- Specified by:
getLoadedUrlListin interfaceConfigApiDelegate- Returns:
- a
ResponseEntity<List<String>>with the URLs. - See Also:
-
putConfig
public org.springframework.http.ResponseEntity putConfig(String sectionName, org.springframework.web.multipart.MultipartFile configFile, String ifMatch, String ifModifiedSince, String ifNoneMatch, String ifUnmodifiedSince) Stores the configuration file for a section given the section name.- Specified by:
putConfigin interfaceConfigApiDelegate- Parameters:
sectionName- A String with the section name.configFile- A MultipartFile with the configuration file to be stored.ifMatch- A Listwith the "If-Match" request header, containing an asterisk or values equivalent to the "If-Unmodified-Since" request header but with a granularity of 1 ms. ifModifiedSince- A String with "If-Modified-Since" request header.ifNoneMatch- A Listwith the "If-None-Match" request header, containing an asterisk or values equivalent to the "If-Modified-Since" request header but with a granularity of 1 ms. ifUnmodifiedSince- A String with the "If-Unmodified-Since" request header.- Returns:
- a
ResponseEntity<Void>. - See Also:
-
putConfigReload
Requests a reload of the configuration.- Specified by:
putConfigReloadin interfaceConfigApiDelegate- Returns:
- a
ResponseEntity<Void>with the status. - See Also:
-
getPlatformConfig
public org.springframework.http.ResponseEntity getPlatformConfig()Provides the platform configuration.- Specified by:
getPlatformConfigin interfaceConfigApiDelegate- Returns:
- a
ResponseEntity<PlatformConfigurationWsResult>with the platform configuration. - See Also:
-
validateSectionName
protected String validateSectionName(String sectionName, org.lockss.util.AccessType access) throws MalformedParametersException Provides a validated canonical version of the passed section name.- Parameters:
sectionName- A String with the section name.access- An AccessType indicating whether this is for a reading or writing operation.- Returns:
- a String with the validated canonical version of the section name.
- Throws:
MalformedParametersException- if validation fails.
-
setETag
-
setLastModified
-
getBuildTimestamp
Provides the build timestamp.- Returns:
- A long with the build timestamp.
- Throws:
ParseException- if there are problems parsing the timestamp.
-