]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
f669634d35e8829f81e2e8419355fea6159d53d0
[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.imports.ImportsResource;
36 import org.collectionspace.services.location.LocationAuthorityResource;
37 import org.collectionspace.services.movement.MovementResource;
38 import org.collectionspace.services.relation.RelationResource;
39 import org.collectionspace.services.report.ReportResource;
40 import org.collectionspace.services.acquisition.AcquisitionResource;
41 import org.collectionspace.services.dimension.DimensionResource;
42 import org.collectionspace.services.contact.ContactResource;
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
53 //import org.collectionspace.services.common.FileUtils;
54 import org.collectionspace.services.authorization.PermissionResource;
55 import org.collectionspace.services.authorization.RoleResource;
56 import org.collectionspace.services.common.security.SecurityInterceptor;
57 //import org.collectionspace.services.common.document.DocumentUtils;
58 //import org.collectionspace.services.common.imaging.nuxeo.NuxeoImageUtils;
59 //import org.collectionspace.services.common.profile.Profiler;
60
61 /**
62  * CollectionSpaceJaxRsApplication, the root application
63  * for enumerating Resource classes in the Services Layer,
64  * which in turn respond to and route REST-based requests.
65  *
66  * $LastChangedRevision$
67  * $LastChangedDate$
68  */
69 public class CollectionSpaceJaxRsApplication extends Application {
70
71     private Set<Object> singletons = new HashSet<Object>();
72     private Set<Class<?>> empty = new HashSet<Class<?>>();    
73
74     public CollectionSpaceJaxRsApplication() {          
75         //
76         // Instantiate all our JaxRS resources
77         //
78         singletons.add(new SecurityInterceptor());
79         singletons.add(new AccountResource());
80         singletons.add(new RoleResource());
81         singletons.add(new PermissionResource());
82         singletons.add(new CollectionObjectResource());
83         singletons.add(new IntakeResource());
84         singletons.add(new VocabularyResource());
85         singletons.add(new DimensionResource());
86         singletons.add(new ContactResource());
87         singletons.add(new PersonAuthorityResource());
88         singletons.add(new OrgAuthorityResource());
89         singletons.add(new RelationResource());
90         singletons.add(new NoteResource());
91         singletons.add(new LoaninResource());
92         singletons.add(new LoanoutResource());
93         singletons.add(new AcquisitionResource());
94         singletons.add(new ObjectExitResource());
95         singletons.add(new ImportsResource());
96         singletons.add(new MediaResource());
97         singletons.add(new BlobResource());
98         singletons.add(new MovementResource());
99         singletons.add(new ReportResource());
100         singletons.add(new LocationAuthorityResource());
101         singletons.add(new IDResource());
102 //        singletons.add(new QueryResource());
103 //        singletons.add(new DomainIdentifierResource());
104 //        singletons.add(new PingResource());
105     }
106
107     @Override
108     public Set<Class<?>> getClasses() {
109         return empty;
110     }
111
112     @Override
113     public Set<Object> getSingletons() {
114         return singletons;
115     }
116 }
117