org.jenkinsci.plugins.periodicreincarnation
Class RegEx

java.lang.Object
  extended by org.jenkinsci.plugins.periodicreincarnation.RegEx

public class RegEx
extends Object

Class for handling regular expressions.

Author:
yboev

Field Summary
 String cronTime
          Cron time format for this regex.
 String description
          Description for this regex.
 String masterAction
          Script for master.
 String nodeAction
          Script for node.
 String value
          Value of the reg ex as String.
 
Constructor Summary
RegEx(String value, String description, String cronTime, String nodeAction, String masterAction)
          Constructor.
 
Method Summary
 String getCronTime()
          Returns the cron time for this particular regex.
 String getDescription()
          Returns a description for this regex.
 String getMasterAction()
          Returns the master script.
 String getNodeAction()
          Returns the node script.
 Pattern getPattern()
          Returns the pattern corresponding to this reg ex.
 String getValue()
          Returns this reg ex.
 boolean isTimeToRestart(long currentTime)
          Checks if the current time corresponds to the cron tab configured for this RegEx.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

value

public String value
Value of the reg ex as String.


description

public String description
Description for this regex.


cronTime

public String cronTime
Cron time format for this regex. Overrides the globally configured cron time if set.


nodeAction

public String nodeAction
Script for node.


masterAction

public String masterAction
Script for master.

Constructor Detail

RegEx

@DataBoundConstructor
public RegEx(String value,
                                  String description,
                                  String cronTime,
                                  String nodeAction,
                                  String masterAction)
Constructor. Creates a reg ex.

Parameters:
value - the reg ex.
description - regex description
cronTime - cron time format.
nodeAction - node script.
masterAction - master script
Method Detail

getValue

public String getValue()
Returns this reg ex.

Returns:
the reg ex value.

getDescription

public String getDescription()
Returns a description for this regex.

Returns:
Description as String.

getCronTime

public String getCronTime()
Returns the cron time for this particular regex.

Returns:
crontime as String.

getPattern

public Pattern getPattern()
                   throws hudson.AbortException
Returns the pattern corresponding to this reg ex.

Returns:
the pattern.
Throws:
hudson.AbortException - if the pattern could not be compiled.

getNodeAction

public String getNodeAction()
Returns the node script.

Returns:
the script as String.

getMasterAction

public String getMasterAction()
Returns the master script.

Returns:
the script as String.

isTimeToRestart

public boolean isTimeToRestart(long currentTime)
Checks if the current time corresponds to the cron tab configured for this RegEx. If such cron tab is missing or could not be parsed then the global cron tab is used.

Parameters:
currentTime - current time from System
Returns:
true if global cron time covers the current time, false otherwise.


Copyright © 2004-2013. All Rights Reserved.