summaryrefslogtreecommitdiffstats
path: root/base/ca
diff options
context:
space:
mode:
authorAde Lee <alee@redhat.com>2012-07-06 17:39:39 -0400
committerAde Lee <alee@redhat.com>2012-07-10 15:24:27 -0400
commitc0fab92cce771af6e627a057ae4f18cc28d1442d (patch)
tree8c40ea762767295297adff22a6924cff7e9f61ea /base/ca
parentf65eae145ca6720fab774600ddda2b04f364dda0 (diff)
downloadpki-c0fab92cce771af6e627a057ae4f18cc28d1442d.tar.gz
pki-c0fab92cce771af6e627a057ae4f18cc28d1442d.tar.xz
pki-c0fab92cce771af6e627a057ae4f18cc28d1442d.zip
Add Application files to list REST resources
Diffstat (limited to 'base/ca')
-rw-r--r--base/ca/src/CMakeLists.txt9
-rw-r--r--base/ca/src/com/netscape/ca/CertificateAuthorityApplication.java57
2 files changed, 65 insertions, 1 deletions
diff --git a/base/ca/src/CMakeLists.txt b/base/ca/src/CMakeLists.txt
index 12436f301..cd0c352a8 100644
--- a/base/ca/src/CMakeLists.txt
+++ b/base/ca/src/CMakeLists.txt
@@ -24,6 +24,12 @@ find_file(COMMONS_CODEC_JAR
/usr/share/java
)
+find_file(JAXRS_API_JAR
+ NAMES
+ jaxrs-api.jar
+ PATHS
+ /usr/share/java/resteasy
+)
# identify java sources
set(pki-ca_java_SRCS
@@ -34,6 +40,7 @@ set(pki-ca_java_SRCS
com/netscape/ca/CRLIssuingPoint.java
com/netscape/ca/CAPolicy.java
com/netscape/ca/CertificateAuthority.java
+ com/netscape/ca/CertificateAuthorityApplication.java
)
@@ -41,7 +48,7 @@ set(pki-ca_java_SRCS
set(CMAKE_JAVA_INCLUDE_PATH
${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR}
${PKI_CMSUTIL_JAR} ${PKI_NSUTIL_JAR}
- ${LDAPJDK_JAR}
+ ${LDAPJDK_JAR} ${JAXRS_API_JAR}
${JSS_JAR} ${COMMONS_CODEC_JAR} ${SYMKEY_JAR})
diff --git a/base/ca/src/com/netscape/ca/CertificateAuthorityApplication.java b/base/ca/src/com/netscape/ca/CertificateAuthorityApplication.java
new file mode 100644
index 000000000..a70a3600d
--- /dev/null
+++ b/base/ca/src/com/netscape/ca/CertificateAuthorityApplication.java
@@ -0,0 +1,57 @@
+package com.netscape.ca;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.ws.rs.core.Application;
+
+import com.netscape.cms.servlet.admin.GroupMemberResourceService;
+import com.netscape.cms.servlet.admin.GroupResourceService;
+import com.netscape.cms.servlet.admin.SystemCertificateResourceService;
+import com.netscape.cms.servlet.admin.UserCertResourceService;
+import com.netscape.cms.servlet.admin.UserResourceService;
+import com.netscape.cms.servlet.cert.CertResourceService;
+import com.netscape.cms.servlet.cert.CertsResourceService;
+import com.netscape.cms.servlet.csadmin.SystemConfigurationResourceService;
+import com.netscape.cms.servlet.profile.ProfileResourceService;
+import com.netscape.cms.servlet.profile.ProfilesResourceService;
+import com.netscape.cms.servlet.request.CertRequestResourceService;
+import com.netscape.cms.servlet.request.CertRequestsResourceService;
+
+public class CertificateAuthorityApplication extends Application {
+ private Set<Object> singletons = new HashSet<Object>();
+ private Set<Class<?>> classes = new HashSet<Class<?>>();
+
+ public CertificateAuthorityApplication() {
+ // installer
+ classes.add(SystemConfigurationResourceService.class);
+
+ // certs and requests
+ classes.add(CertsResourceService.class);
+ classes.add(CertResourceService.class);
+ classes.add(CertRequestsResourceService.class);
+ classes.add(CertRequestResourceService.class);
+
+ // profile management
+ classes.add(ProfileResourceService.class);
+ classes.add(ProfilesResourceService.class);
+
+ // user and group management
+ classes.add(GroupMemberResourceService.class);
+ classes.add(GroupResourceService.class);
+ classes.add(UserCertResourceService.class);
+ classes.add(UserResourceService.class);
+
+ // system certs
+ classes.add(SystemCertificateResourceService.class);
+ }
+
+ public Set<Class<?>> getClasses() {
+ return classes;
+ }
+
+ public Set<Object> getSingletons() {
+ return singletons;
+ }
+
+}