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.model.meta;
17  
18  import org.fourthline.cling.model.ValidationError;
19  
20  import java.util.List;
21  import java.util.Collections;
22  
23  
24  /**
25   * Describes a single action, the deprecated "query any state variable" action.
26   *
27   * Note: This is already deprecated in UDA 1.0!
28   *
29   * @author Christian Bauer
30   */
31  public class QueryStateVariableAction<S extends Service> extends Action<S> {
32  
33      public static final String INPUT_ARG_VAR_NAME = "varName";
34      public static final String OUTPUT_ARG_RETURN = "return";
35  
36      public static final String ACTION_NAME = "QueryStateVariable";
37      public static final String VIRTUAL_STATEVARIABLE_INPUT = "VirtualQueryActionInput";
38      public static final String VIRTUAL_STATEVARIABLE_OUTPUT = "VirtualQueryActionOutput";
39  
40      public QueryStateVariableAction() {
41          this(null);
42      }
43  
44      public QueryStateVariableAction(S service) {
45          super(ACTION_NAME,
46                  new ActionArgument[]{
47                          new ActionArgument(INPUT_ARG_VAR_NAME, VIRTUAL_STATEVARIABLE_INPUT, ActionArgument.Direction.IN),
48                          new ActionArgument(OUTPUT_ARG_RETURN, VIRTUAL_STATEVARIABLE_OUTPUT, ActionArgument.Direction.OUT),
49                  }
50          );
51          setService(service);
52      }
53  
54      @Override
55      public String getName() {
56          return ACTION_NAME;
57      }
58  
59      @Override
60      public List<ValidationError> validate() {
61          return Collections.EMPTY_LIST;
62      }
63  }