hudson.plugins.sitemonitor
Class SiteMonitorRecorder

java.lang.Object
  extended by hudson.tasks.BuildStepCompatibilityLayer
      extended by hudson.tasks.Publisher
          extended by hudson.tasks.Recorder
              extended by hudson.plugins.sitemonitor.SiteMonitorRecorder
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.tasks.Publisher>, hudson.tasks.BuildStep

public class SiteMonitorRecorder
extends hudson.tasks.Recorder

Performs the web site monitoring process.

Author:
cliffano

Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.tasks.Publisher
hudson.tasks.Publisher.DescriptorExtensionListImpl
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Nested classes/interfaces inherited from interface hudson.tasks.BuildStep
hudson.tasks.BuildStep.PublisherList
 
Field Summary
private static int MILLISECS_IN_SECS
          1 sec = 1000 msecs .
private  java.util.List<Site> mSites
          The list of web sites to monitor.
 
Fields inherited from interface hudson.tasks.BuildStep
BUILDERS, PUBLISHERS
 
Constructor Summary
SiteMonitorRecorder(java.util.List<Site> sites)
          Construct SiteMonitorRecorder.
 
Method Summary
 hudson.tasks.BuildStepMonitor getRequiredMonitorService()
          Gets the required monitor service.
 java.util.List<Site> getSites()
           
 boolean perform(hudson.model.AbstractBuild<?,?> build, hudson.Launcher launcher, hudson.model.BuildListener listener)
          Performs the web site monitoring by checking the response code of the site's URL.
 
Methods inherited from class hudson.tasks.Recorder
getDescriptor
 
Methods inherited from class hudson.tasks.Publisher
all, getProjectAction, needsToRunAfterFinalized, prebuild
 
Methods inherited from class hudson.tasks.BuildStepCompatibilityLayer
getProjectAction, perform, prebuild
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hudson.tasks.BuildStep
getProjectAction, prebuild
 

Field Detail

MILLISECS_IN_SECS

private static final int MILLISECS_IN_SECS
1 sec = 1000 msecs .

See Also:
Constant Field Values

mSites

private java.util.List<Site> mSites
The list of web sites to monitor.

Constructor Detail

SiteMonitorRecorder

public SiteMonitorRecorder(java.util.List<Site> sites)
Construct SiteMonitorRecorder.

Parameters:
sites - the list of web sites to monitor
Method Detail

getSites

public final java.util.List<Site> getSites()
Returns:
the list of web sites to monitor

perform

public final boolean perform(hudson.model.AbstractBuild<?,?> build,
                             hudson.Launcher launcher,
                             hudson.model.BuildListener listener)
                      throws java.lang.InterruptedException,
                             java.io.IOException
Performs the web site monitoring by checking the response code of the site's URL.

Specified by:
perform in interface hudson.tasks.BuildStep
Overrides:
perform in class hudson.tasks.BuildStepCompatibilityLayer
Parameters:
build - the build
launcher - the launcher
listener - the listener
Returns:
true if all sites give success response codes, false otherwise
Throws:
java.lang.InterruptedException - when there's an interruption
java.io.IOException - when there's an IO error

getRequiredMonitorService

public final hudson.tasks.BuildStepMonitor getRequiredMonitorService()
Gets the required monitor service.

Returns:
the BuildStepMonitor


Copyright © 2010. All Rights Reserved.