com.endeca.itl.cas.api
Interface CasCrawler


public interface CasCrawler

Provides the public interface to CAS Server. This interface includes:


Method Summary
 List<ConfigurationMessage> createCrawl(CrawlConfig crawlConfig)
          Creates a crawl on the server.
 void deleteCrawl(CrawlId crawlId)
          Deletes a crawl from the server.
 List<CrawlMetrics> getAllMetrics()
          Gets a list of all metrics for all crawls on the server.
 List<ModuleSpec> getAllModuleSpecs(ModuleType moduleType)
          Gets a list of specifications for modules available on the server that match the requested module type.
 CrawlConfig getCrawlConfig(CrawlId crawlId, Boolean fillInDefaults)
          Gets configuration for a particular crawl.
 List<Metric> getMetrics(CrawlId crawlId)
          Gets metrics for a particular crawl.
 ModuleSpec getModuleSpec(ModuleId moduleId)
          Gets information on how to configure a particular module.
 List<ModuleInfo> getNonIncrementalManipulators(CrawlId crawlId)
          Returns the ModuleInfos of the manipulators in the given crawl that do no support incremental acquisition.
 List<Property> getServerInfo()
          Returns information about the server, including version number.
 Status getStatus(CrawlId crawlId)
          Gets status for a particular crawl.
 List<CrawlId> listCrawls()
          Gets a list of crawls available on the server
 List<ModuleInfo> listModules(ModuleType moduleType)
          Gets a list of modules available on the server that match the requested module type.
 void startCrawl(CrawlId crawlId, CrawlMode crawlMode)
          Starts a particular crawl.
 void stopCrawl(CrawlId crawlId)
          Stops a crawl.
 List<ConfigurationMessage> updateCrawl(CrawlConfig crawlConfig)
          Updates a crawl that already exists on the server.
 

Method Detail

getServerInfo

@ResponseWrapper(className="com.endeca.itl.cas.api.GetServerInfoResponse")
List<Property> getServerInfo()
Returns information about the server, including version number.

Returns:
a list of Property objects, with name-value pairs.

listModules

@ResponseWrapper(className="com.endeca.itl.cas.api.ListModulesResponse")
List<ModuleInfo> listModules(ModuleType moduleType)
Gets a list of modules available on the server that match the requested module type.

Parameters:
moduleType - of modules to list.
Returns:
list of ModuleInfo objects that identify the modules available.

getModuleSpec

ModuleSpec getModuleSpec(ModuleId moduleId)
                         throws ModuleNotFoundException
Gets information on how to configure a particular module.

Parameters:
moduleId - of the module
Returns:
specification for module
Throws:
ModuleNotFoundException - if module is not available on the server.

getAllModuleSpecs

@ResponseWrapper(className="com.endeca.itl.cas.api.GetAllModuleSpecsResponse")
List<ModuleSpec> getAllModuleSpecs(ModuleType moduleType)
Gets a list of specifications for modules available on the server that match the requested module type.

Parameters:
moduleType - of module specs to list
Returns:
a list of ModuleSpec objects.

listCrawls

@ResponseWrapper(className="com.endeca.itl.cas.api.ListCrawlsResponse")
List<CrawlId> listCrawls()
Gets a list of crawls available on the server

Returns:
a list of CrawlId objects.

getCrawlConfig

CrawlConfig getCrawlConfig(CrawlId crawlId,
                           Boolean fillInDefaults)
                           throws CrawlNotFoundException
Gets configuration for a particular crawl.

Parameters:
crawlId - of crawl
fillInDefaults - set to true if configuration should be populated with default values for those parameters that have them.
Returns:
configuration
Throws:
CrawlNotFoundException - if crawl does not exist

createCrawl

@ResponseWrapper(className="com.endeca.itl.cas.api.CrawlConfigurationResponse")
List<ConfigurationMessage> createCrawl(CrawlConfig crawlConfig)
                                       throws InvalidCrawlConfigException,
                                              CrawlAlreadyExistsException
Creates a crawl on the server. One can only create crawls if they don't already exist. For crawls that exist, use updateCrawl

Parameters:
crawlConfig - configuration of crawl to create
Returns:
list of ConfigurationMessages that provides pertinent information about the configuration.
Throws:
InvalidCrawlConfigException - if configuration is invalid.
CrawlAlreadyExistsException - if crawl already exists on the server.

updateCrawl

@ResponseWrapper(className="com.endeca.itl.cas.api.CrawlConfigurationResponse")
List<ConfigurationMessage> updateCrawl(CrawlConfig crawlConfig)
                                       throws CrawlNotFoundException,
                                              CrawlInProgressException,
                                              InvalidCrawlConfigException
Updates a crawl that already exists on the server. Crawls cannot be updated if they are currently running.

Parameters:
crawlConfig - updated config to replace that on the server.
Returns:
list of ConfigurationMessages that provides pertinent information about the configuration.
Throws:
CrawlNotFoundException - if crawl does not already exist on the server.
CrawlInProgressException - if crawl is currently running.
InvalidCrawlConfigException - if there are validation errors in the config being submitted. If so, the configuration of the crawl remains unchanged, and the exception contains information about the particular validation errors encountered.

deleteCrawl

void deleteCrawl(CrawlId crawlId)
                 throws CrawlNotFoundException,
                        CrawlInProgressException,
                        ItlException
Deletes a crawl from the server. One cannot delete crawls that are currently in progress.

Parameters:
crawlId - of crawl
Throws:
CrawlNotFoundException - if crawl does not exist on the server
CrawlInProgressException - if crawl is currently running
ItlException - if internal exception was encountered by the server.

getNonIncrementalManipulators

@ResponseWrapper(className="com.endeca.itl.cas.api.GetNonIncrementalManipulatorsResponse")
List<ModuleInfo> getNonIncrementalManipulators(CrawlId crawlId)
                                               throws CrawlNotFoundException
Returns the ModuleInfos of the manipulators in the given crawl that do no support incremental acquisition.

Parameters:
crawlId -
Returns:
the ModuleInfos of the non-incremental manipulators in the crawl
Throws:
CrawlNotFoundException - if crawl does not already exist on the server.

startCrawl

void startCrawl(CrawlId crawlId,
                CrawlMode crawlMode)
                throws CrawlNotFoundException,
                       CrawlInProgressException,
                       InvalidCrawlConfigException,
                       ItlException
Starts a particular crawl.

Parameters:
crawlId - of the crawl
crawlMode - the mode in which the crawl should be run (e.g. full or incremental)
Throws:
CrawlNotFoundException - if crawl does not exist
CrawlInProgressException - if crawl is already running
InvalidCrawlConfigException - if crawl's configuration is no longer valid. This can happen, for example, if a particular module that is configured for the crawl has been uninstalled.
ItlException - if a server-internal exception occurs in building or starting the crawl.

stopCrawl

void stopCrawl(CrawlId crawlId)
               throws CrawlNotFoundException
Stops a crawl. It is a no-op if the crawl is not currently running.

Parameters:
crawlId - of crawl
Throws:
CrawlNotFoundException - if crawl does not exist on the server

getStatus

Status getStatus(CrawlId crawlId)
                 throws CrawlNotFoundException
Gets status for a particular crawl.

Parameters:
crawlId - of crawl
Returns:
current state of the crawl
Throws:
CrawlNotFoundException - if crawl does not exist.

getMetrics

@ResponseWrapper(className="com.endeca.itl.cas.api.GetMetricsResponse")
List<Metric> getMetrics(CrawlId crawlId)
                        throws CrawlNotFoundException
Gets metrics for a particular crawl. If the crawl was never run, it returns a single metric for the crawl state.

Parameters:
crawlId - of crawl
Returns:
a list of Metric objects
Throws:
CrawlNotFoundException - if crawl does not exist on the server

getAllMetrics

@ResponseWrapper(className="com.endeca.itl.cas.api.GetAllMetricsResponse")
List<CrawlMetrics> getAllMetrics()
Gets a list of all metrics for all crawls on the server.

Returns:
a list of CrawlMetric objects, each with a list of metrics for each crawl on the server. If a crawl has not yet been run, the metrics contain a single metric describing the crawl state.


Copyright © 2011 Endeca. All Rights Reserved.