-
Notifications
You must be signed in to change notification settings - Fork 2
/
XMPPServiceDiscovery.h
77 lines (74 loc) · 2.53 KB
/
XMPPServiceDiscovery.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//
// XMPPServiceDiscovery.h
// Jabber
//
// Created by David Chisnall on 18/02/2005.
// Copyright 2005 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "XMPPDispatcher.h"
#import "XMPPDiscoInfo.h"
#import "XMPPDiscoItems.h"
@class XMPPAccount;
@class XMPPConnection;
/**
* Service discovery handler class. Handles XEP-0030 service discovery and
* caching via XEP-0115 entity capabilities.
*/
@interface XMPPServiceDiscovery : NSObject <XMPPInfoQueryStanzaHandler> {
XMPPConnection * connection;
XMPPDispatcher * dispatcher;
NSMutableDictionary * features;
NSMutableDictionary * children;
NSMutableDictionary * knownNodes;
NSMutableDictionary * capabilitiesPerJID;
NSMutableDictionary * featuresForCapabilities;
NSMutableSet * myFeatures;
XMPPDiscoInfo * info;
XMPPDiscoItems * items;
}
- (XMPPServiceDiscovery*) initWithAccount:(XMPPAccount*)account;
/**
* Sets XEP-00115 entitiy capabilities for a specified JID.
*/
- (void) setCapabilities:(NSString*)caps forJID:(JID*)aJid;
/**
* Returns the identities associated with a given JID/node combination.
* Returns nil if they have not been retrieved yet. A DiscoFeaturesFound
* notification will be posted when they have been with the jid field of the
* userinfo dictionary set to the
* JID.
*/
- (NSArray*) identitiesForJID:(JID*)aJid node:(NSString*)aNode;
/**
* Returns the features associated with a given JID/node combination. Returns
* nil if they have not been retrieved yet. A DiscoFeaturesFound notification
* will be posted when they have been with the jid field of the userinfo
* dictionary set to the
* JID.
*/
- (NSArray*) featuresForJID:(JID*)aJid node:(NSString*)aNode;
/**
* Returns the items associated with a given JID/node combination. Returns nil
* if they have not been retrieved yet. A DiscoItemsFound notification will be
* posted when they have been with the jid field of the userinfo dictionary set
* to the JID.
*/
- (NSArray*) itemsForJID:(JID*)aJid node:(NSString*)aNode;
/**
* Adds a feature to the list this client advertises.
*/
- (void) addFeature:(NSString*)aFeature;
/**
* Returns the info ivar, instantiated after a service discovery for disco#info namespace
*/
- (XMPPDiscoInfo*) info;
/**
* Returns the item ivar, instantiated after a service discovery for dico#item namespace
*/
- (XMPPDiscoItems*) items;
/**
* Sends a query to the specified Jid for the specified namespace; disco#info or disco#items
*/
- (void) sendQueryToJID:(const NSString*)jid node:(const NSString*)node inNamespace:(const NSString*)xmlns;
@end