1Net::Jabber::Dialback::URseesrulCto(n3t)ributed Perl DocNuemte:n:tJaatbiboenr::Dialback::Result(3)
2
3
4

NAME

6       Net::Jabber::Dialback::Result - Jabber Dialback Result Module
7

SYNOPSIS

9         Net::Jabber::Dialback::Result is a companion to the Net::Jabber::Dialback
10         module.  It provides the user a simple interface to set and retrieve all
11         parts of a Jabber Dialback Result.
12

DESCRIPTION

14         To initialize the Result with a Jabber <db:*/> you must pass it
15         the XML::Stream hash.  For example:
16
17           my $dialback = new Net::Jabber::Dialback::Result(%hash);
18
19         There has been a change from the old way of handling the callbacks.
20         You no longer have to do the above yourself, a NJ::Dialback::Result
21         object is passed to the callback function for the message.  Also,
22         the first argument to the callback functions is the session ID from
23         XML::Streams.  There are some cases where you might want this
24         information, like if you created a Client that connects to two servers
25         at once, or for writing a mini server.
26
27           use Net::Jabber qw(Server);
28
29           sub dialbackResult {
30             my ($sid,$Result) = @_;
31             .
32             .
33             .
34           }
35
36         You now have access to all of the retrieval functions available.
37
38         To create a new dialback to send to the server:
39
40           use Net::Jabber qw(Server);
41
42           $Result = new Net::Jabber::Dialback::Result();
43
44         Now you can call the creation functions below to populate the tag before
45         sending it.
46
47         For more information about the array format being passed to the CallBack
48         please read the Net::Jabber::Client documentation.
49
50   Retrieval functions
51           $to         = $Result->GetTo();
52           $from       = $Result->GetFrom();
53           $type       = $Result->GetType();
54
55           $data       = $Result->GetData();
56
57           $str        = $Result->GetXML();
58           @dialback   = $Result->GetTree();
59
60   Creation functions
61           $Result->SetResult(from=>"jabber.org",
62                              to=>"jabber.com",
63                              data=>key);
64           $Result->SetTo("jabber.org");
65           $Result->SetFrom("jabber.com");
66           $Result->SetType("valid");
67           $Result->SetData(key);
68
69   Test functions
70           $test = $Result->DefinedTo();
71           $test = $Result->DefinedFrom();
72           $test = $Result->DefinedType();
73

METHODS

75   Retrieval functions
76         GetTo() -  returns a string with server that the <db:result/> is being
77                    sent to.
78
79         GetFrom() -  returns a string with server that the <db:result/> is being
80                      sent from.
81
82         GetType() - returns a string with the type <db:result/> this is.
83
84         GetData() - returns a string with the cdata of the <db:result/>.
85
86         GetXML() - returns the XML string that represents the <db:result/>.
87                    This is used by the Send() function in Server.pm to send
88                    this object as a Jabber Dialback Result.
89
90         GetTree() - returns an array that contains the <db:result/> tag
91                     in XML::Parser::Tree format.
92
93   Creation functions
94         SetResult(to=>string,   - set multiple fields in the <db:result/>
95                   from=>string,   at one time.  This is a cumulative
96                   type=>string,   and over writing action.  If you set
97                   data=>string)   the "from" attribute twice, the second
98                                   setting is what is used.  If you set
99                                   the type, and then set the data
100                                   then both will be in the <db:result/>
101                                   tag.  For valid settings read the
102                                   specific Set functions below.
103
104         SetTo(string) - sets the to attribute.
105
106         SetFrom(string) - sets the from attribute.
107
108         SetType(string) - sets the type attribute.  Valid settings are:
109
110                           valid
111                           invalid
112
113         SetData(string) - sets the cdata of the <db:result/>.
114
115   Test functions
116         DefinedTo() - returns 1 if the to attribute is defined in the
117                       <db:result/>, 0 otherwise.
118
119         DefinedFrom() - returns 1 if the from attribute is defined in the
120                         <db:result/>, 0 otherwise.
121
122         DefinedType() - returns 1 if the type attribute is defined in the
123                         <db:result/>, 0 otherwise.
124

AUTHOR

126       By Ryan Eatmon in May of 2001 for http://jabber.org..
127
129       This module is free software; you can redistribute it and/or modify it
130       under the same terms as Perl itself.
131
132
133
134perl v5.28.0                      2004-08-17  Net::Jabber::Dialback::Result(3)
Impressum