@Deprecated public class ApplicationArticlePresentationManager extends AbstractNurseryService implements UpdatePresentationObject.Callback, IOEventFilter, IOEventListener
PresentationLoader
instead.GenericService.StartCommand, GenericService.StopCommand
Modifier and Type | Field and Description |
---|---|
protected Map<String,PresentationDecoratorFactory<PresentationArticle>> |
mArticleDecoratorFactories |
CLASS_VERSION
mLogger, state
Constructor and Description |
---|
ApplicationArticlePresentationManager()
Deprecated.
constructs an instance of the ArticlePresentationManager
|
ApplicationArticlePresentationManager(EventManager pEventManager)
Deprecated.
constructs an instance of the ArticlePresentationManager
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptEvent(IOEvent pEvent)
Deprecated.
This method decides whether an event is accepted.
|
void |
addDecoratorFactory(String pName,
PresentationDecoratorFactory<PresentationArticle> pFactory) |
protected void |
createPresentationObject(int pArticleId)
Deprecated.
|
protected PresentationArticle |
decorate(PresentationArticle pPresentationArticle)
Decorates the given article.
|
protected PresentationArticle |
decorateUsingClazz(PresentationArticle pPresentationArticle,
neo.xredsys.content.type.Decorator pDecorator)
Deprecated.
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.
|
PresentationArticle |
getArticle(int articleId,
int publicationId)
Deprecated.
Get a PresentationArticle.
|
PresentationArticle |
getArticle(int articleId,
int publicationId,
boolean stale)
Deprecated.
Get a PresentationArticle.
|
PresentationArticle |
getArticle(int articleId,
int publicationId,
boolean stale,
Date today)
Deprecated.
|
PresentationArticle |
getArticle(int articleId,
int publicationId,
boolean stale,
Date today,
boolean pPreviewAll)
Deprecated.
|
PresentationArticle |
getArticle(int articleId,
int publicationId,
Date today,
boolean pPreviewAll)
Deprecated.
|
Cache<Integer,PresentationArticle> |
getArticlePresentationCache()
Deprecated.
|
Cache<Integer,PresentationArticle> |
getCache()
Deprecated.
|
Map<String,PresentationDecoratorFactory<PresentationArticle>> |
getDecoratorFactories() |
boolean |
getExpireCache()
Deprecated.
|
protected PresentationArticle |
getFromCache(int pArticleId)
Deprecated.
|
PresentationLoader |
getPresentationLoader()
Deprecated.
|
int |
getTimeout()
Deprecated.
|
UpdatePresentationObject |
getUpdater()
Deprecated.
|
boolean |
getValidateArticlesInCacheOnRequest()
Deprecated.
|
void |
handleEvent(IOEvent pEvent)
Deprecated.
This method is called to let an event listener respond to an event.
|
boolean |
isLive(int pArticleId,
int pPublicationId)
Deprecated.
Indicates whether a call to getArticle with the same parameters would return
an article that is live.
|
boolean |
isLive(int pArticleId,
int pPublicationId,
Date pNow)
Deprecated.
|
void |
refresh(int pObjectId)
Deprecated.
|
void |
setCache(Cache<Integer,PresentationArticle> pCache)
Deprecated.
|
void |
setExpireCache(boolean pExpireCache)
Deprecated.
|
void |
setObjectLoader(ObjectLoader pObjectLoader)
Deprecated.
|
void |
setPresentationLoader(PresentationLoader pPresentationLoader)
Deprecated.
|
void |
setTimeout(int pTimeout)
Deprecated.
|
void |
setUpdater(UpdatePresentationObject newUpdater)
Deprecated.
|
void |
setValidateArticlesInCacheOnRequest(boolean pValidate)
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 ApplicationArticlePresentationManager()
public ApplicationArticlePresentationManager(EventManager pEventManager)
public void setExpireCache(boolean pExpireCache)
public boolean getExpireCache()
public void setValidateArticlesInCacheOnRequest(boolean pValidate)
public boolean getValidateArticlesInCacheOnRequest()
public void setTimeout(int pTimeout)
public int getTimeout()
public void setCache(Cache<Integer,PresentationArticle> pCache)
public Cache<Integer,PresentationArticle> getCache()
public void setUpdater(UpdatePresentationObject newUpdater)
public UpdatePresentationObject getUpdater()
public void setObjectLoader(ObjectLoader pObjectLoader)
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()
protected PresentationArticle getFromCache(int pArticleId)
public Cache<Integer,PresentationArticle> getArticlePresentationCache()
public PresentationArticle getArticle(int articleId, int publicationId)
getArticle
in interface 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 getArticle(int articleId, int publicationId, Date today, boolean pPreviewAll)
public PresentationArticle getArticle(int articleId, int publicationId, boolean stale)
false
it will first check if this object is in the updating
queue.getArticle
in interface ArticlePresentationManager
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 PresentationArticle getArticle(int articleId, int publicationId, boolean stale, Date today)
public PresentationArticle getArticle(int articleId, int publicationId, boolean stale, Date today, boolean pPreviewAll)
public boolean isLive(int pArticleId, int pPublicationId)
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
isArticleLiveisLive
in interface ArticlePresentationManager
pArticleId
- id of the presentation article to fetchpPublicationId
- true
if getArticle(...).isLive() would return true
,
false
otherwise.public boolean isLive(int pArticleId, int pPublicationId, Date pNow)
public void expireArticle(int articleId)
expireArticle
in interface ArticlePresentationManager
articleId
- The id of the article to expire from cache.public void drop(int articleId)
drop
in interface ArticlePresentationManager
articleId
- id of the article to be dropped from the cacheprotected void createPresentationObject(int pArticleId)
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.public void setPresentationLoader(PresentationLoader pPresentationLoader)
public PresentationLoader getPresentationLoader()
public void refresh(int pObjectId)
refresh
in interface UpdatePresentationObject.Callback
public boolean acceptEvent(IOEvent pEvent) throws Exception
IOEventFilter
acceptEvent
in interface IOEventFilter
pEvent
- the event to acceptException
- when any unknown error happenspublic void handleEvent(IOEvent pEvent) throws Exception
IOEventListener
handleEvent
in interface IOEventListener
pEvent
- the eventException
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
© 1998- 2021 Escenic AS