Class HistoryReference


  • public class HistoryReference
    extends java.lang.Object
    This class abstracts a reference to a http message stored in database. It reads the whole http message from database when getHttpMessage() is called.
    • Method Detail

      • getSessionId

        public long getSessionId()
        Returns:
        Returns the sessionId.
      • getClearIfManual

        public java.util.ArrayList<java.lang.Boolean> getClearIfManual()
        Returns:
        whether the icon has to be cleaned when being manually visited or not.
      • getCustomIcons

        public java.util.ArrayList<java.lang.String> getCustomIcons()
        Returns:
        The icon's string path (i.e. /resource/icon/16/xx.png)
      • setCustomIcon

        public void setCustomIcon​(java.lang.String i,
                                  boolean c)
        Parameters:
        i - the icon's URL (i.e. /resource/icon/16/xx.png)
        c - if the icon has to be cleaned when the node is manually visited
      • setTableHistory

        public static void setTableHistory​(TableHistory tableHistory)
      • setTableTag

        public static void setTableTag​(TableTag tableTag)
      • setTableAlert

        public static void setTableAlert​(TableAlert tableAlert)
      • getHistoryId

        public int getHistoryId()
        Returns:
        Returns the historyId.
      • getURI

        public org.apache.commons.httpclient.URI getURI()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getHistoryType

        public int getHistoryType()
        Returns:
        Returns the historyType.
      • delete

        public void delete()
        Delete this HistoryReference from database This should typically only be called via the ExtensionHistory.delete(href) method
      • getSiteNode

        public SiteNode getSiteNode()
        Returns:
        Returns the siteNode.
      • setSiteNode

        public void setSiteNode​(SiteNode siteNode)
        Parameters:
        siteNode - The siteNode to set.
      • addTag

        public void addTag​(java.lang.String tag)
      • deleteTag

        public void deleteTag​(java.lang.String tag)
      • getTags

        public java.util.List<java.lang.String> getTags()
      • setNote

        public void setNote​(java.lang.String note)
      • loadAlerts

        public void loadAlerts()
      • addAlert

        public boolean addAlert​(Alert alert)
      • updateAlert

        public void updateAlert​(Alert alert)
      • deleteAlert

        public void deleteAlert​(Alert alert)
      • deleteAllAlerts

        public void deleteAllAlerts()
      • hasAlert

        public boolean hasAlert​(Alert alert)
        Tells whether or not this history reference has the given alert.
        Parameters:
        alert - the alert to check
        Returns:
        true if it has the given alert, false otherwise.
        Since:
        2.6.0
        See Also:
        hasAlerts(), addAlert(Alert)
      • hasAlerts

        public boolean hasAlerts()
        Tells whether or not this history reference has alerts.
        Returns:
        true if it has alerts, false otherwise.
        Since:
        2.6.0
        See Also:
        hasAlert(Alert), addAlert(Alert)
      • getHighestAlert

        public int getHighestAlert()
      • getAlerts

        public java.util.List<Alert> getAlerts()
        Gets the alerts.

        If alerts where never added, an unmodifiable empty list is returned, otherwise it's returned a copy of the internal collection.

        Returns:
        the alerts
        See Also:
        addAlert(Alert), hasAlerts(), hasAlert(Alert)
      • getMethod

        public java.lang.String getMethod()
      • getStatusCode

        public int getStatusCode()
      • getReason

        public java.lang.String getReason()
      • getRtt

        public int getRtt()
      • setTags

        public void setTags​(java.util.List<java.lang.String> tags)
        Sets the tags for the HTTP message.
        Parameters:
        tags - the new tags.
        Throws:
        java.lang.IllegalArgumentException - if the given parameter is null.
        Since:
        2.7.0
        See Also:
        addTag(String), deleteTag(String)
      • setTags

        @Deprecated
        public void setTags​(java.util.Vector<java.lang.String> tags)
        Deprecated.
        (2.7.0) Use setTags(List) instead.
        Sets the tags for the HTTP message.
        Parameters:
        tags - the new tags.
        Throws:
        java.lang.IllegalArgumentException - if the given parameter is null.
      • hasNote

        public boolean hasNote()
      • getTimeSentMillis

        public long getTimeSentMillis()
      • getTimeReceivedMillis

        public long getTimeReceivedMillis()
      • isWebSocketUpgrade

        public boolean isWebSocketUpgrade()
      • getRequestHeaderLength

        public int getRequestHeaderLength()
      • getRequestBodyLength

        public int getRequestBodyLength()
      • getResponseHeaderLength

        public int getResponseHeaderLength()
      • getResponseBodyLength

        public int getResponseBodyLength()
      • getRequestBody

        public java.lang.String getRequestBody()
      • addTemporaryType

        public static void addTemporaryType​(int type)
        Adds the given type to the set of temporary types.

        Persisted messages with temporary types are deleted when the session is closed.

        Parameters:
        type - the history type that will be added
        Since:
        2.5.0
        See Also:
        removeTemporaryType(int), getTemporaryTypes()
      • getTemporaryTypes

        public static java.util.Set<java.lang.Integer> getTemporaryTypes()
        Gets the temporary history types.

        Persisted messages with temporary types are deleted when the session is closed.

        Returns:
        a Set with the temporary history types
        See Also:
        addTemporaryType(int), removeTemporaryType(int)
      • getTags

        public static java.util.List<java.lang.String> getTags​(int historyId)
                                                        throws DatabaseException
        Gets the tags of the message with the given history ID.
        Parameters:
        historyId - the history ID.
        Returns:
        a List with the tags of the message, never null.
        Throws:
        DatabaseException - if an error occurred while obtaining the tags from the database.
        Since:
        2.7.0