
Net::Jabber::Query - Jabber Query Library

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

Net::Jabber::Query differs from the other modules in that its behavior
and available functions are based off of the XML namespace that is
set in it. The current supported namespaces are:
jabber:iq:agent
jabber:iq:agents
jabber:iq:auth
jabber:iq:autoupdate
jabber:iq:browse
jabber:iq:conference
jabber:iq:filter
jabber:iq:gateway
jabber:iq:last
jabber:iq:oob
jabber:iq:pass
jabber:iq:register
jabber:iq:roster
jabber:iq:rpc
jabber:iq:search
jabber:iq:time
jabber:iq:version
http://jabber.org/protocol/bytestreams
http://jabber.org/protocol/commands
http://jabber.org/protocol/disco#info
http://jabber.org/protocol/disco#items
http://jabber.org/protocol/feature-neg
http://jabber.org/protocol/muc#admin
http://jabber.org/protocol/pubsub
http://jabber.org/protocol/pubsub#event
http://jabber.org/protocol/pubsub#owner
http://jabber.org/protocol/si
http://jabber.org/protocol/si/profile/file-transfer
http://www.jabber.org/protocol/soap # Experimental
For more information on what these namespaces are for, visit
http://www.jabber.org and browse the Jabber Programmers Guide.
Each of these namespaces provide Net::Jabber::Query with the functions
to access the data. By using the AUTOLOAD function the functions for
each namespace is used when that namespace is active.
To access a Query object you must create an IQ object and use the
access functions there to get to the Query. To initialize the IQ with
a Jabber <iq/> you must pass it the XML::Stream hash from the
Net::Jabber::Client module.
my $iq = new Net::Jabber::IQ(%hash);
There has been a change from the old way of handling the callbacks.
You no longer have to do the above yourself, a Net::Jabber::IQ
object is passed to the callback function for the message. Also,
the first argument to the callback functions is the session ID from
XML::Streams. There are some cases where you might want this
information, like if you created a Client that connects to two servers
at once, or for writing a mini server.
use Net::Jabber qw(Client);
sub iqCB {
my ($sid,$IQ) = @_;
my $query = $IQ->GetQuery();
.
.
.
}
You now have access to all of the retrieval functions available for
that namespace.
To create a new iq to send to the server:
use Net::Jabber;
my $iq = new Net::Jabber::IQ();
$query = $iq->NewQuery("jabber:iq:register");
Now you can call the creation functions for the Query as defined in the
proper namespaces. See below for the general <query/> functions, and
in each query module for those functions.
For more information about the array format being passed to the
CallBack please read the Net::Jabber::Client documentation.

GetXMLNS() - returns a string with the namespace of the query that
the <iq/> contains.
$xmlns = $IQ->GetXMLNS();
GetQuery() - since the behavior of this module depends on the
namespace, a Query object may contain Query objects.
This helps to leverage code reuse by making children
behave in the same manner. More than likely this
function will never be called.
@query = GetQuery()
SetXMLNS(string) - sets the xmlns of the <query/> to the string.
$query->SetXMLNS("jabber:iq:roster");
In an effort to make maintaining this document easier, I am not going to go into full detail on each of these functions. Rather I will present the functions in a list with a type in the first column to show what they return, or take as arugments. Here is the list of types I will use:
string - just a string
array - array of strings
flag - this means that the specified child exists in the
XML <child/> and acts like a flag. get will return
0 or 1.
JID - either a string or Net::Jabber::JID object.
objects - creates new objects, or returns an array of
objects.
special - this is a special case kind of function. Usually
just by calling Set() with no arguments it will
default the value to a special value, like OS or time.
Sometimes it will modify the value you set, like
in jabber:iq:version SetVersion() the function
adds on the Net::Jabber version to the string
just for advertisement purposes. =)
master - this desribes a function that behaves like the
SetMessage() function in Net::Jabber::Message.
It takes a hash and sets all of the values defined,
and the Set returns a hash with the values that
are defined in the object.

Type Get Set Defined ======= ================ ================ ================== flag GetAgents() SetAgents() DefinedAgents() string GetDescription() SetDescription() DefinedDesrciption() JID GetJID() SetJID() DefinedJID() string GetName() SetName() DefinedName() flag GetGroupChat() SetGroupChat() DefinedGroupChat() flag GetRegister() SetRegister() DefinedRegister() flag GetSearch() SetSearch() DefinedSearch() string GetService() SetService() DefinedService() string GetTransport() SetTransport() DefinedTransport() string GetURL() SetURL() DefinedURL() master GetAgent() SetAgent()

Type Get Set Defined ======= ================ ================ ================== objects AddAgent() DefinedAgent() master GetAgents()

Type Get Set Defined ======= ================ ================ ================== string GetDigest() SetDigest() DefinedDigest() string GetHash() SetHash() DefiendHash() string GetPassword() SetPassword() DefinedPassword() string GetResource() SetResource() DefinedResource() string GetSequence() SetSequence() DefinedSequence() string GetToken() SetToken() DefinedToken() string GetUsername() SetUsername() DefinedUsername() master GetAuth() SetAuth()

Type Get Set Defined ======= ================ ================ ================== objects GetReleases() objects AddBeta() objects AddDev() objects AddRelease()

Type Get Set Defined ======= ================ ================ ================== string GetDesc() SetDesc() DefinedDesc() string GetPriority() SetPriority() DefinedPriority() string GetURL() SetURL() DefinedURL() string GetVersion() SetVersion() DefinedVersion() master GetRelease() SetRelease()

Type Get Set Defined ======= ================ ================ ================== JID GetJID() SetJID() DefinedJID() string GetName() SetName() DefinedName() string GetType() SetType() DefinedType() array GetNS() SetNS() DefinedNS() master GetBrowse() SetBrowse() objects AddItem() objects GetItems()

Type Get Set Defined ======= ================ ================ ================== JID GetJID() SetJID() DefinedJID() string GetName() SetName() DefinedName() string GetType() SetType() DefinedType() array GetNS() SetNS() DefinedNS() master GetBrowse() SetBrowse() objects AddItem() objects GetItems()

Type Get Set Defined ======= ================ ================ ================== string GetID() SetID() DefinedID() string GetName() SetName() DefinedName() array GetNick() SetNick() DefinedNick() flag GetPrivacy() SetPrivacy() DefinedPrivacy() string GetSecret() SetSecret() DefinedSecret() master GetConference() SetConference()

Type Get Set Defined ======= ================ ================ ================== objects AddRule() objects GetRules()

Type Get Set Defined ======= ================ ================ ================== string GetBody() SetBody() DefinedBody() string GetContinued() SetContinued() DefinedContinued() string GetDrop() SetDrop() DefinedDrop() string GetEdit() SetEdit() DefinedEdit() string GetError() SetError() DefinedError() string GetFrom() SetFrom() DefinedFrom() string GetOffline() SetOffline() DefinedOffline() string GetReply() SetReply() DefinedReply() string GetResource() SetResource() DefinedResource() string GetShow() SetShow() DefinedShow() string GetSize() SetSize() DefinedSize() string GetSubject() SetSubject() DefinedSubject() string GetTime() SetTime() DefinedTime() string GetType() SetType() DefinedType() string GetUnavailable() SetUnavailable() DefinedUnavailable() master GetConference() SetConference()

Type Get Set Defined ======= ================ ================ ================== JID GetJID() SetJID() DefinedJID() string GetDesc() SetDesc() DefinedDesc() string GetPrompt() SetPrompt() DefinedPrompt() master GetGateway() SetGateway()

Type Get Set Defined ======= ================ ================ ================== string GetMessage() SetMessage() DefinedMessage() string GetSeconds() SetSeconds() DefinedSeconds() master GetLast() SetLast()

Type Get Set Defined ======= ================ ================ ================== string GetDesc() SetDesc() DefinedDesc() string GetURL() SetURL() DefinedURL() master GetOob() SetOob()

Type Get Set Defined ======= ================ ================ ================== string GetClient() SetClient() DefinedClient() string GetClientPort() SetClientPort() DefinedClientPort() string GetClose() SetClose() DefinedClose() string GetExpire() SetExpire() DefinedExpire() string GetOneShot() SetOneShot() DefinedOneShot() string GetProxy() SetProxy() DefinedProxy() string GetProxyPort() SetProxyPort() DefinedProxyPort() string GetServer() SetServer() DefinedServer() string GetServerPort() SetServerPort() DefinedServerPort() master GetPass() SetPass()

Type Get Set Defined ======= ================ ================ ================== string GetAddress() SetAddress() DefinedAddress() string GetCity() SetCity() DefinedCity() string GetDate() SetDate() DefinedDate() string GetEmail() SetEmail() DefinedEmail() string GetFirst() SetFirst() DefinedFirst() string GetInstructions() SetInstructions() DefinedInstructions() string GetKey() SetKey() DefinedKey() string GetLast() SetLast() DefinedLast() string GetMisc() SetMisc() DefinedMisc() string GetName() SetName() DefinedName() string GetNick() SetNick() DefinedNick() string GetPassword() SetPassword() DefinedPassword() string GetPhone() SetPhone() DefinedPhone() flag GetRegistered() SetRegistered() DefinedRegistered() flag GetRemove() SetRemove() DefinedRemove() string GetState() SetState() DefinedState() string GetText() SetText() DefinedText() string GetURL() SetURL() DefinedURL() string GetUsername() SetUsername() DefinedUsername() string GetZip() SetZip() DefinedZip() master GetRegister() SetRegister()

Type Get Set Defined ======= ================ ================ ================== objects AddItem() objects GetItems()

Type Get Set Defined ======= ================ ================ ================== string GetAsk() SetAsk() DefinedAsk() array GetGroup() SetGroup() DefinedGroup() JID GetJID() SetJID() DefinedJID() string GetName() SetName() DefinedName() string GetSubscription() SetSubscription() DefinedSubscription() master GetItem() SetItem()

Type Get Set Defined ======= ================ ================ ================== objects GetMethodCall() AddMethodCall() DefinedMethodCall() objects GetMethodResponse() AddMethodResponse() DefinedMethodReponse()

Type Get Set Defined ======= ================ ================ ================== string GetMethodName() SetMethodName() DefinedMethodName() objects GetParams() AddParams() DefinedParams() master GetMethodCall() SetMethodCall()

Type Get Set Defined ======= ================ ================ ================== objects GetParams() AddParams() DefinedParams() objects GetFault() AddFault() DefinedFault()

Type Get Set Defined ======= ================ ================ ================== objects GetValue() AddValue() DefinedValue()

Type Get Set Defined ======= ================ ================ ================== objects AddParam() objects GetParams()

Type Get Set Defined ======= ================ ================ ================== objects GetValue() AddValue() DefinedValue()

Type Get Set Defined ======= ================ ================ ================== string GetBase64() SetBase64() DefinedBase64() string GetBoolean() SetBoolean() DefinedBoolean() string GetDateTime() SetDateTime() DefinedDateTime() string GetDouble() SetDouble() DefinedDouble() string GetI4() SetI4() DefinedI4() string GetInt() SetInt() DefinedInt() string GetString() SetString() DefinedString() string GetValue() SetValue() DefinedValue() objects GetStruct() AddStruct() DefinedStruct() objects GetArray() AddArray() DefinedArray() master GetRPCValue() SetRPCValue()

Type Get Set Defined ======= ================ ================ ================== objects AddMember() objects GetMembers()

Type Get Set Defined ======= ================ ================ ================== string GetName() SetName() DefinedName() objects GetValue() AddValue() DefinedValue() master GetMember() SetMember()

Type Get Set Defined ======= ================ ================ ================== objects AddData() objects GetDatas()

Type Get Set Defined ======= ================ ================ ================== objects GetValue() AddValue() DefinedValue()

Type Get Set Defined ======= ================ ================ ================== string GetEmail() SetEmail() DefinedEmail() string GetFirst() SetFirst() DefinedFirst() string GetFamily() SetFamily() DefinedFamily() string GetGiven() SetGiven() DefinedGiven() string GetInstructions() SetInstructions() DefinedInstructions() string GetKey() SetKey() DefinedKey() string GetLast() SetLast() DefinedLast() string GetName() SetName() DefinedName() string GetNick() SetNick() DefinedNick() flag GetTruncated() SetTruncated() DefinedTruncated() master GetSearch() SetSearch() objects AddItem() objects GetItems()

Type Get Set Defined ======= ================ ================ ================== string GetEmail() SetEmail() DefinedEmail() string GetFirst() SetFirst() DefinedFirst() string GetFamily() SetFamily() DefinedFamily() string GetGiven() SetGiven() DefinedGiven() JID GetJID() SetJID() DefinedJID() string GetKey() SetKey() DefinedKey() string GetLast() SetLast() DefinedLast() string GetName() SetName() DefinedName() string GetNick() SetNick() DefinedNick() master GetSearch() SetSearch()

Type Get Set Defined ======= ================ ================ ================== special GetDisplay() SetDisplay() DefinedDisplay() special GetTZ() SetTZ() DefinedTZ() special GetUTC() SetUTC() DefinedUTC() master GetTime() SetTime()

Type Get Set Defined ======= ================ ================ ================== string GetName() SetName() DefinedName() special GetOS() SetOS() DefinedOS() special GetVer() SetVer() DefinedVer() master GetVersion() SetVersion()

Type Get Set Defined
======= ================ ================ ==================
string GetActivate() SetActivate() DefinedActivate()
string GetStreamHostUsedJID()
SetStreamHostUsedJID()
DefinedStreamHostUsedJID()
string GetSID() SetSID() DefinedSID()
objects AddStreamHost()
objects GetStreamHosts()
master GetByteStreams() SetByteStreams()

Type Get Set Defined ======= ================ ================ ================== string GetHost() SetHost() DefinedHost() string GetJID() SetJID() DefinedJID() string GetPort() SetPort() DefinedPort() string GetZeroConf() SetZeroConf() DefinedZeroConf() master GetStreamHost() SetStreamHost()

Type Get Set Defined ======= ================ ================ ================== string GetAction() SetAction() DefinedAction() string GetNode() SetNode() DefinedNode() string GetSessionID() SetSessionID() DefinedSessionID() objects AddNote() objects GetNotes() master GetCommand() SetCommand()

Type Get Set Defined ======= ================ ================ ================== string GetMessage() SetMessage() DefinedMessage() string GetType() SetType() DefinedType() master GetNote() SetNote()

Type Get Set Defined ======= ================ ================ ================== string GetNode() SetNode() DefinedNode() objects AddFeature() objects GetFeatures() objects AddIdentity() objects GetIdentities() master GetDiscoInfo() SetDiscoInfo()

Type Get Set Defined ======= ================ ================ ================== string GetVar() SetVar() DefinedVar() master GetFeature() SetFeature()

Type Get Set Defined ======= ================ ================ ================== string GetCategory() SetCategory() DefinedCategory() string GetName() SetName() DefinedName() string GetType() SetType() DefinedType() master GetIdentity() SetIdentity()

Type Get Set Defined ======= ================ ================ ================== string GetNode() SetNode() DefinedNode() objects AddItem() objects GetItems() master GetDiscoItems() SetDiscoItems()

Type Get Set Defined ======= ================ ================ ================== string GetAction() SetAction() DefinedAction() string GetJID() SetJID() DefinedJID() string GetName() SetName() DefinedName() string GetNode() SetNode() DefinedNode() master GetItem() SetItem()

Type Get Set Defined
======= ================ ================ ==================
This is just a wrapper for x:data to provide it with context.

Type Get Set Defined ======= ================ ================ ================== objects GetAffiliations() AddAffiliations() objects GetConfigure() AddConfigure() objects GetCreate() AddCreate() objects GetDelete() AddDelete() objects GetEntities() AddEntities() objects GetEntity() AddEntity() objects GetItems() AddItems() objects GetItem() AddItem() objects GetOptions() AddOptions() objects GetPublish() AddPublish() objects GetPurge() AddPurge() objects GetRetract() AddRetract() objects GetSubscribe() AddSubscribe() objects GetUnsubscribe() AddUnsubscribe()

Type Get Set Defined ======= ================ ================ ================== objects GetEntity() AddEntity()

Type Get Set Defined ======= ================ ================ ================== string GetNode() SetNode() DefinedNode() master GetConfigure() SetConfigure()

Type Get Set Defined ======= ================ ================ ================== string GetNode() SetNode() DefinedNode() master GetCreate() SetCreate()

Type Get Set Defined ======= ================ ================ ================== string GetNode() SetNode() DefinedNode() master GetDelete() SetDelete()

Type Get Set Defined
======= ================ ================ ==================
string GetAffiliation() SetAffiliation() DefinedAffiliation()
string GetJID() SetJID() DefinedJID()
string GetNode() SetNode() DefinedNode()
string GetSubscription() SetSubscription() DefinedSubscription()
objects GetSubscribeOptions()
AddSubscribeOptions()
master GetEntity() SetEntity()

Type Get Set Defined ======= ================ ================ ================== objects GetItem() AddItem() string GetMaxItems() SetMaxItems() DefinedMaxItems() string GetNode() SetNode() DefinedNode() master GetItems() SetItems()

Type Get Set Defined ======= ================ ================ ================== string GetID() SetID() DefinedID() raw GetPayload() SetPayload() DefinedPayload() master GetItem() SetItem()

Type Get Set Defined ======= ================ ================ ================== string GetJID() SetJID() DefinedJID() string GetNode() SetNode() DefinedNode() master GetOptions() SetOptions()

Type Get Set Defined ======= ================ ================ ================== objects GetItem() AddItem() string GetNode() SetNode() DefinedNode() master GetRetract() SetRetract()

Type Get Set Defined ======= ================ ================ ================== string GetNode() SetNode() DefinedNode() master GetPurge() SetPurge()

Type Get Set Defined ======= ================ ================ ================== objects GetItem() AddItem() string GetNode() SetNode() DefinedNode() master GetRetract() SetRetract()

Type Get Set Defined ======= ================ ================ ================== string GetJID() SetJID() DefinedJID() string GetNode() SetNode() DefinedNode() master GetSubscribe() SetSubscribe()

Type Get Set Defined
======= ================ ================ ==================
flag GetRequired() SetRequired() DefinedRequired()
master GetSubscribeOptions()
SetSubscriceOptions()

Type Get Set Defined ======= ================ ================ ================== string GetJID() SetJID() DefinedJID() string GetNode() SetNode() DefinedNode() master GetUnsubscribe() SetUnsubscribe()

Type Get Set Defined ======= ================ ================ ================== objects GetDelete() AddDelete() objects GetItems() AddItems()

Type Get Set Defined ======= ================ ================ ================== string GetNode() SetNode() DefinedNode() master GetDelete() SetDelete()

Type Get Set Defined ======= ================ ================ ================== objects GetItem() AddItem() string GetNode() SetNode() DefinedNode() objects GetRetract() AddRetract() master GetItems() SetItems()

Type Get Set Defined ======= ================ ================ ================== string GetID() SetID() DefinedID() raw GetPayload() SetPayload() DefinedPayload() master GetItem() SetItem()

Type Get Set Defined ======= ================ ================ ================== string GetID() SetID() DefinedID() master GetRetract() SetRetract()

Type Get Set Defined ======= ================ ================ ================== string GetAction() SetAction() DefinedAction() objects GetConfigure() AddConfigure() master GetOwner() SetOwner()

Type Get Set Defined ======= ================ ================ ================== string GetNode() SetNode() DefinedNode() master GetConfigure() SetConfigure()

Type Get Set Defined ======= ================ ================ ================== string GetID() SetID() DefinedID() string GetMimeType() SetMimeType() DefinedMimeType() string GetProfile() SetProfile() DefinedProfile() master GetStream() SetStream()

Type Get Set Defined ======= ================ ================ ================== string GetDate() SetDate() DefinedDate() string GetDesc() SetDesc() DefinedDesc() string GetHash() SetHash() DefinedHash() string GetName() SetName() DefinedName() string GetRange() SetRange() DefinedRange() string GetRangeOffset() SetRangeOffset() DefinedRangeOffset() string GetRangeLength() SetRangeLength() DefinedRangeLength() string GetSize() SetSize() DefinedSize() master GetFile() SetFile()

Type Get Set Defined ======= ================ ================ ================== raw GetPayload() SetPayload() DefinedPayload() master GetSoap() SetSoap()

Part of the flexability of this module is that you can define your own namespace. For more information on this topic, please read the Net::Jabber::Namespaces man page.

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

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