View Javadoc
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.test.data;
17  
18  import org.fourthline.cling.model.meta.Device;
19  import org.fourthline.cling.model.meta.DeviceDetails;
20  import org.fourthline.cling.model.profile.RemoteClientInfo;
21  import org.fourthline.cling.model.profile.DeviceDetailsProvider;
22  import org.fourthline.cling.model.meta.DeviceIdentity;
23  import org.fourthline.cling.model.meta.Icon;
24  import org.fourthline.cling.model.meta.ManufacturerDetails;
25  import org.fourthline.cling.model.meta.ModelDetails;
26  import org.fourthline.cling.model.meta.Service;
27  import org.fourthline.cling.model.types.DeviceType;
28  import org.fourthline.cling.model.types.UDADeviceType;
29  import org.fourthline.cling.model.types.UDN;
30  
31  /**
32   * @author Christian Bauer
33   */
34  public class SampleDeviceEmbeddedTwo extends SampleDevice {
35  
36      public SampleDeviceEmbeddedTwo(DeviceIdentity identity, Service service, Device embeddedDevice) {
37          super(identity, service, embeddedDevice);
38      }
39  
40      @Override
41      public DeviceType getDeviceType() {
42          return new UDADeviceType("MY-DEVICE-TYPE-THREE", 3);
43      }
44  
45      @Override
46      public DeviceDetails getDeviceDetails() {
47          return new DeviceDetails(
48                  "My Testdevice Third",
49                  new ManufacturerDetails("4th Line", "http://www.4thline.org/"),
50                  new ModelDetails("MYMODEL", "TEST Device", "ONE", "http://www.4thline.org/another_embedded_model"),
51                  "000da201238d",
52                  "100000000003",
53                  "http://www.4thline.org/some_third_user_interface");
54  
55      }
56  
57      @Override
58      public DeviceDetailsProvider getDeviceDetailsProvider() {
59          return new DeviceDetailsProvider() {
60              public DeviceDetails provide(RemoteClientInfo info) {
61                  return getDeviceDetails();
62              }
63          };
64      }
65  
66      @Override
67      public Icon[] getIcons() {
68          return null;
69      }
70  
71      public static UDN getEmbeddedTwoUDN() {
72          return new UDN("MY-DEVICE-789");
73      }
74  
75  }