當前位置: 首頁>>代碼示例>>Java>>正文


Java UpnpHeader.getValue方法代碼示例

本文整理匯總了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;
}
 
開發者ID:offbye,項目名稱:DroidDLNA,代碼行數:18,代碼來源:IncomingSearchResponse.java

示例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;
}
 
開發者ID:offbye,項目名稱:DroidDLNA,代碼行數:21,代碼來源:IncomingNotificationRequest.java

示例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;
}
 
開發者ID:offbye,項目名稱:DroidDLNA,代碼行數:10,代碼來源:IncomingEventRequestMessage.java

示例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);
            }
        }
    }
}
 
開發者ID:offbye,項目名稱:DroidDLNA,代碼行數:33,代碼來源:UpnpHeaders.java

示例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);
            }
        }
    }
}
 
開發者ID:offbye,項目名稱:DroidDLNA,代碼行數:28,代碼來源:DLNAHeaders.java

示例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;
}
 
開發者ID:offbye,項目名稱:DroidDLNA,代碼行數:7,代碼來源:IncomingSearchResponse.java


注:本文中的org.fourthline.cling.model.message.header.UpnpHeader.getValue方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。