public class RequestArticlePresentationManager extends AbstractNurseryService
GenericService.StartCommand, GenericService.StopCommand
Modifier and Type | Field and Description |
---|---|
protected Map<String,PresentationDecoratorFactory<PresentationArticle>> |
mArticleDecoratorFactories |
CLASS_VERSION
mLogger, state
Constructor and Description |
---|
RequestArticlePresentationManager()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addDecoratorFactory(String pName,
PresentationDecoratorFactory<PresentationArticle> pFactory) |
protected PresentationArticle |
decorate(PresentationArticle pPresentationArticle)
Decorates the given article.
|
protected PresentationArticle |
decorateUsingClazz(PresentationArticle pPresentationArticle,
neo.xredsys.content.type.Decorator pDecorator)
A template method invoked from
decorate(PresentationArticle) if the given article should be decorated
using a decorator class. |
protected PresentationArticle |
decorateUsingFactory(PresentationArticle pPresentationArticle,
neo.xredsys.content.type.Decorator pDecorator) |
protected PresentationArticle |
decorateUsingFactory(PresentationArticle pPresentationArticle,
String pDecoratorName) |
void |
drop(int articleId)
Deprecated.
Will drop the the given PresentationArticle from the cache.
|
void |
expireArticle(int articleId)
Deprecated.
Expire an PresentationArticle object from presentationArticle cache.
|
ApplicationArticlePresentationManager |
getApplicationArticlePresentationManager()
Deprecated.
|
PresentationArticle |
getArticle(int articleId,
int publicationId)
Deprecated.
Get a PresentationArticle.
|
PresentationArticle |
getArticle(int articleId,
int publicationId,
boolean stale)
Deprecated.
Get a PresentationArticle.
|
PresentationArticle |
getArticleDoNotEagerLoadFieldsAndDoNotCacheIt(int pArticleId)
Deprecated.
|
Map<String,PresentationDecoratorFactory<PresentationArticle>> |
getDecoratorFactories() |
boolean |
isLive(int pArticleId,
int pPublicationId)
Deprecated.
Indicates whether a call to getArticle with the same parameters would return
an article that is live.
|
void |
setApplicationArticlePresentationManager(ApplicationArticlePresentationManager pApplicationArticlePresentationManager)
Deprecated.
|
protected void |
startService()
Deprecated.
Is called by
AbstractNurseryService.doStartService() when the NurseryService is being started. |
protected void |
stopService()
Deprecated.
Is called by
AbstractNurseryService.doStopService() when the service is being shut down. |
doStartService, doStopService, stopIdleService
assertServiceRunning, getServiceDescription, getServiceMessage, getServiceState, isServiceEnabled, isServiceFailed, isServiceIdle, isServiceRunning, isServiceShutdownFailed, isServiceStopped, setServiceDescription, setServiceEnabled, start, stop, validateIsTrue, validateNotNull
protected Map<String,PresentationDecoratorFactory<PresentationArticle>> mArticleDecoratorFactories
public RequestArticlePresentationManager()
public ApplicationArticlePresentationManager getApplicationArticlePresentationManager()
public void setApplicationArticlePresentationManager(ApplicationArticlePresentationManager pApplicationArticlePresentationManager)
protected void startService() throws Exception
AbstractNurseryService
Is called by AbstractNurseryService.doStartService()
when the NurseryService
is being started. Exceptions thrown by this
method are logged by AbstractNurseryService.doStartService()
.
Subclasses must implement this method to bootstrap the service.
startService
in class AbstractNurseryService
Exception
- when something goes wrong during startup. GenericService.isServiceRunning()
will return false
and GenericService.isServiceFailed()
will return true
.IllegalArgumentException
- when the configuration of the service
is invalid. GenericService.isServiceRunning()
will return false
and GenericService.isServiceFailed()
will return true
.IllegalStateException
- when this service is in the wrong state for startup. Used to signal to AbstractNurseryService.doStartService()
that it is OK to try to starting
this service
later. GenericService.isServiceRunning()
returns false
and GenericService.isServiceIdle()
returns true
.AbstractNurseryService.doStartService()
protected void stopService() throws Exception
AbstractNurseryService
Is called by AbstractNurseryService.doStopService()
when the service
is being shut down. Exceptions thrown by this
method are logged by AbstractNurseryService.doStopService()
.
Subclasses must implement this method to shut down the service.
stopService
in class AbstractNurseryService
IllegalStateException
- when this service is in the wrong state for shutdown. Used to signal to AbstractNurseryService.doStopService()
that
it is OK to try stopping this service
later. GenericService.isServiceRunning()
returns true
.Exception
- when something goes during shutdown. GenericService.isServiceRunning()
returns false
and
GenericService.isServiceShutdownFailed()
returns true
.AbstractNurseryService.doStopService()
public PresentationArticle getArticle(int articleId, int publicationId)
ArticlePresentationManager
articleId
- The articleId of the article.publicationId
- The publicationId of the publication displaying
the article. Used to check for specific publication
configurations.public PresentationArticle getArticleDoNotEagerLoadFieldsAndDoNotCacheIt(int pArticleId)
public PresentationArticle getArticle(int articleId, int publicationId, boolean stale)
ArticlePresentationManager
false
it will first check if this object is in the updating
queue.articleId
- The articleId of the article.publicationId
- The publicationId of the publication displaying
the article. Used to check for specific publication
configurations.stale
- says if you accept stale date or not
PresentationArticle.public boolean isLive(int pArticleId, int pPublicationId)
ArticlePresentationManager
true
does not guarantee that a call to getArticle() actually will return a
live article, since the article may have changed since the call to
isArticleLivepArticleId
- id of the presentation article to fetchtrue
if getArticle(...).isLive() would return true
,
false
otherwise.public void drop(int articleId)
ArticlePresentationManager
articleId
- id of the article to be dropped from the cachepublic void expireArticle(int articleId)
ArticlePresentationManager
articleId
- The id of the article to expire from cache.public void addDecoratorFactory(String pName, PresentationDecoratorFactory<PresentationArticle> pFactory)
public Map<String,PresentationDecoratorFactory<PresentationArticle>> getDecoratorFactories()
protected PresentationArticle decorate(PresentationArticle pPresentationArticle)
decorateUsingClazz(PresentationArticle, neo.xredsys.content.type.Decorator)
and decorateUsingFactory(PresentationArticle, neo.xredsys.content.type.Decorator)
pPresentationArticle
- the article to decorateprotected PresentationArticle decorateUsingFactory(PresentationArticle pPresentationArticle, neo.xredsys.content.type.Decorator pDecorator) throws Exception
Exception
protected PresentationArticle decorateUsingFactory(PresentationArticle pPresentationArticle, String pDecoratorName) throws Exception
Exception
protected PresentationArticle decorateUsingClazz(PresentationArticle pPresentationArticle, neo.xredsys.content.type.Decorator pDecorator) throws Exception
decorate(PresentationArticle)
if the given article should be decorated
using a decorator class. The default implementation is to not do anythingpPresentationArticle
- the article to decoratepDecorator
- the decoratorException
- if decorating the article failed.© 1998- 2018 Stibo DX