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