1Net::Jabber::Dialback::URseesrulCto(n3t)ributed Perl DocNuemte:n:tJaatbiboenr::Dialback::Result(3)
2
3
4
6 Net::Jabber::Dialback::Result - Jabber Dialback Result Module
7
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
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
52 $to = $Result->GetTo();
53 $from = $Result->GetFrom();
54 $type = $Result->GetType();
55
56 $data = $Result->GetData();
57
58 $str = $Result->GetXML();
59 @dialback = $Result->GetTree();
60
61 Creation functions
62
63 $Result->SetResult(from=>"jabber.org",
64 to=>"jabber.com",
65 data=>key);
66 $Result->SetTo("jabber.org");
67 $Result->SetFrom("jabber.com");
68 $Result->SetType("valid");
69 $Result->SetData(key);
70
71 Test functions
72
73 $test = $Result->DefinedTo();
74 $test = $Result->DefinedFrom();
75 $test = $Result->DefinedType();
76
78 Retrieval functions
79
80 GetTo() - returns a string with server that the <db:result/> is being
81 sent to.
82
83 GetFrom() - returns a string with server that the <db:result/> is being
84 sent from.
85
86 GetType() - returns a string with the type <db:result/> this is.
87
88 GetData() - returns a string with the cdata of the <db:result/>.
89
90 GetXML() - returns the XML string that represents the <db:result/>.
91 This is used by the Send() function in Server.pm to send
92 this object as a Jabber Dialback Result.
93
94 GetTree() - returns an array that contains the <db:result/> tag
95 in XML::Parser::Tree format.
96
97 Creation functions
98
99 SetResult(to=>string, - set multiple fields in the <db:result/>
100 from=>string, at one time. This is a cumulative
101 type=>string, and over writing action. If you set
102 data=>string) the "from" attribute twice, the second
103 setting is what is used. If you set
104 the type, and then set the data
105 then both will be in the <db:result/>
106 tag. For valid settings read the
107 specific Set functions below.
108
109 SetTo(string) - sets the to attribute.
110
111 SetFrom(string) - sets the from attribute.
112
113 SetType(string) - sets the type attribute. Valid settings are:
114
115 valid
116 invalid
117
118 SetData(string) - sets the cdata of the <db:result/>.
119
120 Test functions
121
122 DefinedTo() - returns 1 if the to attribute is defined in the
123 <db:result/>, 0 otherwise.
124
125 DefinedFrom() - returns 1 if the from attribute is defined in the
126 <db:result/>, 0 otherwise.
127
128 DefinedType() - returns 1 if the type attribute is defined in the
129 <db:result/>, 0 otherwise.
130
132 By Ryan Eatmon in May of 2001 for http://jabber.org..
133
135 This module is free software; you can redistribute it and/or modify it
136 under the same terms as Perl itself.
137
138
139
140perl v5.8.8 2004-08-16 Net::Jabber::Dialback::Result(3)