|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.esri.aims.mtier.io.ConnectionProxy
Used by client applications to establish communication with the ArcIMS Application Server.
...
ConnectionProxy mcp = new ConnectionProxy();
mcp.setConnectionType(ConnectionProxy.HTTP);
mcp.setService("ExcitingMetadata");
mcp.setURL(new java.net.URL("http://hilbert.esri.com:81"));
String response = mcp.send("...");
...
...
ConnectionProxy mcp = new ConnectionProxy();
mcp.setConnectionType(ConnectionProxy.TCP);
mcp.setService("SocialistHealthCare");
mcp.setHost("dali");
mcp.setPort(9973);
String response = mcp.send("...");
...
Field Summary | |
static int |
HTTP
Defines a HTTP connection type. |
static int |
HTTP_ADMIN
Defines a HTTP connection for administrative requests. |
static int |
PING_FAIL
Describes a failed ping. |
static int |
PING_FIRST_LOGIN
Indicates that the username and password have not been set. |
static int |
PING_OK
Desribes a successful ping. |
static int |
TCP
Defines a TCP connection type. |
static int |
TCP_ADMIN
Defines a TCP connection for administrative requests. |
Constructor Summary | |
ConnectionProxy()
Constructs a new ConnectionProxy object. |
Method Summary | |
int |
getConnectionType()
Returns the current connection type setting. |
boolean |
getDisplayMessages()
Returns True, if requests and responses are to be written to System.out , False otherwise. |
String |
getHost()
Returns the current hostname for the connection proxy. |
String |
getPassword()
Returns the password used for authentication. |
int |
getPort()
Returns the current port of the host machine that is used to send requests. |
String |
getService()
Returns the name of the service which is currently being used to access the defined host machine. |
URL |
getUrl()
Returns the defined URL. |
String |
getUsername()
Returns the username used for authentication. |
com.esri.aims.mtier.model.axl.admin.Warnings |
getWarnings()
|
int |
ping()
Sends a ping to the Application Server to test the connection. |
int |
ping(boolean validate)
Sends a ping to the Application Server to test the connection. |
String |
send(String request)
Sends a request to the service configured by the connector bean. |
static String |
send(String host,
String service,
int port,
int connectionType,
String request)
An utility method that can be used to send a single request without having to maintain a ConnectionProxy object reference. |
static String |
send(String host,
String service,
int port,
int connectionType,
String username,
String password,
String request)
An utility method that can be used to send a single authenticatable request without having to maintain a ConnectionProxy object reference. |
InputStream |
sendGetStream(String request)
Sends a request to the service configured by the connector bean. |
void |
setConnectionType(int newConnectionType)
Sets the connection type with given integer. |
void |
setConnectionType(String newConnectionType)
Sets the connection type with given string. |
void |
setDisplayMessages(boolean display)
Used to write requests and responses to System.out . |
void |
setFileLength(long fileLength)
Sets the size of the mxd InputStream. |
void |
setHost(String newHost)
Defines the name of the host machine. |
void |
setMxdStream(InputStream mxdStream)
Sets the InputStream for mxd stream. |
void |
setPassword(String newPassword)
Sets the password used for authentication. |
void |
setPort(int newPort)
Sets the port on the host machine to which the request is being sent. |
void |
setService(String newService)
Defines the service this connection object will be accessing. |
void |
setUrl(URL newUrl)
Sets the URL to connect with. |
void |
setUsername(String newUsername)
Sets the username to be used for authentication. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TCP
public static final int HTTP
public static final int TCP_ADMIN
public static final int HTTP_ADMIN
public static final int PING_OK
public static final int PING_FAIL
public static final int PING_FIRST_LOGIN
Constructor Detail |
public ConnectionProxy()
ConnectionProxy
object.
Method Detail |
public int ping() throws ConnectionParameterException
PING_FIRST_LOGIN
, the username and password of the
ConnectionProxy
are reset. The old username and password will
only work with a request to Site.setSiteUser()
to set
the site user profile.
Same as calling ping(true);
ConnectionParameterException
public int ping(boolean validate) throws ConnectionParameterException
PING_FIRST_LOGIN
, the username and password of the
ConnectionProxy
are reset. The old username and password will
only work with a request to Site.setSiteUser()
to set
the site user profile.
ConnectionParameterException
public static String send(String host, String service, int port, int connectionType, String request) throws ConnectionParameterException, UnableToPingEsrimapException, AuthenticationException, IOException
host
- the serverservice
- see parameter newService
in function setService
port
- the port the server is running onconnectionType
- the type of connection being usedrequest
- the request being sent
ConnectionParameterException,
- if a parameter is set incorrectly
or if there is an error trying to load a given parameter.
UnableToPingEsrimapException,
- if the server defined cannot be found
on a given network (internet or intranet).
ConnectionParameterException
UnableToPingEsrimapException
AuthenticationException
IOException
public static String send(String host, String service, int port, int connectionType, String username, String password, String request) throws ConnectionParameterException, UnableToPingEsrimapException, AuthenticationException, IOException
host
- the serverservice
- see parameter newService
in function setService
port
- the port the server is running onconnectionType
- the type of connection being usedusername
- the username used to authenticate the requestpassword
- the password used to authenticate the requestrequest
- the request being sent
ConnectionParameterException,
- if a parameter is set incorrectly
or if there is an error in trying to load a given parameter.
UnableToPingEsrimapException,
- if the server defined cannot be found
on a given network (internet or intranet).
AuthenticationException,
- if the user profile defined by the
username and password cannot be authenticated on the service defined
by this connection.
ConnectionParameterException
UnableToPingEsrimapException
AuthenticationException
IOException
public String send(String request) throws ConnectionParameterException, UnableToPingEsrimapException, AuthenticationException, IOException
request
- the request sent to the defined location
ConnectionParameterException,
- if a parameter is set incorrectly
or if there is an error in trying to load a given parameter.
UnableToPingEsrimapException,
- if the server cannot be found
on a given network (internet or intranet).
AuthenticationException,
- if the user profile defined by the
username and password cannot be authenticated on the service defined
by this connection.
ConnectionParameterException
UnableToPingEsrimapException
AuthenticationException
IOException
public InputStream sendGetStream(String request) throws ConnectionParameterException, UnableToPingEsrimapException, AuthenticationException, IOException
request
- the request to be sent the defined location
java.io.StreamInput
ConnectionParameterException,
- if a parameter is set incorrectly
or if there is an error in trying to load a given parameter.
UnableToPingEsrimapException,
- if the server defined cannot be found
on a given network (internet or intranet).
AuthenticationException,
- if the user profile defined by the
username and password cannot be authenticated on the service defined
by this connection.
ConnectionParameterException
UnableToPingEsrimapException
AuthenticationException
IOException
public void setHost(String newHost)
newHost
- the name of the host machine.public String getHost()
public void setPort(int newPort)
newPort
- the port on the remote machine.public int getPort()
public void setService(String newService)
connectionProxy.setService("SantaClara&CustomService=Query");
newService
- specfies the map service name and the custom service, in the format of "map_service_name&CustomService=custom_service_name", the custom_service_name can be of three values: "Query" for <GET_FEATURES> request, "Geocode" for <GET_GEOCODE> request, and "Image", the default, is for all other requests.public String getService()
public void setConnectionType(int newConnectionType)
newConnectionType
- the connection type used for communication - TCP/HTTP/HTTPSpublic void setConnectionType(String newConnectionType) throws ConnectionParameterException
newConnectionType
- the connection type used for communication - TCP/HTTP/HTTPS
ConnectionParameterException,
- if the protocol defined is not found.
ConnectionParameterException
public int getConnectionType()
public void setUsername(String newUsername)
newUsername
- the new usernamepublic String getUsername()
public void setPassword(String newPassword)
newPassword
- the password stringpublic void setMxdStream(InputStream mxdStream)
mxdStream
- is the mxd InputStream.public void setFileLength(long fileLength)
fileLength
- the size of the mxd InputStream.public String getPassword()
public void setUrl(URL newUrl)
newUrl
- the URL to connect with.public URL getUrl()
java.net.URL
, if defined for this object.public void setDisplayMessages(boolean display)
System.out
. Note,
that you may have performance issues if set to True.
display
- a boolean attribute - True, to display requests and
responses, False otherwise.public boolean getDisplayMessages()
System.out
, False otherwise.
public com.esri.aims.mtier.model.axl.admin.Warnings getWarnings()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |