本文整理汇总了Java中org.fourthline.cling.model.message.header.UpnpHeader.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java UpnpHeader.getValue方法的具体用法?Java UpnpHeader.getValue怎么用?Java UpnpHeader.getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fourthline.cling.model.message.header.UpnpHeader
的用法示例。
在下文中一共展示了UpnpHeader.getValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRootDeviceUDN
import org.fourthline.cling.model.message.header.UpnpHeader; //导入方法依赖的package包/类
public UDN getRootDeviceUDN() {
// This processes the headers as specified in UDA 1.0, tables in section 1.1.12
UpnpHeader<UDN> udnHeader = getHeaders().getFirstHeader(UpnpHeader.Type.USN, USNRootDeviceHeader.class);
if (udnHeader != null) return udnHeader.getValue();
udnHeader = getHeaders().getFirstHeader(UpnpHeader.Type.USN, UDNHeader.class);
if (udnHeader != null) return udnHeader.getValue();
UpnpHeader<NamedDeviceType> deviceTypeHeader = getHeaders().getFirstHeader(UpnpHeader.Type.USN, DeviceUSNHeader.class);
if (deviceTypeHeader != null) return deviceTypeHeader.getValue().getUdn();
UpnpHeader<NamedServiceType> serviceTypeHeader = getHeaders().getFirstHeader(UpnpHeader.Type.USN, ServiceUSNHeader.class);
if (serviceTypeHeader != null) return serviceTypeHeader.getValue().getUdn();
return null;
}
示例2: getUDN
import org.fourthline.cling.model.message.header.UpnpHeader; //导入方法依赖的package包/类
/**
* @return The UDN value after parsing various USN header values, or <code>null</code>.
*/
public UDN getUDN() {
// This processes the headers as specified in UDA 1.0, tables in section 1.1.12
UpnpHeader<UDN> udnHeader = getHeaders().getFirstHeader(UpnpHeader.Type.USN, USNRootDeviceHeader.class);
if (udnHeader != null) return udnHeader.getValue();
udnHeader = getHeaders().getFirstHeader(UpnpHeader.Type.USN, UDNHeader.class);
if (udnHeader != null) return udnHeader.getValue();
UpnpHeader<NamedDeviceType> deviceTypeHeader = getHeaders().getFirstHeader(UpnpHeader.Type.USN, DeviceUSNHeader.class);
if (deviceTypeHeader != null) return deviceTypeHeader.getValue().getUdn();
UpnpHeader<NamedServiceType> serviceTypeHeader = getHeaders().getFirstHeader(UpnpHeader.Type.USN, ServiceUSNHeader.class);
if (serviceTypeHeader != null) return serviceTypeHeader.getValue().getUdn();
return null;
}
示例3: hasNotificationHeaders
import org.fourthline.cling.model.message.header.UpnpHeader; //导入方法依赖的package包/类
/**
* @return <code>true</code> if this message as an NT and NTS header.
*/
public boolean hasNotificationHeaders() {
UpnpHeader ntHeader = getHeaders().getFirstHeader(UpnpHeader.Type.NT);
UpnpHeader ntsHeader = getHeaders().getFirstHeader(UpnpHeader.Type.NTS);
return ntHeader != null && ntHeader.getValue() != null
&& ntsHeader != null && ntsHeader.getValue() != null;
}
示例4: parseHeaders
import org.fourthline.cling.model.message.header.UpnpHeader; //导入方法依赖的package包/类
protected void parseHeaders() {
// This runs as late as possible and only when necessary (getter called and map is dirty)
parsedHeaders = new LinkedHashMap();
if (log.isLoggable(Level.FINE))
log.fine("Parsing all HTTP headers for known UPnP headers: " + size());
for (Entry<String, List<String>> entry : entrySet()) {
if (entry.getKey() == null) continue; // Oh yes, the JDK has 'null' HTTP headers
UpnpHeader.Type type = UpnpHeader.Type.getByHttpName(entry.getKey());
if (type == null) {
if (log.isLoggable(Level.FINE))
log.fine("Ignoring non-UPNP HTTP header: " + entry.getKey());
continue;
}
for (String value : entry.getValue()) {
UpnpHeader upnpHeader = UpnpHeader.newInstance(type, value);
if (upnpHeader == null || upnpHeader.getValue() == null) {
if (log.isLoggable(Level.FINE))
log.fine(
"Ignoring known but irrelevant header (value violates the UDA specification?) '"
+ type.getHttpName()
+ "': "
+ value
);
} else {
addParsedValue(type, upnpHeader);
}
}
}
}
示例5: parseHeaders
import org.fourthline.cling.model.message.header.UpnpHeader; //导入方法依赖的package包/类
@Override
protected void parseHeaders() {
if (parsedHeaders == null) super.parseHeaders();
// This runs as late as possible and only when necessary (getter called and map is dirty)
parsedDLNAHeaders = new LinkedHashMap();
log.log(Level.FINE, "Parsing all HTTP headers for known UPnP headers: {0}", size());
for (Entry<String, List<String>> entry : entrySet()) {
if (entry.getKey() == null) continue; // Oh yes, the JDK has 'null' HTTP headers
DLNAHeader.Type type = DLNAHeader.Type.getByHttpName(entry.getKey());
if (type == null) {
log.log(Level.FINE, "Ignoring non-UPNP HTTP header: {0}", entry.getKey());
continue;
}
for (String value : entry.getValue()) {
UpnpHeader upnpHeader = DLNAHeader.newInstance(type, value);
if (upnpHeader == null || upnpHeader.getValue() == null) {
log.log(Level.FINE, "Ignoring known but non-parsable header (value violates the UDA specification?) '{0}': {1}", new Object[]{type.getHttpName(), value});
} else {
addParsedValue(type, upnpHeader);
}
}
}
}
示例6: isSearchResponseMessage
import org.fourthline.cling.model.message.header.UpnpHeader; //导入方法依赖的package包/类
public boolean isSearchResponseMessage() {
UpnpHeader st = getHeaders().getFirstHeader(UpnpHeader.Type.ST);
UpnpHeader usn = getHeaders().getFirstHeader(UpnpHeader.Type.USN);
UpnpHeader ext = getHeaders().getFirstHeader(UpnpHeader.Type.EXT); // Has no value!
return st != null && st.getValue() != null && usn != null && usn.getValue() != null && ext != null;
}