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

NAME

Net::RVP::User - RVP user encapsulation

SYNOPSIS

 my $user = $rvp->user('Fred_Smith');
 $user->watch() or die 'no such user';
 print "Email for ".($user->display())." is ".$user->email()."\n";

METHODS

new ( RVP object, URL )

Create new user object.

name

Return the short name e.g. jsmith, bob_jones.

url

Return the URL representing the user.

display

Return the display name for the user.

email

Return the user email address.

state

Return user state (without the namespace prefix) e.g. 'idle', 'online', 'offline', etc.

change_event

Send XML tree for NOTIFY property change event (under r:notification).

get_all

Read all available properties for the user.

Returns hashref on success, false on failure. Some possible keys are: user (this object), href (the canonical URL), and properties: d:displayname, r:mobile-state, r:mobile-description, r:email, r:state (note that we normalize the XML so the namespaces will stay the same).

watch

Subscribe to notifications for this user; renew if already subscribed.

Returns subscription timeout if successful, false otherwise.

unwatch

Stop watching (unsubscribe).

Note that we don't unsubscribe on object destruction (because global destruction order may be wrong), but we do when the RVP object is destroyed.

get ( property [, no cache flag ] )

User name should be the URL name final part e.g. 'jsmith'. If the 'no cache' flag is set, DON'T use the cache (default: use cache).

Properties may be 'd:' (DAV) or 'r:' (RVP) or 'a:' (ACL), e.g. 'd:displayname'.

Returns value, undef on failure.

set( prop, value )

Set property. Returns true on success, false on failure.

This should only be done on our own node, it should fail with an access error on others.

acl

Get ACL for user.

Returns true on success, false on failure (this method isn't needed so we don't bother to parse out the XML yet, sorry).

Note that although it isn't shown in the Microsoft RVP "specification", ACLs can also be set although this seems to be unnecessary for the most part (although perhaps handy e.g. to disallow someone from receiving presence information about onesself).

activity

Sent when there's activity. Updates the last activity time.

lag

Returns lag time since last activity, undef if no activity.

AUTHOR

David Robins <dbrobins@davidrobins.net>.