]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
3bf763ec3cc71f912d5a60c2de8df09a458d2f3b
[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.intake.IntakeResource;
29 import org.collectionspace.services.loanin.LoaninResource;
30 import org.collectionspace.services.loanout.LoanoutResource;
31 import org.collectionspace.services.relation.NewRelationResource;
32 import org.collectionspace.services.acquisition.AcquisitionResource;
33 import org.collectionspace.services.dimension.DimensionResource;
34 import org.collectionspace.services.contact.ContactResource;
35
36 import org.collectionspace.services.vocabulary.VocabularyResource;
37 import org.collectionspace.services.organization.OrgAuthorityResource;
38 import org.collectionspace.services.person.PersonAuthorityResource;
39
40 //import org.collectionspace.services.query.QueryResource;
41
42 import javax.ws.rs.core.Application;
43 import java.util.HashSet;
44 import java.util.Set;
45 import org.collectionspace.services.authorization.PermissionResource;
46 import org.collectionspace.services.authorization.RoleResource;
47 import org.collectionspace.services.common.security.SecurityInterceptor;
48
49 /**
50  * CollectionSpaceJaxRsApplication, the root application
51  * for enumerating Resource classes in the Services Layer,
52  * which in turn respond to and route REST-based requests.
53  *
54  * $LastChangedRevision$
55  * $LastChangedDate$
56  */
57 public class CollectionSpaceJaxRsApplication extends Application {
58
59     private Set<Object> singletons = new HashSet<Object>();
60     private Set<Class<?>> empty = new HashSet<Class<?>>();
61
62     public CollectionSpaceJaxRsApplication() {
63         singletons.add(new SecurityInterceptor());
64         singletons.add(new AccountResource());
65         singletons.add(new RoleResource());
66         singletons.add(new PermissionResource());
67         singletons.add(new CollectionObjectResource());
68         singletons.add(new IDResource());
69         singletons.add(new IntakeResource());
70         singletons.add(new LoaninResource());
71         singletons.add(new LoanoutResource());
72         singletons.add(new AcquisitionResource());
73         singletons.add(new NewRelationResource());
74         singletons.add(new VocabularyResource());
75         singletons.add(new OrgAuthorityResource());
76         singletons.add(new PersonAuthorityResource());
77         singletons.add(new DimensionResource());
78         singletons.add(new ContactResource());
79
80 //        singletons.add(new QueryResource());
81 //        singletons.add(new DomainIdentifierResource());
82 //        singletons.add(new PingResource());
83     }
84
85     @Override
86     public Set<Class<?>> getClasses() {
87         return empty;
88     }
89
90     @Override
91     public Set<Object> getSingletons() {
92         return singletons;
93     }
94 }
95