Skip to content

Commit

Permalink
use jenkins instance instead of hudson
Browse files Browse the repository at this point in the history
  • Loading branch information
cashlalala committed Oct 8, 2018
1 parent a86412c commit 70a6d3a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,17 @@
*/
package com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events;

import com.sonymobile.tools.gerrit.gerritevents.dto.events.PrivateStateChanged;
import java.io.Serializable;

import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;

import com.sonyericsson.hudson.plugins.gerrit.trigger.Messages;
import com.sonymobile.tools.gerrit.gerritevents.dto.events.PrivateStateChanged;

import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.Hudson;
import java.io.Serializable;
import org.kohsuke.stapler.DataBoundConstructor;
import jenkins.model.Jenkins;

/**
* An event configuration that causes the build to be triggered when a change's
Expand All @@ -52,7 +56,7 @@ public PluginPrivateStateChangedEvent() {
*/
@Override
public Descriptor<PluginGerritEvent> getDescriptor() {
return Hudson.getInstance().getDescriptorByType(PluginPrivateStateChangedEventDescriptor.class);
return Jenkins.getInstance().getDescriptorByType(PluginPrivateStateChangedEventDescriptor.class);
}

@Override
Expand All @@ -64,6 +68,7 @@ public Class getCorrespondingEventClass() {
* The descriptor for the PluginPrivateStateChangedEvent.
*/
@Extension
@Symbol("privateStateChanged")
public static class PluginPrivateStateChangedEventDescriptor extends PluginGerritEventDescriptor {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,24 @@
*/
package com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.events;

import com.sonymobile.tools.gerrit.gerritevents.dto.events.WipStateChanged;
import java.io.Serializable;

import org.jenkinsci.Symbol;
import org.kohsuke.stapler.DataBoundConstructor;

import com.sonyericsson.hudson.plugins.gerrit.trigger.Messages;
import com.sonymobile.tools.gerrit.gerritevents.dto.events.WipStateChanged;

import hudson.Extension;
import hudson.model.Descriptor;
import hudson.model.Hudson;
import java.io.Serializable;
import org.kohsuke.stapler.DataBoundConstructor;
import jenkins.model.Jenkins;

/**
* An event configuration that causes the build to be triggered when a change's
* WIP state changed.
*/
public class PluginWipStateChangedEvent extends PluginGerritEvent implements Serializable {
private static final long serialVersionUID = -8490721342780735276L;
private static final long serialVersionUID = 5530163420962242330L;

/**
* Standard constructor.
Expand All @@ -52,7 +56,7 @@ public PluginWipStateChangedEvent() {
*/
@Override
public Descriptor<PluginGerritEvent> getDescriptor() {
return Hudson.getInstance().getDescriptorByType(PluginWorkInProgressStateChangedEventDescriptor.class);
return Jenkins.getInstance().getDescriptorByType(PluginWorkInProgressStateChangedEventDescriptor.class);
}

@Override
Expand All @@ -64,6 +68,7 @@ public Class getCorrespondingEventClass() {
* The descriptor for the PluginWipStateChangedEvent.
*/
@Extension
@Symbol("wipStateChanged")
public static class PluginWorkInProgressStateChangedEventDescriptor extends PluginGerritEventDescriptor {

@Override
Expand Down

0 comments on commit 70a6d3a

Please sign in to comment.