public class TimePlugin extends PluginActivator implements TimeService, PostCreateTopicListener, PostCreateAssociationListener, PostUpdateTopicListener, PostUpdateTopicRequestListener, PostUpdateAssociationListener, PreSendTopicListener, PreSendAssociationListener, ServiceResponseFilterListener
Modifier and Type | Field and Description |
---|---|
private static String |
HEADER_LAST_MODIFIED |
private Logger |
logger |
private static String |
PROP_CREATED |
private static String |
PROP_MODIFIED |
private DateFormat |
rfc2822 |
bundle, dmx, mf
Constructor and Description |
---|
TimePlugin() |
Modifier and Type | Method and Description |
---|---|
private void |
enrichWithTimestamp(DMXObject object) |
Collection<Association> |
getAssociationsByCreationTime(long from,
long to) |
Collection<Association> |
getAssociationsByModificationTime(long from,
long to) |
long |
getCreationTime(long objectId) |
long |
getModificationTime(long objectId) |
private Set<DMXObject> |
getParents(Topic topic)
Returns all parent topics/associations of the given topic (recursively).
|
Collection<Topic> |
getTopicsByCreationTime(long from,
long to) |
Collection<Topic> |
getTopicsByModificationTime(long from,
long to) |
void |
init() |
void |
postCreateAssociation(Association assoc) |
void |
postCreateTopic(Topic topic) |
void |
postUpdateAssociation(Association assoc,
AssociationModel updateModel,
AssociationModel oldAssoc) |
void |
postUpdateTopic(Topic topic,
TopicModel updateModel,
TopicModel oldTopic) |
void |
postUpdateTopicRequest(Topic topic) |
void |
preSendAssociation(Association assoc) |
void |
preSendTopic(Topic topic) |
private DMXObject |
responseObject(com.sun.jersey.spi.container.ContainerResponse response) |
void |
serviceResponseFilter(com.sun.jersey.spi.container.ContainerResponse response) |
private void |
setHeader(com.sun.jersey.spi.container.ContainerResponse response,
String header,
String value) |
private void |
setLastModifiedHeader(com.sun.jersey.spi.container.ContainerResponse response,
long time) |
void |
setModified(DMXObject object) |
private void |
storeCreationTime(DMXObject object,
long time) |
private void |
storeModificationTime(DMXObject object,
long time) |
private void |
storeParentsTimestamp(Topic topic) |
private void |
storeTime(DMXObject object,
String propUri,
long time) |
private void |
storeTimestamp(DMXObject object) |
private void |
storeTimestamps(DMXObject object) |
getBundleContext, getPluginName, getStaticResource, getUri, preInstall, publishFileSystem, serviceArrived, serviceGone, setCoreService, shutdown, start, stop, toString
private static String PROP_CREATED
private static String PROP_MODIFIED
private static String HEADER_LAST_MODIFIED
private DateFormat rfc2822
public TimePlugin()
public long getCreationTime(long objectId)
getCreationTime
in interface TimeService
public long getModificationTime(long objectId)
getModificationTime
in interface TimeService
public void setModified(DMXObject object)
setModified
in interface TimeService
public Collection<Topic> getTopicsByCreationTime(long from, long to)
getTopicsByCreationTime
in interface TimeService
public Collection<Topic> getTopicsByModificationTime(long from, long to)
getTopicsByModificationTime
in interface TimeService
public Collection<Association> getAssociationsByCreationTime(long from, long to)
getAssociationsByCreationTime
in interface TimeService
public Collection<Association> getAssociationsByModificationTime(long from, long to)
getAssociationsByModificationTime
in interface TimeService
public void init()
init
in interface PluginContext
init
in class PluginActivator
public void postCreateTopic(Topic topic)
postCreateTopic
in interface PostCreateTopicListener
public void postCreateAssociation(Association assoc)
postCreateAssociation
in interface PostCreateAssociationListener
public void postUpdateTopic(Topic topic, TopicModel updateModel, TopicModel oldTopic)
postUpdateTopic
in interface PostUpdateTopicListener
public void postUpdateAssociation(Association assoc, AssociationModel updateModel, AssociationModel oldAssoc)
postUpdateAssociation
in interface PostUpdateAssociationListener
public void postUpdateTopicRequest(Topic topic)
postUpdateTopicRequest
in interface PostUpdateTopicRequestListener
public void preSendTopic(Topic topic)
preSendTopic
in interface PreSendTopicListener
public void preSendAssociation(Association assoc)
preSendAssociation
in interface PreSendAssociationListener
public void serviceResponseFilter(com.sun.jersey.spi.container.ContainerResponse response)
serviceResponseFilter
in interface ServiceResponseFilterListener
private void storeTimestamps(DMXObject object)
private void storeTimestamp(DMXObject object)
private void storeParentsTimestamp(Topic topic)
private void storeCreationTime(DMXObject object, long time)
private void storeModificationTime(DMXObject object, long time)
private DMXObject responseObject(com.sun.jersey.spi.container.ContainerResponse response)
private void enrichWithTimestamp(DMXObject object)
private void setLastModifiedHeader(com.sun.jersey.spi.container.ContainerResponse response, long time)
private void setHeader(com.sun.jersey.spi.container.ContainerResponse response, String header, String value)
private Set<DMXObject> getParents(Topic topic)
Copyright © 2018. All Rights Reserved.