]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
dcf50b38ed20d7c0ae43f519f48fad63e1e1bfcb
[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
53 /**
54  * CollectionSpaceJaxRsApplication, the root application
55  * for enumerating Resource classes in the Services Layer,
56  * which in turn respond to and route REST-based requests.
57  *
58  * $LastChangedRevision$
59  * $LastChangedDate$
60  */
61 public class CollectionSpaceJaxRsApplication extends Application {
62
63     private Set<Object> singletons = new HashSet<Object>();
64     private Set<Class<?>> empty = new HashSet<Class<?>>();
65
66     public CollectionSpaceJaxRsApplication() {
67         singletons.add(new SecurityInterceptor());
68         singletons.add(new AccountResource());
69         singletons.add(new RoleResource());
70         singletons.add(new PermissionResource());
71         singletons.add(new CollectionObjectResource());
72         singletons.add(new IDResource());
73         singletons.add(new NoteResource());
74         singletons.add(new IntakeResource());
75         singletons.add(new LoaninResource());
76         singletons.add(new LoanoutResource());
77         singletons.add(new LocationAuthorityResource());
78         singletons.add(new MovementResource());
79         singletons.add(new ReportResource());
80         singletons.add(new AcquisitionResource());
81         singletons.add(new NewRelationResource());
82         singletons.add(new VocabularyResource());
83         singletons.add(new OrgAuthorityResource());
84         singletons.add(new PersonAuthorityResource());
85         singletons.add(new DimensionResource());
86         singletons.add(new ContactResource());
87
88 //        singletons.add(new QueryResource());
89 //        singletons.add(new DomainIdentifierResource());
90 //        singletons.add(new PingResource());
91     }
92
93     @Override
94     public Set<Class<?>> getClasses() {
95         return empty;
96     }
97
98     @Override
99     public Set<Object> getSingletons() {
100         return singletons;
101     }
102 }
103