Created
August 29, 2013 10:30
-
-
Save tfennelly/6376514 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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