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, dm4, mf
Constructor and Description |
---|
TimePlugin() |
Modifier and Type | Method and Description |
---|---|
private void |
enrichWithTimestamp(DeepaMehtaObject 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<DeepaMehtaObject> |
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 newModel,
AssociationModel oldModel) |
void |
postUpdateTopic(Topic topic,
TopicModel newModel,
TopicModel oldModel) |
void |
postUpdateTopicRequest(Topic topic) |
void |
preSendAssociation(Association assoc) |
void |
preSendTopic(Topic topic) |
private DeepaMehtaObject |
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(DeepaMehtaObject object) |
private void |
storeCreationTime(DeepaMehtaObject object,
long time) |
private void |
storeModificationTime(DeepaMehtaObject object,
long time) |
private void |
storeParentsTimestamp(Topic topic) |
private void |
storeTime(DeepaMehtaObject object,
String propUri,
long time) |
private void |
storeTimestamp(DeepaMehtaObject object) |
private void |
storeTimestamps(DeepaMehtaObject 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(DeepaMehtaObject 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 newModel, TopicModel oldModel)
postUpdateTopic
in interface PostUpdateTopicListener
public void postUpdateAssociation(Association assoc, AssociationModel newModel, AssociationModel oldModel)
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(DeepaMehtaObject object)
private void storeTimestamp(DeepaMehtaObject object)
private void storeParentsTimestamp(Topic topic)
private void storeCreationTime(DeepaMehtaObject object, long time)
private void storeModificationTime(DeepaMehtaObject object, long time)
private void storeTime(DeepaMehtaObject object, String propUri, long time)
private DeepaMehtaObject responseObject(com.sun.jersey.spi.container.ContainerResponse response)
private void enrichWithTimestamp(DeepaMehtaObject 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<DeepaMehtaObject> getParents(Topic topic)
Copyright © 2016. All Rights Reserved.