Stanford OpenFlow Forums: Web Bundle - Stanford OpenFlow Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Web Bundle Rate Topic: -----

#1 User is offline   Philip Wette 

  • Member
  • PipPip
  • Group: Members
  • Posts: 10
  • Joined: 17-December 12

Posted 04 February 2015 - 05:44 AM

Hi,

i created a new web bundle as described at https://openflow.sta...con/Web+Bundles and used Method 2.

Using @RequestMapping, i created a new website that is already accessible.
Unfortunately, when using my new web bundle, all other web bundles stopped working. The Main Beacon website (localhost:8080) is empty, now (the Beacon-logo in the top right corner and the tree buttons are still there; but nothing else)

So my question is: what did i do wrong?


My code is as follows:
package net.beaconcontroller.weathermap.web;

import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import net.beaconcontroller.core.IBeaconProvider;
import net.beaconcontroller.core.IOFSwitch;
import net.beaconcontroller.devicemanager.Device;
import net.beaconcontroller.devicemanager.IDeviceManager;
import net.beaconcontroller.web.IWebManageable;
import net.beaconcontroller.web.view.BeaconViewResolver;
import net.beaconcontroller.web.view.Tab;
import net.beaconcontroller.web.view.layout.OneColumnLayout;
import net.beaconcontroller.web.view.section.JspSection;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 *
 * @author Philip Wette
 */

@Controller
@RequestMapping("/weatherwebservice")
public class WeatherWebService  implements IWebManageable {


	public IBeaconProvider beaconProvider;
	public IDeviceManager deviceManager;

	public void startUp() {
		System.out.println("WeatherWebService staring up!");
		
	}

	public void shutDown() {
		//NOOP
	}



	/**
	 * @param beaconProvider the beaconProvider to set
	 */
	public void setBeaconProvider(IBeaconProvider beaconProvider) {
		this.beaconProvider = beaconProvider;
	}

	/**
	 * @param deviceManager the deviceManager to set
	 */
	public void setDeviceManager(IDeviceManager deviceManager) {
		this.deviceManager = deviceManager;
	}


	@Override
	public String getName() {
		// TODO Auto-generated method stub
		return "WeatherWebService";
	}

	@Override
	public String getDescription() {
		// TODO Auto-generated method stub
		return "WeatherWebService";
	}

	@Override
	public List<Tab> getTabs() {
		// TODO Auto-generated method stub

		return null;
	}
	
	
    @RequestMapping("/throughput")
    public String switches(Map<String, Object> model) {
    	
    	String throughput = "";
    	
    	HashSet<IOFSwitch> switches = new HashSet<IOFSwitch>();
    	
    	if(this.deviceManager == null)
    		System.out.println("No devicemanager available!");
    	else
    		for(Device d : this.deviceManager.getDevices()) {
    			switches.add(d.getSw());
    		}

    	Long sum = 0L;
    	
    	for(IOFSwitch s : switches) {
    		ConcurrentHashMap<Short, Long> ratesRX = (ConcurrentHashMap<Short, Long>) s.getAttributes().get("dataRatesRX");
    		for(Long l : ratesRX.values()) {
    			sum += l;
    		}
    	}
    	
    	sum /= (long)1e6;	//is now in MBit/s
    	
    	throughput = sum.toString();
    	
    	OneColumnLayout layout = new OneColumnLayout();
    	model.put("output", throughput);
    	layout.addSection(new JspSection("raw.jsp", model), null);
        return BeaconViewResolver.SIMPLE_JSON_VIEW;
    }

}



The URL "http://localhost:8080/wm/weatherwebservice/throughput.do" works as expected. However, the rest of the web UIs is missing now...
0

#2 User is offline   Bharat Sharmaa 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 07-February 15
  • LocationUnited State

Posted 07 February 2015 - 02:25 AM

while open the given url i got this error This page is under construction
1

#3 User is offline   p4bl1t0 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 11-August 16

Posted 11 August 2016 - 03:04 PM

I have the same error... :S
0

#4 User is offline   Fbacker 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 26-February 16
  • LocationIstanbul, TR

Posted 31 January 2017 - 05:14 AM

This page is under construction
NewAge Clinic turns back the body clock for people who want to perform Hair Transplant Turkey & Aesthetic Cosmetic surgery ! This young and dynamic Clinic offers you the best result in cosmetic surgery with new methods
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users