public ServiceType[] findServiceTypes() { Collection<S> services = findServices(null, null, (D) this); Collection<ServiceType> col = new HashSet<>(); for (S service : services) { col.add(service.getServiceType()); } return col.toArray(new ServiceType[col.size()]); }
public ControlPointAdapter getControlPointAdapter(Service service) { // TODO: Just take the first, we really should provide a drop-down menu for (ControlPointAdapter controlPointAdapter : controlPointLoader) { if (controlPointAdapter.getServiceType().implementsVersion(service.getServiceType())) { return controlPointAdapter; } } return null; }
public void onUseServiceRequest(@Observes UseService request) { for (ServiceType supportedServiceType : getSupportedServiceTypes()) { if (request.service.getServiceType().implementsVersion(supportedServiceType)) { onUseServiceRequest(request.service); break; } } }
public String getDetailsMessage() { StringBuilder sb = new StringBuilder(); if (getDevice().isFullyHydrated()) { sb.append(getDevice().getDisplayString()); sb.append("\n\n"); for (Service service : getDevice().getServices()) { sb.append(service.getServiceType()).append("\n"); } } else { sb.append(getString(R.string.deviceDetailsNotYetAvailable)); } return sb.toString(); } // DOC:DETAILS
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 OutgoingActionResponseMessage(UpnpResponse.Status status, Action action) { super(new UpnpResponse(status)); if (action != null) { if (action instanceof QueryStateVariableAction) { this.actionNamespace = Constants.NS_UPNP_CONTROL_10; } else { this.actionNamespace = action.getService().getServiceType().toString(); } } addHeaders(); }
@Override public void init(Service service) { this.service = service; this.callback = new MonitorSubscriptionCallback(service); view.setPresenter(this); view.setTitle("Monitoring Service: " + service.getServiceType().toFriendlyString()); }
public List<ValidationError> validate() { List<ValidationError> errors = new ArrayList<>(); if (getServiceType() == null) { errors.add(new ValidationError( getClass(),
soapActionHeader = new SoapActionHeader( new SoapActionType( action.getService().getServiceType(), action.getName()
setText(serviceNode.getServiceType().getType());
public ServiceType[] findServiceTypes() { Collection<S> services = findServices(null, null, (D) this); Collection<ServiceType> col = new HashSet(); for (S service : services) { col.add(service.getServiceType()); } return col.toArray(new ServiceType[col.size()]); }
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)); } } }
deviceNode.add(serviceNode); addIfNotNull(serviceNode, "Service Type: ", service.getServiceType().toString()); 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 OutgoingActionResponseMessage(UpnpResponse.Status status, Action action) { super(new UpnpResponse(status)); if (action != null) { if (action instanceof QueryStateVariableAction) { this.actionNamespace = Constants.NS_UPNP_CONTROL_10; } else { this.actionNamespace = action.getService().getServiceType().toString(); } } addHeaders(); }
public List<ValidationError> validate() { List<ValidationError> errors = new ArrayList(); if (getServiceType() == null) { errors.add(new ValidationError( getClass(),
soapActionHeader = new SoapActionHeader( new SoapActionType( action.getService().getServiceType(), action.getName()
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)); } } }