streams-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dsulli...@apache.org
Subject svn commit: r1535000 - in /incubator/streams/branches/webservice/streams-web/src/main: java/org/apache/streams/mvc/configuration/ java/org/apache/streams/mvc/controller/ resources/
Date Wed, 23 Oct 2013 12:13:08 GMT
Author: dsullivan
Date: Wed Oct 23 12:13:07 2013
New Revision: 1535000

URL: http://svn.apache.org/r1535000
Log:
removing need for base url in configuration

Removed:
    incubator/streams/branches/webservice/streams-web/src/main/java/org/apache/streams/mvc/configuration/
    incubator/streams/branches/webservice/streams-web/src/main/resources/streams.properties
Modified:
    incubator/streams/branches/webservice/streams-web/src/main/java/org/apache/streams/mvc/controller/StreamsWebController.java
    incubator/streams/branches/webservice/streams-web/src/main/resources/streams_web_applicationContext.xml

Modified: incubator/streams/branches/webservice/streams-web/src/main/java/org/apache/streams/mvc/controller/StreamsWebController.java
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-web/src/main/java/org/apache/streams/mvc/controller/StreamsWebController.java?rev=1535000&r1=1534999&r2=1535000&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-web/src/main/java/org/apache/streams/mvc/controller/StreamsWebController.java
(original)
+++ incubator/streams/branches/webservice/streams-web/src/main/java/org/apache/streams/mvc/controller/StreamsWebController.java
Wed Oct 23 12:13:07 2013
@@ -6,7 +6,6 @@ import org.apache.streams.components.ser
 import org.apache.streams.components.service.StreamsActivityReceivingService;
 import org.apache.streams.components.service.StreamsPublisherRegistrationService;
 import org.apache.streams.components.service.StreamsSubscriberRegistrationService;
-import org.apache.streams.mvc.configuration.StreamsConfiguration;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
@@ -25,20 +24,17 @@ public class StreamsWebController {
     private StreamsSubscriberRegistrationService subscriberRegistrationService;
     private StreamsActivityPublishingService activityPublishingService;
     private StreamsActivityReceivingService activityReceivingService;
-    private StreamsConfiguration streamsConfiguration;
 
     @Autowired
     public StreamsWebController(
             StreamsPublisherRegistrationService publisherRegistrationService,
             StreamsSubscriberRegistrationService subscriberRegistrationService,
             StreamsActivityPublishingService activityPublishingService,
-            StreamsActivityReceivingService activityReceivingService,
-            StreamsConfiguration streamsConfiguration) {
+            StreamsActivityReceivingService activityReceivingService) {
         this.publisherRegistrationService = publisherRegistrationService;
         this.subscriberRegistrationService = subscriberRegistrationService;
         this.activityPublishingService = activityPublishingService;
         this.activityReceivingService = activityReceivingService;
-        this.streamsConfiguration = streamsConfiguration;
     }
 
     /**
@@ -49,9 +45,9 @@ public class StreamsWebController {
      */
     @RequestMapping(headers = {"content-type=application/json"}, value = "/publisherRegister",
method = RequestMethod.POST)
     @ResponseBody
-    public ResponseEntity<String> registerPublisher(@RequestBody String payload) {
+    public ResponseEntity<String> registerPublisher(@RequestBody String payload, @RequestHeader("host")
String host) {
         try{
-            return new ResponseEntity<String>(streamsConfiguration.getBaseUrlPath()
+ "postActivity/" + publisherRegistrationService.register(payload), HttpStatus.OK);
+            return new ResponseEntity<String>("http://" + host + "/postActivity/" +
publisherRegistrationService.register(payload), HttpStatus.OK);
         }catch(Exception e){
             log.error(e);
             return new ResponseEntity<String>(e.getMessage(), HttpStatus.BAD_REQUEST);
@@ -66,9 +62,9 @@ public class StreamsWebController {
      */
     @RequestMapping(headers = {"content-type=application/json"}, value = "/subscriberRegister",
method = RequestMethod.POST)
     @ResponseBody
-    public ResponseEntity<String> registerSubscriber(@RequestBody String payload) {
+    public ResponseEntity<String> registerSubscriber(@RequestBody String payload, @RequestHeader("host")
String host) {
         try{
-            return new ResponseEntity<String>(streamsConfiguration.getBaseUrlPath()
+ "getActivity/" + subscriberRegistrationService.register(payload), HttpStatus.OK);
+            return new ResponseEntity<String>("http://" + host + "/getActivity/" +
subscriberRegistrationService.register(payload), HttpStatus.OK);
         }catch(Exception e){
             log.error(e);
             return new ResponseEntity<String>(e.getMessage(), HttpStatus.BAD_REQUEST);

Modified: incubator/streams/branches/webservice/streams-web/src/main/resources/streams_web_applicationContext.xml
URL: http://svn.apache.org/viewvc/incubator/streams/branches/webservice/streams-web/src/main/resources/streams_web_applicationContext.xml?rev=1535000&r1=1534999&r2=1535000&view=diff
==============================================================================
--- incubator/streams/branches/webservice/streams-web/src/main/resources/streams_web_applicationContext.xml
(original)
+++ incubator/streams/branches/webservice/streams-web/src/main/resources/streams_web_applicationContext.xml
Wed Oct 23 12:13:07 2013
@@ -1,13 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="
-            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
-            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
+            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
 
     <import resource="classpath:streams_components_applicationContext.xml"/>
-    <context:annotation-config />
-    <context:component-scan base-package="org.apache.streams.mvc.configuration"/>
 
 </beans>
\ No newline at end of file



Mime
View raw message