@Override public String toString() { return "urn:" + getNamespace() + ":service:" + getType() + ":" + getVersion(); }
public ServiceType getServiceType() { if (version == null) return null; return new ServiceType(namespace, type, version); }
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; }
@Override public String getExtendedInformation() { String info = ""; if (device.findServiceTypes() != null) for (ServiceType cap : device.findServiceTypes()) { info += "\n\t" + cap.getType() + " : " + cap.toFriendlyString(); } ; return info; }
public String getString() { return getValue().toString(); } }
public void setString(String s) throws InvalidHeaderException { try { setValue(ServiceType.valueOf(s)); } catch (RuntimeException ex) { throw new InvalidHeaderException("Invalid service type header value, " + ex.getMessage()); } }
setText(serviceNode.getServiceType().getType());
@Override public void init(Service service) { this.service = service; this.callback = new MonitorSubscriptionCallback(service); view.setPresenter(this); view.setTitle("Monitoring Service: " + service.getServiceType().toFriendlyString()); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof NamedServiceType)) return false; NamedServiceType that = (NamedServiceType) o; if (!serviceType.equals(that.serviceType)) return false; if (!udn.equals(that.udn)) return false; return true; }
@Override public int hashCode() { int result = udn.hashCode(); result = 31 * result + serviceType.hashCode(); return result; } }
@Override public String getExtendedInformation() { String info = ""; if (device.findServiceTypes() != null) for (ServiceType cap : device.findServiceTypes()) { info += "\n\t" + cap.getType() + " : " + cap.toFriendlyString(); } ; return info; }
@Override public String toString() { return getUdn().toString() + "::" + getServiceType().toString(); }
public static NamedServiceType valueOf(String s) throws InvalidValueException { String[] strings = s.split("::"); if (strings.length != 2) { throw new InvalidValueException("Can't parse UDN::ServiceType from: " + s); } UDN udn; try { udn = UDN.valueOf(strings[0]); } catch (Exception ex) { throw new InvalidValueException("Can't parse UDN: " + strings[0]); } ServiceType serviceType = ServiceType.valueOf(strings[1]); return new NamedServiceType(udn, serviceType); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || !(o instanceof NamedServiceType)) return false; NamedServiceType that = (NamedServiceType) o; if (!serviceType.equals(that.serviceType)) return false; if (!udn.equals(that.udn)) return false; return true; }
@Override public int hashCode() { int result = udn.hashCode(); result = 31 * result + serviceType.hashCode(); return result; } }
public String toFriendlyString() { return getNamespace() + ":" + getType() + ":" + getVersion(); }
protected List<RemoteService> filterExclusiveServices(RemoteService[] services) { ServiceType[] exclusiveTypes = getUpnpService().getConfiguration().getExclusiveServiceTypes(); if (exclusiveTypes == null || exclusiveTypes.length == 0) return Arrays.asList(services); List<RemoteService> exclusiveServices = new ArrayList<>(); for (RemoteService discoveredService : services) { for (ServiceType exclusiveType : exclusiveTypes) { if (discoveredService.getServiceType().implementsVersion(exclusiveType)) { log.fine("Including exclusive service: " + discoveredService); exclusiveServices.add(discoveredService); } else { log.fine("Excluding unwanted service: " + exclusiveType); } } } return exclusiveServices; }
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 ServiceType getServiceType() { return new ServiceType("samsung.com", "MessageBoxService", 1); }
service.serviceType = (ServiceType.valueOf(XMLUtil.getTextContent(serviceChild))); } else if (ELEMENT.serviceId.equals(serviceChild)) { service.serviceId = (ServiceId.valueOf(XMLUtil.getTextContent(serviceChild)));