|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.smaxe.me.uv.client.NetConnection
public final class NetConnection
NetConnection
- Net Connection.
Nested Class Summary | |
---|---|
static class |
NetConnection.Configuration
Configuration - NetConnection configuration constants. |
static interface |
NetConnection.IListener
IListener - NetConnection listener. |
static class |
NetConnection.ListenerAdapter
ListenerAdapter - NetConnection.IListener adapter. |
Field Summary | |
---|---|
static java.lang.String |
CALL_BADVERSION
The URI specified in the NetConnection.connect method did not specify 'rtmp' as the protocol. |
static java.lang.String |
CALL_FAILED
The NetConnection.call method was not able to invoke the server-side method or command. |
static java.lang.String |
CONNECT_APPSHUTDOWN
The application has been shut down (for example, if the application is out of memory resources and must shut down to prevent the server from crashing) or the server has shut down. |
static java.lang.String |
CONNECT_BANDWIDTH
Connection bandwidth. |
static java.lang.String |
CONNECT_CLOSED
The connection was closed successfully |
static java.lang.String |
CONNECT_FAILED
The connection attempt failed. |
static java.lang.String |
CONNECT_INVALID_APPLICATION
The application name specified during connect is invalid. |
static java.lang.String |
CONNECT_REJECTED
The client does not have permission to connect to the application, the application expected different parameters from those that were passed, or the application name specified during the connection attempt was not found on the server. |
static java.lang.String |
CONNECT_SUCCESS
The connection attempt succeeded. |
static ObjectEncoding |
defaultObjectEncoding
Default object encoding. |
static java.lang.String |
PROXY_TYPE_BEST
PROXY_TYPE_BEST - "best" |
static java.lang.String |
PROXY_TYPE_CONNECT
PROXY_TYPE_CONNECT - "CONNECT" |
static java.lang.String |
PROXY_TYPE_HTTP
PROXY_TYPE_HTTP - "HTTP" |
static java.lang.String |
PROXY_TYPE_NONE
PROXY_TYPE_NONE - "none" |
Constructor Summary | |
---|---|
NetConnection()
Constructor. |
|
NetConnection(java.util.Hashtable configuration)
Constructor. |
|
NetConnection(java.util.Hashtable configuration,
ExecutorService dispatcher)
Constructor. |
Method Summary | |
---|---|
void |
addEventListener(NetConnection.IListener listener)
Registers an event listener. |
void |
addHeader(java.lang.String operation,
boolean mustUnderstand,
java.lang.Object param)
Adds a context header to the AMF packet structure. |
void |
call(java.lang.String command,
Responder responder,
java.lang.Object[] args)
Invokes a command or method on the server, or on an application server, to which the application instance is connected. |
static java.util.Hashtable |
checkConfiguration(java.util.Hashtable configuration)
Checks configuration and returns the configuration to use. |
java.lang.Object |
client()
Returns the object on which callback methods should be invoked. |
void |
client(java.lang.Object client)
Sets the object on which callback methods should be invoked. |
void |
close()
Closes the connection. |
java.util.Hashtable |
configuration()
Returns NetConnection configuration. |
void |
connect(java.lang.String url,
java.lang.Object[] args)
Opens a connection to a server. |
boolean |
connected()
Checks if it is connected to the server. |
java.lang.String |
connectedProxyType()
If a successful connection is made, indicates the method that was used to make it: a direct connection, the CONNECT method, or HTTP tunneling. |
static java.util.Hashtable |
createDefaultConfiguration()
Creates default configuration. |
ProtocolLayerInfo |
getInfo()
Returns connection info (read/written bytes/packets). |
int |
getUploadBufferSize()
Returns upload buffer size. |
ObjectEncoding |
objectEncoding()
Returns object encoding. |
void |
objectEncoding(ObjectEncoding encoding)
The object encoding (AMF version). |
java.lang.String |
proxyType()
Returns proxy type. |
void |
proxyType(java.lang.String type)
Determines whether native SSL is used for RTMPS instead of HTTPS, and whether the CONNECT method of tunneling is used to connect through a proxy server. |
void |
removeEventListener(NetConnection.IListener listener)
Removes the listener. |
void |
setMaxUploadBandwidth(int bandwidth)
Sets max upload bandwidth (in bytes per second). |
java.lang.String |
uri()
The URI of the application server that was passed to INetConnection#connect(String, Object[]) ,
if INetConnection#connect(String, Object[]) was used to connect to a server. |
boolean |
usingTLS()
Indicates whether a secure connection was made using native Transport Layer Security (TLS) rather than HTTPS. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROXY_TYPE_NONE
PROXY_TYPE_NONE
- "none"
public static final java.lang.String PROXY_TYPE_HTTP
PROXY_TYPE_HTTP
- "HTTP"
public static final java.lang.String PROXY_TYPE_CONNECT
PROXY_TYPE_CONNECT
- "CONNECT"
public static final java.lang.String PROXY_TYPE_BEST
PROXY_TYPE_BEST
- "best"
public static final java.lang.String CALL_FAILED
public static final java.lang.String CALL_BADVERSION
public static final java.lang.String CONNECT_APPSHUTDOWN
public static final java.lang.String CONNECT_CLOSED
public static final java.lang.String CONNECT_FAILED
public static final java.lang.String CONNECT_REJECTED
public static final java.lang.String CONNECT_SUCCESS
public static final java.lang.String CONNECT_INVALID_APPLICATION
public static final java.lang.String CONNECT_BANDWIDTH
Note:
This event is introduced in the JUV RTMP Client library and not available in
ActionScript/FMS interaction.
public static ObjectEncoding defaultObjectEncoding
Constructor Detail |
---|
public NetConnection()
public NetConnection(java.util.Hashtable configuration)
configuration
- connection configurationpublic NetConnection(java.util.Hashtable configuration, ExecutorService dispatcher)
configuration
- connection configurationdispatcher
- dispatcherMethod Detail |
---|
public static java.util.Hashtable createDefaultConfiguration()
public static java.util.Hashtable checkConfiguration(java.util.Hashtable configuration)
configuration
-
public void client(java.lang.Object client)
client
- the object on which callback methods should be invokedpublic java.lang.Object client()
public boolean connected()
true
if connected; false
otherwisepublic java.lang.String connectedProxyType()
public ObjectEncoding objectEncoding()
public void objectEncoding(ObjectEncoding encoding)
encoding
- object encodingpublic java.lang.String proxyType()
public void proxyType(java.lang.String type)
type
- proxy typepublic java.lang.String uri()
INetConnection#connect(String, Object[])
,
if INetConnection#connect(String, Object[])
was used to connect to a server.
public boolean usingTLS()
public void addHeader(java.lang.String operation, boolean mustUnderstand, java.lang.Object param)
operation
- identifies the header and the object data associated with itmustUnderstand
- (default = false
) — A value of
true
indicates that the server must understand and process
this header before it handles any of the following headers or messages.param
- (default = null
) — any objectpublic void call(java.lang.String command, Responder responder, java.lang.Object[] args)
command
- commandresponder
- an optional object that is used to handle return values from the serverargs
- command argumentspublic void connect(java.lang.String url, java.lang.Object[] args)
url
- url to connectargs
- connection argumentspublic void close()
public void addEventListener(NetConnection.IListener listener)
listener
- listener to addpublic void removeEventListener(NetConnection.IListener listener)
listener
- listener to removepublic final java.util.Hashtable configuration()
NetConnection.Configuration
class constants
for configuration properties.
public ProtocolLayerInfo getInfo()
public int getUploadBufferSize()
public void setMaxUploadBandwidth(int bandwidth)
Note:
- you can change max upload bandwidth after connection is established
only if NetConnection.Configuration.MAX_UPLOAD_BANDWIDTH
configuration property
was set positive before connection is established.
bandwidth
- max upload bandwidth
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |