001    //$HeadURL: svn+ssh://jwilden@svn.wald.intevation.org/deegree/base/branches/2.5_testing/src/org/deegree/security/drm/SecurityRegistry.java $
002    /*----------------------------------------------------------------------------
003     This file is part of deegree, http://deegree.org/
004     Copyright (C) 2001-2009 by:
005     Department of Geography, University of Bonn
006     and
007     lat/lon GmbH
008    
009     This library is free software; you can redistribute it and/or modify it under
010     the terms of the GNU Lesser General Public License as published by the Free
011     Software Foundation; either version 2.1 of the License, or (at your option)
012     any later version.
013     This library is distributed in the hope that it will be useful, but WITHOUT
014     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
015     FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
016     details.
017     You should have received a copy of the GNU Lesser General Public License
018     along with this library; if not, write to the Free Software Foundation, Inc.,
019     59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020    
021     Contact information:
022    
023     lat/lon GmbH
024     Aennchenstr. 19, 53177 Bonn
025     Germany
026     http://lat-lon.de/
027    
028     Department of Geography, University of Bonn
029     Prof. Dr. Klaus Greve
030     Postfach 1147, 53001 Bonn
031     Germany
032     http://www.geographie.uni-bonn.de/deegree/
033    
034     e-mail: info@deegree.org
035     ----------------------------------------------------------------------------*/
036    package org.deegree.security.drm;
037    
038    import java.util.Collection;
039    import java.util.LinkedList;
040    import java.util.List;
041    import java.util.Properties;
042    
043    import org.deegree.framework.util.StringPair;
044    import org.deegree.security.GeneralSecurityException;
045    import org.deegree.security.drm.model.Group;
046    import org.deegree.security.drm.model.Privilege;
047    import org.deegree.security.drm.model.Right;
048    import org.deegree.security.drm.model.RightType;
049    import org.deegree.security.drm.model.Role;
050    import org.deegree.security.drm.model.SecurableObject;
051    import org.deegree.security.drm.model.SecuredObject;
052    import org.deegree.security.drm.model.Service;
053    import org.deegree.security.drm.model.User;
054    
055    /**
056     * This is an interface for datastores that are able to stores the following object types and their relations:
057     * <ul>
058     * <li><code>User</code>
059     * <li><code>Group</code>
060     * <li><code>Role</code>
061     * <li><code>SecurableObject</code>
062     * <li><code>Right / RightType</code>
063     * <li><code>Privilege</code>
064     * </ul>
065     * 
066     * @author <a href="mailto:mschneider@lat-lon.de">Markus Schneider </a>
067     * @version $Revision: 25490 $
068     */
069    public interface SecurityRegistry {
070    
071        /**
072         * Initializes the <code>Registry</code> -instance according to the contents of the submitted
073         * <code>Properties</code>.
074         * <p>
075         * The supported keys and values depend on the concrete implementation.
076         * 
077         * @param properties
078         * @throws GeneralSecurityException
079         */
080        void initialize( Properties properties )
081                                throws GeneralSecurityException;
082    
083        /**
084         * Signals the <code>Registry</code> that a new transaction starts.
085         * <p>
086         * Only one transaction can be active at a time.
087         * 
088         * @param transaction
089         * 
090         * @throws GeneralSecurityException
091         */
092        void beginTransaction( SecurityTransaction transaction )
093                                throws GeneralSecurityException;
094    
095        /**
096         * Signals the <code>Registry</code> that the current transaction ends. Changes made during the transaction are now
097         * made persistent.
098         * 
099         * @param transaction
100         * 
101         * @throws GeneralSecurityException
102         */
103        void commitTransaction( SecurityTransaction transaction )
104                                throws GeneralSecurityException;
105    
106        /**
107         * Signals the <code>Registry</code> that the transaction shall be aborted. Changes made by the transaction are
108         * undone.
109         * 
110         * @param transaction
111         * 
112         * @throws GeneralSecurityException
113         */
114        void abortTransaction( SecurityTransaction transaction )
115                                throws GeneralSecurityException;
116    
117        /**
118         * Deletes all data from the <code>Registry</code> and sets the default objects (SEC_ADMIN user, role and group) and
119         * standard rights and privileges.
120         * 
121         * @param transaction
122         * @throws GeneralSecurityException
123         */
124        void clean( SecurityTransaction transaction )
125                                throws GeneralSecurityException;
126    
127        /**
128         * Adds a new User-account to the <code>Registry</code>.
129         * 
130         * @param transaction
131         * @param name
132         * @param password
133         * @param lastName
134         * @param firstName
135         * @param mailAddress
136         * @return the new user
137         * 
138         * @throws GeneralSecurityException
139         *             this is a <code>DuplicateException</code> if the group already existed
140         */
141        User registerUser( SecurityTransaction transaction, String name, String password, String lastName,
142                           String firstName, String mailAddress )
143                                throws GeneralSecurityException;
144    
145        /**
146         * Removes an existing <code>User<code> from the <code>Registry</code>.
147         * 
148         * @param transaction
149         * @param user
150         * 
151         * @throws GeneralSecurityException
152         */
153        void deregisterUser( SecurityTransaction transaction, User user )
154                                throws GeneralSecurityException;
155    
156        /**
157         * Updates the metadata (name, email, etc.) of a <code>User</code> in the <code>Registry</code>.
158         * 
159         * @param transaction
160         * @param user
161         * 
162         * @throws GeneralSecurityException
163         *             this is a <code>DuplicateException</code> if a user with the new name already existed
164         */
165        void updateUser( SecurityTransaction transaction, User user )
166                                throws GeneralSecurityException;
167    
168        /**
169         * Retrieves a <code>User</code> from the <code>Registry</code>.
170         * 
171         * @param securityAccess
172         * @param name
173         * @return the user
174         * 
175         * @throws GeneralSecurityException
176         *             this is an <code>UnknownException</code> if the user is not known to the <code>Registry</code>
177         */
178        User getUserByName( SecurityAccess securityAccess, String name )
179                                throws GeneralSecurityException;
180    
181        /**
182         * Retrieves a <code>User</code> from the <code>Registry</code>.
183         * 
184         * @param securityAccess
185         * @param id
186         * @return the user
187         * 
188         * @throws GeneralSecurityException
189         *             this is an <code>UnknownException</code> if the user is not known to the <code>Registry</code>
190         */
191        User getUserById( SecurityAccess securityAccess, int id )
192                                throws GeneralSecurityException;
193    
194        /**
195         * Retrieves all <code>User</code> s from the <code>Registry</code>.
196         * 
197         * @param securityAccess
198         * @return the users
199         * 
200         * @throws GeneralSecurityException
201         */
202        User[] getAllUsers( SecurityAccess securityAccess )
203                                throws GeneralSecurityException;
204    
205        /**
206         * Retrieves all <code>Users</code> s from the <code>Registry</code> that are associated DIRECTLY (SecurityAccess
207         * securityAccess, i.e. not via group memberships) with a given <code>Role</code>.
208         * 
209         * @param securityAccess
210         * @param role
211         * @return the users
212         * 
213         * @throws GeneralSecurityException
214         */
215        User[] getUsersWithRole( SecurityAccess securityAccess, Role role )
216                                throws GeneralSecurityException;
217    
218        /**
219         * Retrieves all <code>User</code> s from the <code>Registry</code> belong to the given <code>Group</code>.
220         * 
221         * @param securityAccess
222         * @param group
223         * @return the users
224         * 
225         * @throws GeneralSecurityException
226         */
227        User[] getUsersInGroup( SecurityAccess securityAccess, Group group )
228                                throws GeneralSecurityException;
229    
230        /**
231         * Sets the <code>User</code> s that are members of a given <code>Group</code>.
232         * 
233         * @param transaction
234         * @param group
235         * @param users
236         * 
237         * @throws GeneralSecurityException
238         */
239        void setUsersInGroup( SecurityTransaction transaction, Group group, User[] users )
240                                throws GeneralSecurityException;
241    
242        /**
243         * Sets the <code>User</code> s that a given <code>Role</code> is associated to.
244         * 
245         * @param transaction
246         * @param role
247         * @param users
248         * 
249         * @throws GeneralSecurityException
250         */
251        void setUsersWithRole( SecurityTransaction transaction, Role role, User[] users )
252                                throws GeneralSecurityException;
253    
254        /**
255         * Adds a new Group-account to the <code>Registry</code>.
256         * 
257         * @param transaction
258         * @param name
259         * @param title
260         * @return the group
261         * 
262         * @throws GeneralSecurityException
263         *             this is a <code>DuplicateException</code> if the group already existed
264         */
265        Group registerGroup( SecurityTransaction transaction, String name, String title )
266                                throws GeneralSecurityException;
267    
268        /**
269         * Removes an existing <code>Group</code> from the <code>Registry</code> (including its relations).
270         * 
271         * @param transaction
272         * @param group
273         * 
274         * @throws GeneralSecurityException
275         */
276        void deregisterGroup( SecurityTransaction transaction, Group group )
277                                throws GeneralSecurityException;
278    
279        /**
280         * Retrieves a <code>Group</code> from the <code>Registry</code>.
281         * 
282         * @param securityAccess
283         * @param name
284         * @return the group
285         * 
286         * @throws GeneralSecurityException
287         *             this is an <code>UnknownException</code> if the group is not known to the <code>Registry</code>
288         */
289        Group getGroupByName( SecurityAccess securityAccess, String name )
290                                throws GeneralSecurityException;
291    
292        /**
293         * Retrieves a <code>Group</code> from the <code>Registry</code>.
294         * 
295         * @param securityAccess
296         * @param id
297         * @return the group
298         * 
299         * @throws GeneralSecurityException
300         *             this is an <code>UnknownException</code> if the group is not known to the <code>Registry</code>
301         */
302        Group getGroupById( SecurityAccess securityAccess, int id )
303                                throws GeneralSecurityException;
304    
305        /**
306         * Retrieves all <code>Group</code> s from the <code>Registry</code>.
307         * 
308         * @param securityAccess
309         * @return the groups
310         * 
311         * @throws GeneralSecurityException
312         */
313        Group[] getAllGroups( SecurityAccess securityAccess )
314                                throws GeneralSecurityException;
315    
316        /**
317         * Retrieves all <code>Group</code> s from the <code>Registry</code> that the given <code>User</code> belongs to.
318         * 
319         * @param securityAccess
320         * @param user
321         * @return the groups
322         * 
323         * @throws GeneralSecurityException
324         */
325        Group[] getGroupsForUser( SecurityAccess securityAccess, User user )
326                                throws GeneralSecurityException;
327    
328        /**
329         * Retrieves all <code>Group</code> s from the <code>Registry</code> that the given <code>Group</code> belongs to.
330         * 
331         * @param securityAccess
332         * @param group
333         * @return the groups
334         * 
335         * @throws GeneralSecurityException
336         */
337        Group[] getGroupsForGroup( SecurityAccess securityAccess, Group group )
338                                throws GeneralSecurityException;
339    
340        /**
341         * Retrieves all <code>Group</code> s from the <code>Registry</code> belong to the given <code>Group</code>.
342         * 
343         * @param securityAccess
344         * @param group
345         * @return the groups
346         * 
347         * @throws GeneralSecurityException
348         */
349        Group[] getGroupsInGroup( SecurityAccess securityAccess, Group group )
350                                throws GeneralSecurityException;
351    
352        /**
353         * Retrieves all <code>Group</code> s from the <code>Registry</code> that are associated with a given
354         * <code>Role</code>.
355         * 
356         * @param securityAccess
357         * @param role
358         * @return the groups
359         * 
360         * @throws GeneralSecurityException
361         */
362        Group[] getGroupsWithRole( SecurityAccess securityAccess, Role role )
363                                throws GeneralSecurityException;
364    
365        /**
366         * Sets the <code>Group</code> s that a given <code>User</code> is a DIRECT member of.
367         * 
368         * @param transaction
369         * @param user
370         * @param groups
371         * 
372         * @throws GeneralSecurityException
373         */
374        void setGroupsForUser( SecurityTransaction transaction, User user, Group[] groups )
375                                throws GeneralSecurityException;
376    
377        /**
378         * Sets the <code>Groups</code> s that are members of a given <code>Group</code>.
379         * 
380         * @param transaction
381         * @param group
382         * @param groups
383         * 
384         * @throws GeneralSecurityException
385         */
386        void setGroupsInGroup( SecurityTransaction transaction, Group group, Group[] groups )
387                                throws GeneralSecurityException;
388    
389        /**
390         * Sets the <code>Group</code> s that a given <code>Role</code> is associated to.
391         * 
392         * @param transaction
393         * @param role
394         * @param groups
395         * 
396         * @throws GeneralSecurityException
397         */
398        void setGroupsWithRole( SecurityTransaction transaction, Role role, Group[] groups )
399                                throws GeneralSecurityException;
400    
401        /**
402         * Sets the <code>Groups</code> s that a given <code>Group</code> is member of DIRECTLY (i.e. not via group
403         * membership).
404         * 
405         * @param transaction
406         * @param group
407         * @param groups
408         * 
409         * @throws GeneralSecurityException
410         */
411        void setGroupsForGroup( SecurityTransaction transaction, Group group, Group[] groups )
412                                throws GeneralSecurityException;
413    
414        /**
415         * Adds a new role to the <code>Registry</code>.
416         * 
417         * @param transaction
418         * @param name
419         * @return the role
420         * 
421         * @throws GeneralSecurityException
422         *             this is a <code>DuplicateException</code> if the role already existed
423         */
424        Role registerRole( SecurityTransaction transaction, String name )
425                                throws GeneralSecurityException;
426    
427        /**
428         * Removes an existing <code>Role</code> from the <code>Registry</code> (including its relations).
429         * 
430         * @param transaction
431         * @param role
432         * 
433         * @throws GeneralSecurityException
434         */
435        void deregisterRole( SecurityTransaction transaction, Role role )
436                                throws GeneralSecurityException;
437    
438        /**
439         * Retrieves a <code>Role</code> from the <code>Registry</code>.
440         * 
441         * @param securityAccess
442         * @param name
443         * @return the role
444         * 
445         * @throws GeneralSecurityException
446         *             this is an <code>UnknownException</code> if the role is not known to the <code>Registry</code>
447         */
448        Role getRoleByName( SecurityAccess securityAccess, String name )
449                                throws GeneralSecurityException;
450    
451        /**
452         * Retrieves all <code>Role</code> s from the <code>Registry</code> that have a certain namespace.
453         * 
454         * @param securityAccess
455         * @param ns
456         * @return the roles
457         * 
458         * @throws GeneralSecurityException
459         */
460        Role[] getRolesByNS( SecurityAccess securityAccess, String ns )
461                                throws GeneralSecurityException;
462    
463        /**
464         * Retrieves a <code>Role</code> from the <code>Registry</code>.
465         * 
466         * @param securityAccess
467         * @param id
468         * @return the role
469         * 
470         * @throws GeneralSecurityException
471         *             this is an <code>UnknownException</code> if the role is not known to the <code>Registry</code>
472         */
473        Role getRoleById( SecurityAccess securityAccess, int id )
474                                throws GeneralSecurityException;
475    
476        /**
477         * Retrieves all <code>Role</code> s from the <code>Registry</code>, except those that are only used internally
478         * (these end with a $ symbol);
479         * 
480         * @param securityAccess
481         * @return the roles
482         * 
483         * @throws GeneralSecurityException
484         */
485        Role[] getAllRoles( SecurityAccess securityAccess )
486                                throws GeneralSecurityException;
487    
488        /**
489         * Retrieves all <code>Role</code> s from the <code>Registry</code> that are associated with a given
490         * <code>User</code> DIRECTLY (i.e. not via group memberships).
491         * 
492         * @param securityAccess
493         * @param user
494         * @return the roles
495         * 
496         * @throws GeneralSecurityException
497         */
498        Role[] getRolesForUser( SecurityAccess securityAccess, User user )
499                                throws GeneralSecurityException;
500    
501        /**
502         * Retrieves all <code>Role</code> s from the <code>Registry</code> that are associated with a given
503         * <code>Group</code> DIRECTLY (i.e. not via group memberships).
504         * 
505         * @param securityAccess
506         * @param group
507         * @return the roles
508         * 
509         * @throws GeneralSecurityException
510         */
511        Role[] getRolesForGroup( SecurityAccess securityAccess, Group group )
512                                throws GeneralSecurityException;
513    
514        /**
515         * Sets the <code>Role</code> s that a given <code>User</code> is directly associated to.
516         * 
517         * @param transaction
518         * @param user
519         * @param roles
520         * 
521         * @throws GeneralSecurityException
522         */
523        void setRolesForUser( SecurityTransaction transaction, User user, Role[] roles )
524                                throws GeneralSecurityException;
525    
526        /**
527         * Sets the <code>Role</code> s that a given <code>Group</code> is associated to.
528         * 
529         * @param transaction
530         * @param group
531         * @param roles
532         * 
533         * @throws GeneralSecurityException
534         */
535        void setRolesForGroup( SecurityTransaction transaction, Group group, Role[] roles )
536                                throws GeneralSecurityException;
537    
538        /**
539         * Adds a new <code>SecuredObject</code> to the <code>Registry</code>.
540         * 
541         * @param transaction
542         * @param type
543         * @param name
544         * @param title
545         * @return the new object
546         * 
547         * @throws GeneralSecurityException
548         *             this is a <code>DuplicateException</code> if the object already existed
549         */
550        SecuredObject registerSecuredObject( SecurityTransaction transaction, String type, String name, String title )
551                                throws GeneralSecurityException;
552    
553        /**
554         * Removes an existing <code>SecuredObject</code> from the <code>Registry</code> (including its associated rights).
555         * 
556         * @param transaction
557         * @param object
558         * 
559         * @throws GeneralSecurityException
560         */
561        void deregisterSecuredObject( SecurityTransaction transaction, SecuredObject object )
562                                throws GeneralSecurityException;
563    
564        /**
565         * Retrieves a <code>SecuredObject</code> from the <code>Registry</code>.
566         * 
567         * @param securityAccess
568         * @param name
569         * @param type
570         * @return the object
571         * 
572         * @throws GeneralSecurityException
573         *             this is an <code>UnknownException</code> if the <code>SecuredObject</code> is not known to the
574         *             <code>Registry</code>
575         */
576        SecuredObject getSecuredObjectByName( SecurityAccess securityAccess, String name, String type )
577                                throws GeneralSecurityException;
578    
579        /**
580         * Retrieves all <code>SecuredObject</code> s from the <code>Registry</code> that have a certain namespace.
581         * 
582         * @param securityAccess
583         * @param ns
584         * @param type
585         * @return the objects
586         * 
587         * @throws GeneralSecurityException
588         */
589        SecuredObject[] getSecuredObjectsByNS( SecurityAccess securityAccess, String ns, String type )
590                                throws GeneralSecurityException;
591    
592        /**
593         * Retrieves a <code>SecuredObject</code> from the <code>Registry</code>.
594         * 
595         * @param securityAccess
596         * @param id
597         * @return the object
598         * 
599         * @throws GeneralSecurityException
600         *             this is an <code>UnknownException</code> if the <code>SecuredObject</code> is not known to the
601         *             <code>Registry</code>
602         */
603        SecuredObject getSecuredObjectById( SecurityAccess securityAccess, int id )
604                                throws GeneralSecurityException;
605    
606        /**
607         * Retrieves all <code>SecuredObject</code> s from the <code>Registry</code>.
608         * 
609         * @param securityAccess
610         * @param type
611         * @return the objects
612         * 
613         * @throws GeneralSecurityException
614         */
615        SecuredObject[] getAllSecuredObjects( SecurityAccess securityAccess, String type )
616                                throws GeneralSecurityException;
617    
618        /**
619         * Adds a new <code>Privilege</code> to the <code>Registry</code>.
620         * 
621         * @param transaction
622         * @param name
623         * @return the privilege
624         * 
625         * @throws GeneralSecurityException
626         *             this is a <code>DuplicateException</code> if the <code>Privilege</code> already existed
627         */
628        Privilege registerPrivilege( SecurityTransaction transaction, String name )
629                                throws GeneralSecurityException;
630    
631        /**
632         * Removes an existing</code> Privilege</code> from the <code>Registry </code> (including its relations).
633         * 
634         * @param transaction
635         * @param privilege
636         * 
637         * @throws GeneralSecurityException
638         */
639        void deregisterPrivilege( SecurityTransaction transaction, Privilege privilege )
640                                throws GeneralSecurityException;
641    
642        /**
643         * Retrieves a <code>Privilege</code> from the <code>Registry</code>.
644         * 
645         * @param securityAccess
646         * @param name
647         * @return the privilege
648         * 
649         * @throws GeneralSecurityException
650         *             this is an <code>UnknownException</code> if the privilege is not known to the <code>Registry</code>
651         */
652        Privilege getPrivilegeByName( SecurityAccess securityAccess, String name )
653                                throws GeneralSecurityException;
654    
655        /**
656         * Retrieves all <code>Privileges</code> s from the <code>Registry</code> that are associated with a given
657         * <code>Role</code>.
658         * 
659         * @param securityAccess
660         * @param role
661         * @return the privileges
662         * 
663         * @throws GeneralSecurityException
664         */
665        Privilege[] getPrivilegesForRole( SecurityAccess securityAccess, Role role )
666                                throws GeneralSecurityException;
667    
668        /**
669         * Sets all <code>Privilege</code> s that are associated with a given <code>Role</code>.
670         * 
671         * @param transaction
672         * @param role
673         * @param privileges
674         * 
675         * @throws GeneralSecurityException
676         */
677        void setPrivilegesForRole( SecurityTransaction transaction, Role role, Privilege[] privileges )
678                                throws GeneralSecurityException;
679    
680        /**
681         * Adds a new <code>RightType</code> to the <code>Registry</code>.
682         * 
683         * @param transaction
684         * @param name
685         * @return the right type
686         * 
687         * @throws GeneralSecurityException
688         *             this is a <code>DuplicateException</code> if the <code>RightType</code> already existed
689         */
690        RightType registerRightType( SecurityTransaction transaction, String name )
691                                throws GeneralSecurityException;
692    
693        /**
694         * Removes an existing <code>RightType</code> from the <code>Registry</code> (including its relations).
695         * 
696         * @param transaction
697         * @param type
698         * 
699         * @throws GeneralSecurityException
700         */
701        void deregisterRightType( SecurityTransaction transaction, RightType type )
702                                throws GeneralSecurityException;
703    
704        /**
705         * Retrieves a <code>RightType</code> from the <code>Registry</code>.
706         * 
707         * @param securityAccess
708         * @param name
709         * @return the right type
710         * 
711         * @throws GeneralSecurityException
712         *             this is an <code>UnknownException</code> if the <code>RightType</code> is not known to the
713         *             <code>Registry</code>
714         */
715        RightType getRightTypeByName( SecurityAccess securityAccess, String name )
716                                throws GeneralSecurityException;
717    
718        /**
719         * Retrieves the <code>Rights</code> from the <code>Registry</code> that are associated with a given
720         * <code>Role</code> and a <code>SecurableObject</code>.
721         * 
722         * @param securityAccess
723         * @param object
724         * @param role
725         * @return the rights
726         * 
727         * @throws GeneralSecurityException
728         */
729        Right[] getRights( SecurityAccess securityAccess, SecurableObject object, Role role )
730                                throws GeneralSecurityException;
731    
732        /**
733         * Sets the <code>Rights</code> to be associated with a given <code>Role</code> and <code>SecurableObject</code>.
734         * 
735         * @param transaction
736         * @param object
737         * @param role
738         * @param rights
739         * 
740         * @throws GeneralSecurityException
741         */
742        void setRights( SecurityTransaction transaction, SecurableObject object, Role role, Right[] rights )
743                                throws GeneralSecurityException;
744    
745        /**
746         * Sets the services an user has access to.
747         * 
748         * @param transaction
749         * @param services
750         *            the ids of the accessible services
751         * @param role
752         * @throws GeneralSecurityException
753         */
754        void setServicesRights( SecurityTransaction transaction, Collection<Integer> services, Role role )
755                                throws GeneralSecurityException;
756    
757        /**
758         * Sets one <code>Right</code> to be associated with a given <code>Role</code> and all given
759         * <code>SecurableObjects</code>.
760         * 
761         * @param transaction
762         * @param objects
763         * @param role
764         * @param right
765         * 
766         * @throws GeneralSecurityException
767         */
768        void setRights( SecurityTransaction transaction, SecurableObject[] objects, Role role, Right right )
769                                throws GeneralSecurityException;
770    
771        /**
772         * @param access
773         * @param address
774         * @return the service
775         * @throws GeneralSecurityException
776         */
777        Service getServiceByAddress( SecurityAccess access, String address )
778                                throws GeneralSecurityException;
779    
780        /**
781         * @param transaction
782         * @param address
783         * @param title
784         * @param objects
785         * @param type
786         * @return the new service
787         * @throws GeneralSecurityException
788         */
789        Service registerService( SecurityTransaction transaction, String address, String title, List<StringPair> objects,
790                                 String type )
791                                throws GeneralSecurityException;
792    
793        /**
794         * @param transaction
795         * @param service
796         * @throws GeneralSecurityException
797         */
798        void deregisterService( SecurityTransaction transaction, Service service )
799                                throws GeneralSecurityException;
800    
801        /**
802         * @param access
803         * @return all services
804         * @throws GeneralSecurityException
805         */
806        LinkedList<Service> getAllServices( SecurityAccess access )
807                                throws GeneralSecurityException;
808    
809        /**
810         * @param securityTransaction
811         * @param oldService
812         * @param newService
813         * @throws GeneralSecurityException
814         */
815        void updateService( SecurityTransaction securityTransaction, Service oldService, Service newService )
816                                throws GeneralSecurityException;
817    
818        /**
819         * @param securityTransaction
820         * @param service
821         * @param oldName
822         * @param newName
823         * @throws GeneralSecurityException
824         */
825        void renameObject( SecurityTransaction securityTransaction, Service service, String oldName, String newName )
826                                throws GeneralSecurityException;
827    
828        /**
829         * @param securityTransaction
830         * @param service
831         * @param newTitle
832         * @param newAddress
833         * @throws GeneralSecurityException
834         */
835        void editService( SecurityTransaction securityTransaction, Service service, String newTitle, String newAddress )
836                                throws GeneralSecurityException;
837    
838        /**
839         * @param access
840         * @param role
841         * @return the appropriate services
842         * @throws GeneralSecurityException
843         */
844        LinkedList<Service> getRolesServices( SecurityAccess access, Role role )
845                                throws GeneralSecurityException;
846    
847    }