Class 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 Detail

      • CommonModelFactory

        public CommonModelFactory()
    • 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 Information
        BuildModel - Pipeline Job Status DTO
      • captureUserLoginEvent

        public static void captureUserLoginEvent​(String userName,
                                                 AuditEventTypeEnum auditEventTypeEnum)
      • getRelativeJenkinsHomePath

        public static String getRelativeJenkinsHomePath​(String configPath)
      • updateStatus

        public static void updateStatus​(Computer computer,
                                        String eventSource)
      • 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)