コード例 #1
0
ファイル: Namespace.java プロジェクト: ruipires/cling
 public URI getPath(Service service) {
   if (service.getServiceId() == null) {
     throw new IllegalStateException("Can't generate local URI prefix without service ID");
   }
   StringBuilder s = new StringBuilder();
   s.append(SERVICE);
   s.append("/");
   s.append(service.getServiceId().getNamespace());
   s.append("/");
   s.append(service.getServiceId().getId());
   return URI.create(getPath(service.getDevice()).toString() + s.toString());
 }
コード例 #2
0
 public static List<String> getServiceNames(Device d) {
   ArrayList<String> services = new ArrayList<>();
   for (Service s : d.getServices()) {
     services.add(s.getServiceId().getId());
   }
   return services;
 }
コード例 #3
0
 protected void hydrateBasic(MutableService descriptor, Service undescribedService) {
   descriptor.serviceId = undescribedService.getServiceId();
   descriptor.serviceType = undescribedService.getServiceType();
   if (undescribedService instanceof RemoteService) {
     RemoteService rs = (RemoteService) undescribedService;
     descriptor.controlURI = rs.getControlURI();
     descriptor.eventSubscriptionURI = rs.getEventSubscriptionURI();
     descriptor.descriptorURI = rs.getDescriptorURI();
   }
 }
コード例 #4
0
 protected void subscribeAll(Device d, String uuid) {
   String name = getFriendlyName(d);
   int ctrl = 0;
   for (Service s : d.getServices()) {
     String sid = s.getServiceId().getId();
     LOGGER.debug("Subscribing to " + sid + " service on " + name);
     if (sid.contains("AVTransport")) {
       ctrl |= AVT;
     } else if (sid.contains("RenderingControl")) {
       ctrl |= RC;
     }
     upnpService.getControlPoint().execute(new SubscriptionCB(s));
   }
   rendererMap.mark(uuid, RENEW, false);
   rendererMap.mark(uuid, CONTROLS, ctrl);
 }