当前位置: 首页>>代码示例>>Java>>正文


Java Action类代码示例

本文整理汇总了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;
}
 
开发者ID:Ch3ck,项目名称:ramaTiNuP,代码行数:29,代码来源:UPnP.java

示例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;
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:27,代码来源:SonosZonePlayer.java

示例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;
		}
	}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:17,代码来源:SonosZonePlayer.java

示例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;
		}

	}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:18,代码来源:SonosZonePlayer.java

示例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;
		}
	}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:17,代码来源:SonosZonePlayer.java

示例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;
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:26,代码来源:SonosZonePlayer.java

示例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;
    }
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:24,代码来源:SonosZonePlayer.java

示例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;
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:16,代码来源:SonosZonePlayer.java

示例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;
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:14,代码来源:SonosZonePlayer.java

示例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;
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:14,代码来源:SonosZonePlayer.java

示例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;
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:14,代码来源:SonosZonePlayer.java

示例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;
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:14,代码来源:SonosZonePlayer.java

示例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;
		}
	}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:33,代码来源:SonosZonePlayer.java

示例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;
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:16,代码来源:SonosZonePlayer.java

示例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;
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:14,代码来源:SonosZonePlayer.java


注:本文中的org.teleal.cling.model.meta.Action类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。