PageRenderTime 28ms CodeModel.GetById 21ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/razpubs/src/razie/upnp/DeviceBridge.scala

http://razpub.googlecode.com/
Scala | 55 lines | 10 code | 11 blank | 34 comment | 0 complexity | 119a2b5863acb96dbec833bb32fd30b8 MD5 | raw file
 1package razie.upnp
 2
 3import org.cybergarage.upnp._
 4import com.razie.pub.base.data._
 5
 6/** bridging the scala stuff with the cybergarage library 
 7 * 
 8 * The scala device will dynamically create the XMl which is parsed back into the associated cybergarage device.
 9 * 
10 * 
11 * 
12 */
13class DeviceBridge (val sdevice:UpnpDevice) extends DeviceBridgeJ {
14   loadDescription (sdevice.toFullUpnpXml.toString) 
15
16   override def razscpdStr (id:String):String = { 
17	   sdevice.service(id).toFullUpnpXml.toString
18   }
19   
20   override def getService(name:String) = super.getService (name)
21
22//   override def getServiceList():ServiceList = {
23//        val s = svcs
24        // TODO optimize after scala 2.8 compiler fixed
25//        val services = RazElement.tolist(oldservices)
26       
27        // TODO use the RazElement.tolist
28//        for (i <- 0 to services.size-1)
29//           services.get(i)
30	   
31//        svcs
32//		   null 
33//   }
34
35//   override def getServiceList():ServiceList =  {
36//        val serviceList = super.getServiceList()
37        
38//        RazElement.tolist(serviceList).foreach ()
39        
40//        val serviceListNode = getDeviceNode().getNode(ServiceList.ELEM_NAME);
41//        if (serviceListNode == null)
42//            return serviceList;
43//        val nNode = serviceListNode.getNNodes();
44//        for (val n <- 0 to nNode-1) {
45//            val node = serviceListNode.getNode(n);
46//            if (Service.isServiceNode(node) != false) {
47//            val u = if (this.descriptionURL == null) null else this.descriptionURL.toExternalForm().replaceFirst("/[^/]+$", "")
48//            val service = new Service(node, u);
49//            serviceList.add(service);
50//            }
51//        } 
52
53//        return serviceList;
54//    }
55}