-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public interface PulsarSession implements AutoCloseable
-
-
Method Summary
Modifier and Type Method Description abstract BooleanregisterClosable(AutoCloseable closable)Close objects when sessions closes abstract UnitdisableCache()abstract LoadOptionsoptions(String args)Create a new options, with a new volatile config abstract NormUrlnormalize(String url, LoadOptions options, Boolean toItemOption)abstract List<NormUrl>normalize(Iterable<String> urls, LoadOptions options, Boolean toItemOption)abstract NormUrlnormalize(UrlAware url, LoadOptions options, Boolean toItemOption)abstract List<NormUrl>normalize(Collection<UrlAware> urls, LoadOptions options, Boolean toItemOption)abstract NormUrlnormalizeOrNull(String url, LoadOptions options, Boolean toItemOption)abstract NormUrlnormalizeOrNull(UrlAware url, LoadOptions options, Boolean toItemOption)abstract WebPageinject(String url)Inject a url abstract WebPageget(String url)abstract WebPagegetOrNull(String url)abstract Booleanexists(String url)abstract CheckStatefetchState(WebPage page, LoadOptions options)abstract WebPageload(String url, String args)Load a url with specified options abstract WebPageload(String url, LoadOptions options)Load a url with specified options abstract WebPageload(UrlAware url, String args)abstract WebPageload(UrlAware url, LoadOptions options)abstract WebPageload(NormUrl normUrl)abstract WebPageloadDeferred(String url, LoadOptions options)abstract WebPageloadDeferred(UrlAware url, String args)abstract WebPageloadDeferred(UrlAware url, LoadOptions options)abstract WebPageloadDeferred(NormUrl normUrl)abstract Collection<WebPage>loadAll(Iterable<String> urls, LoadOptions options, Boolean areItems)Load all urls with specified options, this causes a parallel fetching whenever applicable abstract Collection<WebPage>loadOutPages(String portalUrl, String args)Load all out pages in a portal page abstract Collection<WebPage>loadOutPages(String portalUrl, LoadOptions options)Load all out pages in a portal page abstract FeaturedDocumentparse(WebPage page, Boolean noCache)Parse the Web page into DOM. abstract FeaturedDocumentloadDocument(String url, String args)abstract FeaturedDocumentloadDocument(String url, LoadOptions options)abstract FeaturedDocumentloadDocument(NormUrl normUrl)abstract Map<String, String>scrape(String url, String args, Iterable<String> fieldSelectors)abstract Map<String, String>scrape(String url, String args, Map<String, String> fieldSelectors)abstract List<Map<String, String>>scrape(String url, String args, String restrictSelector, Iterable<String> fieldSelectors)abstract List<Map<String, String>>scrape(String url, String args, String restrictSelector, Map<String, String> fieldSelectors)abstract List<Map<String, String>>scrapeOutPages(String portalUrl, String args, Iterable<String> fieldSelectors)abstract List<Map<String, String>>scrapeOutPages(String portalUrl, String args, String restrictSelector, Iterable<String> fieldSelectors)abstract List<Map<String, String>>scrapeOutPages(String portalUrl, String args, Map<String, String> fieldSelectors)abstract List<Map<String, String>>scrapeOutPages(String portalUrl, String args, String restrictSelector, Map<String, String> fieldSelectors)abstract ObjectgetVariable(String name)abstract UnitsetVariable(String name, Object value)abstract UnitputSessionBean(Object obj)abstract Unitdelete(String url)abstract Unitflush()abstract Booleanpersist(WebPage page)abstract Pathexport(WebPage page, String ident)abstract Pathexport(FeaturedDocument doc, String ident)abstract PathexportTo(FeaturedDocument doc, Path path)abstract IntegergetId()The session id. abstract AbstractPulsarContextgetContext()The pulsar context abstract VolatileConfiggetSessionConfig()The session scope volatile config, every setting is supposed to be changed at any time and any place abstract ImmutableConfiggetUnmodifiedConfig()abstract BeanFactorygetSessionBeanFactory()The scoped bean factory: for each volatileConfig object, there is a bean factory TODO: session scoped? abstract StringgetDisplay()abstract ConcurrentExpiringLRUCache<String, WebPage>getPageCache()abstract ConcurrentExpiringLRUCache<String, FeaturedDocument>getDocumentCache()abstract GlobalCacheFactorygetGlobalCacheFactory()-
-
Method Detail
-
registerClosable
abstract Boolean registerClosable(AutoCloseable closable)
Close objects when sessions closes
-
disableCache
abstract Unit disableCache()
-
options
abstract LoadOptions options(String args)
Create a new options, with a new volatile config
-
normalize
abstract NormUrl normalize(String url, LoadOptions options, Boolean toItemOption)
-
normalize
abstract List<NormUrl> normalize(Iterable<String> urls, LoadOptions options, Boolean toItemOption)
-
normalize
abstract NormUrl normalize(UrlAware url, LoadOptions options, Boolean toItemOption)
-
normalize
abstract List<NormUrl> normalize(Collection<UrlAware> urls, LoadOptions options, Boolean toItemOption)
-
normalizeOrNull
abstract NormUrl normalizeOrNull(String url, LoadOptions options, Boolean toItemOption)
-
normalizeOrNull
abstract NormUrl normalizeOrNull(UrlAware url, LoadOptions options, Boolean toItemOption)
-
inject
abstract WebPage inject(String url)
Inject a url
- Parameters:
url- The url followed by options
-
fetchState
abstract CheckState fetchState(WebPage page, LoadOptions options)
-
load
abstract WebPage load(String url, String args)
Load a url with specified options
- Parameters:
url- The url to loadargs- The load args
-
load
abstract WebPage load(String url, LoadOptions options)
Load a url with specified options
- Parameters:
url- The url to loadoptions- The load options
-
load
abstract WebPage load(UrlAware url, LoadOptions options)
-
loadDeferred
abstract WebPage loadDeferred(String url, LoadOptions options)
-
loadDeferred
abstract WebPage loadDeferred(UrlAware url, String args)
-
loadDeferred
abstract WebPage loadDeferred(UrlAware url, LoadOptions options)
-
loadDeferred
abstract WebPage loadDeferred(NormUrl normUrl)
-
loadAll
abstract Collection<WebPage> loadAll(Iterable<String> urls, LoadOptions options, Boolean areItems)
Load all urls with specified options, this causes a parallel fetching whenever applicable
- Parameters:
urls- The urls to loadoptions- The load options
-
loadOutPages
abstract Collection<WebPage> loadOutPages(String portalUrl, String args)
Load all out pages in a portal page
- Parameters:
portalUrl- The portal url from where to load pagesargs- The load args
-
loadOutPages
abstract Collection<WebPage> loadOutPages(String portalUrl, LoadOptions options)
Load all out pages in a portal page
- Parameters:
portalUrl- The portal url from where to load pagesoptions- The load options
-
parse
abstract FeaturedDocument parse(WebPage page, Boolean noCache)
Parse the Web page into DOM. If the Web page is not changed since last parse, use the last result if available
-
loadDocument
abstract FeaturedDocument loadDocument(String url, String args)
-
loadDocument
abstract FeaturedDocument loadDocument(String url, LoadOptions options)
-
loadDocument
abstract FeaturedDocument loadDocument(NormUrl normUrl)
-
scrape
abstract Map<String, String> scrape(String url, String args, Iterable<String> fieldSelectors)
-
scrape
abstract Map<String, String> scrape(String url, String args, Map<String, String> fieldSelectors)
-
scrape
abstract List<Map<String, String>> scrape(String url, String args, String restrictSelector, Iterable<String> fieldSelectors)
-
scrape
abstract List<Map<String, String>> scrape(String url, String args, String restrictSelector, Map<String, String> fieldSelectors)
-
scrapeOutPages
abstract List<Map<String, String>> scrapeOutPages(String portalUrl, String args, Iterable<String> fieldSelectors)
-
scrapeOutPages
abstract List<Map<String, String>> scrapeOutPages(String portalUrl, String args, String restrictSelector, Iterable<String> fieldSelectors)
-
scrapeOutPages
abstract List<Map<String, String>> scrapeOutPages(String portalUrl, String args, Map<String, String> fieldSelectors)
-
scrapeOutPages
abstract List<Map<String, String>> scrapeOutPages(String portalUrl, String args, String restrictSelector, Map<String, String> fieldSelectors)
-
getVariable
abstract Object getVariable(String name)
-
setVariable
abstract Unit setVariable(String name, Object value)
-
putSessionBean
abstract Unit putSessionBean(Object obj)
-
getId
abstract Integer getId()
The session id. Session id is expected to be set by the container, e.g. the h2 database runtime
-
getContext
abstract AbstractPulsarContext getContext()
The pulsar context
-
getSessionConfig
abstract VolatileConfig getSessionConfig()
The session scope volatile config, every setting is supposed to be changed at any time and any place
-
getUnmodifiedConfig
abstract ImmutableConfig getUnmodifiedConfig()
-
getSessionBeanFactory
abstract BeanFactory getSessionBeanFactory()
The scoped bean factory: for each volatileConfig object, there is a bean factory TODO: session scoped?
-
getDisplay
abstract String getDisplay()
-
getPageCache
abstract ConcurrentExpiringLRUCache<String, WebPage> getPageCache()
-
getDocumentCache
abstract ConcurrentExpiringLRUCache<String, FeaturedDocument> getDocumentCache()
-
getGlobalCacheFactory
abstract GlobalCacheFactory getGlobalCacheFactory()
-
-
-
-