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.binding;
17  
18  import org.fourthline.cling.model.meta.LocalService;
19  import org.fourthline.cling.model.types.ServiceId;
20  import org.fourthline.cling.model.types.ServiceType;
21  
22  /**
23   * Reads {@link org.fourthline.cling.model.meta.LocalService} metadata given a Java class.
24   *
25   * @author Christian Bauer
26   */
27  public interface LocalServiceBinder {
28  
29      /**
30       * @param clazz The Java class that is the source of the service metadata.
31       * @return The produced metadata.
32       * @throws LocalServiceBindingException If binding failed.
33       */
34      public LocalService read(Class<?> clazz) throws LocalServiceBindingException;
35  
36      /**
37       *
38       * @param clazz The Java class that is the source of the service metadata.
39       * @param id The pre-defined identifier of the service.
40       * @param type The pre-defined type of the service.
41       * @param supportsQueryStateVariables <code>true</code> if the service should support the
42       *                                    deprecated "query any state variable value" action.
43       * @param stringConvertibleTypes A list of Java classes which map directly to string-typed
44       *                               UPnP state variables.
45       * @return The produced metadata.
46       * @throws LocalServiceBindingException If binding failed.
47       */
48      public LocalService read(Class<?> clazz, ServiceId id, ServiceType type,
49                                boolean supportsQueryStateVariables, Class[] stringConvertibleTypes) throws LocalServiceBindingException;
50  }