Skip to content

Instantly share code, notes, and snippets.

@tfennelly
Created August 29, 2013 10:30
Show Gist options
  • Save tfennelly/6376514 to your computer and use it in GitHub Desktop.
Save tfennelly/6376514 to your computer and use it in GitHub Desktop.
package com.foxweave.mocksaas;
import com.cloudbees.weave.api.webhook.WEAVEHook;
import com.foxweave.mocksaas.model.Contact;
import javax.inject.Inject;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
@Path("/contacts")
@Produces("application/json")
@Consumes("application/json")
public class ContactService {
@Inject
private WEAVEHook weaveHook;
@POST
@Path("/webhook")
public void webhook(String webhookDirective) {
weaveHook.hook(webhookDirective);
}
@POST
@Path("/created")
public void created(Contact contact) {
System.out.println("Contact added in source system: [" + contact + "].");
weaveHook.created(contact);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment