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  import java.net.URI;
32  
33  /**
34   * @author Christian Bauer
35   */
36  public class SampleDeviceEmbeddedOne extends SampleDevice {
37  
38      public SampleDeviceEmbeddedOne(DeviceIdentity identity, Service service, Device embeddedDevice) {
39          super(identity, service, embeddedDevice);
40      }
41  
42      @Override
43      public DeviceType getDeviceType() {
44          return new UDADeviceType("MY-DEVICE-TYPE-TWO", 2);
45      }
46  
47      @Override
48      public DeviceDetails getDeviceDetails() {
49          return new DeviceDetails(
50                  "My Testdevice Second",
51                  new ManufacturerDetails("4th Line", "http://www.4thline.org/"),
52                  new ModelDetails("MYMODEL", "TEST Device", "ONE", "http://www.4thline.org/this_is_the_embedded_model"),
53                  "000da201238d",
54                  "100000000002",
55                  "http://www.4thline.org/some_other_user_interface");
56  
57      }
58  
59      @Override
60      public DeviceDetailsProvider getDeviceDetailsProvider() {
61          return new DeviceDetailsProvider() {
62              public DeviceDetails provide(RemoteClientInfo info) {
63                  return getDeviceDetails();
64              }
65          };
66      }
67  
68      @Override
69      public Icon[] getIcons() {
70          return new Icon[]{
71                  new Icon("image/png", 32, 32, 8, URI.create("icon3.png"))
72          };
73      }
74  
75      public static UDN getEmbeddedOneUDN() {
76          return new UDN("MY-DEVICE-456");
77      }
78  
79  }