summaryrefslogtreecommitdiffstats
path: root/base/common/src/com
diff options
context:
space:
mode:
authorChristina Fu <cfu@redhat.com>2014-03-03 15:52:55 -0800
committerChristina Fu <cfu@redhat.com>2014-03-06 19:33:35 -0800
commit61ec5553e416733996be05fda16983d32252000c (patch)
tree61f7a81cec53df149113d4c73cd1c1836904cb35 /base/common/src/com
parent35fcdc2ca9c5ef42ccdddcbfdf484c4f66a720fc (diff)
trac ticket #862 - TPS rewrite: provide connector service for JAVA-based TPS subsystem
Diffstat (limited to 'base/common/src/com')
-rw-r--r--base/common/src/com/netscape/certsrv/apps/CMS.java28
-rw-r--r--base/common/src/com/netscape/certsrv/apps/ICMSEngine.java24
-rw-r--r--base/common/src/com/netscape/certsrv/base/IConfigStore.java4
-rw-r--r--base/common/src/com/netscape/certsrv/connector/IConnector.java12
-rw-r--r--base/common/src/com/netscape/certsrv/connector/IHttpConnection.java11
-rw-r--r--base/common/src/com/netscape/certsrv/connector/IRemoteAuthority.java23
6 files changed, 100 insertions, 2 deletions
diff --git a/base/common/src/com/netscape/certsrv/apps/CMS.java b/base/common/src/com/netscape/certsrv/apps/CMS.java
index fbcf65ac0..405e99ecf 100644
--- a/base/common/src/com/netscape/certsrv/apps/CMS.java
+++ b/base/common/src/com/netscape/certsrv/apps/CMS.java
@@ -850,6 +850,19 @@ public final class CMS {
*
* @param authority remote authority
* @param factory socket factory
+ * @param op operation to determine receiving servlet (multi-uri support)
+ * @return http connection to the remote authority
+ */
+ public static IHttpConnection getHttpConnection(IRemoteAuthority authority,
+ ISocketFactory factory, String op) {
+ return _engine.getHttpConnection(authority, factory, op);
+ }
+
+ /**
+ * Retrieves the HTTP Connection for use with connector.
+ *
+ * @param authority remote authority
+ * @param factory socket factory
* @param timeout return error if connection cannot be established within
* the timeout period
* @return http connection to the remote authority
@@ -860,6 +873,21 @@ public final class CMS {
}
/**
+ * Retrieves the HTTP Connection for use with connector.
+ *
+ * @param authority remote authority
+ * @param factory socket factory
+ * @param timeout return error if connection cannot be established within
+ * the timeout period
+ * @param op operation to determine receiving servlet (multi-uri support)
+ * @return http connection to the remote authority
+ */
+ public static IHttpConnection getHttpConnection(IRemoteAuthority authority,
+ ISocketFactory factory, int timeout, String op) {
+ return _engine.getHttpConnection(authority, factory, timeout, op);
+ }
+
+ /**
* Retrieves the request sender for use with connector.
*
* @param authority local authority
diff --git a/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java b/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java
index 74fa09003..fb3881ed3 100644
--- a/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java
+++ b/base/common/src/com/netscape/certsrv/apps/ICMSEngine.java
@@ -1029,6 +1029,17 @@ public interface ICMSEngine extends ISubsystem {
*
* @param authority remote authority
* @param factory socket factory
+ * @param op operation to determine receiving servlet (multi-uri support)
+ * @return http connection to the remote authority
+ */
+ public IHttpConnection getHttpConnection(IRemoteAuthority authority,
+ ISocketFactory factory, String op);
+
+ /**
+ * Retrieves the HTTP Connection for use with connector.
+ *
+ * @param authority remote authority
+ * @param factory socket factory
* @param timeout return error if connection cannot be established within
* the timeout period
* @return http connection to the remote authority
@@ -1037,6 +1048,19 @@ public interface ICMSEngine extends ISubsystem {
ISocketFactory factory, int timeout);
/**
+ * Retrieves the HTTP Connection for use with connector.
+ *
+ * @param authority remote authority
+ * @param factory socket factory
+ * @param timeout return error if connection cannot be established within
+ * the timeout period
+ * @param op operation to determine receiving servlet (multi-uri support)
+ * @return http connection to the remote authority
+ */
+ public IHttpConnection getHttpConnection(IRemoteAuthority authority,
+ ISocketFactory factory, int timeout, String op);
+
+ /**
* Retrieves the request sender for use with connector.
*
* @param authority local authority
diff --git a/base/common/src/com/netscape/certsrv/base/IConfigStore.java b/base/common/src/com/netscape/certsrv/base/IConfigStore.java
index 92bf7b2f6..2f9d95556 100644
--- a/base/common/src/com/netscape/certsrv/base/IConfigStore.java
+++ b/base/common/src/com/netscape/certsrv/base/IConfigStore.java
@@ -47,11 +47,11 @@ import java.util.Map;
* String valx = config.getString(&quot;param1&quot;);
* // valx is &quot;value1&quot; &lt;p&gt;
*
- * IConfigStore substore1 = config.getSubstore(&quot;configStore1&quot;);
+ * IConfigStore substore1 = config.getSubStore(&quot;configStore1&quot;);
* String valy = substore1.getString(&quot;param11&quot;);
* // valy is &quot;value11&quot; &lt;p&gt;
*
- * IConfigStore substore2 = config.getSubstore(&quot;configStore2&quot;);
+ * IConfigStore substore2 = config.getSubStore(&quot;configStore2&quot;);
* String valz = substore2.getString(&quot;param21&quot;);
* // valz is &quot;value21&quot; &lt;p&gt;
* }
diff --git a/base/common/src/com/netscape/certsrv/connector/IConnector.java b/base/common/src/com/netscape/certsrv/connector/IConnector.java
index 02e7231ab..6eda896c4 100644
--- a/base/common/src/com/netscape/certsrv/connector/IConnector.java
+++ b/base/common/src/com/netscape/certsrv/connector/IConnector.java
@@ -19,6 +19,7 @@ package com.netscape.certsrv.connector;
import com.netscape.certsrv.base.EBaseException;
import com.netscape.certsrv.request.IRequest;
+import com.netscape.cmsutil.http.HttpResponse;
/**
* This interface represents a connector that forwards
@@ -55,6 +56,17 @@ public interface IConnector {
throws EBaseException;
/**
+ * Sends the request to a remote authority.
+ *
+ * @param op operation to determine receiving servlet (multi-uri support)
+ * @param msg Request to be forwarded to remote authority.
+ * @return HttpResponse to be parsed by client
+ * @exception EBaseException Failure to send request to remote authority.
+ */
+ public HttpResponse send(String op, String msg)
+ throws EBaseException;
+
+ /**
* Starts this connector.
*/
public void start();
diff --git a/base/common/src/com/netscape/certsrv/connector/IHttpConnection.java b/base/common/src/com/netscape/certsrv/connector/IHttpConnection.java
index 8adc7da72..2e871851b 100644
--- a/base/common/src/com/netscape/certsrv/connector/IHttpConnection.java
+++ b/base/common/src/com/netscape/certsrv/connector/IHttpConnection.java
@@ -18,6 +18,7 @@
package com.netscape.certsrv.connector;
import com.netscape.certsrv.base.EBaseException;
+import com.netscape.cmsutil.http.HttpResponse;
/**
* This represents a HTTP connection to a remote authority.
@@ -38,4 +39,14 @@ public interface IHttpConnection {
*/
public IPKIMessage send(IPKIMessage tomsg)
throws EBaseException;
+
+ /**
+ * Sends the message to the remote authority.
+ *
+ * @param msg Message to forward to authority.
+ * @return HttpResponse response to be parsed by the client
+ * @exception EBaseException Failed to send message.
+ */
+ public HttpResponse send(String msg)
+ throws EBaseException;
}
diff --git a/base/common/src/com/netscape/certsrv/connector/IRemoteAuthority.java b/base/common/src/com/netscape/certsrv/connector/IRemoteAuthority.java
index f02154021..1e66daa81 100644
--- a/base/common/src/com/netscape/certsrv/connector/IRemoteAuthority.java
+++ b/base/common/src/com/netscape/certsrv/connector/IRemoteAuthority.java
@@ -17,6 +17,8 @@
// --- END COPYRIGHT BLOCK ---
package com.netscape.certsrv.connector;
+import java.util.Hashtable;
+
/**
* This represents a remote authority that can be
* a certificate manager, or key recovery manager or
@@ -48,9 +50,30 @@ public interface IRemoteAuthority {
public String getURI();
/**
+ * Retrieves the list of URIs supported by the remote Authority
+ * (multi-URI support)
+ */
+ public Hashtable<String, String> getURIs();
+
+ /**
+ * Retrieves an URI by operation
+ * (multi-URI support)
+ * @param op operation to determine the receiving servlet
+ */
+ public String getURI(String op);
+
+ /**
* Retrieves the timeout value for the connection to the remote Authority.
*
* @return In with remote Authority timeout value.
*/
public int getTimeout();
+
+ /**
+ * Retrieves the Content-Type value of the connection to the Remote Authority.
+ *
+ * @return String with Content-Type, if it was set
+ * @return
+ */
+ public String getContentType();
}