File Coverage

blib/lib/WWW/Wookie/Connector/Service/Interface.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 19 19 100.0


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