org.openxdm.xcap.client
Class XCAPClientImpl

java.lang.Object
  extended by org.openxdm.xcap.client.XCAPClientImpl
All Implemented Interfaces:
XCAPClient

public class XCAPClientImpl
extends java.lang.Object
implements XCAPClient


Constructor Summary
XCAPClientImpl(java.lang.String host, int port, java.lang.String xcapRoot)
           
 
Method Summary
 Response delete(org.openxdm.xcap.common.key.XcapUriKey key)
          Deletes the content related the specified XCAP URI key.
 Response deleteIfMatch(org.openxdm.xcap.common.key.XcapUriKey key, java.lang.String eTag)
          Deletes the content related the specified XCAP URI key, if the specified ETag matches the current one on the server.
 Response deleteIfNoneMatch(org.openxdm.xcap.common.key.XcapUriKey key, java.lang.String eTag)
          Deletes the content related the specified XCAP URI key, if the specified ETag does not matches the current one on the server.
 Response get(org.openxdm.xcap.common.key.XcapUriKey key)
          Retrieves the XML resource from the XCAP server, for the specified key.
 Response put(org.openxdm.xcap.common.key.XcapUriKey key, java.lang.String mimetype, byte[] content)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key.
 Response put(org.openxdm.xcap.common.key.XcapUriKey key, java.lang.String mimetype, java.lang.String content)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key.
 Response putIfMatch(org.openxdm.xcap.common.key.XcapUriKey key, java.lang.String eTag, java.lang.String mimetype, byte[] content)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key, if the specified ETag matches the current one on the server.
 Response putIfMatch(org.openxdm.xcap.common.key.XcapUriKey key, java.lang.String eTag, java.lang.String mimetype, java.lang.String content)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key, if the specified ETag matches the current one on the server.
 Response putIfNoneMatch(org.openxdm.xcap.common.key.XcapUriKey key, java.lang.String eTag, java.lang.String mimetype, byte[] content)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key, if the specified ETag does not matches the current one on the server.
 Response putIfNoneMatch(org.openxdm.xcap.common.key.XcapUriKey key, java.lang.String eTag, java.lang.String mimetype, java.lang.String content)
          Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key, if the specified ETag does not matches the current one on the server.
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XCAPClientImpl

public XCAPClientImpl(java.lang.String host,
                      int port,
                      java.lang.String xcapRoot)
               throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException
Method Detail

shutdown

public void shutdown()
Specified by:
shutdown in interface XCAPClient

get

public Response get(org.openxdm.xcap.common.key.XcapUriKey key)
             throws org.apache.commons.httpclient.HttpException,
                    java.io.IOException
Description copied from interface: XCAPClient
Retrieves the XML resource from the XCAP server, for the specified key.

Specified by:
get in interface XCAPClient
Throws:
org.apache.commons.httpclient.HttpException
java.io.IOException

put

public Response put(org.openxdm.xcap.common.key.XcapUriKey key,
                    java.lang.String mimetype,
                    java.lang.String content)
             throws org.apache.commons.httpclient.HttpException,
                    java.io.IOException
Description copied from interface: XCAPClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key.

Specified by:
put in interface XCAPClient
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.
Returns:
Throws:
org.apache.commons.httpclient.HttpException
java.io.IOException

putIfMatch

public Response putIfMatch(org.openxdm.xcap.common.key.XcapUriKey key,
                           java.lang.String eTag,
                           java.lang.String mimetype,
                           java.lang.String content)
                    throws org.apache.commons.httpclient.HttpException,
                           java.io.IOException
Description copied from interface: XCAPClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key, if the specified ETag matches the current one on the server.

Specified by:
putIfMatch in interface XCAPClient
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.
Returns:
Throws:
org.apache.commons.httpclient.HttpException
java.io.IOException

putIfNoneMatch

public Response putIfNoneMatch(org.openxdm.xcap.common.key.XcapUriKey key,
                               java.lang.String eTag,
                               java.lang.String mimetype,
                               java.lang.String content)
                        throws org.apache.commons.httpclient.HttpException,
                               java.io.IOException
Description copied from interface: XCAPClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key, if the specified ETag does not matches the current one on the server.

Specified by:
putIfNoneMatch in interface XCAPClient
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.
Returns:
Throws:
org.apache.commons.httpclient.HttpException
java.io.IOException

put

public Response put(org.openxdm.xcap.common.key.XcapUriKey key,
                    java.lang.String mimetype,
                    byte[] content)
             throws org.apache.commons.httpclient.HttpException,
                    java.io.IOException
Description copied from interface: XCAPClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key.

Specified by:
put in interface XCAPClient
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.
Returns:
Throws:
org.apache.commons.httpclient.HttpException
java.io.IOException

putIfMatch

public Response putIfMatch(org.openxdm.xcap.common.key.XcapUriKey key,
                           java.lang.String eTag,
                           java.lang.String mimetype,
                           byte[] content)
                    throws org.apache.commons.httpclient.HttpException,
                           java.io.IOException
Description copied from interface: XCAPClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key, if the specified ETag matches the current one on the server.

Specified by:
putIfMatch in interface XCAPClient
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.
Returns:
Throws:
org.apache.commons.httpclient.HttpException
java.io.IOException

putIfNoneMatch

public Response putIfNoneMatch(org.openxdm.xcap.common.key.XcapUriKey key,
                               java.lang.String eTag,
                               java.lang.String mimetype,
                               byte[] content)
                        throws org.apache.commons.httpclient.HttpException,
                               java.io.IOException
Description copied from interface: XCAPClient
Puts the specified content in the XCAP Server, in the XCAP URI pointed by the key, if the specified ETag does not matches the current one on the server.

Specified by:
putIfNoneMatch in interface XCAPClient
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.
Returns:
Throws:
org.apache.commons.httpclient.HttpException
java.io.IOException

delete

public Response delete(org.openxdm.xcap.common.key.XcapUriKey key)
                throws org.apache.commons.httpclient.HttpException,
                       java.io.IOException
Description copied from interface: XCAPClient
Deletes the content related the specified XCAP URI key.

Specified by:
delete in interface XCAPClient
Returns:
Throws:
org.apache.commons.httpclient.HttpException
java.io.IOException

deleteIfMatch

public Response deleteIfMatch(org.openxdm.xcap.common.key.XcapUriKey key,
                              java.lang.String eTag)
                       throws org.apache.commons.httpclient.HttpException,
                              java.io.IOException
Description copied from interface: XCAPClient
Deletes the content related the specified XCAP URI key, if the specified ETag matches the current one on the server.

Specified by:
deleteIfMatch in interface XCAPClient
Returns:
Throws:
org.apache.commons.httpclient.HttpException
java.io.IOException

deleteIfNoneMatch

public Response deleteIfNoneMatch(org.openxdm.xcap.common.key.XcapUriKey key,
                                  java.lang.String eTag)
                           throws org.apache.commons.httpclient.HttpException,
                                  java.io.IOException
Description copied from interface: XCAPClient
Deletes the content related the specified XCAP URI key, if the specified ETag does not matches the current one on the server.

Specified by:
deleteIfNoneMatch in interface XCAPClient
Returns:
Throws:
org.apache.commons.httpclient.HttpException
java.io.IOException


Copyright © 2009. All Rights Reserved.