• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java UDAServiceId类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: testRetrieveContentDirectoryContent

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
public void testRetrieveContentDirectoryContent() throws Exception {
	UpnpClient upnpClient = new UpnpClient();
	final List<Device<?, ?, ?>> devices = searchDevices(upnpClient);
	ContentDirectoryBrowser browse = null;
	for (Device<?, ?, ?> device : devices) {
		Log.d(getClass().getName(),
				"#####Device: " + device.getDisplayString());
		Service service = device.findService(new UDAServiceId(
				"ContentDirectory"));
		if (service != null) {
			browse = new ContentDirectoryBrowser(service, "0",
					BrowseFlag.DIRECT_CHILDREN);
			upnpClient.getUpnpService().getControlPoint().execute(browse);
			while (browse != null && browse.getStatus() != Status.OK)
				;
			browseContainer(upnpClient, browse.getContainers(), service, 0);
		}

	}

}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:22,代码来源:UpnpClientTest.java


示例2: getAVTransportService

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
private Service getAVTransportService(Device<?, ?, ?> device) {
	// urn:upnp-org:serviceId:urn:schemas-upnp-org:service:AVTransport
	// urn:schemas-upnp-org:serviceId:AVTransport
	// new ServiceId(UDAServiceId.BROKEN_DEFAULT_NAMESPACE,"AVTransport")
	ServiceId serviceId = new ServiceId(
			UDAServiceId.BROKEN_DEFAULT_NAMESPACE, "AVTransport");
	Service[] services = device.getServices();
	Service avservice = null; // device.findService(serviceId);
	for (Service service : services) {
		if (service.getServiceType().toFriendlyString()
				.indexOf("AVTransport") > -1) {
			Log.d(getClass().getName(), serviceId.toString());
			Log.d(getClass().getName(), service.getServiceType()
					.toFriendlyString());
			avservice = service;
			break;
		}
	}
	assertNotNull(avservice);
	Log.d(getClass().getName(),
			"Service found: " + avservice.getServiceId() + " Type: "
					+ avservice.getServiceType());
	return avservice;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:25,代码来源:OpenbitTestCases.java


示例3: getRenderingControlService

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
private Service getRenderingControlService(Device<?, ?, ?> device) {
	// urn:upnp-org:serviceId:urn:schemas-upnp-org:service:AVTransport
	// urn:schemas-upnp-org:serviceId:AVTransport
	// new ServiceId(UDAServiceId.BROKEN_DEFAULT_NAMESPACE,"AVTransport")
	ServiceId serviceId = new UDAServiceId("RenderingControl");
	// Service[] services = device.getServices();
	Service avservice = device.findService(serviceId);
	// for (Service service : services) {
	// if (service.getServiceType().toFriendlyString()
	// .indexOf("AVTransport") > -1) {
	// Log.d(getClass().getName(), serviceId.toString());
	// Log.d(getClass().getName(), service.getServiceType()
	// .toFriendlyString());
	// avservice = service;
	// break;
	// }
	// }
	assertNotNull(avservice);
	Log.d(getClass().getName(),
			"Service found: " + avservice.getServiceId() + " Type: "
					+ avservice.getServiceType());
	return avservice;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:24,代码来源:OpenbitTestCases.java


示例4: getConnectionManagerService

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
private Service getConnectionManagerService(Device<?, ?, ?> device) {	
	ServiceId serviceId = new ServiceId(
			UDAServiceId.BROKEN_DEFAULT_NAMESPACE, "ConnectionManager");
	Service[] services = device.getServices();
	Service avservice = null; // device.findService(serviceId);
	for (Service service : services) {
		if (service.getServiceType().toFriendlyString()
				.indexOf("ConnectionManager") > -1) {
			Log.d(getClass().getName(), serviceId.toString());
			Log.d(getClass().getName(), service.getServiceType()
					.toFriendlyString());
			avservice = service;
			break;
		}
	}
	assertNotNull(avservice);
	Log.d(getClass().getName(),
			"Service found: " + avservice.getServiceId() + " Type: "
					+ avservice.getServiceType());
	return avservice;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:22,代码来源:OpenbitTestCases.java


示例5: browseSync

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
/**
 * Browse ContenDirctory synchronous
 *
 * @param device      the device to be browsed
 * @param objectID    the browsing root
 * @param flag        kind of browsing @see {@link BrowseFlag}
 * @param filter      a filter
 * @param firstResult first result
 * @param maxResults  max result count
 * @param orderBy     sorting criteria @see {@link SortCriterion}
 * @return the browsing result
 */
public ContentDirectoryBrowseResult browseSync(Device<?, ?, ?> device, String objectID, BrowseFlag flag, String filter, long firstResult,
                                               Long maxResults, SortCriterion... orderBy) {
    ContentDirectoryBrowseResult result = new ContentDirectoryBrowseResult();
    if (device == null) {
        return result;
    }
    Service service = device.findService(new UDAServiceId("ContentDirectory"));
    ContentDirectoryBrowseActionCallback actionCallback = null;
    if (service != null) {
        Log.d(getClass().getName(), "#####Service found: " + service.getServiceId() + " Type: " + service.getServiceType());
        actionCallback = new ContentDirectoryBrowseActionCallback(service, objectID, flag, filter, firstResult, maxResults, result, orderBy);
        getControlPoint().execute(actionCallback);
        while (actionCallback.getStatus() == Status.LOADING && actionCallback.getUpnpFailure() == null)

            ;
    }

    if (preferences.getBoolean(context.getString(R.string.settings_browse_thumbnails_coverlookup_chkbx), false)) {
        result = enrichWithCover(result);
    }
    return result;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:35,代码来源:UpnpClient.java


示例6: browseAsync

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
/**
 * Browse ContenDirctory asynchronous
 *
 * @param device      the device to be browsed
 * @param objectID    the browsing root
 * @param flag        kind of browsing @see {@link BrowseFlag}
 * @param filter      a filter
 * @param firstResult first result
 * @param maxResults  max result count
 * @param orderBy     sorting criteria @see {@link SortCriterion}
 * @return the browsing result
 */
public ContentDirectoryBrowseResult browseAsync(Device<?, ?, ?> device, String objectID, BrowseFlag flag, String filter, long firstResult,
                                                Long maxResults, SortCriterion... orderBy) {
    Service service = device.findService(new UDAServiceId("ContentDirectory"));
    ContentDirectoryBrowseResult result = new ContentDirectoryBrowseResult();
    ContentDirectoryBrowseActionCallback actionCallback = null;
    if (service != null) {
        Log.d(getClass().getName(), "#####Service found: " + service.getServiceId() + " Type: " + service.getServiceType());
        actionCallback = new ContentDirectoryBrowseActionCallback(service, objectID, flag, filter, firstResult, maxResults, result, orderBy);
        getControlPoint().execute(actionCallback);
    }
    if (preferences.getBoolean(context.getString(R.string.settings_browse_thumbnails_coverlookup_chkbx), false)) {
        result = enrichWithCover(result);
    }
    return result;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:28,代码来源:UpnpClient.java


示例7: testRendererGetProtocolInfo

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
public void testRendererGetProtocolInfo(){
		
	waitForService();
	LocalDevice rendererDevice = getService().getUpnpClient().getRegistry().getLocalDevice(new UDN(YaaccUpnpServerService.MEDIA_RENDERER_UDN_ID),false);
	LocalService connectionService = rendererDevice.findService(new ServiceId(UDAServiceId.DEFAULT_NAMESPACE,"ConnectionManager"));
	Action action = connectionService.getAction("GetProtocolInfo");
	ActionInvocation<LocalService> actionInvocation = new ActionInvocation<LocalService>(action);
	connectionService.getExecutor(action).execute(actionInvocation);
	if(actionInvocation.getFailure() != null){
		throw new RuntimeException(actionInvocation.getFailure().fillInStackTrace());
	}		
	
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:14,代码来源:YaaccUpnpServerServiceTest.java


示例8: testServerGetProtocolInfo

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
public void testServerGetProtocolInfo(){
	
	waitForService();
	LocalDevice serverDevice = getService().getUpnpClient().getRegistry().getLocalDevice(new UDN(YaaccUpnpServerService.MEDIA_SERVER_UDN_ID),false);
	LocalService connectionService = serverDevice.findService(new ServiceId(UDAServiceId.DEFAULT_NAMESPACE,"ConnectionManager"));
	Action action = connectionService.getAction("GetProtocolInfo");
	ActionInvocation<LocalService> actionInvocation = new ActionInvocation<LocalService>(action);
	connectionService.getExecutor(action).execute(actionInvocation);
	if(actionInvocation.getFailure() != null){
		throw new RuntimeException(actionInvocation.getFailure().fillInStackTrace());
	}		
	
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:14,代码来源:YaaccUpnpServerServiceTest.java


示例9: getConnectionInfos

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
private void getConnectionInfos(UpnpClient upnpClient,
		final List<Device<?, ?, ?>> devices) throws Exception {
	for (Device<?, ?, ?> device : devices) {
		Service service = device.findService(new UDAServiceId(
				"ConnectionManager"));
		if (service != null) {
			Action getCurrentConnectionIds = service
					.getAction("GetCurrentConnectionIDs");
			assertNotNull(getCurrentConnectionIds);
			ActionInvocation getCurrentConnectionIdsInvocation = new ActionInvocation(
					getCurrentConnectionIds);
			ActionCallback getCurrentConnectionCallback = new ActionCallback(
					getCurrentConnectionIdsInvocation) {
				
				@Override
				public void success(ActionInvocation invocation) {
					ActionArgumentValue[] connectionIds = invocation
							.getOutput();
				    for (ActionArgumentValue connectionId : connectionIds) {
				    	Log.d(getClass().getName(), connectionId.getValue().toString());
						
					}
				}

				@Override
				public void failure(ActionInvocation actioninvocation,
						UpnpResponse upnpresponse, String s) {
					Log.d(getClass().getName(),"Failure:" + upnpresponse);

				}
			};

			upnpClient.getUpnpService().getControlPoint()
					.execute(getCurrentConnectionCallback);

		}
	}
	myWait();
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:41,代码来源:UpnpClientTest.java


示例10: getAVTransportService

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
/**
 * Returns a Service of type AVTransport
 *
 * @param device the device which provides the service
 * @return the service of null
 */
public Service getAVTransportService(Device<?, ?, ?> device) {
    if (device == null) {
        Log.d(getClass().getName(), "Device is null!");
        return null;
    }
    ServiceId serviceId = new UDAServiceId("AVTransport");
    Service service = device.findService(serviceId);
    if (service != null) {
        Log.d(getClass().getName(), "Service found: " + service.getServiceId() + " Type: " + service.getServiceType());
    }
    return service;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:19,代码来源:UpnpClient.java


示例11: getRenderingControlService

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
/**
 * Returns a Service of type RenderingControl
 *
 * @param device the device which provides the service
 * @return the service of null
 */
public Service getRenderingControlService(Device<?, ?, ?> device) {
    if (device == null) {
        Log.d(getClass().getName(), "Device is null!");
        return null;
    }
    ServiceId serviceId = new UDAServiceId("RenderingControl");
    Service service = device.findService(serviceId);
    if (service != null) {
        Log.d(getClass().getName(), "Service found: " + service.getServiceId() + " Type: " + service.getServiceType());
    }
    return service;
}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:19,代码来源:UpnpClient.java


示例12: devicesAvailable

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
public boolean devicesAvailable() {
    if(mAndroidUpnpService != null) {
        for(Device device : mAndroidUpnpService.getControlPoint().getRegistry().getRemoteDevices()) {
            Service heartRateService = device.findService(new UDAServiceId("WearNotificationService"));

            if(heartRateService != null) {
                return true;
            }
        }
    }

    return false;
}
 
开发者ID:mklschreiber,项目名称:Crowdi,代码行数:14,代码来源:WearNotificationServiceSenderConnection.java


示例13: getAVTransportService

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
/**
 * Returns a Service of type AVTransport
 * 
 * @param device
 *            the device which provides the service
 * @return the service of null
 */
public Service getAVTransportService(Device<?, ?, ?> device) {
	if (device == null) {
		Log.d(getClass().getName(), "Device is null!");
		return null;
	}
	ServiceId serviceId = new UDAServiceId("AVTransport");
	Service service = device.findService(serviceId);
	if (service != null) {
		Log.d(getClass().getName(),
				"Service found: " + service.getServiceId() + " Type: "
						+ service.getServiceType());
	}
	return service;
}
 
开发者ID:msafin,项目名称:wmc,代码行数:22,代码来源:UpnpClient.java


示例14: listFiles

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
public void listFiles(final Device device, final String containerId) {
    Log.d(TAG, "listFiles "+device+"  containerId="+containerId);
    Service service = device.findService(new UDAServiceId("ContentDirectory"));
    int ready = mUpnpServiceManager.execute(new Browse(service, containerId, BrowseFlag.DIRECT_CHILDREN) {
        @Override
        public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2) {
            Log.d(TAG, "failure on " + arg0 + "\nresponse " + arg1 + ", " + arg2);
            synchronized (mLock) {
                mLock.notify();
            }
        }
        @Override
        public void updateStatus(Status status) {}

        @Override
        public void received(ActionInvocation action, final DIDLContent content) {
            mFiles = new ArrayList<>();

            // Add all the directories
            for (Container container : content.getContainers()){
                if(shouldIAddContainer(container, device, containerId)) {
                    String encodedId = null;
                    try {
                        encodedId = URLEncoder.encode(container.getId(), "UTF-8");
                    } catch (UnsupportedEncodingException e) {/* does not happen, UTF-8 always available... */}
                    mFiles.add(new UpnpFile2(container.getTitle(), encodedId, mUri));
                }
            }

            // All files matching the filter
            for (Item item : content.getItems()){
                boolean match = true;
                String mimeType = item.getFirstResource().getProtocolInfo().getContentFormatMimeType().toString();
                String path = item.getFirstResource().getValue();
                if (match){
                    Uri thumbUri = null;
                    DIDLObject.Property<URI> albumArtURI = item.getFirstProperty(DIDLObject.Property.UPNP.ALBUM_ART_URI.class);
                    if (albumArtURI!=null) {
                        thumbUri = Uri.parse(albumArtURI.getValue().toString());
                    }
                    mFiles.add(new  UpnpFile2(item, mimeType, mUri, path, thumbUri));
                }

            }
            synchronized (mLock) {
                mLock.notify();
            }
        }
    });
    if (ready == -1)
        synchronized (mLock) {
            mLock.notify();
        }
}
 
开发者ID:archos-sa,项目名称:aos-MediaLib,代码行数:55,代码来源:UpnpRawLister.java


示例15: testCurrentTransportActions

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
public void testCurrentTransportActions() throws Exception {
	UpnpClient upnpClient = new UpnpClient();
	final List<Device<?, ?, ?>> devices = searchDevices(upnpClient);
	GetCurrentTransportActions getCurrentTransportActions = null;
	for (Device<?, ?, ?> device : devices) {
		Log.d(getClass().getName(), "#####Device: " + device);
		Service service = device.findService(new UDAServiceId(
				"GetCurrentTransportActions"));
		if (service != null) {
			Log.d(getClass().getName(),
					"#####Service found: " + service.getServiceId()
							+ " Type: " + service.getServiceType());
			getCurrentTransportActions = new GetCurrentTransportActions(
					service) {

				@Override
				public void failure(ActionInvocation actioninvocation,
						UpnpResponse upnpresponse, String s) {
					System.err.println("Failure:" + upnpresponse);

				}

				@Override
				public void received(ActionInvocation actioninvocation,
						TransportAction[] atransportaction) {

					Log.d(getClass().getName(),
							"received TransportActions:");
					for (TransportAction action : atransportaction) {
						Log.d(getClass().getName(), "TransportAction: "
								+ action);
					}

				}
			};

			upnpClient.getUpnpService().getControlPoint()
					.execute(getCurrentTransportActions);
			myWait();
		}

	}

}
 
开发者ID:theopenbit,项目名称:yaacc-code,代码行数:45,代码来源:UpnpClientTest.java


示例16: browseAsync

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
/**
 * Browse ContenDirctory asynchronous
 * 
 * @param device
 *            the device to be browsed
 * @param objectID
 *            the browsing root
 * @param flag
 *            kind of browsing @see {@link BrowseFlag}
 * @param filter
 *            a filter
 * @param firstResult
 *            first result
 * @param maxResults
 *            max result count
 * @param orderBy
 *            sorting criteria @see {@link SortCriterion}
 * @return the browsing result
 */
public void browseAsync(Device<?, ?, ?> device, String objectID,
		BrowseFlag flag, String filter, long firstResult, Long maxResults,
		BrowseListener listener,SortCriterion... orderBy) {
	Service service = device.findService(new UDAServiceId(
			"ContentDirectory"));
	ContentDirectoryBrowseActionCallback actionCallback = null;
	if (service != null) {
		Log.d(getClass().getName(),
				"#####Service found: " + service.getServiceId() + " Type: "
						+ service.getServiceType());
		actionCallback = new ContentDirectoryBrowseActionCallback(service,
				objectID, flag, filter, firstResult, maxResults, orderBy,listener);
		getControlPoint().execute(actionCallback);
	}
}
 
开发者ID:msafin,项目名称:wmc,代码行数:35,代码来源:UpnpClient.java


示例17: setPlayer

import org.fourthline.cling.model.types.UDAServiceId; //导入依赖的package包/类
/**
 * Sets a device as our player for play/stop and other services<br>
 * Use getAvailablePlayers() for a list of them.
 * 
 * @param device
 *          device for playing
 */
public void setPlayer(Device device) {
  this.playerService = device.findService(new UDAServiceId("AVTransport"));
  if (this.playerService == null) {
    LOGGER.warn("Could not find AVTransportService on device " + device.getDisplayString());
  }
}
 
开发者ID:tinyMediaManager,项目名称:tinyMediaManager,代码行数:14,代码来源:Upnp.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java XMLField类代码示例发布时间:2022-05-22
下一篇:
Java TinkerInstaller类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap