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.Action;
19  import org.fourthline.cling.model.meta.StateVariable;
20  import org.fourthline.cling.model.types.ServiceId;
21  import org.fourthline.cling.model.types.ServiceType;
22  import org.fourthline.cling.model.types.UDAServiceId;
23  import org.fourthline.cling.model.types.UDAServiceType;
24  import org.seamless.util.URIUtil;
25  
26  import java.net.URI;
27  import java.net.URL;
28  
29  /**
30   * @author Christian Bauer
31   */
32  public class SampleServiceTwo extends SampleService {
33  
34      public static URI getThisDescriptorURI() {
35          return URI.create("service/upnp-org/MY-SERVICE-456/desc");
36      }
37  
38      public static URL getThisDescriptorURL() {
39          return URIUtil.createAbsoluteURL(SampleDeviceRoot.getDeviceDescriptorURL(), getThisDescriptorURI());
40      }
41  
42      public static ServiceId getThisServiceId() {
43          return new UDAServiceId("MY-SERVICE-456");
44      }
45  
46      public static ServiceType getThisServiceType() {
47          return new UDAServiceType("MY-SERVICE-TYPE-TWO", 2);
48      }
49  
50      @Override
51      public ServiceType getServiceType() {
52          return getThisServiceType();
53      }
54  
55      @Override
56      public ServiceId getServiceId() {
57          return getThisServiceId();
58      }
59  
60      @Override
61      public URI getDescriptorURI() {
62          return getThisDescriptorURI();
63      }
64  
65      @Override
66      public URI getControlURI() {
67          return URI.create("service/upnp-org/MY-SERVICE-456/control");
68      }
69  
70      @Override
71      public URI getEventSubscriptionURI() {
72          return URI.create("service/upnp-org/MY-SERVICE-456/events");
73      }
74  
75      @Override
76      public Action[] getActions() {
77          return new Action[0];
78      }
79  
80      @Override
81      public StateVariable[] getStateVariables() {
82          return new StateVariable[0];
83      }
84  
85  }