Design of X.Y Task

Surveillance design

Suggested archtecture

Surveilable applications expose their status using REST, see the interface below.

The surveying application is configured with a number of REST endpoints. It will then poll for these messages, and generate a simple website with these messages.

Log messages will stay in the application until handled, thus keeping the state yellow or red. Handling log messages is done by pressing a button on the interface. See mockup below. Immediate messages will of course update as the immediate state changes.

Since some log messages are often seen, but are harmless, these messages may be marked with "Never show again". We should probably consider that parts of these messages may contain non-fixed strings. Open for investigation - short edit distance enough?

Interface

/** The interface for a status message for a surveyed application. */
public static interface StatusMessage {
    /** Severity defined in a classic traffic-light fashion. *
    enum Severity {GREEN, RED, YELLOW}

    /** 
      * Get the text for the status message. May be formatted in HTML. 
      *
      * @return The message. Never null.
      */
    public String getMessage();

    /** 
      * Get the severity of the message. 
      *
      * @return The severity. Never null.
      */
    public Severity getSeverity();

    /**
      * Get the time for this message. For log messages, this is the time it
      * was logged. For status messages, this is the first time this state
      * was true.
      *
      * @return The time this message was first generated. Never null.
      */
    public Date getTime();

    /** 
      * Whether this message is about the immediate state of the system, or
      * some logged message.
      *
      * @return true if the message is a log message, false if it is a 
      *         message about the current state. Never null.
      */ 
    public boolean isLogMessage();
}

/** The interface of something that offers status messages for surveillance.*/
public interface Surveilable {
    /** 
      * Get all status messages newer than the given time.
      * An application should use the newest timestamp in the given messages
      * from the last call as input to this method next time it calls it, to
      * ensure not losing messages.
      *
      * @return List of status messages. May be empty, but never null.
      */
    public List<StatusMessage> getMessagesSince(Date time);

    /**
      * Get all status messages. This behaves exactly like 
      * getMessagesSince(new Date(0)).
      *
      * @return List of status messages. May be empty, but never null.
      * @see{#getMessagesSince(Date)}
      */
    public StatusMessage getMessagesSince(Date time);

    /**
      * Get the name of what is surveyed.
      *
      * @return The name. Never null.
      */
     public String getName();
}

Mockup

surveillance.html

Prerequisites and Design Decisions

Required Software and Modules

Resources

Tasks/2/2/2/DesignDocument (last edited 2010-03-17 13:09:06 by localhost)