com.esri.aims.mtier.model.admin
Class SdeServer

java.lang.Object
  extended by com.esri.aims.mtier.model.admin.SdeServer

public class SdeServer
extends Object

Implements a bean for registering an ArcSDE service.


Constructor Summary
SdeServer()
           
 
Method Summary
 String compressSde(ConnectionProxy connection)
          Compresses - Removes all states that are not referenced by a version and flushes all records in delta tables back to base data if their stateid preceeds the stateid of any version.
 String getConnectionsNumber()
          Returns the count of connections to this ArcSDE server.
 String getDescription()
          Retrieves the previously set ArcSDE service description.
 String getInstanceName()
          Returns the name of this ArcSDE instance.
 String getName()
          Returns the name string of this ArcSDE server.
 String getPassword()
          Returns the password string associated with this ArcSDE server.
 String getPort()
          Returns an ArcSDE server port value.
 String getRelease()
          Returns a string containing the ArcSDE release number.
 String getSdeAdminDatabase()
          Returns the name string of the Admin database.
 String getStatus()
          Returns the status of the current ArcSDE Server.
 String pauseService(ConnectionProxy connection)
          This method pauses a service and prevents it from setting up new connections.
 String resumeService(ConnectionProxy connection)
          Resumes a paused service.
 SdeStatus sdeServerStatus(ConnectionProxy connection, SdeServer service)
          Returns the status properties of a current ArcSDE service.
 void setConnectionsNumber(String numcons)
          Sets the given value as the number of connections.
 void setDescription(String description)
          Sets an user defined description of an ArcSDE Service.
 void setInstanceName(String instancename)
          Sets the name of an instance with given string.
 void setName(String name)
          Sets the name of the ArcSDE server with given string.
 void setPassword(String password)
          Sets the password for this ArcSDE server with given string.
 void setPort(String port)
          Sets an ArcSDE server port with given string.
 void setRelease(String release)
          Sets the ArcSDE release number with given string.
 void setSdeAdminDatabase(String sdeAdminDatabase)
          Sets the database with given name string as an Admin database.
 void setStatus(String status)
          Sets the status of the current ArcSDE Server with given string.
 String shutdownService(ConnectionProxy connection)
          Shuts down a running ArcSDE service.
 String startService(ConnectionProxy connection)
          Starts an ArcSDE service.
 String terminateSdeConnection(ConnectionProxy connection, String pid)
          Terminates an ArcSDE Server connection using the given pid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SdeServer

public SdeServer()
Method Detail

setName

public void setName(String name)
Sets the name of the ArcSDE server with given string.

Parameters:
name - the name string of the ArcSDE server

getName

public String getName()
Returns the name string of this ArcSDE server.


setPort

public void setPort(String port)
Sets an ArcSDE server port with given string.

Parameters:
port - the ArcSDE server port number

getPort

public String getPort()
Returns an ArcSDE server port value.


setPassword

public void setPassword(String password)
Sets the password for this ArcSDE server with given string.


getPassword

public String getPassword()
Returns the password string associated with this ArcSDE server.


getStatus

public String getStatus()
Returns the status of the current ArcSDE Server.

Returns:
the ArcSDE Server status - RUNNING, SHUTDOWN, PAUSED

setStatus

public void setStatus(String status)
Sets the status of the current ArcSDE Server with given string.

Parameters:
status - the ArcSDE Server status - RUNNING, SHUTDOWN, PAUSED

setInstanceName

public void setInstanceName(String instancename)
Sets the name of an instance with given string. An instance name is the service alias in both the OS services and ArcSDE services file.

This example entry, esri_sde 5151/tcp, can be found in the file: $SDEHOME/etc/services.sde , on UNIX and, %SDEHOME\etc/services.sde , on Windows.


getInstanceName

public String getInstanceName()
Returns the name of this ArcSDE instance.


setDescription

public void setDescription(String description)
Sets an user defined description of an ArcSDE Service.

Parameters:
description - the string that describes the ArcSDE service.

getDescription

public String getDescription()
Retrieves the previously set ArcSDE service description.

Returns:
the string describing the ArcSDE service

setSdeAdminDatabase

public void setSdeAdminDatabase(String sdeAdminDatabase)
Sets the database with given name string as an Admin database. You can only set SQl Server, DB2, and Informix databases as Admin databases.


getSdeAdminDatabase

public String getSdeAdminDatabase()
Returns the name string of the Admin database. Note that only SQl Server, DB2, and Informix databases can be set as Admin databases.


setRelease

public void setRelease(String release)
Sets the ArcSDE release number with given string.


getRelease

public String getRelease()
Returns a string containing the ArcSDE release number.


setConnectionsNumber

public void setConnectionsNumber(String numcons)
Sets the given value as the number of connections.


getConnectionsNumber

public String getConnectionsNumber()
Returns the count of connections to this ArcSDE server.


sdeServerStatus

public SdeStatus sdeServerStatus(ConnectionProxy connection,
                                 SdeServer service)
                          throws ConnectionParameterException,
                                 AuthenticationException,
                                 com.esri.aims.mtier.io.http.UnableToPingEsrimapException,
                                 com.esri.aims.mtier.model.axl.AXLAttributeException,
                                 com.esri.aims.mtier.model.axl.ErrorAndWarningException
Returns the status properties of a current ArcSDE service. The ArcSDE service's status properties include,

Returns:
an SdeStatus object
Throws:
ConnectionParameterException
AuthenticationException
com.esri.aims.mtier.io.http.UnableToPingEsrimapException
com.esri.aims.mtier.model.axl.AXLAttributeException
com.esri.aims.mtier.model.axl.ErrorAndWarningException

startService

public String startService(ConnectionProxy connection)
                    throws ConnectionParameterException,
                           AuthenticationException,
                           com.esri.aims.mtier.io.http.UnableToPingEsrimapException,
                           com.esri.aims.mtier.model.axl.AXLAttributeException,
                           com.esri.aims.mtier.model.axl.ErrorAndWarningException,
                           SAXException
Starts an ArcSDE service. This method uses jni sdejavautil lib. It must be present in $SDEHOME/bin or %sdehome%\bin.

Example:


 //create the SdeServer bean and assign its properties
 SdeServer sdeserver=new SdeServer();
 sdeserver.setName("Zaphod");
 sdeserver.setPort("5151");
 sdeserver.setInstanceName("esri_sde");
 sdeserver.setDescription("standby server for assessor");

 //add to app server catalog
 sdeserver.addSdeServer(connectionproxy)

 //get status and start if necessary
 SdeStatus serverStatus=server.getSdeStatus(connectionproxy,this);
 if (serverStatus.getStatus().equalsIgnoreCase("SHUTDOWN")) {
   server.startService(connectionproxy,"sde.password"); }
 

Parameters:
connection - the ConnectionProxy object
Throws:
ConnectionParameterException, - if the parameters used to initialize a MetadataConnectionProxy contain errors
AuthenticationException, - if the ConnectionProxy cannot validate the user and/or the password supplied
UnableToPingEsrimapException, - when trying to construct a BaseEsrimap and the code is unable to ping the ESRIMAP.
AXLAttributeException, - if an error occurs during reading or writing an AXL attribute.
ErrorAndWarningException, - if an ERROR or WARNING response is received.
SAXException
ConnectionParameterException
AuthenticationException
com.esri.aims.mtier.io.http.UnableToPingEsrimapException
com.esri.aims.mtier.model.axl.AXLAttributeException
com.esri.aims.mtier.model.axl.ErrorAndWarningException

shutdownService

public String shutdownService(ConnectionProxy connection)
                       throws ConnectionParameterException,
                              AuthenticationException,
                              com.esri.aims.mtier.io.http.UnableToPingEsrimapException,
                              com.esri.aims.mtier.model.axl.AXLAttributeException,
                              com.esri.aims.mtier.model.axl.ErrorAndWarningException,
                              SAXException
Shuts down a running ArcSDE service.

Parameters:
connection - the ConnectionProxy object
Throws:
ConnectionParameterException, - if the parameters used to initialize a MetadataConnectionProxy contain errors
AuthenticationException, - if the ConnectionProxy cannot validate the user and/or the password supplied
UnableToPingEsrimapException, - when trying to construct a BaseEsrimap and the code is unable to ping the ESRIMAP.
AXLAttributeException, - if an error occurs during reading or writing an AXL attribute.
ErrorAndWarningException, - if an ERROR or WARNING response is received.
SAXException
ConnectionParameterException
AuthenticationException
com.esri.aims.mtier.io.http.UnableToPingEsrimapException
com.esri.aims.mtier.model.axl.AXLAttributeException
com.esri.aims.mtier.model.axl.ErrorAndWarningException

pauseService

public String pauseService(ConnectionProxy connection)
                    throws ConnectionParameterException,
                           AuthenticationException,
                           com.esri.aims.mtier.io.http.UnableToPingEsrimapException,
                           com.esri.aims.mtier.model.axl.AXLAttributeException,
                           com.esri.aims.mtier.model.axl.ErrorAndWarningException,
                           SAXException
This method pauses a service and prevents it from setting up new connections.

Parameters:
connection - the ConnectionProxy object
Throws:
ConnectionParameterException, - if the parameters used to initialize a MetadataConnectionProxy contain errors
AuthenticationException, - if the ConnectionProxy cannot validate the user and/or the password supplied
UnableToPingEsrimapException, - when trying to construct a BaseEsrimap and the code is unable to ping the ESRIMAP.
AXLAttributeException, - if an error occurs during reading or writing an AXL attribute.
ErrorAndWarningException, - if an ERROR or WARNING response is received.
SAXException
ConnectionParameterException
AuthenticationException
com.esri.aims.mtier.io.http.UnableToPingEsrimapException
com.esri.aims.mtier.model.axl.AXLAttributeException
com.esri.aims.mtier.model.axl.ErrorAndWarningException

resumeService

public String resumeService(ConnectionProxy connection)
                     throws ConnectionParameterException,
                            AuthenticationException,
                            com.esri.aims.mtier.io.http.UnableToPingEsrimapException,
                            com.esri.aims.mtier.model.axl.AXLAttributeException,
                            com.esri.aims.mtier.model.axl.ErrorAndWarningException,
                            SAXException
Resumes a paused service.

Parameters:
connection - the ConnectionProxy object
Throws:
ConnectionParameterException, - if the parameters used to initialize a MetadataConnectionProxy contain errors
AuthenticationException, - if the ConnectionProxy cannot validate the user and/or the password supplied
UnableToPingEsrimapException, - when trying to construct a BaseEsrimap and the code is unable to ping the ESRIMAP.
AXLAttributeException, - if an error occurs during reading or writing an AXL attribute.
ErrorAndWarningException, - if an ERROR or WARNING response is received.
SAXException
ConnectionParameterException
AuthenticationException
com.esri.aims.mtier.io.http.UnableToPingEsrimapException
com.esri.aims.mtier.model.axl.AXLAttributeException
com.esri.aims.mtier.model.axl.ErrorAndWarningException

compressSde

public String compressSde(ConnectionProxy connection)
                   throws ConnectionParameterException,
                          AuthenticationException,
                          com.esri.aims.mtier.io.http.UnableToPingEsrimapException,
                          com.esri.aims.mtier.model.axl.AXLAttributeException,
                          com.esri.aims.mtier.model.axl.ErrorAndWarningException,
                          SAXException
Compresses - Removes all states that are not referenced by a version and flushes all records in delta tables back to base data if their stateid preceeds the stateid of any version.

Throws:
ConnectionParameterException
AuthenticationException
com.esri.aims.mtier.io.http.UnableToPingEsrimapException
com.esri.aims.mtier.model.axl.AXLAttributeException
com.esri.aims.mtier.model.axl.ErrorAndWarningException
SAXException

terminateSdeConnection

public String terminateSdeConnection(ConnectionProxy connection,
                                     String pid)
                              throws ConnectionParameterException,
                                     AuthenticationException,
                                     com.esri.aims.mtier.io.http.UnableToPingEsrimapException,
                                     com.esri.aims.mtier.model.axl.AXLAttributeException,
                                     com.esri.aims.mtier.model.axl.ErrorAndWarningException,
                                     SAXException
Terminates an ArcSDE Server connection using the given pid. If no pid is specified, all SDE connections will be terminated. To get an SDE pid, use the SdeConnections class:

 //get all connections
 SdeConnections cnns = new SdeConnections();
 cnns.getSdeConnections(connectionproxy, sdeserver);
 SdeConnection cnn = cnns.getSdeConnection(1);

 sdeserver.terminateSdeConnection(connection,cnn.getPid());
 

Parameters:
connection - the ConnectionProxy object
pid - the SDE identifier
Returns:
a boolean variable - True, if SDE connection is terminated, False otherwise.
Throws:
ConnectionParameterException
AuthenticationException
com.esri.aims.mtier.io.http.UnableToPingEsrimapException
com.esri.aims.mtier.model.axl.AXLAttributeException
com.esri.aims.mtier.model.axl.ErrorAndWarningException
SAXException