]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
6d745dfcf0a2d63c51bfd7065851cdd40c01b337
[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 import org.collectionspace.services.vocabulary.VocabularyResource;
43 import org.collectionspace.services.organization.OrgAuthorityResource;
44 import org.collectionspace.services.person.PersonAuthorityResource;
45
46 //import org.collectionspace.services.query.QueryResource;
47
48 import javax.ws.rs.core.Application;
49 import java.util.HashSet;
50 import java.util.Set;
51
52 //import org.collectionspace.services.common.FileUtils;
53 import org.collectionspace.services.authorization.PermissionResource;
54 import org.collectionspace.services.authorization.RoleResource;
55 import org.collectionspace.services.common.security.SecurityInterceptor;
56 //import org.collectionspace.services.common.document.DocumentUtils;
57 //import org.collectionspace.services.common.imaging.nuxeo.NuxeoImageUtils;
58 //import org.collectionspace.services.common.profile.Profiler;
59
60 /**
61  * CollectionSpaceJaxRsApplication, the root application
62  * for enumerating Resource classes in the Services Layer,
63  * which in turn respond to and route REST-based requests.
64  *
65  * $LastChangedRevision$
66  * $LastChangedDate$
67  */
68 public class CollectionSpaceJaxRsApplication extends Application {
69
70     private Set<Object> singletons = new HashSet<Object>();
71     private Set<Class<?>> empty = new HashSet<Class<?>>();    
72
73     public CollectionSpaceJaxRsApplication() {          
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 IntakeResource());
83         singletons.add(new VocabularyResource());
84         singletons.add(new DimensionResource());
85         singletons.add(new ContactResource());
86         singletons.add(new PersonAuthorityResource());
87         singletons.add(new OrgAuthorityResource());
88         singletons.add(new NewRelationResource());
89         singletons.add(new NoteResource());
90         singletons.add(new LoaninResource());
91         singletons.add(new LoanoutResource());
92         singletons.add(new AcquisitionResource());
93         singletons.add(new ObjectExitResource());
94         singletons.add(new MediaResource());
95         singletons.add(new BlobResource());
96         singletons.add(new MovementResource());
97         singletons.add(new ReportResource());
98         singletons.add(new LocationAuthorityResource());
99         singletons.add(new IDResource());
100 //        singletons.add(new QueryResource());
101 //        singletons.add(new DomainIdentifierResource());
102 //        singletons.add(new PingResource());
103     }
104
105     @Override
106     public Set<Class<?>> getClasses() {
107         return empty;
108     }
109
110     @Override
111     public Set<Object> getSingletons() {
112         return singletons;
113     }
114 }
115