Omaha #3541 Updated A2 baseline to reflect request service split
Change-Id: Iaa540397b6723a61841d93baf655be87701d9c93 Former-commit-id: e6b16ea30563c0afdd48822e8efc9faabadef8f0
This commit is contained in:
parent
fdf20738b9
commit
e90bdb6fce
11 changed files with 65 additions and 97 deletions
|
@ -301,7 +301,7 @@
|
|||
</bean>
|
||||
|
||||
<!-- Holds the registry of request routers by server key -->
|
||||
<bean id="handlerRegistry" class="com.raytheon.uf.edex.auth.HandlerRegistry"
|
||||
<bean id="handlerRegistry" class="com.raytheon.uf.edex.requestsrv.HandlerRegistry"
|
||||
factory-method="getInstance" />
|
||||
|
||||
<bean id="requestRouterRegistry"
|
||||
|
@ -310,20 +310,20 @@
|
|||
|
||||
<!-- Server Request routers -->
|
||||
<bean id="serverPrivilegedRequestHandler"
|
||||
class="com.raytheon.uf.edex.auth.req.ServerPrivilegedRequestHandler">
|
||||
class="com.raytheon.uf.edex.requestsrv.request.ServerPrivilegedRequestHandler">
|
||||
<constructor-arg ref="handlerRegistry" />
|
||||
</bean>
|
||||
|
||||
|
||||
<bean factory-bean="handlerRegistry" factory-method="register">
|
||||
<constructor-arg
|
||||
value="com.raytheon.uf.edex.auth.req.ServerPrivilegedRequestHandler.ServerPrivilegedRequest" />
|
||||
value="com.raytheon.uf.edex.requestsrv.request.ServerPrivilegedRequestHandler.ServerPrivilegedRequest" />
|
||||
<constructor-arg ref="serverPrivilegedRequestHandler" />
|
||||
</bean>
|
||||
|
||||
<util:constant id="requestServerKey"
|
||||
static-field="com.raytheon.uf.common.auth.RequestConstants.REQUEST_SERVER" />
|
||||
|
||||
<bean id="requestServiceRouter" class="com.raytheon.uf.edex.auth.ServerRequestRouter">
|
||||
<bean id="requestServiceRouter" class="com.raytheon.uf.edex.requestsrv.router.ServerRequestRouter">
|
||||
<!-- This bean will cause all RequestRouter.route(request) calls
|
||||
to be processed internally to EDEX -->
|
||||
</bean>
|
||||
|
|
|
@ -27,5 +27,6 @@ Require-Bundle: com.raytheon.uf.common.localization;bundle-version="1.11.1",
|
|||
com.google.guava;bundle-version="1.0.0",
|
||||
com.raytheon.uf.edex.auth;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.serialization.comm,
|
||||
org.apache.commons.io;bundle-version="2.4.0"
|
||||
org.apache.commons.io;bundle-version="2.4.0",
|
||||
com.raytheon.uf.edex.requestsrv;bundle-version="1.14.0"
|
||||
Export-Package: com.raytheon.uf.edex.activetable
|
||||
|
|
|
@ -57,11 +57,11 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
|||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.util.StringUtil;
|
||||
import com.raytheon.uf.edex.auth.RemoteServerRequestRouter;
|
||||
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils;
|
||||
import com.raytheon.uf.edex.database.cluster.ClusterLockUtils.LockState;
|
||||
import com.raytheon.uf.edex.database.cluster.ClusterTask;
|
||||
import com.raytheon.uf.edex.database.cluster.handler.CurrentTimeClusterLockHandler;
|
||||
import com.raytheon.uf.edex.requestsrv.router.RemoteServerRequestRouter;
|
||||
|
||||
/**
|
||||
* Library module of functions to support retrieval of next ETN in sequence for
|
||||
|
|
|
@ -3,17 +3,22 @@
|
|||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
||||
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
|
||||
|
||||
<camelContext id="server-camel"
|
||||
xmlns="http://camel.apache.org/schema/spring" errorHandlerRef="errorHandler">
|
||||
<camelContext id="ebxml-request-service-camel"
|
||||
xmlns="http://camel.apache.org/schema/spring"
|
||||
errorHandlerRef="errorHandler">
|
||||
|
||||
<endpoint id="ebxmlThriftService_from"
|
||||
uri="jetty:http://0.0.0.0:${ebxml.thrift.service.port}/services/thrift?disableStreamCache=true&chunked=false&httpBindingRef=#binaryHttpBinding" />
|
||||
<endpoint id="webServiceEndpoint"
|
||||
uri="jetty:http://0.0.0.0:${ebxml.thrift.service.port}${edex.requestsrv.http.path}?${edex.requestsrv.http.properties}" />
|
||||
|
||||
<route id="ebxmlThriftService">
|
||||
<from uri="ref:ebxmlThriftService_from" />
|
||||
<bean ref="routeWrapper" method="executeThrift" />
|
||||
</route>
|
||||
|
||||
</camelContext>
|
||||
<route id="webServiceRoute" streamCache="false">
|
||||
<from uri="webServiceEndpoint" />
|
||||
<setBody>
|
||||
<simple>
|
||||
bodyAs(javax.servlet.http.HttpServletRequest)
|
||||
</simple>
|
||||
</setBody>
|
||||
<bean ref="httpServiceExecutor" method="execute(${body}, ${in.header.CamelHttpServletResponse})"/>
|
||||
</route>
|
||||
</camelContext>
|
||||
|
||||
</beans>
|
||||
|
|
|
@ -2,18 +2,36 @@
|
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">
|
||||
|
||||
<bean id="handlerRegistry" class="com.raytheon.uf.edex.auth.HandlerRegistry" factory-method="getInstance"/>
|
||||
<bean id="handlerRegistry" class="com.raytheon.uf.edex.requestsrv.HandlerRegistry" factory-method="getInstance"/>
|
||||
|
||||
<bean id="serializeServer" class="com.raytheon.uf.edex.auth.RemoteRequestServer" factory-method="getInstance">
|
||||
<property name="registry" ref="handlerRegistry"/>
|
||||
</bean>
|
||||
|
||||
<bean id="routeWrapper" class="com.raytheon.uf.edex.registry.ebxml.RegistryRemoteRequestWrapper">
|
||||
<property name="server" ref="serializeServer"/>
|
||||
<property name="byteLimitInMB" value="${thriftService.byteLimitInMB}" />
|
||||
</bean>
|
||||
|
||||
<!-- TODO: Need better way of using plugin spring files, copy pasted from request-service spring XML files for WEB context -->
|
||||
<bean id="binaryHttpBinding" class="com.raytheon.uf.edex.esb.camel.http.BinaryHttpBinding"/>
|
||||
|
||||
<bean id="serializingStreamExecutor" class="com.raytheon.uf.edex.requestsrv.serialization.SerializingStreamExecutor"
|
||||
factory-method="getInstance"/>
|
||||
|
||||
<bean id="thriftStreamSerializer" class="com.raytheon.uf.edex.requestsrv.serialization.thrift.ThriftStreamSerializer"/>
|
||||
|
||||
<bean factory-bean="serializingStreamExecutor" factory-method="registerMultiple">
|
||||
<constructor-arg ref="thriftStreamSerializer" />
|
||||
<constructor-arg>
|
||||
<list>
|
||||
<value>thrift</value>
|
||||
<value>application/thrift</value>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="limitingStreamExecutor" class="com.raytheon.uf.edex.requestsrv.serialization.ByteLimitingStreamExecutor">
|
||||
<constructor-arg ref="serializingStreamExecutor"/>
|
||||
<constructor-arg value="${edex.requestsrv.byteLimitInMB}"/>
|
||||
<property name="limitOutput" value="false"/>
|
||||
</bean>
|
||||
|
||||
<bean id="httpServiceExecutor" class="com.raytheon.uf.edex.requestsrv.http.HttpRequestServiceExecutor">
|
||||
<!-- TODO: We are streaming to the HttpServletResponse directly in http service route, don't believe we need limiting anymore -->
|
||||
<constructor-arg ref="limitingStreamExecutor"/>
|
||||
</bean>
|
||||
|
||||
<bean factory-bean="handlerRegistry" factory-method="register">
|
||||
<constructor-arg value="com.raytheon.uf.common.registry.IRegistryRequest"/>
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
/**
|
||||
* This software was developed and / or modified by Raytheon Company,
|
||||
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
|
||||
*
|
||||
* U.S. EXPORT CONTROLLED TECHNICAL DATA
|
||||
* This software product contains export-restricted data whose
|
||||
* export/transfer/disclosure is restricted by U.S. law. Dissemination
|
||||
* to non-U.S. persons whether in the United States or abroad requires
|
||||
* an export license or other authorization.
|
||||
*
|
||||
* Contractor Name: Raytheon Company
|
||||
* Contractor Address: 6825 Pine Street, Suite 340
|
||||
* Mail Stop B8
|
||||
* Omaha, NE 68106
|
||||
* 402.291.0100
|
||||
*
|
||||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.registry.ebxml;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
||||
import com.raytheon.uf.edex.auth.RemoteRequestRouteWrapper;
|
||||
|
||||
/**
|
||||
*
|
||||
* Registry specific wrapper for the remote request router
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* 5/3/2013 1948 bphillip Initial implementation
|
||||
* 7/26/2013 2232 mpduff Don't override executeThrift.
|
||||
* 10/30/2013 1538 bphillip Removed unused IRegistryRequestService interface
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bphillip
|
||||
* @version 1
|
||||
*/
|
||||
public class RegistryRemoteRequestWrapper extends RemoteRequestRouteWrapper {
|
||||
|
||||
public byte[] request(byte[] data) {
|
||||
return executeThrift(new ByteArrayInputStream(data));
|
||||
}
|
||||
}
|
|
@ -91,16 +91,12 @@
|
|||
<classpathentry combineaccessrules="false" kind="src" path="/javax.jms"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/org.apache.commons.cxf"/>
|
||||
<classpathentry kind="src" path="/com.raytheon.uf.common.archive"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.edex.plugin.shef"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.common.dataplugin.obs"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.edex.datadelivery.bandwidth.ncf"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/org.apache.thrift"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.common.dataplugin.gfe"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.edex.plugin.gfe"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.common.python"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.common.message"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.edex.plugin.shef"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.common.dataplugin.obs"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/gov.noaa.nws.ncep.common.dataplugin.ffg"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/gov.noaa.nws.ncep.common"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/gov.noaa.nws.ncep.edex.plugin.ffg"/>
|
||||
|
@ -162,10 +158,12 @@
|
|||
<classpathentry kind="lib" path="lib/jetty-util-7.6.14.v20131031.jar"/>
|
||||
<classpathentry kind="lib" path="lib/servlet-api-2.5.jar"/>
|
||||
<classpathentry kind="lib" path="lib/jetty-security-7.6.14.v20131031.jar"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.edex.plugin.taf"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.common.dataplugin.redbook"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.edex.plugin.hpe"/>
|
||||
<classpathentry kind="src" path="/com.raytheon.uf.common.plugin.hpe"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.common.wmo"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.common.jms"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.common.registry.schemas.iso19115"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/com.raytheon.uf.edex.requestsrv"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.raytheon.uf.common.datadelivery.request.DataDeliveryConstants;
|
|||
import com.raytheon.uf.common.registry.RegistryConstants;
|
||||
import com.raytheon.uf.common.util.DeployTestProperties;
|
||||
import com.raytheon.uf.common.util.registry.RegistryException;
|
||||
import com.raytheon.uf.edex.auth.RemoteServerRequestRouter;
|
||||
import com.raytheon.uf.edex.requestsrv.router.RemoteServerRequestRouter;
|
||||
|
||||
/**
|
||||
* Test {@link RequestRouter}.
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.auth.req;
|
||||
package com.raytheon.uf.edex.requestsrv.request;
|
||||
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
@ -35,9 +35,8 @@ import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest;
|
|||
import com.raytheon.uf.common.localization.msgs.GetServersRequest;
|
||||
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
|
||||
import com.raytheon.uf.common.serialization.comm.IServerRequest;
|
||||
import com.raytheon.uf.edex.auth.HandlerRegistry;
|
||||
import com.raytheon.uf.edex.auth.RemoteRequestServer;
|
||||
import com.raytheon.uf.edex.auth.req.ServerPrivilegedRequestHandler.ServerPrivilegedRequest;
|
||||
import com.raytheon.uf.edex.requestsrv.HandlerRegistry;
|
||||
import com.raytheon.uf.edex.requestsrv.request.ServerPrivilegedRequestHandler.ServerPrivilegedRequest;
|
||||
|
||||
/**
|
||||
* Test {@link ServerPrivilegedRequestHandler}.
|
||||
|
@ -69,8 +68,6 @@ public class ServerPrivilegedRequestHandlerTest {
|
|||
|
||||
@Before
|
||||
public void setUp() {
|
||||
RemoteRequestServer.getInstance().setRegistry(registry);
|
||||
|
||||
when(
|
||||
registry.getRequestHandler(BandwidthRequest.class
|
||||
.getCanonicalName())).thenReturn(bandwidthHandler);
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.auth;
|
||||
package com.raytheon.uf.edex.requestsrv.router;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
@ -28,7 +28,7 @@ import com.raytheon.uf.common.comm.CommunicationException;
|
|||
import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest;
|
||||
import com.raytheon.uf.common.localization.msgs.GetServersRequest;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.edex.auth.req.ServerPrivilegedRequestHandler.ServerPrivilegedRequest;
|
||||
import com.raytheon.uf.edex.requestsrv.request.ServerPrivilegedRequestHandler.ServerPrivilegedRequest;
|
||||
|
||||
/**
|
||||
* Test {@link RemoteServerRequestRouter}.
|
||||
|
@ -47,7 +47,7 @@ import com.raytheon.uf.edex.auth.req.ServerPrivilegedRequestHandler.ServerPrivil
|
|||
* @version 1.0
|
||||
*/
|
||||
public class RemoteServerRequestRouterTest {
|
||||
|
||||
|
||||
private static final BandwidthRequest PRIVILEGED_REQUEST = new BandwidthRequest();
|
||||
|
||||
private static final GetServersRequest UNPRIVILEGED_REQUEST = new GetServersRequest();
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.uf.edex.auth;
|
||||
package com.raytheon.uf.edex.requestsrv.router;
|
||||
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.mock;
|
||||
|
@ -30,8 +30,9 @@ import org.junit.Test;
|
|||
import com.raytheon.uf.common.datadelivery.bandwidth.BandwidthRequest;
|
||||
import com.raytheon.uf.common.localization.msgs.GetServersRequest;
|
||||
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
|
||||
import com.raytheon.uf.edex.auth.req.ServerPrivilegedRequestHandler;
|
||||
import com.raytheon.uf.edex.auth.req.ServerPrivilegedRequestHandler.ServerPrivilegedRequest;
|
||||
import com.raytheon.uf.edex.requestsrv.HandlerRegistry;
|
||||
import com.raytheon.uf.edex.requestsrv.request.ServerPrivilegedRequestHandler;
|
||||
import com.raytheon.uf.edex.requestsrv.request.ServerPrivilegedRequestHandler.ServerPrivilegedRequest;
|
||||
|
||||
/**
|
||||
* Test {@link ServerPrivilegedRequestHandler}.
|
||||
|
@ -66,8 +67,6 @@ public class ServerRequestRouterTest {
|
|||
|
||||
@Before
|
||||
public void setUp() {
|
||||
RemoteRequestServer.getInstance().setRegistry(registry);
|
||||
|
||||
when(
|
||||
registry.getRequestHandler(ServerPrivilegedRequest.class
|
||||
.getCanonicalName())).thenReturn(
|
Loading…
Add table
Reference in a new issue