本文整理匯總了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;
}