Package ball.upnp.ssdp
Interface SSDPMessage
-
- All Superinterfaces:
HttpMessage
,MessageHeaders
- All Known Implementing Classes:
SSDPRequest
,SSDPResponse
public interface SSDPMessage extends HttpMessage
SSDPHttpMessage
interface definition.- Author:
- Allen D. Ball
-
-
Field Summary
Fields Modifier and Type Field Description static String
AL
SSDP message header name.static String
BOOTID_UPNP_ORG
SSDP message header name.static String
CACHE_CONTROL
SSDP message header name.static String
CONFIGID_UPNP_ORG
SSDP message header name.static String
DATE
SSDP message header name.static String
EOL
SSDPMessage
end-of-line sequence.static String
EOM
SSDPMessage
end-of-message sequence.static String
EXT
SSDP message header name.static String
HOST
SSDP message header name.static String
LOCATION
SSDP message header name.static String
MAN
SSDP message header name.static String
MAX_AGE
HTTP cache control key.static String
MX
SSDP message header name.static String
NEXTBOOTID_UPNP_ORG
SSDP message header name.static String
NT
SSDP message header name.static String
NTS
SSDP message header name.static String
SEARCHPORT_UPNP_ORG
SSDP message header name.static String
SECURELOCATION_UPNP_ORG
SSDP message header name.static String
SERVER
SSDP message header name.static String
SSDP_ALIVE
SSDPNTS
value.static URI
SSDP_ALL
SSDPST
value.static String
SSDP_BYEBYE
SSDPNTS
value.static String
SSDP_UPDATE
SSDPNTS
value.static String
ST
SSDP message header name.static String
USER_AGENT
SSDP message header name.static String
USN
SSDP message header name.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description long
getExpiration()
Method to get the expiration time forthis
SSDPMessage
.static long
getExpiration(SSDPMessage message, long timestamp)
Implementation method forgetExpiration()
.default String
getHeaderParameterValue(String name, String parameter)
Method to find the firstHeader
matchingname
with a parameter matchingparameter
and return that parameter value.default <T> T
getHeaderParameterValue(Function<String,T> function, String name, String parameter)
Method to find the firstHeader
matchingname
with a parameter matchingparameter
and return that parameter value converted withfunction
.default String
getHeaderValue(String... names)
Method to find the firstHeader
matchingnames
and return that value.default <T> T
getHeaderValue(Function<String,T> function, String... names)
default URI
getLocation()
Method to get the locationURI
.default URI
getNT()
default URI
getST()
default URI
getUSN()
static List<CharArrayBuffer>
parse(DatagramPacket packet)
static CharArrayBuffer
toCharArrayBuffer(String string)
Static method to convert aString
to aCharArrayBuffer
.static CharArrayBuffer
toCharArrayBuffer(DatagramPacket packet)
Static method to convert aDatagramPacket
to aCharArrayBuffer
.-
Methods inherited from interface org.apache.hc.core5.http.HttpMessage
addHeader, addHeader, getVersion, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setVersion
-
Methods inherited from interface org.apache.hc.core5.http.MessageHeaders
containsHeader, countHeaders, getFirstHeader, getHeader, getHeaders, getHeaders, getLastHeader, headerIterator, headerIterator
-
-
-
-
Field Detail
-
AL
static final String AL
SSDP message header name.- See Also:
- Constant Field Values
-
CACHE_CONTROL
static final String CACHE_CONTROL
SSDP message header name.
-
DATE
static final String DATE
SSDP message header name.- See Also:
- Constant Field Values
-
EXT
static final String EXT
SSDP message header name.- See Also:
- Constant Field Values
-
MAN
static final String MAN
SSDP message header name.- See Also:
- Constant Field Values
-
MX
static final String MX
SSDP message header name.- See Also:
- Constant Field Values
-
NT
static final String NT
SSDP message header name.- See Also:
- Constant Field Values
-
NTS
static final String NTS
SSDP message header name.- See Also:
- Constant Field Values
-
ST
static final String ST
SSDP message header name.- See Also:
- Constant Field Values
-
USN
static final String USN
SSDP message header name.- See Also:
- Constant Field Values
-
BOOTID_UPNP_ORG
static final String BOOTID_UPNP_ORG
SSDP message header name.- See Also:
- Constant Field Values
-
NEXTBOOTID_UPNP_ORG
static final String NEXTBOOTID_UPNP_ORG
SSDP message header name.- See Also:
- Constant Field Values
-
CONFIGID_UPNP_ORG
static final String CONFIGID_UPNP_ORG
SSDP message header name.- See Also:
- Constant Field Values
-
SEARCHPORT_UPNP_ORG
static final String SEARCHPORT_UPNP_ORG
SSDP message header name.- See Also:
- Constant Field Values
-
USER_AGENT
static final String USER_AGENT
SSDP message header name.- See Also:
- Constant Field Values
-
SECURELOCATION_UPNP_ORG
static final String SECURELOCATION_UPNP_ORG
SSDP message header name.- See Also:
- Constant Field Values
-
SSDP_ALIVE
static final String SSDP_ALIVE
SSDPNTS
value.- See Also:
- Constant Field Values
-
SSDP_UPDATE
static final String SSDP_UPDATE
SSDPNTS
value.- See Also:
- Constant Field Values
-
SSDP_BYEBYE
static final String SSDP_BYEBYE
SSDPNTS
value.- See Also:
- Constant Field Values
-
MAX_AGE
static final String MAX_AGE
HTTP cache control key.- See Also:
- Constant Field Values
-
EOL
static final String EOL
SSDPMessage
end-of-line sequence.- See Also:
- Constant Field Values
-
EOM
static final String EOM
SSDPMessage
end-of-message sequence.- See Also:
- Constant Field Values
-
-
Method Detail
-
parse
static List<CharArrayBuffer> parse(DatagramPacket packet)
- Parameters:
packet
- TheDatagramPacket
.- Returns:
- The
List
of parsed lines asCharArrayBuffer
s.
-
toCharArrayBuffer
static CharArrayBuffer toCharArrayBuffer(DatagramPacket packet)
Static method to convert aDatagramPacket
to aCharArrayBuffer
.- Parameters:
packet
- TheDatagramPacket
.- Returns:
- The
CharArrayBuffer
.
-
toCharArrayBuffer
static CharArrayBuffer toCharArrayBuffer(String string)
Static method to convert aString
to aCharArrayBuffer
.- Parameters:
string
- TheString
.- Returns:
- The
CharArrayBuffer
.
-
getExpiration
long getExpiration()
Method to get the expiration time forthis
SSDPMessage
.- Returns:
- The expiration time (milliseconds since the UNIX epoch).
-
getHeaderValue
default String getHeaderValue(String... names)
Method to find the firstHeader
matchingnames
and return that value.- Parameters:
names
- The candidateHeader
names.- Returns:
- The value or
null
if no header found.
-
getHeaderValue
default <T> T getHeaderValue(Function<String,T> function, String... names)
- Type Parameters:
T
- The target type.- Parameters:
function
- The conversionFunction
.names
- The candidateHeader
names.- Returns:
- The converted value or
null
if no header found.
-
getHeaderParameterValue
default String getHeaderParameterValue(String name, String parameter)
Method to find the firstHeader
matchingname
with a parameter matchingparameter
and return that parameter value.- Parameters:
name
- The targetHeader
name.parameter
- The target parameter name.- Returns:
- The value or
null
if no header/parameter combination is found.
-
getHeaderParameterValue
default <T> T getHeaderParameterValue(Function<String,T> function, String name, String parameter)
Method to find the firstHeader
matchingname
with a parameter matchingparameter
and return that parameter value converted withfunction
.- Type Parameters:
T
- The target type.- Parameters:
name
- The targetHeader
name.parameter
- The target parameter name.- Returns:
- The value or
null
if no header/parameter combination is found.
-
getLocation
default URI getLocation()
Method to get the locationURI
.- Returns:
- The service location
URI
.
-
getExpiration
static long getExpiration(SSDPMessage message, long timestamp)
Implementation method forgetExpiration()
.- Parameters:
message
- TheSSDPMessage
.timestamp
- The message's timestamp.- Returns:
- The expiration time (milliseconds since the UNIX epoch).
-
-