Package org.lockss.laaws.rs.impl
Class ArtifactsApiServiceImpl
java.lang.Object
org.lockss.spring.base.BaseSpringApiServiceImpl
org.lockss.laaws.rs.impl.ArtifactsApiServiceImpl
- All Implemented Interfaces:
ArtifactsApiDelegate,LockssConfigurableService
@Service
public class ArtifactsApiServiceImpl
extends BaseSpringApiServiceImpl
implements ArtifactsApiDelegate, LockssConfigurableService
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lockss.spring.base.BaseSpringApiServiceImpl
BaseSpringApiServiceImpl.MapMessageListener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.springframework.http.MediaTypestatic final Stringstatic final longstatic final intstatic final intstatic final longstatic final StringInterval after which unused Artifact iterator continuations will be discarded.static final StringDefault number of Artifacts that will be returned in a single (paged) responsestatic final StringMax number of Artifacts that will be returned in a single (paged) responsestatic final StringLargest Artifact content that will be included in a response to a getArtifactData call with includeContent == IF_SMALLstatic final StringFields 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 TypeMethodDescriptionorg.springframework.http.ResponseEntity<Artifact>createArtifact(String properties, org.springframework.web.multipart.MultipartFile payload, String httpResponseHeader) POST /artifacts: Adds artifacts to the repositoryorg.springframework.http.ResponseEntity<Void>deleteArtifact(String artifactid, String namespace) DELETE /artifacts/{artifactid}: Deletes an artifact from this repository.org.springframework.http.ResponseEntitygetArtifactDataByMultipart(String artifactid, String namespace, String includeContent) GET /artifacts/{artifactid}: Retrieves an artifact from the repository.org.springframework.http.ResponseEntity<org.springframework.core.io.Resource>getArtifactDataByPayload(String artifactId, String namespace, String includeContentParam) GET /artifacts/{artifactid}/payload: Retrieves an artifact from the repository.org.springframework.http.ResponseEntity<org.springframework.core.io.Resource>getArtifactDataByResponse(String artifactId, String namespace, String includeContentParam) GET /artifacts/{artifactid}/response: Retrieves an artifact from the repository.org.springframework.http.ResponseEntity<ArtifactPageInfo>getArtifactsFromAllAus(String namespace, String url, String urlPrefix, String versions, Integer limit, String continuationToken) GET /artifacts: Returns the committed artifacts of all versions of a given URL, from a specified namespace.protected voidWhen JMS connection is established, tell clients to flush their artifact cache to ensure that no stale cached artifacts.protected voidprotected voidprotected voidsendPingResponse(String key) voidsetConfig(org.lockss.config.Configuration newConfig, org.lockss.config.Configuration prevConfig, org.lockss.config.Configuration.Differences changedKeys) org.springframework.http.ResponseEntityupdateArtifact(Boolean committed, String artifactid, String namespace) PUT /artifacts/{artifactid}: Updates an artifact's propertiesMethods inherited from class org.lockss.spring.base.BaseSpringApiServiceImpl
configMgrCreated, getClassName, getConfigWaitTime, getJMSManager, getPluginManager, getReadyWaitTime, getRunningLockssDaemon, getStateManager, getWaitTime, 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.rs.api.ArtifactsApiDelegate
getAcceptHeader, getObjectMapper, getRequest
-
Field Details
-
APPLICATION_HTTP_RESPONSE_VALUE
- See Also:
-
APPLICATION_HTTP_RESPONSE
public static final org.springframework.http.MediaType APPLICATION_HTTP_RESPONSE -
PREFIX
- See Also:
-
PARAM_SMALL_CONTENT_THRESHOLD
Largest Artifact content that will be included in a response to a getArtifactData call with includeContent == IF_SMALL- See Also:
-
DEFAULT_SMALL_CONTENT_THRESHOLD
public static final long DEFAULT_SMALL_CONTENT_THRESHOLD- See Also:
-
PARAM_DEFAULT_ARTIFACT_PAGESIZE
Default number of Artifacts that will be returned in a single (paged) response- See Also:
-
DEFAULT_DEFAULT_ARTIFACT_PAGESIZE
public static final int DEFAULT_DEFAULT_ARTIFACT_PAGESIZE- See Also:
-
PARAM_MAX_ARTIFACT_PAGESIZE
Max number of Artifacts that will be returned in a single (paged) response- See Also:
-
DEFAULT_MAX_ARTIFACT_PAGESIZE
public static final int DEFAULT_MAX_ARTIFACT_PAGESIZE- See Also:
-
PARAM_ARTIFACT_ITERATOR_TIMEOUT
Interval after which unused Artifact iterator continuations will be discarded. Change requires restart to take effect.- See Also:
-
DEFAULT_ARTIFACT_ITERATOR_TIMEOUT
public static final long DEFAULT_ARTIFACT_ITERATOR_TIMEOUT- See Also:
-
-
Constructor Details
-
ArtifactsApiServiceImpl
@Autowired public ArtifactsApiServiceImpl(jakarta.servlet.http.HttpServletRequest request)
-
-
Method Details
-
setConfig
public void setConfig(org.lockss.config.Configuration newConfig, org.lockss.config.Configuration prevConfig, org.lockss.config.Configuration.Differences changedKeys) - Specified by:
setConfigin interfaceLockssConfigurableService
-
createArtifact
public org.springframework.http.ResponseEntity<Artifact> createArtifact(String properties, org.springframework.web.multipart.MultipartFile payload, String httpResponseHeader) POST /artifacts: Adds artifacts to the repository- Specified by:
createArtifactin interfaceArtifactsApiDelegate- Parameters:
properties-payload-httpResponseHeader-- Returns:
- a
ResponseEntity<Artifact>. - See Also:
-
deleteArtifact
public org.springframework.http.ResponseEntity<Void> deleteArtifact(String artifactid, String namespace) DELETE /artifacts/{artifactid}: Deletes an artifact from this repository.- Specified by:
deleteArtifactin interfaceArtifactsApiDelegate- Parameters:
artifactid- A String with the Identifier of the artifact.namespace- A String with the namespace of the artifact.- Returns:
- a
ResponseEntity<Void>. - See Also:
-
getArtifactDataByMultipart
public org.springframework.http.ResponseEntity getArtifactDataByMultipart(String artifactid, String namespace, String includeContent) GET /artifacts/{artifactid}: Retrieves an artifact from the repository.- Specified by:
getArtifactDataByMultipartin interfaceArtifactsApiDelegate- Parameters:
artifactid- A String with the Identifier of the artifact.namespace- A String with the namespace of the artifact.includeContent- ABooleanindicating whether the artifact content part should be included in the multipart response.- Returns:
- a
ResponseEntitycontaining aMultipartResponse. - See Also:
-
getArtifactDataByPayload
public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getArtifactDataByPayload(String artifactId, String namespace, String includeContentParam) GET /artifacts/{artifactid}/payload: Retrieves an artifact from the repository.- Specified by:
getArtifactDataByPayloadin interfaceArtifactsApiDelegate- Parameters:
artifactId- A String with the Identifier of the artifact.namespace- A String with the namespace of the artifact.includeContentParam- ABooleanindicating whether the artifact content part should be included in the multipart response.- Returns:
- a
ResponseEntitycontaining aMultipartResponse. - See Also:
-
getArtifactDataByResponse
public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getArtifactDataByResponse(String artifactId, String namespace, String includeContentParam) GET /artifacts/{artifactid}/response: Retrieves an artifact from the repository.- Specified by:
getArtifactDataByResponsein interfaceArtifactsApiDelegate- Parameters:
artifactId- A String with the Identifier of the artifact.namespace- A String with the namespace of the artifact.includeContentParam- ABooleanindicating whether the artifact content part should be included in the multipart response.- Returns:
- a
ResponseEntitycontaining aMultipartResponse. - See Also:
-
getArtifactsFromAllAus
public org.springframework.http.ResponseEntity<ArtifactPageInfo> getArtifactsFromAllAus(String namespace, String url, String urlPrefix, String versions, Integer limit, String continuationToken) GET /artifacts: Returns the committed artifacts of all versions of a given URL, from a specified namespace.- Specified by:
getArtifactsFromAllAusin interfaceArtifactsApiDelegate- Parameters:
namespace- A String with the namespace of the artifact.url- A String with the URL contained by the artifacts.urlPrefix- A String with the prefix to be matched by the artifact URLs.limit- An Integer with the maximum number of artifacts to be returned.continuationToken- A String with the continuation token of the next page of artifacts to be returned.- Returns:
- a
ResponseEntity<ArtifactPageInfo>with the requested artifacts. - See Also:
-
updateArtifact
public org.springframework.http.ResponseEntity updateArtifact(Boolean committed, String artifactid, String namespace) PUT /artifacts/{artifactid}: Updates an artifact's propertiesCurrently limited to updating an artifact's committed status.
- Specified by:
updateArtifactin interfaceArtifactsApiDelegate- Parameters:
artifactid- A String with the Identifier of the artifact.committed- A Boolean with the artifact committed status.namespace- A String with the namespace of the artifact.- Returns:
- a
ResponseEntity<Artifact>. - See Also:
-
sendCacheInvalidateArtifact
-
jmsSetUpDone
protected void jmsSetUpDone()When JMS connection is established, tell clients to flush their artifact cache to ensure that no stale cached artifacts. (Normally shouldn't matter, as artifact IDs are stable, even after an index rebuild, but it's conceivable that the repository service that's starting isn't the same one that was previously running at the same address.)- Overrides:
jmsSetUpDonein classBaseSpringApiServiceImpl
-
sendCacheFlush
protected void sendCacheFlush() -
sendPingResponse
-