|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectflex.messaging.io.amf.client.AMFConnection
public class AMFConnection
A Java alternative to the native flash.net.NetConnection class for sending AMF formatted requests over HTTP or HTTPS based on AMFConnection in ActionScript. AMFConnection automatically handles cookies by looking for cookie headers and setting the cookies in subsequent request. AMF connection class is not thread safe.
| Field Summary | |
|---|---|
static String |
COOKIE
|
static String |
COOKIE_NAMEVALUE_SEPERATOR
|
static String |
COOKIE_SEPERATOR
|
static String |
COOKIE2
|
static String |
SET_COOKIE
|
static String |
SET_COOKIE2
|
| Constructor Summary | |
|---|---|
AMFConnection()
Creates a default AMF connection instance. |
|
| Method Summary | |
|---|---|
void |
addAmfHeader(String name,
boolean mustUnderstand,
Object data)
Adds an AMF packet-level header which is sent with every request for the life of this AMF connection. |
void |
addAmfHeader(String name,
Object data)
Add an AMF packet-level header with mustUnderstand=false, which is sent with every request for the life of this AMF connection. |
void |
addHttpRequestHeader(String name,
String value)
Adds a Http request header to the underlying connection. |
Object |
call(String command,
Object[] arguments)
Makes an AMF request to the server. |
void |
close()
Closes the underlying URL connection, sets the url to null, and clears the cookies. |
void |
connect(String url)
Connects to the URL provided. |
AMFHeaderProcessor |
getAMFHeaderProcessor()
Returns the AMF header processor associated with the AMF connection. |
static int |
getDefaultObjectEncoding()
The default object encoding for all AMFConnection instances. |
int |
getObjectEncoding()
The object encoding for this AMF connection sets which AMF version to use during serialization. |
String |
getUrl()
Returns the HTTP or HTTPS url for the AMF connection. |
boolean |
isInstantiateTypes()
Returns instantiateTypes property. |
static void |
registerAlias(String alias,
String className)
Registers a custom alias for a class name bidirectionally. |
void |
removeAllAmfHeaders()
Removes all AMF headers. |
void |
removeAllHttpRequestHeaders()
Removes all Http request headers. |
boolean |
removeAmfHeader(String name)
Removes any AMF headers found with the name given. |
boolean |
removeHttpRequestHeader(String name)
Removes the Http header found with the name given. |
void |
setAMFHeaderProcessor(AMFHeaderProcessor amfHeaderProcessor)
Sets the AMF header processor associated with the AMF connection. |
static void |
setDefaultObjectEncoding(int value)
Sets the default object encoding of the AMF connection. |
void |
setInstantiateTypes(boolean instantiateTypes)
Sets the instantiateTypes property. |
void |
setObjectEncoding(int objectEncoding)
Sets the object encoding for the AMF connection. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String COOKIE
public static final String COOKIE2
public static final String COOKIE_SEPERATOR
public static final String COOKIE_NAMEVALUE_SEPERATOR
public static final String SET_COOKIE
public static final String SET_COOKIE2
| Constructor Detail |
|---|
public AMFConnection()
| Method Detail |
|---|
public static void registerAlias(String alias,
String className)
alias - The alias for the class name.className - The concrete class name.public AMFHeaderProcessor getAMFHeaderProcessor()
public void setAMFHeaderProcessor(AMFHeaderProcessor amfHeaderProcessor)
amfHeaderProcessor - The AMF header processor to set.public static int getDefaultObjectEncoding()
public static void setDefaultObjectEncoding(int value)
value - The value to set the default object encoding to.public boolean isInstantiateTypes()
public void setInstantiateTypes(boolean instantiateTypes)
instantiateTypes - The value to set the instantiateTypes property to.public int getObjectEncoding()
public void setObjectEncoding(int objectEncoding)
objectEncoding - The value to set the object encoding to.public String getUrl()
public void addAmfHeader(String name,
boolean mustUnderstand,
Object data)
name - The name of the header.mustUnderstand - Whether the header must be processed or not.data - The value of the header.
public void addAmfHeader(String name,
Object data)
name - The name of the header.data - The value of the header.public boolean removeAmfHeader(String name)
name - The name of the header(s) to remove.
public void removeAllAmfHeaders()
public void addHttpRequestHeader(String name,
String value)
name - The name of the Http header.value - The value of the Http header.public boolean removeHttpRequestHeader(String name)
name - The name of the Http header.
public void removeAllHttpRequestHeaders()
public Object call(String command,
Object[] arguments)
throws ClientStatusException,
ServerStatusException
command - The method to call on the server.arguments - Arguments for the method.
ClientStatusException - If there is a client side exception.
ServerStatusException - If there is a server side exception.public void close()
public void connect(String url)
throws ClientStatusException
url - The URL to connect to.
ClientStatusException - If there is a client side exception.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/blazeds/1/javadoc/flex/messaging/io/amf/client/AMFConnection.html