本文整理汇总了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;
}
示例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) {}
}
}
}
示例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) {}
}
}
示例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) {}
}
}
}
示例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) {}
}
}
示例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());
}
}
示例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));
}
}
示例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));
}
}
示例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;
}
};
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
});
}
}
示例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()));
}
});
}
示例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());
}
}