author | Michael Krelin <hacker@klever.net> | 2008-02-12 23:37:05 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-02-12 23:37:05 (UTC) |
commit | 2048be862b8619ddec90163af05e6472bf5175e4 (patch) (unidiff) | |
tree | 74ab3384a2a088abe5748ab93cd2f65fa121e1ae /include/opkele/discovery.h | |
parent | a3eba4c33fee80fcf152dcbd198586e12b687e54 (diff) | |
download | libopkele-2048be862b8619ddec90163af05e6472bf5175e4.zip libopkele-2048be862b8619ddec90163af05e6472bf5175e4.tar.gz libopkele-2048be862b8619ddec90163af05e6472bf5175e4.tar.bz2 |
slight api improvement to ease caching of discovery information
* added opend_endpoint_output_iterator to types.h
* changed endpoint_discovery_iterator to the aforementioned iterator typedef
* added discover() virtual to prequeue_RP and made use thereof.
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | include/opkele/discovery.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/opkele/discovery.h b/include/opkele/discovery.h index 4471597..f2721a6 100644 --- a/include/opkele/discovery.h +++ b/include/opkele/discovery.h | |||
@@ -56,60 +56,59 @@ namespace opkele { | |||
56 | uris.clear(); local_ids.clear(); | 56 | uris.clear(); local_ids.clear(); |
57 | provider_id.clear(); | 57 | provider_id.clear(); |
58 | } | 58 | } |
59 | }; | 59 | }; |
60 | typedef priority_map<service_t> services_t; | 60 | typedef priority_map<service_t> services_t; |
61 | 61 | ||
62 | class XRD_t { | 62 | class XRD_t { |
63 | public: | 63 | public: |
64 | time_t expires; | 64 | time_t expires; |
65 | 65 | ||
66 | canonical_ids_t canonical_ids; | 66 | canonical_ids_t canonical_ids; |
67 | local_ids_t local_ids; | 67 | local_ids_t local_ids; |
68 | services_t services; | 68 | services_t services; |
69 | string provider_id; | 69 | string provider_id; |
70 | 70 | ||
71 | void clear() { | 71 | void clear() { |
72 | expires = 0; | 72 | expires = 0; |
73 | canonical_ids.clear(); local_ids.clear(); | 73 | canonical_ids.clear(); local_ids.clear(); |
74 | services.clear(); | 74 | services.clear(); |
75 | provider_id.clear(); | 75 | provider_id.clear(); |
76 | } | 76 | } |
77 | bool empty() const { | 77 | bool empty() const { |
78 | return | 78 | return |
79 | canonical_ids.empty() | 79 | canonical_ids.empty() |
80 | && local_ids.empty() | 80 | && local_ids.empty() |
81 | && services.empty(); | 81 | && services.empty(); |
82 | } | 82 | } |
83 | 83 | ||
84 | }; | 84 | }; |
85 | 85 | ||
86 | } | 86 | } |
87 | 87 | ||
88 | typedef util::output_iterator_proxy<openid_endpoint_t> | 88 | typedef openid_endpoint_output_iterator endpoint_discovery_iterator; |
89 | endpoint_discovery_iterator; | ||
90 | 89 | ||
91 | string idiscover( | 90 | string idiscover( |
92 | endpoint_discovery_iterator oi, | 91 | endpoint_discovery_iterator oi, |
93 | const string& identity); | 92 | const string& identity); |
94 | void yadiscover( | 93 | void yadiscover( |
95 | endpoint_discovery_iterator oi, | 94 | endpoint_discovery_iterator oi, |
96 | const string& yurl, | 95 | const string& yurl, |
97 | const char **types, bool redirs=false); | 96 | const char **types, bool redirs=false); |
98 | 97 | ||
99 | struct idiscovery_t { | 98 | struct idiscovery_t { |
100 | bool xri_identity; | 99 | bool xri_identity; |
101 | string normalized_id; | 100 | string normalized_id; |
102 | string canonicalized_id; | 101 | string canonicalized_id; |
103 | xrd::XRD_t xrd; | 102 | xrd::XRD_t xrd; |
104 | 103 | ||
105 | idiscovery_t() { } | 104 | idiscovery_t() { } |
106 | 105 | ||
107 | void clear() { | 106 | void clear() { |
108 | normalized_id.clear(); canonicalized_id.clear(); | 107 | normalized_id.clear(); canonicalized_id.clear(); |
109 | xrd.clear(); | 108 | xrd.clear(); |
110 | } | 109 | } |
111 | 110 | ||
112 | }; | 111 | }; |
113 | } | 112 | } |
114 | 113 | ||
115 | #endif /* __OPKELE_DISCOVERY_H */ | 114 | #endif /* __OPKELE_DISCOVERY_H */ |