]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
5ea199c769d4009b352b19926130c8a79d612bed
[tmp/jakarta-migration.git] /
1 /**
2  * This document is a part of the source code and related artifacts
3  * for CollectionSpace, an open source collections management system
4  * for museums and related institutions:
5  *
6  * http://www.collectionspace.org
7  * http://wiki.collectionspace.org
8  *
9  * Copyright © 2009 Regents of the University of California
10  *
11  * Licensed under the Educational Community License (ECL), Version 2.0.
12  * You may not use this file except in compliance with this License.
13  *
14  * You may obtain a copy of the ECL 2.0 License at
15  * https://source.collectionspace.org/collection-space/LICENSE.txt
16  *
17  * Unless required by applicable law or agreed to in writing, software
18  * distributed under the License is distributed on an "AS IS" BASIS,
19  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20  * See the License for the specific language governing permissions and
21  * limitations under the License.
22  */
23 package org.collectionspace.services.jaxrs;
24
25 import org.collectionspace.services.account.AccountResource;
26 import org.collectionspace.services.collectionobject.CollectionObjectResource;
27 import org.collectionspace.services.id.IDResource;
28 import org.collectionspace.services.note.NoteResource;
29 import org.collectionspace.services.intake.IntakeResource;
30 import org.collectionspace.services.loanin.LoaninResource;
31 import org.collectionspace.services.loanout.LoanoutResource;
32 import org.collectionspace.services.location.LocationAuthorityResource;
33 import org.collectionspace.services.movement.MovementResource;
34 import org.collectionspace.services.report.ReportResource;
35 import org.collectionspace.services.relation.NewRelationResource;
36 import org.collectionspace.services.acquisition.AcquisitionResource;
37 import org.collectionspace.services.dimension.DimensionResource;
38 import org.collectionspace.services.contact.ContactResource;
39
40 import org.collectionspace.services.vocabulary.VocabularyResource;
41 import org.collectionspace.services.organization.OrgAuthorityResource;
42 import org.collectionspace.services.person.PersonAuthorityResource;
43
44 //import org.collectionspace.services.query.QueryResource;
45
46 import javax.ws.rs.core.Application;
47 import java.util.HashSet;
48 import java.util.Set;
49 import org.collectionspace.services.authorization.PermissionResource;
50 import org.collectionspace.services.authorization.RoleResource;
51 import org.collectionspace.services.common.security.SecurityInterceptor;
52 import org.collectionspace.services.common.document.DocumentUtils;
53 import org.collectionspace.services.common.profile.Profiler;
54
55 /**
56  * CollectionSpaceJaxRsApplication, the root application
57  * for enumerating Resource classes in the Services Layer,
58  * which in turn respond to and route REST-based requests.
59  *
60  * $LastChangedRevision$
61  * $LastChangedDate$
62  */
63 public class CollectionSpaceJaxRsApplication extends Application {
64
65     private Set<Object> singletons = new HashSet<Object>();
66     private Set<Class<?>> empty = new HashSet<Class<?>>();    
67
68     public CollectionSpaceJaxRsApplication() {
69         //
70         // Setup the profiler logger
71         //
72         Profiler.setup();
73         DocumentUtils.loggerSetup();
74         //
75         // Instantiate all our JaxRS resources
76         //
77         singletons.add(new SecurityInterceptor());
78         singletons.add(new AccountResource());
79         singletons.add(new RoleResource());
80         singletons.add(new PermissionResource());
81         singletons.add(new CollectionObjectResource());
82         singletons.add(new IDResource());
83         singletons.add(new NoteResource());
84         singletons.add(new IntakeResource());
85         singletons.add(new LoaninResource());
86         singletons.add(new LoanoutResource());
87         singletons.add(new LocationAuthorityResource());
88         singletons.add(new MovementResource());
89         singletons.add(new ReportResource());
90         singletons.add(new AcquisitionResource());
91         singletons.add(new NewRelationResource());
92         singletons.add(new VocabularyResource());
93         singletons.add(new OrgAuthorityResource());
94         singletons.add(new PersonAuthorityResource());
95         singletons.add(new DimensionResource());
96         singletons.add(new ContactResource());
97
98 //        singletons.add(new QueryResource());
99 //        singletons.add(new DomainIdentifierResource());
100 //        singletons.add(new PingResource());
101     }
102
103     @Override
104     public Set<Class<?>> getClasses() {
105         return empty;
106     }
107
108     @Override
109     public Set<Object> getSingletons() {
110         return singletons;
111     }
112 }
113