package be.ac.ulb.code.wit.resources;

import java.io.Reader;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

import org.apache.abdera.util.Constants;


@Path(ServicePaths.CONTACTS)
public class Contacts {
	private GroupContacts handler = new GroupContacts();

	@GET
    @Produces(Constants.FEED_MEDIA_TYPE)
    public Response getContacts() {
		return handler.getContacts(be.ac.ulb.code.wit.contacts.Contacts.GROUP_ALLCONTACTS);
	}

	@POST
    @Produces(Constants.ENTRY_MEDIA_TYPE)
    @Consumes(Constants.ENTRY_MEDIA_TYPE)
    public Response createContact(final Reader data) {
		return handler.createGroupContacts(
				be.ac.ulb.code.wit.contacts.Contacts.GROUP_ALLCONTACTS,
				data);
	}
}
