|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.resource.Resource
org.restlet.resource.UniformResource
org.restlet.resource.ClientResource
org.restlet.ext.sip.SipClientResource
public class SipClientResource
Client-side resource for the sip protocol. Acts like a proxy of a target
resource.
This class changes the semantics of the Resource.getRequest()
and Resource.getResponse()
methods. Since a clientResource may
receive severals responses for a single request (in case of interim
response), the getResponse()
method returns the last received
response object. The Request object returned by the getRequest()
is
actually a prototype which is cloned (except the representation) just before
the ClientResource.handle()
method is called.
Users must be aware that by most representations can only be read or written
once. Some others, such as StringRepresentation
stored the entity in
memory which can be read several times but has the drawback to consume
memory.
Concurrency note: instances of the class are not designed to be shared among
several threads. If thread-safety is necessary, consider using the
lower-level Client
class instead.
Constructor Summary | |
---|---|
SipClientResource(Context context,
Method method,
Reference reference)
Constructor. |
|
SipClientResource(Context context,
Method method,
String uri)
Constructor. |
|
SipClientResource(Context context,
Method method,
URI uri)
Constructor. |
|
SipClientResource(Context context,
Reference reference)
Constructor. |
|
SipClientResource(Context context,
SipRequest request,
SipResponse response)
Constructor. |
|
SipClientResource(Context context,
String uri)
Constructor. |
|
SipClientResource(Context context,
URI uri)
Constructor. |
|
SipClientResource(Method method,
Reference reference)
Constructor. |
|
SipClientResource(Method method,
String uri)
Constructor. |
|
SipClientResource(Method method,
URI uri)
Constructor. |
|
SipClientResource(Reference reference)
Constructor. |
|
SipClientResource(SipClientResource resource)
Constructor. |
|
SipClientResource(SipRequest request,
SipResponse response)
Constructor. |
|
SipClientResource(String uri)
Constructor. |
|
SipClientResource(URI uri)
Constructor. |
Method Summary | ||
---|---|---|
void |
ack()
Confirms that the client has received a final response to an INVITE request. |
|
void |
ack(Representation representation)
Confirms that the client has received a final response to an INVITE request. |
|
Representation |
bye()
Indicates to the server that the user agent wishes to release the call. |
|
void |
cancel()
Cancels a pending request with the same Call-ID, To, From and CSeq (sequence number only) header field values. |
|
static
|
create(Context context,
Reference reference,
Class<? extends T> resourceInterface)
Creates a client resource that proxy calls to the given Java interface into Restlet method calls. |
|
static
|
create(Reference reference,
Class<? extends T> resourceInterface)
Creates a client resource that proxy calls to the given Java interface into Restlet method calls. |
|
static
|
create(String uri,
Class<? extends T> resourceInterface)
Creates a client resource that proxy calls to the given Java interface into Restlet method calls. |
|
Request |
createRequest(Request prototype)
|
|
protected Response |
createResponse(Request request)
|
|
String |
getCommandSequence()
Returns the request's command sequence. |
|
Address |
getFrom()
Returns the request initiator's address. |
|
SipRequest |
getRequest()
|
|
String |
getRequestCallId()
Returns the request's call ID. |
|
SipResponse |
getResponse()
|
|
String |
getResponseCallId()
Returns the response's call ID. |
|
List<SipRecipientInfo> |
getSipRequestRecipientsInfo()
Returns the request's list of Via entries. |
|
List<SipRecipientInfo> |
getSipResponseRecipientsInfo()
Returns the response's list of Via entries. |
|
Address |
getTo()
Returns the request recipient's address. |
|
Representation |
info()
Communicating mid-session signaling information along the signaling path for the call. |
|
Representation |
info(Representation representation)
Communicating mid-session signaling information along the signaling path for the call. |
|
Representation |
invite()
Indicates that the user or service is being invited to participate in a session. |
|
Representation |
invite(Representation representation)
Indicates that the user or service is being invited to participate in a session. |
|
Representation |
notify(Representation representation)
Informs subscribers of changes in state to which the subscriber has a subscription. |
|
Representation |
options()
Queries a SIP server as to its capabilities. |
|
void |
publish()
Creates, modifies, and removes event state associated with an address-of-record. |
|
void |
publish(Representation representation)
Creates, modifies, and removes event state associated with an address-of-record. |
|
void |
refer()
Indicates that the target recipient should contact a third party using the contact information provided in the request. |
|
void |
register()
Registers the address listed in the To header field with a SIP server. |
|
void |
register(Address to)
Registers the address listed in the To header field with a SIP server. |
|
void |
setCallId(String callId)
Sets the identifier of the call. |
|
void |
setCommandSequence(String commandSequence)
Sets the identifier of the command. |
|
void |
setFrom(Address from)
Sets the description of the request's initiator. |
|
void |
setRequest(Request request)
|
|
void |
setRequestCallId(String callId)
Sets the request's call ID. |
|
void |
setResponse(Response response)
|
|
void |
setTo(Address to)
Sets the logical recipient of the request. |
|
void |
subscribe()
Requests current state and state updates from a remote node. |
|
void |
subscribe(Representation representation)
Requests current state and state updates from a remote node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SipClientResource(Context context, URI uri)
context
- The context.uri
- The target URI.public SipClientResource(Context context, Method method, URI uri)
context
- The context.method
- The method to call.uri
- The target URI.public SipClientResource(Context context, Method method, Reference reference)
context
- The context.method
- The method to call.reference
- The target reference.public SipClientResource(Context context, Method method, String uri)
context
- The context.method
- The method to call.uri
- The target URI.public SipClientResource(Context context, Reference reference)
context
- The context.reference
- The target reference.public SipClientResource(Context context, SipRequest request, SipResponse response)
context
- The current context.request
- The handled request.response
- The handled response.public SipClientResource(Context context, String uri)
context
- The context.uri
- The target URI.public SipClientResource(URI uri)
uri
- The target URI.public SipClientResource(Method method, URI uri)
method
- The method to call.uri
- The target URI.public SipClientResource(Method method, Reference reference)
method
- The method to call.reference
- The target reference.public SipClientResource(Method method, String uri)
method
- The method to call.uri
- The target URI.public SipClientResource(Reference reference)
reference
- The target reference.public SipClientResource(SipClientResource resource)
resource
- The client resource to copy.public SipClientResource(SipRequest request, SipResponse response)
request
- The handled request.response
- The handled response.public SipClientResource(String uri)
uri
- The target URI.Method Detail |
---|
public static <T> T create(Context context, Reference reference, Class<? extends T> resourceInterface)
T
- context
- The context.reference
- The target reference.resourceInterface
- The annotated resource interface class to proxy.
public static <T> T create(Reference reference, Class<? extends T> resourceInterface)
T
- resourceInterface
- The annotated resource interface class to proxy.
public static <T> T create(String uri, Class<? extends T> resourceInterface)
T
- uri
- The target URI.resourceInterface
- The annotated resource interface class to proxy.
public void ack() throws ResourceException
ResourceException
public void ack(Representation representation) throws ResourceException
representation
- The entity to send.
ResourceException
public Representation bye() throws ResourceException
ResourceException
public void cancel() throws ResourceException
ResourceException
public Request createRequest(Request prototype)
createRequest
in class ClientResource
protected Response createResponse(Request request)
createResponse
in class ClientResource
public String getCommandSequence()
public Address getFrom()
public SipRequest getRequest()
getRequest
in class Resource
public String getRequestCallId()
public SipResponse getResponse()
getResponse
in class Resource
public String getResponseCallId()
public List<SipRecipientInfo> getSipRequestRecipientsInfo()
public List<SipRecipientInfo> getSipResponseRecipientsInfo()
public Address getTo()
public Representation info() throws ResourceException
ResourceException
public Representation info(Representation representation) throws ResourceException
representation
- An optional representation.
ResourceException
public Representation invite() throws ResourceException
ResourceException
public Representation invite(Representation representation) throws ResourceException
representation
- An optional representation.
ResourceException
public Representation notify(Representation representation) throws ResourceException
representation
- The notification representation.
ResourceException
public Representation options() throws ResourceException
options
in class ClientResource
ResourceException
public void publish() throws ResourceException
ResourceException
public void publish(Representation representation) throws ResourceException
representation
- The optional request entity.
ResourceException
public void refer() throws ResourceException
ResourceException
public void register() throws ResourceException
ResourceException
public void register(Address to) throws ResourceException
to
- The To header field.
ResourceException
public void setCallId(String callId)
callId
- The identifier of the call.public void setCommandSequence(String commandSequence)
commandSequence
- The identifier of the command.public void setFrom(Address from)
from
- The description of the request's initiator.public void setRequest(Request request)
setRequest
in class Resource
public void setRequestCallId(String callId)
callId
- The call ID.public void setResponse(Response response)
setResponse
in class Resource
public void setTo(Address to)
to
- The logical recipient of the request.public void subscribe() throws ResourceException
ResourceException
public void subscribe(Representation representation) throws ResourceException
representation
- The optional request entity.
ResourceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |