NAME

Net::Jabber::Query::Agent - Jabber Query Agent Module

SYNOPSIS

Net::Jabber::Query::Agent is a companion to the Net::Jabber::Query 
module. It provides the user a simple interface to set and retrieve all 
parts of a Jabber Query Agent.

DESCRIPTION

To initialize the Agent with a Jabber <iq/> you must pass it the 
XML::Parser Tree array from the module trying to access the <iq/>.  
In the callback function:

  use Net::Jabber;

  sub iqCB {
    my $iq = new Net::Jabber::IQ(@_);
    my $agent = $iq->GetQuery();
    .
    .
    .
  }

You now have access to all of the retrieval functions available.

To create a new Agent to send to the server:

  use Net::Jabber;

  $iq = new Net::Jabber::IQ();
  $agent = $iq->NewQuery("jabber:iq:agent");

Now you can call the creation functions below.

For more information about the array format being passed to the CallBack
please read the Net::Jabber::Client documentation.

Retrieval functions

$jid         = $agent->GetJID();
$name        = $agent->GetName();
$description = $agent->GetDescription();
$transport   = $agent->GetTransport();
$service     = $agent->GetService();
$register    = $agent->GetRegister();
$search      = $agent->GetSearch();
$agents      = $agent->GetAgents();

Creation functions

    $agent->SetAgent(jid=>"users.jabber.org",
		     name=>"Jabber User Directory",
	             description=>"You may register and create a public 
                                   searchable profile, and search for 
                                   other registered Jabber users.",
		     service=>"jud",
		     register=>"",
		     search=>"");

    $agent->SetJID("icq.jabber.org");
    $agent->SetName("ICQ Transport");
    $agent->SetDescription("This is the ICQ Transport");
    $agent->SetTransport("ICQ#");
    $agent->SetService("icq");
    $agent->SetRegister();
    $agent->SetSearch();
    $agent->SetAgents();

METHODS

Retrieval functions

GetJID() - returns a string with the JID of the agent to send 
           messages to.

GetName() - returns a string with the name of the agent.

GetDescription() - returns a string with the description of 
                   the agent.

GetTransport() - returns a string with the transport of the agent.

GetService() - returns a string with the service name of the agent.

GetRegister() - returns a 1 if the agent supports registering, 
                0 if not.

GetSearch() - returns a 1 if the agent supports searching, 0 if not.

GetAgents() - returns a 1 if the agent supports sub-agents, 0 if not.

Creation functions

SetAgent(jid=>string,         - set multiple fields in the <iq/> at one
         name=>string,          time.  This is a cumulative and over
         description=>string,   writing action.  If you set the "jid"
         transport=>string,     attribute twice, the second setting is
         service=>string,       what is used.  If you set the name, and
         register=>string,      then set the search then both will be in
         search=>string,        the <iq/> tag.  For valid settings read the
         agents=>string)        specific Set functions below.

SetJID(string) - sets the jid="..." of the agent.

SetName(string) - sets the <name/> of the agent.

SetDescription(string) - sets the <description/> of the agent.

SetTransport(string) - sets the <transport/> of the agent.

SetService(string) - sets the <service/> of the agent.

SetRegister() - if the function is called then a <search/> is
                is put in the <query/> to signify searching is
                available.

SetSearch() - if the function is called then a <search/> is
              is put in the <query/> to signify searching is
              available.

SetAgents() - if the function is called then a <agents/> is
              is put in the <query/> to signify sub-agents are
              available.

AUTHOR

By Ryan Eatmon in May of 2000 for http://jabber.org..

COPYRIGHT

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