com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger
Class GerritAdministrativeMonitor

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by hudson.model.AdministrativeMonitor
          extended by com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritAdministrativeMonitor
All Implemented Interfaces:
ConnectionListener, hudson.ExtensionPoint, hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem

@Extension
public class GerritAdministrativeMonitor
extends hudson.model.AdministrativeMonitor
implements ConnectionListener

Displays a warning message in /manage if the Gerrit connection is down or some other warning.

Author:
Robert Sandell <robert.sandell@sonyericsson.com>

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class hudson.model.AdministrativeMonitor
id
 
Constructor Summary
GerritAdministrativeMonitor()
          Default constructor.
 
Method Summary
protected  void addThisAsConnectionListener()
          Adds this monitor as a connection listener to PluginImpl.
 void connectionDown()
           
 void connectionEstablished()
           
 int getSendQueueSize()
          Gets the current send-command queue size.
 boolean isActivated()
           
 boolean isConnectionError()
          Tells if there is a connection error.
 boolean isConnectionWarning()
          Tells if there is a connection warning.
 boolean isSendQueueWarning()
          Tells if there is a warning with the send-commands-queue.
 
Methods inherited from class hudson.model.AdministrativeMonitor
all, disable, doDisable, getDisplayName, getSearchUrl, getUrl, isEnabled
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GerritAdministrativeMonitor

public GerritAdministrativeMonitor()
Default constructor. Adds this as a ConnectionListener to PluginImpl by calling addThisAsConnectionListener().

See Also:
PluginImpl.addListener(com.sonyericsson.hudson.plugins.gerrit.gerritevents.ConnectionListener)
Method Detail

addThisAsConnectionListener

protected void addThisAsConnectionListener()
Adds this monitor as a connection listener to PluginImpl. If PluginImpl hasn't started yet, a separate Thread will be started that tries again in a little while.

See Also:
PluginImpl.addListener(com.sonyericsson.hudson.plugins.gerrit.gerritevents.ConnectionListener)

isSendQueueWarning

public boolean isSendQueueWarning()
Tells if there is a warning with the send-commands-queue. Utility method for the jelly page.

Returns:
true if so.

getSendQueueSize

public int getSendQueueSize()
Gets the current send-command queue size. Utility method for the jelly page.

Returns:
the amount of jobs in the queue.

isConnectionWarning

public boolean isConnectionWarning()
Tells if there is a connection warning. Utility method for the jelly page.

Returns:
true if so.

isConnectionError

public boolean isConnectionError()
Tells if there is a connection error. Utility method for the jelly page,

Returns:
true if so.

isActivated

public boolean isActivated()
Specified by:
isActivated in class hudson.model.AdministrativeMonitor

connectionEstablished

public void connectionEstablished()
Specified by:
connectionEstablished in interface ConnectionListener

connectionDown

public void connectionDown()
Specified by:
connectionDown in interface ConnectionListener


Copyright © 2004-2011. All Rights Reserved.