users@jersey.java.net

style question WRT REST principles

From: PhuDuc Nguyen <duc.was.here_at_gmail.com>
Date: Thu, 26 Aug 2010 14:03:02 -0600

I often find myself in situations where I need to execute a method that does
not belong with any of the CRUD operations. What if I just want to execute
an action where no resource is being created, read, updated, or deleted. For
example, what if I'm controlling something like a phone and I want to
instruct it to call someone. If this were a SOAP service, I would just
define my Java interface to have something like

public boolean call(int phoneNumber);

However, I'm a bit confused as how this translates into RESTful style. What
then does the HTTP operation become? I'm certainly not deleting anything,
not reading anything, not updating anything. You could make the argument
that an "event" is being created...a "phone call event" is being created
maybe? What then would the URI look like?

http://<server>/phone/5551234
with POST as the HTTP operation? Shouldn't that be the URI for creating a
phone number? I'm trying to adhere to RESTful principles and I'm curious
about good style. Would you define something like:

http://<server>/phone/callevent/5551234

thanks in advance,
PDNWPS