本文整理汇总了Java中org.teleal.cling.model.meta.Action类的典型用法代码示例。如果您正苦于以下问题:Java Action类的具体用法?Java Action怎么用?Java Action使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Action类属于org.teleal.cling.model.meta包,在下文中一共展示了Action类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CreateListenerToPrintUPnPDeviceData
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
/**
* Lists devices, services, actions, and action argumensts.
*
* @return A listener to print out debut information.
*/
public static RegistryListener CreateListenerToPrintUPnPDeviceData(){
RegistryListener Listener = new DefaultRegistryListener(){
@Override
public void deviceAdded(Registry registry, Device device) {
Service service = device.findService(new UDAServiceId("WANIPConnection"));
if (service != null){
ramaTiNup.println("Found WANIPConnection service.");
}
ramaTiNup.println("Added device: " + device.getDisplayString());
for (Service s: device.findServices()){
ramaTiNup.println(" Has Service: " + s.toString());
for (Action a: s.getActions()){
ramaTiNup.println(" Has Action: " + a.getName());
for (ActionArgument aArgs: a.getArguments()){
ramaTiNup.println(" Has Action Argument: " + aArgs.getName());
}
}
}
}
};
return Listener;
}
示例2: updateZoneInfo
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean updateZoneInfo() {
if(stateMap != null && isConfigured()) {
Service service = device.findService(new UDAServiceId("DeviceProperties"));
Action action = service.getAction("GetZoneInfo");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
Service anotherservice = device.findService(new UDAServiceId("DeviceProperties"));
Action anotheraction = service.getAction("GetZoneAttributes");
ActionInvocation anotherinvocation = new ActionInvocation(anotheraction);
executeActionInvocation(anotherinvocation);
// anotherservice = device.findService(new UDAServiceId("ZoneGroupTopology"));
// anotheraction = service.getAction("GetZoneGroupState");
// anotherinvocation = new ActionInvocation(anotheraction);
// executeActionInvocation(anotherinvocation);
return true;
} else {
return false;
}
}
示例3: updateLed
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean updateLed() {
if(isConfigured()) {
Service service = device.findService(new UDAServiceId("DeviceProperties"));
Action action = service.getAction("GetLEDState");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
return true;
}
else {
return false;
}
}
示例4: updateCurrentZoneName
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean updateCurrentZoneName() {
if(isConfigured()) {
Service service = device.findService(new UDAServiceId("DeviceProperties"));
Action action = service.getAction("GetZoneAttributes");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
return true;
}
else {
return false;
}
}
示例5: updatePosition
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean updatePosition() {
if(isConfigured()) {
Service service = device.findService(new UDAServiceId("AVTransport"));
Action action = service.getAction("GetPositionInfo");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
return true;
}
else {
return false;
}
}
示例6: updateZoneInfo
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean updateZoneInfo() {
if (stateMap != null && isConfigured()) {
Service service = device.findService(new UDAServiceId("DeviceProperties"));
Action action = service.getAction("GetZoneInfo");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
Service anotherservice = device.findService(new UDAServiceId("DeviceProperties"));
Action anotheraction = service.getAction("GetZoneAttributes");
ActionInvocation anotherinvocation = new ActionInvocation(anotheraction);
executeActionInvocation(anotherinvocation);
// anotherservice = device.findService(new UDAServiceId("ZoneGroupTopology"));
// anotheraction = service.getAction("GetZoneGroupState");
// anotherinvocation = new ActionInvocation(anotheraction);
// executeActionInvocation(anotherinvocation);
return true;
} else {
return false;
}
}
示例7: getCurrentAlarmList
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public List<SonosAlarm> getCurrentAlarmList() {
List<SonosAlarm> sonosAlarms = null;
if (isConfigured()) {
Service service = device.findService(new UDAServiceId("AlarmClock"));
Action action = service.getAction("ListAlarms");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
try {
sonosAlarms = SonosXMLParser
.getAlarmsFromStringResult(invocation.getOutput("CurrentAlarmList").toString());
} catch (SAXException e) {
logger.error("Could not parse Alarms from String {}",
invocation.getOutput("CurrentAlarmList").toString());
}
}
return sonosAlarms;
}
示例8: play
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean play() {
if(isConfigured()) {
Service service = device.findService(new UDAServiceId("AVTransport"));
Action action = service.getAction("Play");
ActionInvocation invocation = new ActionInvocation(action);
invocation.setInput("Speed", "1");
executeActionInvocation(invocation);
return true;
} else {
return false;
}
}
示例9: stop
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean stop() {
if(isConfigured()) {
Service service = device.findService(new UDAServiceId("AVTransport"));
Action action = service.getAction("Stop");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
return true;
} else {
return false;
}
}
示例10: pause
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean pause() {
if(isConfigured()) {
Service service = device.findService(new UDAServiceId("AVTransport"));
Action action = service.getAction("Pause");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
return true;
} else {
return false;
}
}
示例11: next
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean next() {
if(isConfigured()) {
Service service = device.findService(new UDAServiceId("AVTransport"));
Action action = service.getAction("Next");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
return true;
} else {
return false;
}
}
示例12: previous
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean previous() {
if(isConfigured()) {
Service service = device.findService(new UDAServiceId("AVTransport"));
Action action = service.getAction("Previous");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
return true;
} else {
return false;
}
}
示例13: updateRunningAlarmProperties
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean updateRunningAlarmProperties() {
if(stateMap != null && isConfigured()) {
Service service = device.findService(new UDAServiceId("AVTransport"));
Action action = service.getAction("GetRunningAlarmProperties");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
// for this property we would like to "compile" a more friendly variable.
// this newly created "variable" is also store in the stateMap
StateVariableValue alarmID = stateMap.get("AlarmID");
StateVariableValue groupID = stateMap.get("GroupID");
StateVariableValue loggedStartTime = stateMap.get("LoggedStartTime");
String newStringValue = null;
if(alarmID != null && loggedStartTime != null) {
newStringValue = alarmID.getValue() + " - " + loggedStartTime.getValue();
} else {
newStringValue = "No running alarm";
}
StateVariable newVariable = new StateVariable("RunningAlarmProperties",new StateVariableTypeDetails(Datatype.Builtin.STRING.getDatatype()));
StateVariableValue newValue = new StateVariableValue(newVariable, newStringValue);
processStateVariableValue(newVariable.getName(),newValue);
return true;
} else {
return false;
}
}
示例14: play
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean play() {
if (isConfigured()) {
Service service = device.findService(new UDAServiceId("AVTransport"));
Action action = service.getAction("Play");
ActionInvocation invocation = new ActionInvocation(action);
invocation.setInput("Speed", "1");
executeActionInvocation(invocation);
return true;
} else {
return false;
}
}
示例15: stop
import org.teleal.cling.model.meta.Action; //导入依赖的package包/类
public boolean stop() {
if (isConfigured()) {
Service service = device.findService(new UDAServiceId("AVTransport"));
Action action = service.getAction("Stop");
ActionInvocation invocation = new ActionInvocation(action);
executeActionInvocation(invocation);
return true;
} else {
return false;
}
}