Class Util
- java.lang.Object
-
- com.sonymobile.jenkins.plugins.mq.mqnotifier.Util
-
public final class Util extends Object
Constants and helper functions.- Author:
- Tomas Westling <tomas.westling@sonymobile.com>
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTENT_TYPE
Content Type.static String
ELAPSED_TIME
Elapsed Time.static String
EXECUTOR_NAME
Executor Name.static String
EXECUTOR_OWNER
Executor Owner.static String
EXECUTOR_TYPE
Executor Type.static String
EXECUTOR_WORKSPACE
Executor Workspace.static String
IDLE_START
Idle Start.static String
KEY_BUILD_DURATION
Build Duration Key.static String
KEY_BUILD_NR
BuildNr Key.static String
KEY_CANONICAL_NAME
Canonical Name Key.static String
KEY_DEQUEUE_ALLOCATED_LABEL
Dequeue Allocated Label.static String
KEY_DEQUEUE_REASON
Dequeue Reason Key.static String
KEY_DEQUEUE_TIME_SPENT
Dequeue Time Spent in Queue in ms.static String
KEY_MASTER_FQDN
Master FQDN Key.static String
KEY_PROJECT_NAME
Name Key.static String
KEY_STATE
State Key.static String
KEY_STATUS
Status Key.static String
KEY_URL
Url Key.static String
LISTENER_TYPE
Listener Type (for easier filtering).static String
PROBLEMS
Problems.static String
TASK_DURATION
Task Duration.static String
TASK_IS_CONCURRENT
Task Is Concurrent.static String
TASK_NAME
Task Name.static String
TASK_OWNER_NAME
Task Owner Name.static String
TASK_OWNER_URL
Task Owner Url.static String
TASK_URL
Task Url.static String
VALUE_ADDED_TO_QUEUE
Queued Value.static String
VALUE_BUILDING
Building Value.static String
VALUE_CANCELLED
Cancelled Value.static String
VALUE_COMPLETED
Completed Value.static String
VALUE_DELETED
Deleted Value.static String
VALUE_DEQUEUE_NO_LABEL
Dequeue No Label.static String
VALUE_REMOVED_FROM_QUEUE
Dequeued Value.static String
VALUE_STARTED
Started Value.static String
VALUE_TASK_ACCEPTED
Task accepted Value.static String
VALUE_TASK_COMPLETED
Task completed Value.static String
VALUE_TASK_STARTED
Task started Value.static String
VALUE_UNRESOLVED_HOST
Unknown host Value.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
getCanonicalName()
Returns the canonical host name.static String
getFullName(Queue.Task t)
Fetches the full name task name if available.static String
getHostName()
Fetches and caches the jenkins master FQDN.static String
getJobUrl(Queue.Item item)
Get the job url for use with the REST api.static String
getJobUrl(Run r)
Get the job url for use with the REST api.static String
getTaskUrl(Queue.Task task)
Get the job url for use with the REST api.
-
-
-
Field Detail
-
KEY_URL
public static final String KEY_URL
Url Key.- See Also:
- Constant Field Values
-
KEY_PROJECT_NAME
public static final String KEY_PROJECT_NAME
Name Key.- See Also:
- Constant Field Values
-
KEY_BUILD_NR
public static final String KEY_BUILD_NR
BuildNr Key.- See Also:
- Constant Field Values
-
KEY_BUILD_DURATION
public static final String KEY_BUILD_DURATION
Build Duration Key.- See Also:
- Constant Field Values
-
KEY_MASTER_FQDN
public static final String KEY_MASTER_FQDN
Master FQDN Key.- See Also:
- Constant Field Values
-
KEY_CANONICAL_NAME
public static final String KEY_CANONICAL_NAME
Canonical Name Key.- See Also:
- Constant Field Values
-
KEY_STATE
public static final String KEY_STATE
State Key.- See Also:
- Constant Field Values
-
KEY_DEQUEUE_REASON
public static final String KEY_DEQUEUE_REASON
Dequeue Reason Key.- See Also:
- Constant Field Values
-
KEY_DEQUEUE_TIME_SPENT
public static final String KEY_DEQUEUE_TIME_SPENT
Dequeue Time Spent in Queue in ms.- See Also:
- Constant Field Values
-
KEY_DEQUEUE_ALLOCATED_LABEL
public static final String KEY_DEQUEUE_ALLOCATED_LABEL
Dequeue Allocated Label.- See Also:
- Constant Field Values
-
KEY_STATUS
public static final String KEY_STATUS
Status Key.- See Also:
- Constant Field Values
-
VALUE_DEQUEUE_NO_LABEL
public static final String VALUE_DEQUEUE_NO_LABEL
Dequeue No Label.- See Also:
- Constant Field Values
-
VALUE_UNRESOLVED_HOST
public static final String VALUE_UNRESOLVED_HOST
Unknown host Value.- See Also:
- Constant Field Values
-
VALUE_ADDED_TO_QUEUE
public static final String VALUE_ADDED_TO_QUEUE
Queued Value.- See Also:
- Constant Field Values
-
VALUE_REMOVED_FROM_QUEUE
public static final String VALUE_REMOVED_FROM_QUEUE
Dequeued Value.- See Also:
- Constant Field Values
-
VALUE_CANCELLED
public static final String VALUE_CANCELLED
Cancelled Value.- See Also:
- Constant Field Values
-
VALUE_BUILDING
public static final String VALUE_BUILDING
Building Value.- See Also:
- Constant Field Values
-
VALUE_STARTED
public static final String VALUE_STARTED
Started Value.- See Also:
- Constant Field Values
-
VALUE_COMPLETED
public static final String VALUE_COMPLETED
Completed Value.- See Also:
- Constant Field Values
-
VALUE_DELETED
public static final String VALUE_DELETED
Deleted Value.- See Also:
- Constant Field Values
-
VALUE_TASK_ACCEPTED
public static final String VALUE_TASK_ACCEPTED
Task accepted Value.- See Also:
- Constant Field Values
-
VALUE_TASK_STARTED
public static final String VALUE_TASK_STARTED
Task started Value.- See Also:
- Constant Field Values
-
VALUE_TASK_COMPLETED
public static final String VALUE_TASK_COMPLETED
Task completed Value.- See Also:
- Constant Field Values
-
CONTENT_TYPE
public static final String CONTENT_TYPE
Content Type.- See Also:
- Constant Field Values
-
EXECUTOR_TYPE
public static final String EXECUTOR_TYPE
Executor Type.- See Also:
- Constant Field Values
-
EXECUTOR_NAME
public static final String EXECUTOR_NAME
Executor Name.- See Also:
- Constant Field Values
-
EXECUTOR_WORKSPACE
public static final String EXECUTOR_WORKSPACE
Executor Workspace.- See Also:
- Constant Field Values
-
ELAPSED_TIME
public static final String ELAPSED_TIME
Elapsed Time.- See Also:
- Constant Field Values
-
IDLE_START
public static final String IDLE_START
Idle Start.- See Also:
- Constant Field Values
-
EXECUTOR_OWNER
public static final String EXECUTOR_OWNER
Executor Owner.- See Also:
- Constant Field Values
-
TASK_NAME
public static final String TASK_NAME
Task Name.- See Also:
- Constant Field Values
-
TASK_URL
public static final String TASK_URL
Task Url.- See Also:
- Constant Field Values
-
TASK_IS_CONCURRENT
public static final String TASK_IS_CONCURRENT
Task Is Concurrent.- See Also:
- Constant Field Values
-
TASK_OWNER_NAME
public static final String TASK_OWNER_NAME
Task Owner Name.- See Also:
- Constant Field Values
-
TASK_OWNER_URL
public static final String TASK_OWNER_URL
Task Owner Url.- See Also:
- Constant Field Values
-
LISTENER_TYPE
public static final String LISTENER_TYPE
Listener Type (for easier filtering).- See Also:
- Constant Field Values
-
TASK_DURATION
public static final String TASK_DURATION
Task Duration.- See Also:
- Constant Field Values
-
PROBLEMS
public static final String PROBLEMS
Problems.- See Also:
- Constant Field Values
-
-
Method Detail
-
getJobUrl
public static String getJobUrl(Queue.Item item)
Get the job url for use with the REST api.- Parameters:
item
- The queue item.- Returns:
- The url.
-
getTaskUrl
public static String getTaskUrl(Queue.Task task)
Get the job url for use with the REST api.- Parameters:
task
- The queue task.- Returns:
- The url.
-
getJobUrl
public static String getJobUrl(Run r)
Get the job url for use with the REST api.- Parameters:
r
- The started build.- Returns:
- The url.
-
getHostName
public static String getHostName()
Fetches and caches the jenkins master FQDN.- Returns:
- hostname
-
getFullName
public static String getFullName(Queue.Task t)
Fetches the full name task name if available.- Parameters:
t
- task- Returns:
- full name if available, else the short name
-
getCanonicalName
public static String getCanonicalName()
Returns the canonical host name. This name is derived from the configured Jenkins URL in "Manage Jenkins".- Returns:
- the canonical host name
-
-