org.mobicents.xcap.client.impl
Class XcapClientImpl

java.lang.Object
  extended by org.mobicents.xcap.client.impl.XcapClientImpl
All Implemented Interfaces:
XcapClient

public class XcapClientImpl
extends java.lang.Object
implements XcapClient

Impl of the XcapClient.

Author:
martins

Constructor Summary
XcapClientImpl()
           
 
Method Summary
 XcapResponse delete(java.net.URI uri, org.apache.http.Header[] additionalRequestHeaders, org.apache.http.auth.Credentials credentials)
          Deletes the content related the specified XCAP URI uri.
 XcapResponse deleteIfMatch(java.net.URI uri, java.lang.String eTag, org.apache.http.Header[] additionalRequestHeaders, org.apache.http.auth.Credentials credentials)
          Deletes the content related the specified XCAP URI uri, if the specified ETag matches the current one on the server.
 XcapResponse deleteIfNoneMatch(java.net.URI uri, java.lang.String eTag, org.apache.http.Header[] additionalRequestHeaders, org.apache.http.auth.Credentials credentials)
          Deletes the content related the specified XCAP URI uri, if the specified ETag does not matches the current one on the server.
 XcapResponse get(java.net.URI uri, org.apache.http.Header[] additionalRequestHeaders, org.apache.http.auth.Credentials credentials)
          Retrieves the XML resource from the XCAP server, for the specified uri.
 XcapResponse put(java.net.URI uri, java.lang.String mimetype, byte[] content, org.apache.http.Header[] additionalRequestHeaders, org.apache.http.auth.Credentials credentials)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri.
 XcapResponse put(java.net.URI uri, java.lang.String mimetype, java.lang.String content, org.apache.http.Header[] additionalRequestHeaders, org.apache.http.auth.Credentials credentials)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri.
 XcapResponse putIfMatch(java.net.URI uri, java.lang.String eTag, java.lang.String mimetype, byte[] content, org.apache.http.Header[] additionalRequestHeaders, org.apache.http.auth.Credentials credentials)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri, if the specified ETag matches the current one on the server.
 XcapResponse putIfMatch(java.net.URI uri, java.lang.String eTag, java.lang.String mimetype, java.lang.String content, org.apache.http.Header[] additionalRequestHeaders, org.apache.http.auth.Credentials credentials)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri, if the specified ETag matches the current one on the server.
 XcapResponse putIfNoneMatch(java.net.URI uri, java.lang.String eTag, java.lang.String mimetype, byte[] content, org.apache.http.Header[] additionalRequestHeaders, org.apache.http.auth.Credentials credentials)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri, if the specified ETag does not matches the current one on the server.
 XcapResponse putIfNoneMatch(java.net.URI uri, java.lang.String eTag, java.lang.String mimetype, java.lang.String content, org.apache.http.Header[] additionalRequestHeaders, org.apache.http.auth.Credentials credentials)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri, if the specified ETag does not matches the current one on the server.
 void setAuthenticationCredentials(org.apache.http.auth.Credentials credentials)
          Sets the global authentication credentials, those will be used when there are no credentials for the request.
 void shutdown()
          Shutdown the client.
 void unsetAuthenticationCredentials()
          Unsets the authentication credentials.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XcapClientImpl

public XcapClientImpl()
Method Detail

setAuthenticationCredentials

public void setAuthenticationCredentials(org.apache.http.auth.Credentials credentials)
Description copied from interface: XcapClient
Sets the global authentication credentials, those will be used when there are no credentials for the request. Those credentials are applied to any host.

Specified by:
setAuthenticationCredentials in interface XcapClient

unsetAuthenticationCredentials

public void unsetAuthenticationCredentials()
Description copied from interface: XcapClient
Unsets the authentication credentials.

Specified by:
unsetAuthenticationCredentials in interface XcapClient

shutdown

public void shutdown()
Description copied from interface: XcapClient
Shutdown the client.

Specified by:
shutdown in interface XcapClient

get

public XcapResponse get(java.net.URI uri,
                        org.apache.http.Header[] additionalRequestHeaders,
                        org.apache.http.auth.Credentials credentials)
                 throws org.apache.http.client.ClientProtocolException,
                        java.io.IOException
Description copied from interface: XcapClient
Retrieves the XML resource from the XCAP server, for the specified uri.

Specified by:
get in interface XcapClient
Parameters:
uri - the request uri
additionalRequestHeaders - additional headers to include in the XCAP request
credentials - authentication credentials, can be null for requests that don't need authentication.
Returns:
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

put

public XcapResponse put(java.net.URI uri,
                        java.lang.String mimetype,
                        java.lang.String content,
                        org.apache.http.Header[] additionalRequestHeaders,
                        org.apache.http.auth.Credentials credentials)
                 throws org.apache.http.client.ClientProtocolException,
                        java.io.IOException
Description copied from interface: XcapClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri.

Specified by:
put in interface XcapClient
Parameters:
uri - the request uri
mimetype - the mimetype of the content to put, for document each XCAP App Usage defines their own mimetype, but for elements and attributes you can use ElementResource and AttributeResource static MIMETYPE fields.
additionalRequestHeaders - additional headers to include in the XCAP request
credentials - authentication credentials, can be null for requests that don't need authentication.
Returns:
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

putIfMatch

public XcapResponse putIfMatch(java.net.URI uri,
                               java.lang.String eTag,
                               java.lang.String mimetype,
                               java.lang.String content,
                               org.apache.http.Header[] additionalRequestHeaders,
                               org.apache.http.auth.Credentials credentials)
                        throws org.apache.http.client.ClientProtocolException,
                               java.io.IOException
Description copied from interface: XcapClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri, if the specified ETag matches the current one on the server.

Specified by:
putIfMatch in interface XcapClient
Parameters:
uri - the request uri
mimetype - the mimetype of the content to put, for document each XCAP App Usage defines their own mimetype, but for elements and attributes you can use ElementResource and AttributeResource static MIMETYPE fields.
additionalRequestHeaders - additional headers to include in the XCAP request
credentials - authentication credentials, can be null for requests that don't need authentication.
Returns:
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

putIfNoneMatch

public XcapResponse putIfNoneMatch(java.net.URI uri,
                                   java.lang.String eTag,
                                   java.lang.String mimetype,
                                   java.lang.String content,
                                   org.apache.http.Header[] additionalRequestHeaders,
                                   org.apache.http.auth.Credentials credentials)
                            throws org.apache.http.client.ClientProtocolException,
                                   java.io.IOException
Description copied from interface: XcapClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri, if the specified ETag does not matches the current one on the server.

Specified by:
putIfNoneMatch in interface XcapClient
Parameters:
uri - the request uri
mimetype - the mimetype of the content to put, for document each XCAP App Usage defines their own mimetype, but for elements and attributes you can use ElementResource and AttributeResource static MIMETYPE fields.
additionalRequestHeaders - additional headers to include in the XCAP request
credentials - authentication credentials, can be null for requests that don't need authentication.
Returns:
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

put

public XcapResponse put(java.net.URI uri,
                        java.lang.String mimetype,
                        byte[] content,
                        org.apache.http.Header[] additionalRequestHeaders,
                        org.apache.http.auth.Credentials credentials)
                 throws org.apache.http.client.ClientProtocolException,
                        java.io.IOException
Description copied from interface: XcapClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri.

Specified by:
put in interface XcapClient
Parameters:
uri - the request uri
mimetype - the mimetype of the content to put, for document each XCAP App Usage defines their own mimetype, but for elements and attributes you can use ElementResource and AttributeResource static MIMETYPE fields.
additionalRequestHeaders - additional headers to include in the XCAP request
credentials - authentication credentials, can be null for requests that don't need authentication.
Returns:
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

putIfMatch

public XcapResponse putIfMatch(java.net.URI uri,
                               java.lang.String eTag,
                               java.lang.String mimetype,
                               byte[] content,
                               org.apache.http.Header[] additionalRequestHeaders,
                               org.apache.http.auth.Credentials credentials)
                        throws org.apache.http.client.ClientProtocolException,
                               java.io.IOException
Description copied from interface: XcapClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri, if the specified ETag matches the current one on the server.

Specified by:
putIfMatch in interface XcapClient
Parameters:
uri - the request uri
mimetype - the mimetype of the content to put, for document each XCAP App Usage defines their own mimetype, but for elements and attributes you can use ElementResource and AttributeResource static MIMETYPE fields.
additionalRequestHeaders - additional headers to include in the XCAP request
credentials - authentication credentials, can be null for requests that don't need authentication.
Returns:
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

putIfNoneMatch

public XcapResponse putIfNoneMatch(java.net.URI uri,
                                   java.lang.String eTag,
                                   java.lang.String mimetype,
                                   byte[] content,
                                   org.apache.http.Header[] additionalRequestHeaders,
                                   org.apache.http.auth.Credentials credentials)
                            throws org.apache.http.client.ClientProtocolException,
                                   java.io.IOException
Description copied from interface: XcapClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the uri, if the specified ETag does not matches the current one on the server.

Specified by:
putIfNoneMatch in interface XcapClient
Parameters:
uri - the request uri
mimetype - the mimetype of the content to put, for document each XCAP App Usage defines their own mimetype, but for elements and attributes you can use ElementResource and AttributeResource static MIMETYPE fields.
additionalRequestHeaders - additional headers to include in the XCAP request
credentials - authentication credentials, can be null for requests that don't need authentication.
Returns:
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

delete

public XcapResponse delete(java.net.URI uri,
                           org.apache.http.Header[] additionalRequestHeaders,
                           org.apache.http.auth.Credentials credentials)
                    throws org.apache.http.client.ClientProtocolException,
                           java.io.IOException
Description copied from interface: XcapClient
Deletes the content related the specified XCAP URI uri.

Specified by:
delete in interface XcapClient
Parameters:
uri - the request uri
additionalRequestHeaders - additional headers to include in the XCAP request
credentials - authentication credentials, can be null for requests that don't need authentication.
Returns:
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

deleteIfMatch

public XcapResponse deleteIfMatch(java.net.URI uri,
                                  java.lang.String eTag,
                                  org.apache.http.Header[] additionalRequestHeaders,
                                  org.apache.http.auth.Credentials credentials)
                           throws org.apache.http.client.ClientProtocolException,
                                  java.io.IOException
Description copied from interface: XcapClient
Deletes the content related the specified XCAP URI uri, if the specified ETag matches the current one on the server.

Specified by:
deleteIfMatch in interface XcapClient
Parameters:
uri - the request uri
additionalRequestHeaders - additional headers to include in the XCAP request
credentials - authentication credentials, can be null for requests that don't need authentication.
Returns:
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException

deleteIfNoneMatch

public XcapResponse deleteIfNoneMatch(java.net.URI uri,
                                      java.lang.String eTag,
                                      org.apache.http.Header[] additionalRequestHeaders,
                                      org.apache.http.auth.Credentials credentials)
                               throws org.apache.http.client.ClientProtocolException,
                                      java.io.IOException
Description copied from interface: XcapClient
Deletes the content related the specified XCAP URI uri, if the specified ETag does not matches the current one on the server.

Specified by:
deleteIfNoneMatch in interface XcapClient
Parameters:
uri - the request uri
additionalRequestHeaders - additional headers to include in the XCAP request
credentials - authentication credentials, can be null for requests that don't need authentication.
Returns:
Throws:
org.apache.http.client.ClientProtocolException
java.io.IOException


Copyright © 2010. All Rights Reserved.