@Override public ServiceType[] getExclusiveServiceTypes() { return new ServiceType[]{ new UDAServiceType("SwitchPower") }; } // DOC:SERVICE_TYPE
@Override protected ServiceType[] getSupportedServiceTypes() { return new ServiceType[]{new UDAServiceType("RenderingControl", 1)}; }
@Override protected ServiceType[] getSupportedServiceTypes() { return new ServiceType[] {new UDAServiceType("AVTransport", 1)}; }
@Override protected ServiceType[] getSupportedServiceTypes() { return new ServiceType[]{new UDAServiceType("ContentDirectory", 1)}; }
@Override protected ServiceType[] getSupportedServiceTypes() { return new ServiceType[]{new UDAServiceType("WANIPConnection", 1)}; }
@Override protected ServiceType[] getSupportedServiceTypes() { return new ServiceType[]{new UDAServiceType("SwitchPower", 1)}; }
public static UDAServiceType valueOf(String s) throws InvalidValueException { Matcher matcher = UDAServiceType.PATTERN.matcher(s); try { if (matcher.matches()) return new UDAServiceType(matcher.group(1), Integer.valueOf(matcher.group(2))); } catch (RuntimeException e) { throw new InvalidValueException(String.format( "Can't parse UDA service type string (namespace/type/version) '%s': %s", s, e.toString())); } throw new InvalidValueException("Can't parse UDA service type string (namespace/type/version): " + s); }
protected LocalService<SwitchPower> getSwitchPowerService() { if (upnpService == null) return null; LocalDevice binaryLightDevice; if ((binaryLightDevice = upnpService.getRegistry().getLocalDevice(udn, true)) == null) return null; return (LocalService<SwitchPower>) binaryLightDevice.findService(new UDAServiceType("SwitchPower", 1)); } // DOC:SERVICE_BINDING
public LocalService read(Class<?> clazz) throws LocalServiceBindingException { log.fine("Reading and binding annotations of service implementation class: " + clazz); // Read the service ID and service type from the annotation if (clazz.isAnnotationPresent(UpnpService.class)) { UpnpService annotation = clazz.getAnnotation(UpnpService.class); UpnpServiceId idAnnotation = annotation.serviceId(); UpnpServiceType typeAnnotation = annotation.serviceType(); ServiceId serviceId = idAnnotation.namespace().equals(UDAServiceId.DEFAULT_NAMESPACE) ? new UDAServiceId(idAnnotation.value()) : new ServiceId(idAnnotation.namespace(), idAnnotation.value()); ServiceType serviceType = typeAnnotation.namespace().equals(UDAServiceType.DEFAULT_NAMESPACE) ? new UDAServiceType(typeAnnotation.value(), typeAnnotation.version()) : new ServiceType(typeAnnotation.namespace(), typeAnnotation.value(), typeAnnotation.version()); boolean supportsQueryStateVariables = annotation.supportsQueryStateVariables(); Set<Class> stringConvertibleTypes = readStringConvertibleTypes(annotation.stringConvertibleTypes()); return read(clazz, serviceId, serviceType, supportsQueryStateVariables, stringConvertibleTypes); } else { throw new LocalServiceBindingException("Given class is not an @UpnpService"); } }
public static UDAServiceType valueOf(String s) throws InvalidValueException { Matcher matcher = UDAServiceType.PATTERN.matcher(s); if (matcher.matches()) { return new UDAServiceType(matcher.group(1), Integer.valueOf(matcher.group(2))); } else { throw new InvalidValueException("Can't parse UDA service type string (namespace/type/version): " + s); } }
public LocalService read(Class<?> clazz) throws LocalServiceBindingException { log.fine("Reading and binding annotations of service implementation class: " + clazz); // Read the service ID and service type from the annotation if (clazz.isAnnotationPresent(UpnpService.class)) { UpnpService annotation = clazz.getAnnotation(UpnpService.class); UpnpServiceId idAnnotation = annotation.serviceId(); UpnpServiceType typeAnnotation = annotation.serviceType(); ServiceId serviceId = idAnnotation.namespace().equals(UDAServiceId.DEFAULT_NAMESPACE) ? new UDAServiceId(idAnnotation.value()) : new ServiceId(idAnnotation.namespace(), idAnnotation.value()); ServiceType serviceType = typeAnnotation.namespace().equals(UDAServiceType.DEFAULT_NAMESPACE) ? new UDAServiceType(typeAnnotation.value(), typeAnnotation.version()) : new ServiceType(typeAnnotation.namespace(), typeAnnotation.value(), typeAnnotation.version()); boolean supportsQueryStateVariables = annotation.supportsQueryStateVariables(); Set<Class> stringConvertibleTypes = readStringConvertibleTypes(annotation.stringConvertibleTypes()); return read(clazz, serviceId, serviceType, supportsQueryStateVariables, stringConvertibleTypes); } else { throw new LocalServiceBindingException("Given class is not an @UpnpService"); } }
@Override public boolean asService(String service) { return (device.findService(new UDAServiceType(service)) != null); }
public class MyUpnpService extends AndroidUpnpServiceImpl { @Override protected AndroidUpnpServiceConfiguration createConfiguration(WifiManager wifiManager) { return new AndroidUpnpServiceConfiguration(wifiManager) { @Override public ServiceType[] getExclusiveServiceTypes() { return new ServiceType[] { new UDAServiceType("AVTransport") }; } }; }
public MediaControlBiz(Device device, Handler handler, long mId) { serviceAVT = device.findService(new UDAServiceType("AVTransport", 1)); serviceRC = device .findService(new UDAServiceType("RenderingControl", 1)); upnpBiz = UpnpServiceBiz.newInstance(); this.handler = handler; instanceId = new UnsignedIntegerFourBytes(mId); }
public static Service getAVTransportService() { if (SailorCast.upnpServiceController.getSelectedRenderer() == null) return null; return ((CDevice) SailorCast.upnpServiceController.getSelectedRenderer()).getDevice().findService( new UDAServiceType("AVTransport")); }
public static Service getAVTransportService() { if (Main.upnpServiceController.getSelectedRenderer() == null) return null; return ((CDevice) Main.upnpServiceController.getSelectedRenderer()).getDevice().findService( new UDAServiceType("AVTransport")); }
private Service getContentDirectoryService() { if (Main.upnpServiceController.getSelectedContentDirectory() == null) return null; return ((CDevice) Main.upnpServiceController.getSelectedContentDirectory()).getDevice().findService( new UDAServiceType("ContentDirectory")); }
public static Service getRenderingControlService() { if (SailorCast.upnpServiceController.getSelectedRenderer() == null) return null; return ((CDevice) SailorCast.upnpServiceController.getSelectedRenderer()).getDevice().findService( new UDAServiceType("RenderingControl")); }
public static Service getRenderingControlService() { if (Main.upnpServiceController.getSelectedRenderer() == null) return null; return ((CDevice) Main.upnpServiceController.getSelectedRenderer()).getDevice().findService( new UDAServiceType("RenderingControl")); }
@SuppressWarnings("unused") private Service getMediaReceiverRegistarService() { if (Main.upnpServiceController.getSelectedContentDirectory() == null) return null; return ((CDevice) Main.upnpServiceController.getSelectedContentDirectory()).getDevice().findService( new UDAServiceType("X_MS_MediaReceiverRegistar")); }