final String uri = node.getAttribute("base-uri", "/");
final int depth = DepthSupport.DEPTH_INFINITY;
final int lifetime = node.getAttributeAsInt("subscription-lifetime", 3600);
final int notificationDelay = node.getAttributeAsInt("notification-delay", 0);
final Subscriber contentSubscriber = new Subscriber() {
public void notify(String uri, Map information) {
NamespaceAccessToken nat = Domain.accessNamespace(new SecurityToken(this), Domain.getDefaultNamespace());
try {
nat.begin();
Iterator keys = information.keySet().iterator();
while (keys.hasNext()) {
String key = keys.next().toString();
if ("uri".equals(key)) {
Uri theUri = nat.getUri(new SlideTokenImpl(new CredentialsToken("")), stripUri(information.get(key).toString()));
Store store = theUri.getStore();
if (store instanceof ExtendedStore) {
Domain.log("Resetting cache for " + theUri, LOG_CHANNEL, Logger.INFO);
((ExtendedStore) store).removeObjectFromCache(theUri);
}
}
}
nat.commit();
} catch(Exception e) {
if (Domain.isEnabled(LOG_CHANNEL, Logger.ERROR)) {
Domain.log("Error clearing cache: " + e + ". See stderr for stacktrace.", LOG_CHANNEL, Logger.ERROR);
e.printStackTrace();
}
}
}
};
final Subscriber structureSubscriber = new Subscriber() {
public void notify(String uri, Map information) {
NamespaceAccessToken nat = Domain.accessNamespace(new SecurityToken(this), Domain.getDefaultNamespace());
try {
nat.begin();
Iterator keys = information.keySet().iterator();