org.infoglue.cms.util
Class RemoteCacheUpdater

java.lang.Object
  extended by org.infoglue.cms.util.RemoteCacheUpdater
All Implemented Interfaces:
NotificationListener

public class RemoteCacheUpdater
extends java.lang.Object
implements NotificationListener

This class is a class that sends a update-message to all registered instances of delivery-engine.

Author:
Mattias Bogeblad

Constructor Summary
RemoteCacheUpdater()
          Default Constructor
 
Method Summary
static void clearSystemNotificationMessages()
           
 java.lang.String decodeHTTPEncodedString(java.lang.String encoded)
          As the name indicates, this method takes a URL-encoded string and converts it to a normal javastring.
static java.util.List getSystemNotificationMessages()
           
 java.util.Hashtable httpEncodedStringToHashtable(java.lang.String encodedstrang)
          Converts a serialized hashtable in the url-encoded format to a Hashtable that one can use within the program.
 void notify(NotificationMessage notificationMessage)
          This method gets called when a new NotificationMessage is available.
 void setContextParameters(java.util.Map map)
          This method sets the context/arguments the listener should operate with.
 void updateRemoteCaches(NotificationMessage notificationMessage)
          This method serializes the notificationMessage and calls the remote actions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteCacheUpdater

public RemoteCacheUpdater()
Default Constructor

Method Detail

setContextParameters

public void setContextParameters(java.util.Map map)
This method sets the context/arguments the listener should operate with. Could be debuglevels and stuff like that.

Specified by:
setContextParameters in interface NotificationListener

getSystemNotificationMessages

public static java.util.List getSystemNotificationMessages()

clearSystemNotificationMessages

public static void clearSystemNotificationMessages()

notify

public void notify(NotificationMessage notificationMessage)
This method gets called when a new NotificationMessage is available. The writer just calls the transactionHistoryController which stores it.

Specified by:
notify in interface NotificationListener

updateRemoteCaches

public void updateRemoteCaches(NotificationMessage notificationMessage)
                        throws java.lang.Exception
This method serializes the notificationMessage and calls the remote actions. As a content-tool can have several preview instances we iterate through the instances that have been indexed in the propertyfile starting with 0.

Throws:
java.lang.Exception

decodeHTTPEncodedString

public java.lang.String decodeHTTPEncodedString(java.lang.String encoded)
As the name indicates, this method takes a URL-encoded string and converts it to a normal javastring. That is, all Mime-encoding is removed.

Parameters:
encoded - The encoded string.
Returns:
An decoded string.

httpEncodedStringToHashtable

public java.util.Hashtable httpEncodedStringToHashtable(java.lang.String encodedstrang)
Converts a serialized hashtable in the url-encoded format to a Hashtable that one can use within the program. A good technique when exchanging information between different applications.

Parameters:
encodedstrang - The url-encoded string.
Returns:
A Hashtable.


Copyright © 2005 InfoGlue.org All Rights Reserved.