1 /* 2 * Copyright (C) 2013 4th Line GmbH, Switzerland 3 * 4 * The contents of this file are subject to the terms of either the GNU 5 * Lesser General Public License Version 2 or later ("LGPL") or the 6 * Common Development and Distribution License Version 1 or later 7 * ("CDDL") (collectively, the "License"). You may not use this file 8 * except in compliance with the License. See LICENSE.txt for more 9 * information. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 */ 15 16 package org.fourthline.cling.registry; 17 18 import org.fourthline.cling.model.meta.Device; 19 import org.fourthline.cling.model.meta.LocalDevice; 20 import org.fourthline.cling.model.meta.RemoteDevice; 21 22 /** 23 * Convenience class, provides empty implementations of all methods. 24 * <p> 25 * Also unifies local and remote device additions and removals with 26 * {@link #deviceAdded(Registry, org.fourthline.cling.model.meta.Device)} and 27 * {@link #deviceRemoved(Registry, org.fourthline.cling.model.meta.Device)} methods. 28 * </p> 29 * 30 * @author Christian Bauer 31 */ 32 public class DefaultRegistryListener implements RegistryListener { 33 34 public void remoteDeviceDiscoveryStarted(Registry registry, RemoteDevice device) { 35 36 } 37 38 public void remoteDeviceDiscoveryFailed(Registry registry, RemoteDevice device, Exception ex) { 39 40 } 41 42 /** 43 * Calls the {@link #deviceAdded(Registry, org.fourthline.cling.model.meta.Device)} method. 44 * 45 * @param registry The Cling registry of all devices and services know to the local UPnP stack. 46 * @param device A validated and hydrated device metadata graph, with complete service metadata. 47 */ 48 public void remoteDeviceAdded(Registry registry, RemoteDevice device) { 49 deviceAdded(registry, device); 50 } 51 52 public void remoteDeviceUpdated(Registry registry, RemoteDevice device) { 53 54 } 55 56 /** 57 * Calls the {@link #deviceRemoved(Registry, org.fourthline.cling.model.meta.Device)} method. 58 * 59 * @param registry The Cling registry of all devices and services know to the local UPnP stack. 60 * @param device A validated and hydrated device metadata graph, with complete service metadata. 61 */ 62 public void remoteDeviceRemoved(Registry registry, RemoteDevice device) { 63 deviceRemoved(registry, device); 64 } 65 66 /** 67 * Calls the {@link #deviceAdded(Registry, org.fourthline.cling.model.meta.Device)} method. 68 * 69 * @param registry The Cling registry of all devices and services know to the local UPnP stack. 70 * @param device The local device added to the {@link org.fourthline.cling.registry.Registry}. 71 */ 72 public void localDeviceAdded(Registry registry, LocalDevice device) { 73 deviceAdded(registry, device); 74 } 75 76 /** 77 * Calls the {@link #deviceRemoved(Registry, org.fourthline.cling.model.meta.Device)} method. 78 * 79 * @param registry The Cling registry of all devices and services know to the local UPnP stack. 80 * @param device The local device removed from the {@link org.fourthline.cling.registry.Registry}. 81 */ 82 public void localDeviceRemoved(Registry registry, LocalDevice device) { 83 deviceRemoved(registry, device); 84 } 85 86 public void deviceAdded(Registry registry, Device device) { 87 88 } 89 90 public void deviceRemoved(Registry registry, Device device) { 91 92 } 93 94 public void beforeShutdown(Registry registry) { 95 96 } 97 98 public void afterShutdown() { 99 100 } 101 }