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


Java Registry类代码示例

本文整理汇总了Java中org.teleal.cling.registry.Registry的典型用法代码示例。如果您正苦于以下问题:Java Registry类的具体用法?Java Registry怎么用?Java Registry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: CreateListenerToPrintUPnPDeviceData

import org.teleal.cling.registry.Registry; //导入依赖的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: remoteDeviceAdded

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
public void remoteDeviceAdded(Registry registry, RemoteDevice device) {
    if (device.getType().getNamespace().equals("schemas-upnp-org")
            && device.getType().getType().equals("MediaServer")) {
        if (!found) {
            try {
                if (!TextUtils.isEmpty(device.getDetails().getSerialNumber())) {
                    if (device.getDetails().getSerialNumber().equals(mFileSource.getUpnpSerialNumber())) {
                        startBrowse(device);
                        found = true;
                    }
                } else {
                    if (device.getIdentity().getUdn().toString().equals(mFileSource.getUpnpSerialNumber())) {
                        startBrowse(device);
                        found = true;
                    }
                }
            } catch (Exception e) {}
        }
    }
}
 
开发者ID:MizzleDK,项目名称:Mizuu,代码行数:22,代码来源:UpnpTvShow.java

示例3: localDeviceAdded

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
public void localDeviceAdded(Registry registry, LocalDevice device) {
    if (!found) {
        try {
            if (!TextUtils.isEmpty(device.getDetails().getSerialNumber())) {
                if (device.getDetails().getSerialNumber().equals(mFileSource.getUpnpSerialNumber())) {
                    startBrowse(device);
                    found = true;
                }
            } else {
                if (device.getIdentity().getUdn().toString().equals(mFileSource.getUpnpSerialNumber())) {
                    startBrowse(device);
                    found = true;
                }
            }
        } catch (Exception e) {}
    }
}
 
开发者ID:MizzleDK,项目名称:Mizuu,代码行数:19,代码来源:UpnpTvShow.java

示例4: remoteDeviceAdded

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
public void remoteDeviceAdded(Registry registry, RemoteDevice device) {
	if (device.getType().getNamespace().equals("schemas-upnp-org")
			&& device.getType().getType().equals("MediaServer")) {
		if (!found) {
			try {
				if (!TextUtils.isEmpty(device.getDetails().getSerialNumber())) {
					if (device.getDetails().getSerialNumber().equals(mFileSource.getUpnpSerialNumber())) {
						startBrowse(device);
						found = true;
					}
				} else {
					if (device.getIdentity().getUdn().toString().equals(mFileSource.getUpnpSerialNumber())) {
						startBrowse(device);
						found = true;
					}
				}
			} catch (Exception e) {}
		}
	}
}
 
开发者ID:MizzleDK,项目名称:Mizuu,代码行数:22,代码来源:UpnpMovie.java

示例5: localDeviceAdded

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
public void localDeviceAdded(Registry registry, LocalDevice device) {
	if (!found) {
		try {
			if (!TextUtils.isEmpty(device.getDetails().getSerialNumber())) {
				if (device.getDetails().getSerialNumber().equals(mFileSource.getUpnpSerialNumber())) {
					startBrowse(device);
					found = true;
				}
			} else {
				if (device.getIdentity().getUdn().toString().equals(mFileSource.getUpnpSerialNumber())) {
					startBrowse(device);
					found = true;
				}
			}
		} catch (Exception e) {}
	}
}
 
开发者ID:MizzleDK,项目名称:Mizuu,代码行数:19,代码来源:UpnpMovie.java

示例6: remoteDeviceAdded

import org.teleal.cling.registry.Registry; //导入依赖的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

示例7: deviceAdded

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
public void deviceAdded(Registry registry, Device device) {
	super.deviceAdded(registry, device);
	if (device.getType().toString().contains("MediaRenderer")
			&& callback != null) {
		if (deviceSet.add(device))
			callback.onDeviceAdd(new DmrDevice(device));
	}
}
 
开发者ID:jasoncn90,项目名称:dlna-for-android,代码行数:10,代码来源:DeviceManager.java

示例8: deviceRemoved

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
public void deviceRemoved(Registry registry, Device device) {
	super.deviceRemoved(registry, device);
	if (device.getType().toString().contains("MediaRenderer")
			&& callback != null) {
		deviceSet.remove(device);
		callback.onDeviceDown(new DmrDevice(device));
	}
}
 
开发者ID:jasoncn90,项目名称:dlna-for-android,代码行数:10,代码来源:DeviceManager.java

示例9: onCreate

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
public void onCreate() {
	super.onCreate();

	final WifiManager wifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);

	final ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);

	upnpService = new UpnpServiceImpl(createConfiguration(wifiManager)) {
		@Override
		protected Router createRouter(ProtocolFactory protocolFactory,
				Registry registry) {
			AndroidWifiSwitchableRouter router = AndroidUpnpServiceImpl.this
					.createRouter(getConfiguration(), protocolFactory,
							wifiManager, connectivityManager);
			if (!ModelUtil.ANDROID_EMULATOR
					&& isListeningForConnectivityChanges()) {
				// Only register for network connectivity changes if we are
				// not running on emulator
				registerReceiver(router.getBroadcastReceiver(),
						new IntentFilter(
								"android.net.conn.CONNECTIVITY_CHANGE"));
			}
			return router;
		}
	};

}
 
开发者ID:jasoncn90,项目名称:dlna-for-android,代码行数:29,代码来源:AndroidUpnpServiceImpl.java

示例10: deviceAdded

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
public void deviceAdded(Registry registry, Device device) {
	super.deviceAdded(registry, device);
	if (callback != null) {
		callback.onDeviceAdd(device);
	}
}
 
开发者ID:jasoncn90,项目名称:dlna-for-android,代码行数:8,代码来源:DeviceManager.java

示例11: deviceRemoved

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
public void deviceRemoved(Registry registry, Device device) {
	super.deviceRemoved(registry, device);
	if (callback != null) {
		callback.onDeviceRemove(device);
	}
}
 
开发者ID:jasoncn90,项目名称:dlna-for-android,代码行数:8,代码来源:DeviceManager.java

示例12: remoteDeviceDiscoveryFailed

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
        public void remoteDeviceDiscoveryFailed(Registry registry, final RemoteDevice device, final Exception ex) {
            _hgcontext.runOnUiThread(new Runnable() {
                public void run() {
//                    Toast.makeText(_hgcontext.getApplicationContext(), "UpNP FAILED Discovery: " + device.getDisplayString(), 2000).show();
                }
            });
            deviceRemoved(device);
        }
 
开发者ID:genemars,项目名称:HomeGenie-Android,代码行数:10,代码来源:UpnpManager.java

示例13: remoteDeviceAdded

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
public void remoteDeviceAdded(Registry registry, final RemoteDevice device) {
   	if (device.findDevices(new UDADeviceType("MediaRenderer")).length > 0) {
   		logger.log(Level.INFO, "Adding remote device: " + device.getDetails().getFriendlyName() + "UUID: " + device.getIdentity().getUdn().toString());
   		final DeviceListItem deviceItem = adaptDevice(device);
   		SwingUtilities.invokeLater(new Runnable() {
   			@Override
   			public void run() {
   	    		listModel.addElement(deviceItem);
   			}
   		});
       }
}
 
开发者ID:Douglas6,项目名称:pipoint,代码行数:14,代码来源:DlnaRendererManager.java

示例14: remoteDeviceRemoved

import org.teleal.cling.registry.Registry; //导入依赖的package包/类
@Override
public void remoteDeviceRemoved(Registry registry, final RemoteDevice device) {
	logger.log(Level.INFO, "Removing remote device: " + device.getDetails().getFriendlyName() + "UUID: " + device.getIdentity().getUdn().toString());
	SwingUtilities.invokeLater(new Runnable() {
		@Override
		public void run() {
			listModel.removeElement(getDeviceItemById(device.getIdentity().getUdn()));
		}
	});
}
 
开发者ID:Douglas6,项目名称:pipoint,代码行数:11,代码来源:DlnaRendererManager.java

示例15: remoteDeviceAdded

import org.teleal.cling.registry.Registry; //导入依赖的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.registry.Registry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。