Skip to content

Instantly share code, notes, and snippets.

@rinrinne
Last active January 3, 2016 10:49
Show Gist options
  • Save rinrinne/8451616 to your computer and use it in GitHub Desktop.
Save rinrinne/8451616 to your computer and use it in GitHub Desktop.
proposed implementation
package org.jenkinsci.plugins.study;
import com.sonyericsson.hudson.plugins.gerrit.trigger.api.GerritTrigger;
import com.sonyericsson.hudson.plugins.gerrit.trigger.api.exception.NoInstanceException;
import com.sonyericsson.hudson.plugins.gerrit.gerritevents.Handler;
class MyPlugin extends Plugin {
private GerritTriggerApi api = new GerritTriggerApi();
public void postEvent(String eventString) {
try {
Handler handler = api.getHander();
handler.post(eventString);
} catch (GerritTriggerException ex) {
String msg = ex.getMessage(); // dummy
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment