Class Endpoint
- java.lang.Object
-
- com.tikal.hudson.plugins.notification.Endpoint
-
public class Endpoint extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_BRANCH
static Integer
DEFAULT_RETRIES
static Integer
DEFAULT_TIMEOUT
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBranch()
String
getBuildNotes()
String
getEvent()
Format
getFormat()
Integer
getLoglines()
Protocol
getProtocol()
Integer
getRetries()
int
getTimeout()
UrlInfo
getUrlInfo()
boolean
isJson()
protected Object
readResolve()
void
setBranch(String branch)
Sets branch filtervoid
setBuildNotes(String buildNotes)
Set any additional build information to be sent in message.void
setEvent(String event)
Sets the specific event to contact the endpoint for.void
setFormat(Format format)
Format of the message sent to the endpoint shouldvoid
setLoglines(Integer loglines)
Set the number of log lines to send with the message.void
setProtocol(Protocol protocol)
Sets the protocol for thevoid
setRetries(Integer retries)
Number of retries before giving up on contacting an endpointvoid
setTimeout(Integer timeout)
Sets a timeout for the notification.void
setUrlInfo(UrlInfo urlInfo)
String
toString()
-
-
-
Field Detail
-
DEFAULT_TIMEOUT
public static final Integer DEFAULT_TIMEOUT
-
DEFAULT_RETRIES
public static final Integer DEFAULT_RETRIES
-
DEFAULT_BRANCH
public static final String DEFAULT_BRANCH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Endpoint
@Deprecated public Endpoint(Protocol protocol, String url, String event, Format format, Integer timeout, Integer loglines)
Deprecated.Adds a new endpoint for notifications- Parameters:
protocol
- - Protocol to useurl
- Public URLevent
- - Event to fire on.format
- - Format to send message in.timeout
- Timeout for sending dataloglines
- - Number of lines to send
-
Endpoint
@DataBoundConstructor public Endpoint(UrlInfo urlInfo)
Adds a new endpoint for notifications- Parameters:
urlInfo
- Information about the target URL for the event.
-
-
Method Detail
-
getUrlInfo
public UrlInfo getUrlInfo()
-
setUrlInfo
public void setUrlInfo(UrlInfo urlInfo)
-
getTimeout
public int getTimeout()
-
setTimeout
@DataBoundSetter public void setTimeout(Integer timeout)
Sets a timeout for the notification.- Parameters:
timeout
- - Timeout in ms. Default is 30s (30000)
-
getProtocol
public Protocol getProtocol()
-
setProtocol
@DataBoundSetter public void setProtocol(Protocol protocol)
Sets the protocol for the- Parameters:
protocol
- Protocol to use. Valid values are: UDP, TCP, HTTP. Default is HTTP. HTTP event target urls must start with 'http'
-
getEvent
public String getEvent()
-
setEvent
@DataBoundSetter public void setEvent(String event)
Sets the specific event to contact the endpoint for.- Parameters:
event
- 'STARTED' - Fire on job started. 'COMPLETED' - Fire on job completed. 'FINALIZED' - Fire on job finalized.
-
getFormat
public Format getFormat()
-
setFormat
@DataBoundSetter public void setFormat(Format format)
Format of the message sent to the endpoint should- Parameters:
format
- 'XML' or 'JSON'
-
getLoglines
public Integer getLoglines()
-
setLoglines
@DataBoundSetter public void setLoglines(Integer loglines)
Set the number of log lines to send with the message.- Parameters:
loglines
- - Default 0, -1 for unlimited.
-
getBuildNotes
public String getBuildNotes()
-
setBuildNotes
@DataBoundSetter public void setBuildNotes(String buildNotes)
Set any additional build information to be sent in message.- Parameters:
buildNotes
- - the additional data
-
isJson
public boolean isJson()
-
getRetries
public Integer getRetries()
-
setRetries
@DataBoundSetter public void setRetries(Integer retries)
Number of retries before giving up on contacting an endpoint- Parameters:
retries
- - Number of retries. Default 0.
-
readResolve
protected Object readResolve()
-
getBranch
public String getBranch()
-
setBranch
@DataBoundSetter public void setBranch(String branch)
Sets branch filter- Parameters:
branch
- - regex
-
-