本文整理汇总了Java中javax.jmdns.ServiceInfo.getName方法的典型用法代码示例。如果您正苦于以下问题:Java ServiceInfo.getName方法的具体用法?Java ServiceInfo.getName怎么用?Java ServiceInfo.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.jmdns.ServiceInfo
的用法示例。
在下文中一共展示了ServiceInfo.getName方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getServiceEvent
import javax.jmdns.ServiceInfo; //导入方法依赖的package包/类
@Override
public ServiceEvent getServiceEvent(JmDNSImpl dns) {
ServiceInfo info = this.getServiceInfo(false);
((ServiceInfoImpl) info).setDns(dns);
// String domainName = "";
// String serviceName = this.getServer();
// int index = serviceName.indexOf('.');
// if (index > 0)
// {
// serviceName = this.getServer().substring(0, index);
// if (index + 1 < this.getServer().length())
// domainName = this.getServer().substring(index + 1);
// }
// return new ServiceEventImpl(dns, domainName, serviceName, info);
return new ServiceEventImpl(dns, info.getType(), info.getName(), info);
}
示例2: ServiceInfoImpl
import javax.jmdns.ServiceInfo; //导入方法依赖的package包/类
/**
* During recovery we need to duplicate service info to reregister them
*
* @param info
*/
public ServiceInfoImpl(ServiceInfo info)
{
if (info != null)
{
this._domain = info.getDomain();
this._protocol = info.getProtocol();
this._application = info.getApplication();
this._name = info.getName();
this._subtype = info.getSubtype();
this._port = info.getPort();
this._weight = info.getWeight();
this._priority = info.getPriority();
this._text = info.getTextBytes();
this._persistent = info.isPersistent();
this._ipv4Addr = info.getInet4Address();
this._ipv6Addr = info.getInet6Address();
}
this._state = new ServiceInfoState(this);
}
示例3: getServiceEvent
import javax.jmdns.ServiceInfo; //导入方法依赖的package包/类
@Override
public ServiceEvent getServiceEvent(JmDNSImpl dns)
{
ServiceInfo info = this.getServiceInfo(false);
((ServiceInfoImpl) info).setDns(dns);
// String domainName = "";
// String serviceName = this.getServer();
// int index = serviceName.indexOf('.');
// if (index > 0)
// {
// serviceName = this.getServer().substring(0, index);
// if (index + 1 < this.getServer().length())
// domainName = this.getServer().substring(index + 1);
// }
// return new ServiceEventImpl(dns, domainName, serviceName, info);
return new ServiceEventImpl(dns, info.getType(), info.getName(), info);
}
示例4: removeFromList
import javax.jmdns.ServiceInfo; //导入方法依赖的package包/类
private void removeFromList(ServiceInfo info){
Log.d(TAG, "Deleting unregistered printer from UI: " + info.getName());
String name = info.getName();
for(int i = 0; i < printers.size(); i++) {
if(printers.get(i).getName().equals(name)) {
printers.remove(i);
break;
}
}
adapter.notifyDataSetChanged();
}
示例5: parseUri
import javax.jmdns.ServiceInfo; //导入方法依赖的package包/类
private String parseUri(ServiceInfo serviceInfo) {
String uri = null;
String prefix = "ipp://";
String folderStructure = "/ipp/print3d/"; //defined in standard head 6.1.
String server = serviceInfo.getServer();
String port = ":"+Integer.toString(serviceInfo.getPort());
String name = serviceInfo.getName();
uri = prefix+server+port+folderStructure+name;
return uri;
}
示例6: parseUri
import javax.jmdns.ServiceInfo; //导入方法依赖的package包/类
private String parseUri(ServiceInfo serviceInfo) {
String uri = null;
String prefix = "ipp://";
String folderStructure = "/ipp/print3d/";
String server = serviceInfo.getServer();
String port = ":"+Integer.toString(serviceInfo.getPort());
String name = serviceInfo.getName();
uri = prefix+server+port+folderStructure+name;
return uri;
}
示例7: SPServerInfo
import javax.jmdns.ServiceInfo; //导入方法依赖的package包/类
public SPServerInfo(ServiceInfo si) {
scheme = "http";
name = si.getName();
serverAddress = si.getHostAddress();
port = si.getPort();
path = si.getPropertyString("path");
username = null;
password = null;
passwordAllowed = true;
}