当前位置: 首页>>代码示例>>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;未经允许,请勿转载。