| 1 | # -*- cperl; cperl-indent-level: 4 -*- | ||
| 2 | package WWW::Wookie::Connector::Service::Interface; | ||
| 3 | 5 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 5 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 5 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 5 | ▶ | use 5.020000; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 5 | our $VERSION = 'v1.1.1'; | |
| 10 | |||
| 11 | 5 | ▶ | use Moose::Role qw/requires/; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | 5 | requires 'getAvailableServices'; | |
| 13 | 5 | requires 'getAvailableWidgets'; | |
| 14 | 5 | requires 'getConnection'; | |
| 15 | 5 | requires 'setUser'; | |
| 16 | 5 | requires 'getUser'; | |
| 17 | 5 | requires 'getOrCreateInstance'; | |
| 18 | 5 | requires 'addParticipant'; | |
| 19 | 5 | requires 'deleteParticipant'; | |
| 20 | 5 | requires 'getUsers'; | |
| 21 | 5 | requires 'addProperty'; | |
| 22 | 5 | requires 'setProperty'; | |
| 23 | 5 | requires 'getProperty'; | |
| 24 | 5 | requires 'deleteProperty'; | |
| 25 | 5 | requires 'setLocale'; | |
| 26 | 5 | requires 'getLocale'; | |
| 27 | 5 | requires 'getWidget'; | |
| 28 | |||
| 29 | 5 | 1; | |
| 30 | |||
| 31 | __END__ | ||
| 32 | |||
| 33 | =encoding utf8 | ||
| 34 | |||
| 35 | =for stopwords Wookie guid Ipenburg MERCHANTABILITY | ||
| 36 | |||
| 37 | =head1 NAME | ||
| 38 | |||
| 39 | WWW::Wookie::Connector::Service::Interface - Interface for | ||
| 40 | L<WWW::Wookie::Connector::Service|WWW::Wookie::Connector::Service> | ||
| 41 | |||
| 42 | =head1 VERSION | ||
| 43 | |||
| 44 | This document describes WWW::Wookie::Connector::Service::Interface version | ||
| 45 | v1.1.1 | ||
| 46 | |||
| 47 | =head1 SYNOPSIS | ||
| 48 | |||
| 49 | use Moose; | ||
| 50 | use Moose::Role; | ||
| 51 | with 'WWW::Wookie::Connector::Service::Interface'; | ||
| 52 | |||
| 53 | =head1 DESCRIPTION | ||
| 54 | |||
| 55 | =head1 SUBROUTINES/METHODS | ||
| 56 | |||
| 57 | =head2 C<getAvailableServices> | ||
| 58 | |||
| 59 | Get a all available service categories in the server. Returns an array of | ||
| 60 | L<WWWW::Wookie::Widget::Category|WW::Wookie::Widget::Category> objects. | ||
| 61 | Throws a C<WookieConnectorException>. | ||
| 62 | |||
| 63 | =head2 C<getAvailableWidgets> | ||
| 64 | |||
| 65 | Get all available widgets in the server, or only the available widgets in the | ||
| 66 | specified service category. Returns an array of | ||
| 67 | L<WWW::Wookie::Widget|WWW::Wookie::Widget> objects, otherwise false. Throws a | ||
| 68 | C<WookieConnectorException>. | ||
| 69 | |||
| 70 | =over | ||
| 71 | |||
| 72 | =item 1. Service category name as string | ||
| 73 | |||
| 74 | =back | ||
| 75 | |||
| 76 | =head2 C<getWidget> | ||
| 77 | |||
| 78 | Get the details of the widget specified by it's identifier. Returns a | ||
| 79 | L<WWW::Wookie::Widget|WWW::Wookie::Widget> object. | ||
| 80 | |||
| 81 | =over | ||
| 82 | |||
| 83 | =item 1. The identifier of an available widget | ||
| 84 | |||
| 85 | =back | ||
| 86 | |||
| 87 | =head2 C<getConnection> | ||
| 88 | |||
| 89 | Get the currently active connection to the Wookie server. Returns a | ||
| 90 | L<WWW::Wookie::Server::Connection|WWW::Wookie::Server::Connection> object. | ||
| 91 | |||
| 92 | =head2 C<setUser> | ||
| 93 | |||
| 94 | Set the current user. | ||
| 95 | |||
| 96 | =over | ||
| 97 | |||
| 98 | =item 1. User name for the current Wookie connection | ||
| 99 | |||
| 100 | =item 2. Screen name for the current Wookie connection | ||
| 101 | |||
| 102 | =back | ||
| 103 | |||
| 104 | =head2 C<getUser> | ||
| 105 | |||
| 106 | Retrieve the details of the current user. Returns an instance of the user as a | ||
| 107 | L<WWW::Wookie::User|WWW::Wookie::User> object. | ||
| 108 | |||
| 109 | =head2 C<getOrCreateInstance> | ||
| 110 | |||
| 111 | Get or create a new instance of a widget. The current user will be added as a | ||
| 112 | participant. Returns a | ||
| 113 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object if | ||
| 114 | successful, otherwise false. Throws a C<WookieConnectorException>. | ||
| 115 | |||
| 116 | =over | ||
| 117 | |||
| 118 | =item 1. Widget as guid string or a L<WWW::Wookie::Widget|WWW::Wookie::Widget> | ||
| 119 | object | ||
| 120 | |||
| 121 | =back | ||
| 122 | |||
| 123 | =head2 C<addParticipant> | ||
| 124 | |||
| 125 | Add a participant to a widget. Returns true if successful, otherwise false. | ||
| 126 | Throws a C<WookieWidgetInstanceException> or a C<WookieConnectorException>. | ||
| 127 | |||
| 128 | =over | ||
| 129 | |||
| 130 | =item 1. Instance of widget as | ||
| 131 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||
| 132 | |||
| 133 | =item 2. Instance of user as L<WWW::Wookie::User|WWW::Wookie::User> object | ||
| 134 | |||
| 135 | =back | ||
| 136 | |||
| 137 | =head2 C<deleteParticipant> | ||
| 138 | |||
| 139 | Delete a participant. Returns true if successful, otherwise false. Throws a | ||
| 140 | C<WookieWidgetInstanceException> or a C<WookieConnectorException>. | ||
| 141 | |||
| 142 | =over | ||
| 143 | |||
| 144 | =item 1. Instance of widget as | ||
| 145 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||
| 146 | |||
| 147 | =item 2. Instance of user as L<WWW::Wookie::User|WWW::Wookie::User> object | ||
| 148 | |||
| 149 | =back | ||
| 150 | |||
| 151 | =head2 C<getUsers> | ||
| 152 | |||
| 153 | Get all participants of the current widget. Returns an array of | ||
| 154 | L<WWW::Wookie::User|WWW::Wookie::User> instances. Throws a | ||
| 155 | C<WookieConnectorException>. | ||
| 156 | |||
| 157 | =over | ||
| 158 | |||
| 159 | =item 1. Instance of widget as | ||
| 160 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||
| 161 | |||
| 162 | =back | ||
| 163 | |||
| 164 | =head2 C<addProperty> | ||
| 165 | |||
| 166 | Adds a new property. Returns true if successful, otherwise false. Throws a | ||
| 167 | C<WookieConnectorException>. | ||
| 168 | |||
| 169 | =over | ||
| 170 | |||
| 171 | =item 1. Instance of widget as | ||
| 172 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||
| 173 | |||
| 174 | =item 2. Instance of property as | ||
| 175 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> object | ||
| 176 | |||
| 177 | =back | ||
| 178 | |||
| 179 | =head2 C<setProperty> | ||
| 180 | |||
| 181 | Set a new property. Returns the property as | ||
| 182 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> if successful, | ||
| 183 | otherwise false. Throws a C<WookieWidgetInstanceException> or a | ||
| 184 | C<WookieConnectorException>. | ||
| 185 | |||
| 186 | =over | ||
| 187 | |||
| 188 | =item 1. Instance of widget as | ||
| 189 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||
| 190 | |||
| 191 | =item 2. Instance of property as | ||
| 192 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> object | ||
| 193 | |||
| 194 | =back | ||
| 195 | |||
| 196 | =head2 C<getProperty> | ||
| 197 | |||
| 198 | Get a property. Returns the property as | ||
| 199 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> if successful, | ||
| 200 | otherwise false. Throws a C<WookieWidgetInstanceException> or a | ||
| 201 | C<WookieConnectorException>. | ||
| 202 | |||
| 203 | =over | ||
| 204 | |||
| 205 | =item 1. Instance of widget as | ||
| 206 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||
| 207 | |||
| 208 | =item 2. Instance of property as | ||
| 209 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> object | ||
| 210 | |||
| 211 | =back | ||
| 212 | |||
| 213 | =head2 C<deleteProperty> | ||
| 214 | |||
| 215 | Delete a property. Returns true if successful, otherwise false. Throws a | ||
| 216 | C<WookieWidgetInstanceException> or a C<WookieConnectorException>. | ||
| 217 | |||
| 218 | =over | ||
| 219 | |||
| 220 | =item 1. Instance of widget as | ||
| 221 | L<WWW::Wookie::Widget::Instance|WWW::Wookie::Widget::Instance> object | ||
| 222 | |||
| 223 | =item 2. Instance of property as | ||
| 224 | L<WWW::Wookie::Widget::Property|WWW::Wookie::Widget::Property> object | ||
| 225 | |||
| 226 | =back | ||
| 227 | |||
| 228 | =head2 C<setLocale> | ||
| 229 | |||
| 230 | Set a locale. | ||
| 231 | |||
| 232 | =over | ||
| 233 | |||
| 234 | =item 1. Locale as string | ||
| 235 | |||
| 236 | =back | ||
| 237 | |||
| 238 | =head2 C<getLocale> | ||
| 239 | |||
| 240 | Get the current locale setting. Returns current locale as string. | ||
| 241 | |||
| 242 | =head1 CONFIGURATION AND ENVIRONMENT | ||
| 243 | |||
| 244 | =head1 DEPENDENCIES | ||
| 245 | |||
| 246 | L<Moose::Role|Moose::Role> | ||
| 247 | |||
| 248 | =head1 INCOMPATIBILITIES | ||
| 249 | |||
| 250 | =head1 DIAGNOSTICS | ||
| 251 | |||
| 252 | =head1 BUGS AND LIMITATIONS | ||
| 253 | |||
| 254 | Please report any bugs or feature requests at L<RT for | ||
| 255 | rt.cpan.org|https://rt.cpan.org/Dist/Display.html?Queue=WWW-Wookie>. | ||
| 256 | |||
| 257 | =head1 AUTHOR | ||
| 258 | |||
| 259 | Roland van Ipenburg, E<lt>ipenburg@xs4all.nlE<gt> | ||
| 260 | |||
| 261 | =head1 LICENSE AND COPYRIGHT | ||
| 262 | |||
| 263 | Copyright 2017 by Roland van Ipenburg | ||
| 264 | |||
| 265 | This library is free software; you can redistribute it and/or modify | ||
| 266 | it under the same terms as Perl itself, either Perl version 5.14.0 or, | ||
| 267 | at your option, any later version of Perl 5 you may have available. | ||
| 268 | |||
| 269 | =head1 DISCLAIMER OF WARRANTY | ||
| 270 | |||
| 271 | BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY | ||
| 272 | FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN | ||
| 273 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES | ||
| 274 | PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER | ||
| 275 | EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
| 276 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE | ||
| 277 | ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH | ||
| 278 | YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL | ||
| 279 | NECESSARY SERVICING, REPAIR, OR CORRECTION. | ||
| 280 | |||
| 281 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING | ||
| 282 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR | ||
| 283 | REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENSE, BE | ||
| 284 | LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, | ||
| 285 | OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE | ||
| 286 | THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING | ||
| 287 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A | ||
| 288 | FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF | ||
| 289 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF | ||
| 290 | SUCH DAMAGES. | ||
| 291 | |||
| 292 | =cut | ||