]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
739cc030f6c98f2194da7d380cd986814fc34d22
[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.blob.BlobResource;
27 import org.collectionspace.services.collectionobject.CollectionObjectResource;
28 import org.collectionspace.services.id.IDResource;
29 import org.collectionspace.services.media.MediaResource;
30 import org.collectionspace.services.note.NoteResource;
31 import org.collectionspace.services.intake.IntakeResource;
32 import org.collectionspace.services.loanin.LoaninResource;
33 import org.collectionspace.services.loanout.LoanoutResource;
34 import org.collectionspace.services.objectexit.ObjectExitResource;
35 import org.collectionspace.services.location.LocationAuthorityResource;
36 import org.collectionspace.services.movement.MovementResource;
37 import org.collectionspace.services.report.ReportResource;
38 import org.collectionspace.services.relation.NewRelationResource;
39 import org.collectionspace.services.acquisition.AcquisitionResource;
40 import org.collectionspace.services.dimension.DimensionResource;
41 import org.collectionspace.services.contact.ContactResource;
42
43 import org.collectionspace.services.vocabulary.VocabularyResource;
44 import org.collectionspace.services.organization.OrgAuthorityResource;
45 import org.collectionspace.services.person.PersonAuthorityResource;
46
47 //import org.collectionspace.services.query.QueryResource;
48
49 import javax.ws.rs.core.Application;
50 import java.util.HashSet;
51 import java.util.Set;
52 import org.collectionspace.services.authorization.PermissionResource;
53 import org.collectionspace.services.authorization.RoleResource;
54 import org.collectionspace.services.common.security.SecurityInterceptor;
55 import org.collectionspace.services.common.document.DocumentUtils;
56 import org.collectionspace.services.common.profile.Profiler;
57
58 /**
59  * CollectionSpaceJaxRsApplication, the root application
60  * for enumerating Resource classes in the Services Layer,
61  * which in turn respond to and route REST-based requests.
62  *
63  * $LastChangedRevision$
64  * $LastChangedDate$
65  */
66 public class CollectionSpaceJaxRsApplication extends Application {
67
68     private Set<Object> singletons = new HashSet<Object>();
69     private Set<Class<?>> empty = new HashSet<Class<?>>();    
70
71     public CollectionSpaceJaxRsApplication() {
72         //
73         // Setup the profiler logger
74         //
75         Profiler.setup();
76         DocumentUtils.loggerSetup();
77         //
78         // Instantiate all our JaxRS resources
79         //
80         singletons.add(new SecurityInterceptor());
81         singletons.add(new AccountResource());
82         singletons.add(new RoleResource());
83         singletons.add(new PermissionResource());
84         singletons.add(new CollectionObjectResource());
85         singletons.add(new IDResource());
86         singletons.add(new NoteResource());
87         singletons.add(new IntakeResource());
88         singletons.add(new LoaninResource());
89         singletons.add(new LoanoutResource());
90         singletons.add(new ObjectExitResource());
91         singletons.add(new LocationAuthorityResource());
92         singletons.add(new MediaResource());
93         singletons.add(new BlobResource());
94         singletons.add(new MovementResource());
95         singletons.add(new ReportResource());
96         singletons.add(new AcquisitionResource());
97         singletons.add(new NewRelationResource());
98         singletons.add(new VocabularyResource());
99         singletons.add(new OrgAuthorityResource());
100         singletons.add(new PersonAuthorityResource());
101         singletons.add(new DimensionResource());
102         singletons.add(new ContactResource());
103
104 //        singletons.add(new QueryResource());
105 //        singletons.add(new DomainIdentifierResource());
106 //        singletons.add(new PingResource());
107     }
108
109     @Override
110     public Set<Class<?>> getClasses() {
111         return empty;
112     }
113
114     @Override
115     public Set<Object> getSingletons() {
116         return singletons;
117     }
118 }
119