@Override public String toString() { return "(" + getClass().getSimpleName() + ") ServiceId: " + getServiceId(); } }
protected String getServicePath(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 getDevicePath(service.getDevice()) + s.toString(); } }
private boolean isMatch(Service s, ServiceType serviceType, ServiceId serviceId) { boolean matchesType = serviceType == null || s.getServiceType().implementsVersion(serviceType); boolean matchesId = serviceId == null || s.getServiceId().equals(serviceId); return matchesType && matchesId; }
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(); } }
public ServiceReference getReference() { return new ServiceReference(getDevice().getIdentity().getUdn(), getServiceId()); }
if (getServiceId() == null) { errors.add(new ValidationError( getClass(), if(actionErrors.size() > 0) { log.warning("Discarding invalid action of service '" + getServiceId() + "': " + action.getName()); for (ValidationError actionError : actionErrors) { log.warning("Invalid action '" + action.getName() + "': " + actionError);
@Override public String toString() { return "(" + getClass().getSimpleName() + ") ServiceId: " + getServiceId(); } }
setToolTipText(serviceNode.getServiceId().toString()); setText(serviceNode.getServiceType().getType());
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()); }
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)); } } }
addIfNotNull(serviceNode, "Service ID: ", service.getServiceId().toString());
private boolean isMatch(Service s, ServiceType serviceType, ServiceId serviceId) { boolean matchesType = serviceType == null || s.getServiceType().implementsVersion(serviceType); boolean matchesId = serviceId == null || s.getServiceId().equals(serviceId); return matchesType && matchesId; }
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(); } }
public ServiceReference getReference() { return new ServiceReference(getDevice().getIdentity().getUdn(), getServiceId()); }
if (getServiceId() == null) { errors.add(new ValidationError( getClass(),
@Override public String toString() { return "(" + getClass().getSimpleName() + ") ServiceId: " + getServiceId(); } }
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)); } } }
private boolean isMatch(Service s, ServiceType serviceType, ServiceId serviceId) { boolean matchesType = serviceType == null || s.getServiceType().implementsVersion(serviceType); boolean matchesId = serviceId == null || s.getServiceId().equals(serviceId); return matchesType && matchesId; }
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(); } }
public ServiceReference getReference() { return new ServiceReference(getDevice().getIdentity().getUdn(), getServiceId()); }