public class ApiUtils extends Object
| Constructor and Description |
|---|
ApiUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<String> |
getCrawlerIds() |
static org.lockss.crawler.CrawlerStatus |
getCrawlerStatus(String jobId) |
static CrawlStatus |
getCrawlStatus(String jobId) |
static org.lockss.crawler.CrawlManagerImpl |
getLockssCrawlManager()
Provide the Lockss CrawlManager
|
static PageInfo |
getPageInfo(Integer resultsPerPage,
Long lastElement,
int totalCount,
Long timeStamp) |
static PluggableCrawlManager |
getPluggableCrawlManager()
Provides the Pluggable Crawl manager.
|
static org.lockss.repository.RepositoryManager |
getRepositoryManager()
Provide the Lockss RepositoryManager
|
static String |
getV2Namespace() |
static org.lockss.util.rest.repo.LockssRepository |
getV2Repo() |
static Counter |
makeCounter(org.lockss.laaws.crawler.impl.ApiUtils.COUNTER_KIND kind,
String jobId,
org.lockss.crawler.CrawlerStatus.UrlCount urlCount) |
static org.lockss.util.rest.crawler.CrawlDesc |
makeCrawlDesc(org.lockss.crawler.CrawlerStatus cs) |
static String |
makeCrawlLink(String jobId) |
static CrawlStatus |
makeCrawlStatus(org.lockss.crawler.CrawlerStatus cs) |
static org.lockss.util.rest.crawler.JobStatus |
makeJobStatus(org.lockss.crawler.CrawlerStatus crawlerStatus) |
static void |
validateContinuationToken(long timeStamp,
ContinuationToken continuationToken)
Checks that a continuation token is valid.
|
static Integer |
validateLimit(Integer limit)
Checks that a limit field is valid.
|
public static Integer validateLimit(Integer limit) throws IllegalArgumentException
limit - An Integer with the limit value to validate.IllegalArgumentException - if the passed limit value is not valid.public static PluggableCrawlManager getPluggableCrawlManager()
public static org.lockss.crawler.CrawlManagerImpl getLockssCrawlManager()
public static org.lockss.repository.RepositoryManager getRepositoryManager()
public static PageInfo getPageInfo(Integer resultsPerPage, Long lastElement, int totalCount, Long timeStamp)
public static org.lockss.util.rest.crawler.CrawlDesc makeCrawlDesc(org.lockss.crawler.CrawlerStatus cs)
public static org.lockss.util.rest.crawler.JobStatus makeJobStatus(org.lockss.crawler.CrawlerStatus crawlerStatus)
public static CrawlStatus makeCrawlStatus(org.lockss.crawler.CrawlerStatus cs)
public static void validateContinuationToken(long timeStamp,
ContinuationToken continuationToken)
throws IllegalArgumentException
timeStamp - A long with the timestamp used to validate the continuation token.continuationToken - A ContinuationToken with the continuation token to be validated.IllegalArgumentException - if the passed continuation token is not valid.public static Counter makeCounter(org.lockss.laaws.crawler.impl.ApiUtils.COUNTER_KIND kind, String jobId, org.lockss.crawler.CrawlerStatus.UrlCount urlCount)
kind - the type of counter we will be returningjobId - A String with the identifier assigned to the crawl when added.urlCount - the number of urlspublic static CrawlStatus getCrawlStatus(String jobId)
public static org.lockss.crawler.CrawlerStatus getCrawlerStatus(String jobId) throws javax.ws.rs.NotFoundException
jobId - A String with the identifier assigned to the crawl when added.javax.ws.rs.NotFoundException - if there is no crawl status for this jobpublic static org.lockss.util.rest.repo.LockssRepository getV2Repo()
public static String getV2Namespace()
Copyright © 2000–2023 LOCKSS Program. All rights reserved.