The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

XCAP::Client - XCAP client protocol (RFC 4825).

SYNOPSIS

    use XCAP::Client;

        my $xcap_client = new XCAP::Client(
                xcap_root => "https://my.xcapserver.org/xcap-root",
                user => "sip:foo@domain.org",
                auth_username => "foo",
                auth_password => "bar",
        );

    # Set the document.
    $xcap_client->application('pres-rules');
    $xcap_client->filename('index');
    $xcap_client->tree('user');

    # Delete
    $xcap_client->document->delete;

    # Fetch pres-rules document.
    $xcap_client->document->fetch();

    # If you want to create or replace.
    $xcap_client->document->content($xml_content);
        
    # Create a new document.
    $xcap_client->document->create; 

    # Replace.
    $xcap_client->document->replace;

DESCRIPTION

XCAP (RFC 4825) is a protocol on top of HTTP which allows a client to manipulate the contents of Presence Information Data Format (PIDF) based presence documents. These documents are stored in a server in XML format and are fetched, modified, replaced or deleted by the client. The protocol allows multiple clients to manipulate the data, provided that they are authorized to do so. XCAP is already used in SIMPLE-based presence systems for manipulation of presence lists and presence authorization policies.

XCAPClient library implements the XCAP protocol in client side, allowing the applications to get, store, modify and delete XML documents in the server.

The module implements the following features:

 * Fetch, create/replace and delete a document.
 * Parameters allowing customized fields for each XCAP application.
 * Manage of multiple documents per XCAP application.
 * SSL support.
 * Exception for each HTTP error response.
 * Digest and Basic HTTP authentication.

Todo:

 * Fetch, create/replace and delete a document element (XML node)
 * Fetch, create/replace and delete an element attribute. 
 * Fetch the XCAP server auids, extensions and namespaces.

ATTRIBUTES

xcap_root

It's a context that contains all the documents across all application usages and users that are managed by the server.

The root of the XCAP hierarchy is called the XCAP root. It defines the context in which all other resources exist. The XCAP root is represented with an HTTP URI, called the XCAP Root URI. This URI is a valid HTTP URI; however, it doesn't point to any resource that actually exists on the server. Its purpose is to identify the root of the tree within the domain where all XCAP documents are stored.

user

user - User that represents the parent for all documents for a particular user for a particular application usage within a particular XCAP root.

auth_realm

auth_realm - The HTTP authentication realm or name.

auth_username

auth_username - The HTTP authentication username.

auth_password

auth_password - The HTTP authentcation password.

application

Application can be resource-lists, rls-services, pres-rules, pdif-manipulations or xcap-caps. (Default: pres-rules)

tree

Tree can be users or global. (Default: users)

filename

Filename. (Default: index)

METHODS

document->[create,fetch,replace,delete]

You can create, fetch, replace or delete a document with this methods. To use create or delete you need to say the content of the "document->content".

element->[add,fetch]

AUTHOR

Thiago Rondon <thiago@aware.com.br>

http://www.aware.com.br/

COPYRIGHT AND LICENSE

This software is copyright (c) 2009 by Aware.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.