org.fourthline.cling.model.profile
Class RemoteClientInfo

java.lang.Object
  extended by org.fourthline.cling.model.profile.ClientInfo
      extended by org.fourthline.cling.model.profile.RemoteClientInfo

public class RemoteClientInfo
extends ClientInfo

Encapsulates information about a remote control point, the client.

The getExtraResponseHeaders() method offers modifiable HTTP headers which will be added to the responses and returned to the client.

Author:
Christian Bauer

Field Summary
protected  Connection connection
           
protected  UpnpHeaders extraResponseHeaders
           
 
Fields inherited from class org.fourthline.cling.model.profile.ClientInfo
requestHeaders
 
Constructor Summary
RemoteClientInfo()
           
RemoteClientInfo(Connection connection, UpnpHeaders requestHeaders)
           
RemoteClientInfo(StreamRequestMessage requestMessage)
           
 
Method Summary
 Connection getConnection()
           
 UpnpHeaders getExtraResponseHeaders()
           
 InetAddress getLocalAddress()
           
 InetAddress getRemoteAddress()
           
 boolean isPS3Request()
           
 boolean isRequestCancelled()
           Check if the remote client's connection is still open.
 boolean isWMPRequest()
           
 boolean isXbox360Request()
           
 void setResponseUserAgent(String userAgent)
           
 void setResponseUserAgent(UserAgentHeader userAgentHeader)
           
 void throwIfRequestCancelled()
           
 String toString()
           
 
Methods inherited from class org.fourthline.cling.model.profile.ClientInfo
getRequestHeaders, getRequestUserAgent, setRequestUserAgent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connection

protected final Connection connection

extraResponseHeaders

protected final UpnpHeaders extraResponseHeaders
Constructor Detail

RemoteClientInfo

public RemoteClientInfo()

RemoteClientInfo

public RemoteClientInfo(StreamRequestMessage requestMessage)

RemoteClientInfo

public RemoteClientInfo(Connection connection,
                        UpnpHeaders requestHeaders)
Method Detail

getConnection

public Connection getConnection()

isRequestCancelled

public boolean isRequestCancelled()

Check if the remote client's connection is still open.

How connection checking is actually performed is transport-implementation dependent. Usually, the StreamServer will send meaningless heartbeat data to the client on its (open) socket. If that fails, the client's connection has been closed. Note that some HTTP clients can NOT handle such garbage data in HTTP responses, hence calling this method might cause compatibility issues.

Returns:
true if the remote client's connection was closed.

throwIfRequestCancelled

public void throwIfRequestCancelled()
                             throws InterruptedException
Throws:
InterruptedException - if isRequestCancelled() returns true.

getRemoteAddress

public InetAddress getRemoteAddress()

getLocalAddress

public InetAddress getLocalAddress()

getExtraResponseHeaders

public UpnpHeaders getExtraResponseHeaders()

setResponseUserAgent

public void setResponseUserAgent(String userAgent)

setResponseUserAgent

public void setResponseUserAgent(UserAgentHeader userAgentHeader)

isWMPRequest

public boolean isWMPRequest()

isXbox360Request

public boolean isXbox360Request()

isPS3Request

public boolean isPS3Request()

toString

public String toString()
Overrides:
toString in class ClientInfo


Copyright © 2013 4th Line GmbH, Switzerland. All Rights Reserved.