@Service public class CollectionsApiServiceImpl extends org.lockss.spring.base.BaseSpringApiServiceImpl implements CollectionsApiDelegate, org.lockss.spring.base.LockssConfigurableService
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_DEFAULT_ARTIFACT_PAGESIZE |
static int |
DEFAULT_DEFAULT_AUID_PAGESIZE |
static int |
DEFAULT_MAX_ARTIFACT_PAGESIZE |
static int |
DEFAULT_MAX_AUID_PAGESIZE |
static long |
DEFAULT_SMALL_CONTENT_THRESHOLD |
static String |
PARAM_DEFAULT_ARTIFACT_PAGESIZE
Default number of Artifacts that will be returned in a single (paged)
response
|
static String |
PARAM_DEFAULT_AUID_PAGESIZE
Default number of AUIDs that will be returned in a single (paged)
response
|
static String |
PARAM_MAX_ARTIFACT_PAGESIZE
Max number of Artifacts that will be returned in a single (paged)
response
|
static String |
PARAM_MAX_AUID_PAGESIZE
Max number of AUIDs that will be returned in a single (paged)
response
|
static String |
PARAM_SMALL_CONTENT_THRESHOLD
Largest Artifact content that will be included in a response to a
getArtifactData call with includeContent == IF_SMALL
|
static String |
PREFIX |
| Constructor and Description |
|---|
CollectionsApiServiceImpl(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
javax.servlet.http.HttpServletRequest request)
Constructor for autowiring.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.http.ResponseEntity<Artifact> |
createArtifact(String collectionid,
String auid,
String uri,
org.springframework.web.multipart.MultipartFile content,
Long collectionDate)
POST /collections/{collectionid}/artifacts:
Adds artifacts to the repository
|
org.springframework.http.ResponseEntity<Void> |
deleteArtifact(String collectionid,
String artifactid)
DELETE /collections/{collectionid}/artifacts/{artifactid}:
Deletes an artifact from a collection managed by this repository.
|
static org.springframework.util.MultiValueMap<String,Object> |
generateMultipartResponseFromArtifactData(ArtifactData artifactData,
LockssRepository.IncludeContent includeContent,
long smallContentThreshold) |
org.springframework.http.ResponseEntity |
getArtifact(String collectionid,
String artifactid,
String includeContent)
GET /collections/{collectionid}/artifacts/{artifactid}:
Retrieves an artifact from the repository.
|
org.springframework.http.ResponseEntity<ArtifactPageInfo> |
getArtifacts(String collectionid,
String auid,
String url,
String urlPrefix,
String version,
Boolean includeUncommitted,
Integer limit,
String continuationToken)
GET /collections/{collectionid}/aus/{auid}/artifacts: Get a list with all
the artifacts in a collection and Archival Unit or a pageful of the list
defined by the continuation token and size.
|
org.springframework.http.ResponseEntity<Long> |
getArtifactsSize(String collectionid,
String auid,
String url,
String urlPrefix,
String version)
GET /collections/{collectionid}/aus/{auid}/size:
Get the size of Archival Unit artifacts in a collection.
|
org.springframework.http.ResponseEntity<AuidPageInfo> |
getAus(String collectionid,
Integer limit,
String continuationToken)
GET /collections/{collectionid}/aus: Get all Archival Unit IDs (AUIDs) in a
collection or a pageful of the list defined by the continuation token and
size.
|
org.springframework.http.ResponseEntity<List<String>> |
getCollections()
GET /collections:
Returns a list of collection names managed by this repository.
|
Optional<com.fasterxml.jackson.databind.ObjectMapper> |
getObjectMapper() |
Optional<javax.servlet.http.HttpServletRequest> |
getRequest() |
protected void |
jmsSetUpDone()
When JMS connection is established, tell clients to flush their
artifact cache to ensure that no stale cached artifacts.
|
protected void |
sendCacheFlush() |
protected void |
sendCacheInvalidate(ArtifactCache.InvalidateOp op,
String key) |
protected void |
sendPingResponse(String key) |
void |
setConfig(org.lockss.config.Configuration newConfig,
org.lockss.config.Configuration prevConfig,
org.lockss.config.Configuration.Differences changedKeys) |
org.springframework.http.ResponseEntity |
updateArtifact(String collectionid,
String artifactid,
Boolean committed)
PUT /collections/{collectionid}/artifacts/{artifactid}:
Updates an artifact's properties
|
configMgrCreated, getClassName, getConfigWaitTime, getJMSManager, getReadyWaitTime, getRunningLockssDaemon, getWaitTime, receiveMessage, registerConfigCallback, setUpJms, setUpJms, setUpJms, stopJms, waitConfig, waitConfig, waitReady, waitReadyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAcceptHeaderpublic static final String PREFIX
public static final String PARAM_DEFAULT_ARTIFACT_PAGESIZE
public static final int DEFAULT_DEFAULT_ARTIFACT_PAGESIZE
public static final String PARAM_MAX_ARTIFACT_PAGESIZE
public static final int DEFAULT_MAX_ARTIFACT_PAGESIZE
public static final String PARAM_DEFAULT_AUID_PAGESIZE
public static final int DEFAULT_DEFAULT_AUID_PAGESIZE
public static final String PARAM_MAX_AUID_PAGESIZE
public static final int DEFAULT_MAX_AUID_PAGESIZE
public static final String PARAM_SMALL_CONTENT_THRESHOLD
public static final long DEFAULT_SMALL_CONTENT_THRESHOLD
@Autowired
public CollectionsApiServiceImpl(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
javax.servlet.http.HttpServletRequest request)
objectMapper - An ObjectMapper for JSON processing.request - An HttpServletRequest with the HTTP request.public void setConfig(org.lockss.config.Configuration newConfig,
org.lockss.config.Configuration prevConfig,
org.lockss.config.Configuration.Differences changedKeys)
setConfig in interface org.lockss.spring.base.LockssConfigurableServiceprotected void jmsSetUpDone()
jmsSetUpDone in class org.lockss.spring.base.BaseSpringApiServiceImplpublic org.springframework.http.ResponseEntity<List<String>> getCollections()
getCollections in interface CollectionsApiDelegateCollectionsApi.getCollections()public org.springframework.http.ResponseEntity<Void> deleteArtifact(String collectionid, String artifactid)
deleteArtifact in interface CollectionsApiDelegatecollectionid - A String with the name of the collection containing the artifact.artifactid - A String with the Identifier of the artifact.ResponseEntity<Void>.CollectionsApi.deleteArtifact(java.lang.String, java.lang.String)public org.springframework.http.ResponseEntity getArtifact(String collectionid, String artifactid, String includeContent)
getArtifact in interface CollectionsApiDelegatecollectionid - A String with the name of the collection containing the artifact.artifactid - A String with the Identifier of the artifact.includeContent - A Boolean indicating whether the artifact content part should be included in the
multipart response.ResponseEntity containing a org.lockss.util.rest.multipart.MultipartResponse.CollectionsApi.getArtifact(java.lang.String, java.lang.String, java.lang.String)public static org.springframework.util.MultiValueMap<String,Object> generateMultipartResponseFromArtifactData(ArtifactData artifactData, LockssRepository.IncludeContent includeContent, long smallContentThreshold) throws IOException
IOExceptionpublic org.springframework.http.ResponseEntity updateArtifact(String collectionid, String artifactid, Boolean committed)
Currently limited to updating an artifact's committed status.
updateArtifact in interface CollectionsApiDelegatecollectionid - A String with the name of the collection containing the artifact.artifactid - A String with the Identifier of the artifact.committed - A Boolean with the artifact committed status.ResponseEntity<Artifact>.CollectionsApi.updateArtifact(java.lang.String, java.lang.String, java.lang.Boolean)public org.springframework.http.ResponseEntity<Artifact> createArtifact(String collectionid, String auid, String uri, org.springframework.web.multipart.MultipartFile content, Long collectionDate)
createArtifact in interface CollectionsApiDelegatecollectionid - A String with the name of the collection containing the artifact.auid - A String with the Archival Unit ID (AUID) of new artifact.uri - A String with the URI represented by this artifact.content - A MultipartFile with the artifact content.ResponseEntity<Artifact>.CollectionsApi.createArtifact(java.lang.String, java.lang.String, java.lang.String, org.springframework.web.multipart.MultipartFile, java.lang.Long)public org.springframework.http.ResponseEntity<ArtifactPageInfo> getArtifacts(String collectionid, String auid, String url, String urlPrefix, String version, Boolean includeUncommitted, Integer limit, String continuationToken)
getArtifacts in interface CollectionsApiDelegatecollectionid - A String with the name of the collection
containing the artifact.auid - A String with the Archival Unit ID (AUID) of
artifact.url - A String with the URL contained by the artifacts.urlPrefix - A String with the prefix to be matched by the
artifact URLs.version - An Integer with the version of the URL contained
by the artifacts.includeUncommitted - A boolean with the indication of whether
uncommitted artifacts should be returned.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.ResponseEntity<ArtifactPageInfo> with the requested
artifacts.CollectionsApi.getArtifacts(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.Integer, java.lang.String)public org.springframework.http.ResponseEntity<Long> getArtifactsSize(String collectionid, String auid, String url, String urlPrefix, String version)
getArtifactsSize in interface CollectionsApiDelegatecollectionid - A String with the name of the collection containing the Archival
Unit.auid - A String with the Archival Unit ID (AUID).url - A String with the URL contained by the artifacts.urlPrefix - A String with the prefix to be matched by the artifact URLs.version - An Integer with the version of the URL contained by the artifacts.ResponseEntity<Long>.CollectionsApi.getArtifactsSize(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)public org.springframework.http.ResponseEntity<AuidPageInfo> getAus(String collectionid, Integer limit, String continuationToken)
getAus in interface CollectionsApiDelegatecollectionid - A String with the name of the collection
containing the archival units.limit - An Integer with the maximum number of archival
unit identifiers to be returned.continuationToken - A String with the continuation token of the next
page of archival unit identifiers to be returned.ResponseEntity<AuidPageInfo>.CollectionsApi.getAus(java.lang.String, java.lang.Integer, java.lang.String)public Optional<com.fasterxml.jackson.databind.ObjectMapper> getObjectMapper()
getObjectMapper in interface CollectionsApiDelegatepublic Optional<javax.servlet.http.HttpServletRequest> getRequest()
getRequest in interface CollectionsApiDelegateprotected void sendCacheInvalidate(ArtifactCache.InvalidateOp op, String key)
protected void sendCacheFlush()
protected void sendPingResponse(String key)
Copyright © 2000–2021 LOCKSS Program. All rights reserved.