public List<ValidationError> validateThis() { List<ValidationError> errors = new ArrayList<>(); if (getDescriptorURI() == null) { errors.add(new ValidationError( getClass(), "descriptorURI", "Descriptor location (SCPDURL) is required" )); } if (getControlURI() == null) { errors.add(new ValidationError( getClass(), "controlURI", "Control URL is required" )); } if (getEventSubscriptionURI() == null) { errors.add(new ValidationError( getClass(), "eventSubscriptionURI", "Event subscription URL is required" )); } return errors; }
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(); } }
synchronized public URL getEventSubscriptionURL() { return getService().getDevice().normalizeURI( getService().getEventSubscriptionURI() ); }
protected void generateServiceList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement) { if (!deviceModel.hasServices()) return; Element serviceListElement = appendNewElement(descriptor, deviceElement, ELEMENT.serviceList); for (Service service : deviceModel.getServices()) { Element serviceElement = appendNewElement(descriptor, serviceListElement, ELEMENT.service); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.serviceType, service.getServiceType()); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.serviceId, service.getServiceId()); if (service instanceof RemoteService) { RemoteService rs = (RemoteService) service; appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.SCPDURL, rs.getDescriptorURI()); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.controlURL, rs.getControlURI()); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.eventSubURL, rs.getEventSubscriptionURI()); } else if (service instanceof LocalService) { LocalService ls = (LocalService) service; appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.SCPDURL, namespace.getDescriptorPath(ls)); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.controlURL, namespace.getControlPath(ls)); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.eventSubURL, namespace.getEventSubscriptionPath(ls)); } } }
public List<ValidationError> validateThis() { List<ValidationError> errors = new ArrayList(); if (getDescriptorURI() == null) { errors.add(new ValidationError( getClass(), "descriptorURI", "Descriptor location (SCPDURL) is required" )); } if (getControlURI() == null) { errors.add(new ValidationError( getClass(), "controlURI", "Control URL is required" )); } if (getEventSubscriptionURI() == null) { errors.add(new ValidationError( getClass(), "eventSubscriptionURI", "Event subscription URL is required" )); } return errors; }
addIfNotNull(serviceNode, "Descriptor URL: ", rs.getDevice().normalizeURI(rs.getDescriptorURI()), true); addIfNotNull(serviceNode, "Control URL: ", rs.getDevice().normalizeURI(rs.getControlURI()), true); addIfNotNull(serviceNode, "Event Subscription URL: ", rs.getDevice().normalizeURI(rs.getEventSubscriptionURI()), true);
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(); } }
synchronized public URL getEventSubscriptionURL() { return getService().getDevice().normalizeURI( getService().getEventSubscriptionURI() ); }
protected void generateServiceList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement) { if (!deviceModel.hasServices()) return; Element serviceListElement = appendNewElement(descriptor, deviceElement, ELEMENT.serviceList); for (Service service : deviceModel.getServices()) { Element serviceElement = appendNewElement(descriptor, serviceListElement, ELEMENT.service); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.serviceType, service.getServiceType()); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.serviceId, service.getServiceId()); if (service instanceof RemoteService) { RemoteService rs = (RemoteService) service; appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.SCPDURL, rs.getDescriptorURI()); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.controlURL, rs.getControlURI()); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.eventSubURL, rs.getEventSubscriptionURI()); } else if (service instanceof LocalService) { LocalService ls = (LocalService) service; appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.SCPDURL, namespace.getDescriptorPath(ls)); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.controlURL, namespace.getControlPath(ls)); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.eventSubURL, namespace.getEventSubscriptionPath(ls)); } } }
public List<ValidationError> validateThis() { List<ValidationError> errors = new ArrayList<>(); if (getDescriptorURI() == null) { errors.add(new ValidationError( getClass(), "descriptorURI", "Descriptor location (SCPDURL) is required" )); } if (getControlURI() == null) { errors.add(new ValidationError( getClass(), "controlURI", "Control URL is required" )); } if (getEventSubscriptionURI() == null) { errors.add(new ValidationError( getClass(), "eventSubscriptionURI", "Event subscription URL is required" )); } return errors; }
@Override public void logRouterInfo() throws RouterException { final RemoteDevice device = service.getDevice(); final UDAVersion version = device.getVersion(); final DeviceDetails deviceDetails = device.getDetails(); logger.info("Service id: {}", service.getServiceId()); logger.info("Reference: {}", service.getReference()); logger.info("Display name: {}", device.getDisplayString()); logger.info("Version: {}.{}", version.getMajor(), version.getMinor()); logger.info("Control uri: {}", service.getControlURI()); logger.info("Descriptor uri: {}", service.getDescriptorURI()); logger.info("Event subscription uri: {}", service.getEventSubscriptionURI()); logger.info("Device base url: {}", deviceDetails.getBaseURL()); logger.info("Device presentation uri: {}", deviceDetails.getPresentationURI()); }
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(); } }
synchronized public URL getEventSubscriptionURL() { return getService().getDevice().normalizeURI( getService().getEventSubscriptionURI() ); }
private URI getUri() { if (service.getDevice().getDetails().getPresentationURI() != null) { return service.getDevice().getDetails().getPresentationURI(); } if (service.getControlURI() != null) { return service.getControlURI(); } if (service.getDescriptorURI() != null) { return service.getDescriptorURI(); } if (service.getEventSubscriptionURI() != null) { return service.getEventSubscriptionURI(); } return null; }
protected void generateServiceList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement) { if (!deviceModel.hasServices()) return; Element serviceListElement = appendNewElement(descriptor, deviceElement, ELEMENT.serviceList); for (Service service : deviceModel.getServices()) { Element serviceElement = appendNewElement(descriptor, serviceListElement, ELEMENT.service); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.serviceType, service.getServiceType()); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.serviceId, service.getServiceId()); if (service instanceof RemoteService) { RemoteService rs = (RemoteService) service; appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.SCPDURL, rs.getDescriptorURI()); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.controlURL, rs.getControlURI()); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.eventSubURL, rs.getEventSubscriptionURI()); } else if (service instanceof LocalService) { LocalService ls = (LocalService) service; appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.SCPDURL, namespace.getDescriptorPath(ls)); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.controlURL, namespace.getControlPath(ls)); appendNewElementIfNotNull(descriptor, serviceElement, ELEMENT.eventSubURL, namespace.getEventSubscriptionPath(ls)); } } }