@Override public LocalDevice newInstance(UDN udn, UDAVersion version, DeviceType type, DeviceDetails details, Icon[] icons, LocalService[] services, List<LocalDevice> embeddedDevices) throws ValidationException { return new LocalDevice( new DeviceIdentity(udn, getIdentity().getMaxAgeSeconds()), version, type, details, icons, services, embeddedDevices.size() > 0 ? embeddedDevices.toArray(new LocalDevice[embeddedDevices.size()]) : null ); }
public OutgoingNotificationRequestUDN(Location location, LocalDevice device, NotificationSubtype type) { super(location, device, type); getHeaders().add(UpnpHeader.Type.NT, new UDNHeader(device.getIdentity().getUdn())); getHeaders().add(UpnpHeader.Type.USN, new UDNHeader(device.getIdentity().getUdn())); }
public OutgoingSearchResponseUDN(IncomingDatagramMessage request, Location location, LocalDevice device) { super(request, location, device); getHeaders().add(UpnpHeader.Type.ST, new UDNHeader(device.getIdentity().getUdn())); getHeaders().add(UpnpHeader.Type.USN, new UDNHeader(device.getIdentity().getUdn())); } }
protected boolean isAdvertisementDisabled(LocalDevice device) { DiscoveryOptions options = getUpnpService().getRegistry().getDiscoveryOptions(device.getIdentity().getUdn()); return options != null && !options.isAdvertised(); }
boolean remove(final LocalDevice localDevice, boolean shuttingDown) throws RegistrationException { LocalDevice registeredDevice = get(localDevice.getIdentity().getUdn(), true); if (registeredDevice != null) { setDiscoveryOptions(localDevice.getIdentity().getUdn(), null); getDeviceItems().remove(new RegistryItem(localDevice.getIdentity().getUdn())); incomingSubscription.getItem().getService().getDevice().getIdentity().getUdn(); if (subscriptionForUDN.equals(registeredDevice.getIdentity().getUdn())) { log.fine("Removing incoming subscription: " + incomingSubscription.getKey()); it.remove(); if (isAdvertised(localDevice.getIdentity().getUdn())) advertiseByebye(localDevice, !shuttingDown);
void add(final LocalDevice localDevice, DiscoveryOptions options) throws RegistrationException { setDiscoveryOptions(localDevice.getIdentity().getUdn(), options); if (registry.getDevice(localDevice.getIdentity().getUdn(), false) != null) { log.fine("Ignoring addition, device already registered: " + localDevice); return; log.fine("Adding item to registry with expiration in seconds: " + localDevice.getIdentity().getMaxAgeSeconds()); localDevice.getIdentity().getUdn(), localDevice, localDevice.getIdentity().getMaxAgeSeconds() );
public OutgoingSearchResponseRootDevice(IncomingDatagramMessage request, Location location, LocalDevice device) { super(request, location, device); getHeaders().add(UpnpHeader.Type.ST, new RootDeviceHeader()); getHeaders().add(UpnpHeader.Type.USN, new USNRootDeviceHeader(device.getIdentity().getUdn())); } }
public OutgoingNotificationRequestServiceType(Location location, LocalDevice device, NotificationSubtype type, ServiceType serviceType) { super(location, device, type); getHeaders().add(UpnpHeader.Type.NT, new ServiceTypeHeader(serviceType)); getHeaders().add(UpnpHeader.Type.USN, new ServiceUSNHeader(device.getIdentity().getUdn(), serviceType)); }
public OutgoingSearchResponseServiceType(IncomingDatagramMessage request, Location location, LocalDevice device, ServiceType serviceType) { super(request, location, device); getHeaders().add(UpnpHeader.Type.ST, new ServiceTypeHeader(serviceType)); getHeaders().add(UpnpHeader.Type.USN, new ServiceUSNHeader(device.getIdentity().getUdn(), serviceType)); }
public OutgoingNotificationRequestRootDevice(Location location, LocalDevice device, NotificationSubtype type) { super(location, device, type); getHeaders().add(UpnpHeader.Type.NT, new RootDeviceHeader()); getHeaders().add(UpnpHeader.Type.USN, new USNRootDeviceHeader(device.getIdentity().getUdn())); if ("true".equals(System.getProperty(Constants.SYSTEM_PROPERTY_ANNOUNCE_MAC_ADDRESS)) && location.getNetworkAddress().getHardwareAddress() != null) { getHeaders().add( UpnpHeader.Type.EXT_IFACE_MAC, new InterfaceMacHeader(location.getNetworkAddress().getHardwareAddress()) ); } }
public OutgoingNotificationRequestDeviceType(Location location, LocalDevice device, NotificationSubtype type) { super(location, device, type); getHeaders().add(UpnpHeader.Type.NT, new DeviceTypeHeader(device.getType())); getHeaders().add(UpnpHeader.Type.USN, new DeviceUSNHeader(device.getIdentity().getUdn(), device.getType())); }
public OutgoingSearchResponseDeviceType(IncomingDatagramMessage request, Location location, LocalDevice device) { super(request, location, device); getHeaders().add(UpnpHeader.Type.ST, new DeviceTypeHeader(device.getType())); getHeaders().add(UpnpHeader.Type.USN, new DeviceUSNHeader(device.getIdentity().getUdn(), device.getType())); }
public OutgoingSearchResponse(IncomingDatagramMessage request, Location location, LocalDevice device) { super(new UpnpResponse(UpnpResponse.Status.OK), request.getSourceAddress(), request.getSourcePort()); getHeaders().add(UpnpHeader.Type.MAX_AGE, new MaxAgeHeader(device.getIdentity().getMaxAgeSeconds())); getHeaders().add(UpnpHeader.Type.LOCATION, new LocationHeader(location.getURL())); getHeaders().add(UpnpHeader.Type.SERVER, new ServerHeader()); getHeaders().add(UpnpHeader.Type.EXT, new EXTHeader()); if ("true".equals(System.getProperty(Constants.SYSTEM_PROPERTY_ANNOUNCE_MAC_ADDRESS)) && location.getNetworkAddress().getHardwareAddress() != null) { getHeaders().add( UpnpHeader.Type.EXT_IFACE_MAC, new InterfaceMacHeader(location.getNetworkAddress().getHardwareAddress()) ); } }
protected OutgoingNotificationRequest(Location location, LocalDevice device, NotificationSubtype type) { super( new UpnpRequest(UpnpRequest.Method.NOTIFY), ModelUtil.getInetAddressByName(Constants.IPV4_UPNP_MULTICAST_GROUP), Constants.UPNP_MULTICAST_PORT ); this.type = type; getHeaders().add(UpnpHeader.Type.MAX_AGE, new MaxAgeHeader(device.getIdentity().getMaxAgeSeconds())); getHeaders().add(UpnpHeader.Type.LOCATION, new LocationHeader(location.getURL())); getHeaders().add(UpnpHeader.Type.SERVER, new ServerHeader()); getHeaders().add(UpnpHeader.Type.HOST, new HostHeader()); getHeaders().add(UpnpHeader.Type.NTS, new NTSHeader(type)); }
@Override public LocalDevice newInstance(UDN udn, UDAVersion version, DeviceType type, DeviceDetails details, Icon[] icons, LocalService[] services, List<LocalDevice> embeddedDevices) throws ValidationException { return new LocalDevice( new DeviceIdentity(udn, getIdentity().getMaxAgeSeconds()), version, type, details, icons, services, embeddedDevices.size() > 0 ? embeddedDevices.toArray(new LocalDevice[embeddedDevices.size()]) : null ); }
public OutgoingSearchResponseUDN(IncomingDatagramMessage request, Location location, LocalDevice device) { super(request, location, device); getHeaders().add(UpnpHeader.Type.ST, new UDNHeader(device.getIdentity().getUdn())); getHeaders().add(UpnpHeader.Type.USN, new UDNHeader(device.getIdentity().getUdn())); } }
public OutgoingNotificationRequestUDN(Location location, LocalDevice device, NotificationSubtype type) { super(location, device, type); getHeaders().add(UpnpHeader.Type.NT, new UDNHeader(device.getIdentity().getUdn())); getHeaders().add(UpnpHeader.Type.USN, new UDNHeader(device.getIdentity().getUdn())); }
public OutgoingSearchResponseServiceType(IncomingDatagramMessage request, Location location, LocalDevice device, ServiceType serviceType) { super(request, location, device); getHeaders().add(UpnpHeader.Type.ST, new ServiceTypeHeader(serviceType)); getHeaders().add(UpnpHeader.Type.USN, new ServiceUSNHeader(device.getIdentity().getUdn(), serviceType)); }
public OutgoingNotificationRequestDeviceType(Location location, LocalDevice device, NotificationSubtype type) { super(location, device, type); getHeaders().add(UpnpHeader.Type.NT, new DeviceTypeHeader(device.getType())); getHeaders().add(UpnpHeader.Type.USN, new DeviceUSNHeader(device.getIdentity().getUdn(), device.getType())); }
public OutgoingNotificationRequestRootDevice(Location location, LocalDevice device, NotificationSubtype type) { super(location, device, type); getHeaders().add(UpnpHeader.Type.NT, new RootDeviceHeader()); getHeaders().add(UpnpHeader.Type.USN, new USNRootDeviceHeader(device.getIdentity().getUdn())); if (location.getNetworkAddress().getHardwareAddress() != null) { getHeaders().add( UpnpHeader.Type.EXT_IFACE_MAC, new InterfaceMacHeader(location.getNetworkAddress().getHardwareAddress()) ); } }