Class CommonModelFactory
- java.lang.Object
-
- com.sumologic.jenkins.jenkinssumologicplugin.utility.CommonModelFactory
-
public class CommonModelFactory extends Object
Sumo Logic plugin for Jenkins model.Common Model factory to update common build information
Created by Sourabh Jain on 5/2019.
-
-
Constructor Summary
Constructors Constructor Description CommonModelFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
captureAuditEvent(String userId, AuditEventTypeEnum auditEventTypeEnum, String message, Map<String,Object> fileDetails)
static void
captureConfigChanges(String fileData, String oldFileData, AuditEventTypeEnum auditEventTypeEnum, String fileName)
static void
captureItemAuditEvent(AuditEventTypeEnum auditEventTypeEnum, String itemName, String itemOldValue)
static void
captureUserLoginEvent(String userName, AuditEventTypeEnum auditEventTypeEnum)
static String
getAbsoluteUrl(Run buildInfo)
static String
getAbsoluteUrl(String relativeURL)
static void
getComputerStatus(Computer computer, AgentModel agentModel)
static float
getJobRunDuration(Run buildInfo)
static void
getLabelAndNodeName(Run buildInfo, BuildModel BuildModel)
static List<AgentModel>
getNodeMonitorsDetails()
static String
getRelativeJenkinsHomePath(String configPath)
static String
getUpStreamUrl(Run buildInfo)
static String
getUserId(Run buildInfo)
static void
populateGeneric(BuildModel buildModel, Run buildInfo, PluginDescriptorImpl pluginDescriptor, boolean isSpecificJobFlagEnabled)
static void
sendConsoleLogs(Run run, TaskListener listener)
static void
updateStatus(Computer computer, String eventSource)
-
-
-
Method Detail
-
populateGeneric
public static void populateGeneric(BuildModel buildModel, Run buildInfo, PluginDescriptorImpl pluginDescriptor, boolean isSpecificJobFlagEnabled)
-
getUserId
public static String getUserId(Run buildInfo)
- Parameters:
buildInfo
- Jenkins Job Build Information- Returns:
- the user who triggered the build or upstream build
-
getJobRunDuration
public static float getJobRunDuration(Run buildInfo)
- Parameters:
buildInfo
- Jenkins Job Build Information- Returns:
- job duration
-
getAbsoluteUrl
public static String getAbsoluteUrl(Run buildInfo)
- Parameters:
buildInfo
- Jenkins Job Build Information- Returns:
- URL for the JOB
-
getUpStreamUrl
public static String getUpStreamUrl(Run buildInfo)
- Parameters:
buildInfo
- Jenkins Job Build Information- Returns:
- the upstream job url
-
getLabelAndNodeName
public static void getLabelAndNodeName(Run buildInfo, BuildModel BuildModel)
- Parameters:
buildInfo
- Jenkins Job Build InformationBuildModel
- Pipeline Job Status DTO
-
captureUserLoginEvent
public static void captureUserLoginEvent(String userName, AuditEventTypeEnum auditEventTypeEnum)
-
captureItemAuditEvent
public static void captureItemAuditEvent(AuditEventTypeEnum auditEventTypeEnum, String itemName, String itemOldValue)
-
captureConfigChanges
public static void captureConfigChanges(String fileData, String oldFileData, AuditEventTypeEnum auditEventTypeEnum, String fileName)
-
captureAuditEvent
public static void captureAuditEvent(String userId, AuditEventTypeEnum auditEventTypeEnum, String message, Map<String,Object> fileDetails)
-
getNodeMonitorsDetails
public static List<AgentModel> getNodeMonitorsDetails()
-
getComputerStatus
public static void getComputerStatus(Computer computer, AgentModel agentModel)
-
getAbsoluteUrl
public static String getAbsoluteUrl(String relativeURL)
- Parameters:
relativeURL
- Relative URL- Returns:
- URL for the JOB
-
sendConsoleLogs
public static void sendConsoleLogs(Run run, TaskListener listener)
-
-