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:
hudson.ExtensionPoint, hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem

@Extension
public class GerritAdministrativeMonitor
extends hudson.model.AdministrativeMonitor

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
 LinkedList<String> getConnectionErrorServers()
          Returns the names of the servers with a connection error.
 LinkedList<String> getConnectionWarningServers()
          Returns the names of the servers with a connection warning.
 List<GerritVersionChecker.Feature> getDisabledFeatures(String serverName)
          Returns the list of disabled features for a specific server.
 LinkedList<String> getDisabledFeaturesServers()
          Returns the names of the servers with disabled features.
 int getSendQueueSize()
          Gets the current send-command queue size.
 LinkedList<String> getSnapshotServers()
          Returns the names of the Gerrit servers with a snapshot version.
 boolean hasDisabledFeatures()
          If there is at least one server with features disabled due to old Gerrit version.
 boolean isActivated()
           
 boolean isConnectionError()
          Tells if there is at least one connection error.
 boolean isConnectionWarning()
          Tells if there is at least one connection warning.
 boolean isGerritSnapshotVersion()
          If at least one connected Gerrit is a snapshot version.
 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.

Method Detail

isActivated

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

isConnectionWarning

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

Returns:
true if warning, false otherwise.

getConnectionWarningServers

public LinkedList<String> getConnectionWarningServers()
Returns the names of the servers with a connection warning.

Returns:
the names, or an empty list if no connection warning.

isConnectionError

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

Returns:
true if error, false otherwise.

getConnectionErrorServers

public LinkedList<String> getConnectionErrorServers()
Returns the names of the servers with a connection error.

Returns:
the names, or an empty list if no connection error.

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, false otherwise.

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.

isGerritSnapshotVersion

public boolean isGerritSnapshotVersion()
If at least one connected Gerrit is a snapshot version.

Returns:
true if so, false otherwise.

getSnapshotServers

public LinkedList<String> getSnapshotServers()
Returns the names of the Gerrit servers with a snapshot version.

Returns:
the names, or an empty list if no snapshot servers.

hasDisabledFeatures

public boolean hasDisabledFeatures()
If there is at least one server with features disabled due to old Gerrit version.

Returns:
true if so, false otherwise.

getDisabledFeaturesServers

public LinkedList<String> getDisabledFeaturesServers()
Returns the names of the servers with disabled features.

Returns:
the names, or an empty list if no servers have disabled features.

getDisabledFeatures

public List<GerritVersionChecker.Feature> getDisabledFeatures(String serverName)
Returns the list of disabled features for a specific server.

Parameters:
serverName - the name of the Gerrit server
Returns:
the list of disabled features or empty list if listener not found


Copyright © 2004-2013. All Rights Reserved.