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


Java UDN.getIdentifierString方法代码示例

本文整理汇总了Java中org.teleal.cling.model.types.UDN.getIdentifierString方法的典型用法代码示例。如果您正苦于以下问题:Java UDN.getIdentifierString方法的具体用法?Java UDN.getIdentifierString怎么用?Java UDN.getIdentifierString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.teleal.cling.model.types.UDN的用法示例。


在下文中一共展示了UDN.getIdentifierString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: remoteDeviceAdded

import org.teleal.cling.model.types.UDN; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public void remoteDeviceAdded(Registry registry, RemoteDevice device) {

	// add only Sonos devices
	if (device.getDetails().getManufacturerDetails().getManufacturer()
			.toUpperCase().contains("SONOS")) {

		UDN udn = device.getIdentity().getUdn();
		boolean existingDevice = false;

		logger.info("Found a Sonos device ({}) with UDN {}",device.getDetails().getModelDetails().getModelNumber(),udn);

		// Check if we already received a configuration for this
		// device through the .cfg
		SonosZonePlayer thePlayer = sonosZonePlayerCache.getByUDN(udn.getIdentifierString());

		if (thePlayer == null) {
			// Add device to the cached Configs
			thePlayer = new SonosZonePlayer(udn.getIdentifierString(),self);
			thePlayer.setUdn(udn);

			sonosZonePlayerCache.add(thePlayer);
		}

		thePlayer.setDevice(device);
		thePlayer.setService(upnpService);
		thePlayer.updateCurrentZoneName();

		// add GENA service to capture zonegroup information
		Service service = device.findService(new UDAServiceId(
				"ZoneGroupTopology"));
		SonosSubscriptionCallback callback = new SonosSubscriptionCallback(
				service, interval);
		upnpService.getControlPoint().execute(callback);
	} else {
		logger.debug("A non-Sonos device ({}) is found and will be ignored",device.getDisplayString());
	}
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:39,代码来源:SonosBinding.java

示例2: remoteDeviceAdded

import org.teleal.cling.model.types.UDN; //导入方法依赖的package包/类
@Override
@SuppressWarnings("rawtypes")
public void remoteDeviceAdded(Registry registry, RemoteDevice device) {

    // add only Sonos devices
    if (device.getDetails().getManufacturerDetails().getManufacturer().toUpperCase().contains("SONOS")) {

        UDN udn = device.getIdentity().getUdn();
        boolean existingDevice = false;

        logger.info("Found a Sonos device ({}) with UDN {}",
                device.getDetails().getModelDetails().getModelNumber(), udn);

        // Check if we already received a configuration for this
        // device through the .cfg
        SonosZonePlayer thePlayer = sonosZonePlayerCache.getByUDN(udn.getIdentifierString());

        if (thePlayer == null) {
            // Add device to the cached Configs
            thePlayer = new SonosZonePlayer(udn.getIdentifierString(), self);
            thePlayer.setUdn(udn);

            sonosZonePlayerCache.add(thePlayer);
        }

        thePlayer.setDevice(device);
        thePlayer.setService(upnpService);
        thePlayer.updateCurrentZoneName();

        // add GENA service to capture zonegroup information
        Service service = device.findService(new UDAServiceId("ZoneGroupTopology"));
        SonosSubscriptionCallback callback = new SonosSubscriptionCallback(service, interval);
        upnpService.getControlPoint().execute(callback);
    } else {
        logger.debug("A non-Sonos device ({}) is found and will be ignored", device.getDisplayString());
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:38,代码来源:SonosBinding.java


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