public final class NetConnection extends AbstractNetConnection implements INetConnection
NetConnection - implementation of the INetConnection interface.INetConnection.Configuration, INetConnection.IListener, INetConnection.ListenerAdapterCALL_BADVERSION, CALL_FAILED, CONNECT_APPSHUTDOWN, CONNECT_BANDWIDTH, CONNECT_CLOSED, CONNECT_FAILED, CONNECT_INVALID_APPLICATION, CONNECT_REJECTED, CONNECT_SUCCESS, defaultObjectEncoding, PROXY_TYPE_BEST, PROXY_TYPE_CONNECT, PROXY_TYPE_HTTP, PROXY_TYPE_NONE| Constructor and Description | 
|---|
NetConnection()
Constructor. 
 | 
NetConnection(java.util.Map<java.lang.String,java.lang.Object> configuration)
Constructor. 
 | 
NetConnection(java.util.Map<java.lang.String,java.lang.Object> configuration,
             java.util.concurrent.ExecutorService dispatcher,
             java.util.concurrent.ScheduledExecutorService scheduler)
Constructor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
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. 
 | 
void | 
close()
Closes the connection. 
 | 
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. 
 | 
INetStream | 
createNetStream()
Creates  
INetStream instance. | 
ISharedObject | 
createSharedObject(java.lang.String name,
                  boolean persistent)
Creates  
ISharedObject instance. | 
ProtocolLayerInfo | 
getInfo()
Returns connection info (read/written bytes/packets). 
 | 
int | 
getUploadBufferSize()
Returns upload buffer size. 
 | 
void | 
onBWDone()
'onBWDone' invoked by FMS server. 
 | 
void | 
onBWDone(java.lang.Object... args)
'onBWDone' invoked by FMS server. 
 | 
void | 
setMaxUploadBandwidth(int bandwidth)
Sets max upload bandwidth (in bytes per second). 
 | 
static void | 
setSwfFileSizeAndHash(java.util.Map<java.lang.String,java.lang.Object> configuration,
                     java.io.File swf)
Sets  
Configuration#SWF_HASH and Configuration#SWF_SIZE values using
 swf file. | 
boolean | 
usingTLS()
Indicates whether a secure connection was made using native
 Transport Layer Security (TLS) rather than HTTPS. 
 | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEventListener, client, client, configuration, objectEncoding, objectEncoding, proxyType, proxyType, removeEventListener, uripublic NetConnection()
public NetConnection(java.util.Map<java.lang.String,java.lang.Object> configuration)
configuration - connection configurationpublic NetConnection(java.util.Map<java.lang.String,java.lang.Object> configuration,
             java.util.concurrent.ExecutorService dispatcher,
             java.util.concurrent.ScheduledExecutorService scheduler)
configuration - connection configurationdispatcher - dispatcherscheduler - schedulerpublic static void setSwfFileSizeAndHash(java.util.Map<java.lang.String,java.lang.Object> configuration,
                         java.io.File swf)
                                  throws java.lang.Exception
Configuration#SWF_HASH and Configuration#SWF_SIZE values using
 swf file.configuration - swf - SWF filejava.lang.Exception - if an exception occurredpublic void addHeader(java.lang.String operation,
             boolean mustUnderstand,
             java.lang.Object param)
INetConnectionaddHeader in interface INetConnectionoperation - 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)
INetConnectioncall in interface INetConnectioncommand - commandresponder - an optional object that is used to handle return values from the serverargs - command argumentspublic void close()
INetConnectionclose in interface INetConnectionpublic void connect(java.lang.String url,
           java.lang.Object... args)
INetConnectionconnect in interface INetConnectionurl - url to connectargs - connection argumentspublic boolean connected()
INetConnectionconnected in interface INetConnectiontrue if connected; false otherwisepublic java.lang.String connectedProxyType()
INetConnectionconnectedProxyType in interface INetConnectionpublic boolean usingTLS()
INetConnectionusingTLS in interface INetConnectionpublic INetStream createNetStream()
INetConnectionINetStream instance.createNetStream in interface INetConnectionINetStream instancepublic ISharedObject createSharedObject(java.lang.String name, boolean persistent)
INetConnectionISharedObject instance.createSharedObject in interface INetConnectionname - shared object namepersistent - persistent flagISharedObject instancepublic ProtocolLayerInfo getInfo()
INetConnectiongetInfo in interface INetConnectionpublic int getUploadBufferSize()
INetConnectiongetUploadBufferSize in interface INetConnectionpublic void setMaxUploadBandwidth(int bandwidth)
INetConnection Note:
 
 - you can change max upload bandwidth after connection is established
 only if INetConnection.Configuration.MAX_UPLOAD_BANDWIDTH configuration property
 was set positive before connection is established.
setMaxUploadBandwidth in interface INetConnectionbandwidth - max upload bandwidthpublic void onBWDone()
public void onBWDone(java.lang.Object... args)
args - arguments