com.esri.arcgis.datasourcesGDB
Class DataServerManager

java.lang.Object
  extended by com.esri.arcgis.datasourcesGDB.DataServerManager
All Implemented Interfaces:
IDataServerManager, IDataServerManagerAdmin, IServiceControl, com.esri.arcgis.interop.RemoteObjRef, Serializable

public class DataServerManager
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IDataServerManager, IDataServerManagerAdmin, IServiceControl

Object to administer a Data Server.

Description

The DataServerManager object allows you to connect to a Database Server and administer Database Servers. To be able to connect to a Database Server using this component, you must either be an administrator of that server, or you must be a user that an administrator has added to the server with the appropriate permission levels.

Remarks

At ArcGIS 9.2, the supported Data Servers are Personal ArcSDE and Workgroup ArcSDE for Microsoft SQL Server 2005 Express Edition.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
Serialized Form

Constructor Summary
DataServerManager()
          Constructs a DataServerManager using ArcGIS Engine.
DataServerManager(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
DataServerManager theDataServerManager = (DataServerManager) obj;
 
Method Summary
 void analyze(String gdbName)
          Updates the statistics for a Geodatabase.
 void attachGeodatabase(String dbName, String dataFileName, String logFileName)
          Attachs an existing database to a server.
 boolean backupGeodatabase(String gdbName, String backupFileName, String backupName, String description)
          Performs a full backup on the specified Geodatabase.
 void connect()
          Connects to an initialized Data Server.
 void continueServer()
          Continues the server.
 String createConnectionFile(String pathName, String serverName)
          Create a Data Server connection file.
 void createGeodatabase(String gdbName, String gdbFileName, int gdbFileSize, String logFileName, int logFileSize)
          Creates a new Geodatabase.
 void createLogin(String loginName, boolean isAdministrator)
          Creates a new login.
 IWorkspaceName createWorkspaceName(String gdbName, String versionPropName, Object versionSpecifier)
          Creates a Workspace Name object to the Geodatabase.
 void deleteGeodatabase(String gdbName)
          Deletes a Geodatabase.
 void deleteLogin(String loginName)
          Deletes a login.
 void detachGeodatabase(String dbName)
          Detachs a database from a server.
 void disconnect()
          Disconnects from the Data Server.
 boolean equals(Object o)
          Compare this object with another
 int getAvailableMemory()
          The total available memory (MB).
static String getClsid()
          getClsid.
 int getConnectedUsers(String dbName)
          Gets active users.
 int getDataServerClass()
          The server class.
 int getDataServerType()
          The type of data server.
 void getDBProperties(String dbName, String[] status, int[] dbSize, String[] owner, Object[] createDate, Object[] dbBackup)
          Returns various properties on a Database.
 void getFileProperties(String dbName, String[] dataName, String[] dataPhysicalName, int[] dataFileSize, String[] logName, String[] logPhysicalName, int[] logFileSize)
          Return various properties on a database file.
 String getGeodatabaseName(String dataFileName)
          Returns the Database name from the database file.
 IEnumBSTR getGeodatabaseNames()
          Returns a list of Geodatabse names.
 void getLogins(IEnumBSTR[] loginNames, IEnumBSTR[] dbNames, IEnumBSTR[] loginTypes, IEnumBSTR[] languages)
          Returns a list logins and associated information.
 String getProductName()
          The product name.
 String getProductVersion()
          The product version.
 void getServerAdministrators(IEnumBSTR[] userNames)
          Gets a list of server administrators.
 String getServerName()
          The data server name.
 int getServerStatus()
          The status of the server.
 void getUsersByPermissionType(String dbName, int permission, IEnumBSTR[] userNames)
          Get Users in by the Permission type.
 int hashCode()
          the hashcode for this object
 void initFromFile(String gdsFileName)
          Initializes a saved connection to the GIS Data Server.
 boolean isConnected()
          Indicates whether the server is connected or not.
 boolean isConnectedUserAdministrator()
          Indicates whether the connected user is an administrator or not.
 boolean isHasControlPermissions()
          Indicates whether the user has permissions to control the service.
 void isSimpleRecoveryModel(String gdbName, boolean[] isSimpleRecoveryModel)
          Returns whether the Geodatabase is in simple recovery model or not.
 void modifyGeodatabaseSecurity(String dbName, String loginName, int permission)
          Modify a login's database security.
 void modifyLoginSecurity(String loginName, boolean isAdministrator)
          Modify a login's server security.
 void pauseServer()
          Pauses the server.
 void rebuildIndices(String gdbName)
          Rebuilds the indices on all tables in a Geodatabase.
 void restoreGeodatabase(String gdbName, String backupFileName, String dbFilePath)
          Restores a backup for the specified Geodatabase.
 void setGeodatabaseToSimpleRecoveryModel(String gdbName)
          Sets a Geodatabase to simple recovery model.
 void setServerName(String serverName)
          The data server name.
 void shrinkGeodatabase(String gdbName)
          Shrinks the size of a Geodatabase and frees up unused space.
 void startServer()
          Starts the server.
 void stopServer()
          Stops the server.
 void upgradeGeoDatabase(String gdbName)
          Upgrades a Geodatabase.
 void upgradeSDESchema(String gdbName)
          Upgrades the SDE schema.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

DataServerManager

public DataServerManager()
                  throws IOException,
                         UnknownHostException
Constructs a DataServerManager using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

DataServerManager

public DataServerManager(Object obj)
                  throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
DataServerManager theDataServerManager = (DataServerManager) obj;

Construct a DataServerManager using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to DataServerManager.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

connect

public void connect()
             throws IOException,
                    AutomationException
Connects to an initialized Data Server.

Description

This function connects to a Database Server.

Remarks

The DataServerManager must be initialized by using put_ServerName or InitFromFile. You must already be a user on the server, with the appropriate permissions, in order to connect to it.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
connect in interface IDataServerManager
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

disconnect

public void disconnect()
                throws IOException,
                       AutomationException
Disconnects from the Data Server.

Description

This function disconnects from a Database Server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
disconnect in interface IDataServerManager
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setServerName

public void setServerName(String serverName)
                   throws IOException,
                          AutomationException
The data server name.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setServerName in interface IDataServerManager
Parameters:
serverName - The serverName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServerName

public String getServerName()
                     throws IOException,
                            AutomationException
The data server name.

Remarks

The ServerName property is used to return or set the name of the server of the Data Server Manager, for example; “myserver\sqlexpress”. The ServerName value is used with the CreateConnectionFile method. Setting the ServerName property is one method for initializing the DataServerManager before connecting to the Database Server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getServerName in interface IDataServerManager
Returns:
The serverName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

initFromFile

public void initFromFile(String gdsFileName)
                  throws IOException,
                         AutomationException
Initializes a saved connection to the GIS Data Server.

Description

This method initializes a Data Server from a Database Server connection file (.gds).

Remarks

The .gds file is created using the Add Database Server option in ArcCatalog, or the CreateConnectionFile method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
initFromFile in interface IDataServerManager
Parameters:
gdsFileName - The gdsFileName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createConnectionFile

public String createConnectionFile(String pathName,
                                   String serverName)
                            throws IOException,
                                   AutomationException
Create a Data Server connection file.

Remarks

Creates a Database Server connection file (.gds).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
createConnectionFile in interface IDataServerManager
Parameters:
pathName - The pathName (in)
serverName - The serverName (in)
Returns:
The connFileName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isConnected

public boolean isConnected()
                    throws IOException,
                           AutomationException
Indicates whether the server is connected or not.

Description

This method returns whether you are currenrtly connected to the database server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isConnected in interface IDataServerManager
Returns:
The isConnected
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDataServerType

public int getDataServerType()
                      throws IOException,
                             AutomationException
The type of data server.

Description

This method returns the type of the database server (DataServerType).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getDataServerType in interface IDataServerManager
Returns:
A com.esri.arcgis.datasourcesGDB.esriDataServerType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getProductName

public String getProductName()
                      throws IOException,
                             AutomationException
The product name.

Remarks

This method returns the product name for the underlying database server. For example; “Microsoft SQL Server Express Edition”.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getProductName in interface IDataServerManager
Returns:
The name
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getProductVersion

public String getProductVersion()
                         throws IOException,
                                AutomationException
The product version.

Remarks

This return returns the version of the underlying database server. For example; “9.00.1399.06”.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getProductVersion in interface IDataServerManager
Returns:
The version
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAvailableMemory

public int getAvailableMemory()
                       throws IOException,
                              AutomationException
The total available memory (MB).

Remarks

This function returns the available physical RAM on the database server. This is the total memory that is available to the database server, including memory that may already be in use, either by the database server or other applications.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getAvailableMemory in interface IDataServerManager
Returns:
The memory
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDataServerClass

public int getDataServerClass()
                       throws IOException,
                              AutomationException
The server class.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getDataServerClass in interface IDataServerManager
Returns:
A com.esri.arcgis.geodatabase.esriGeodatabaseServerClassType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createGeodatabase

public void createGeodatabase(String gdbName,
                              String gdbFileName,
                              int gdbFileSize,
                              String logFileName,
                              int logFileSize)
                       throws IOException,
                              AutomationException
Creates a new Geodatabase.

Remarks

The CreateGeodatabase method creates a geodatabase with the supplied name, corresponding to the specified .mdf file.

The gdbName and gdbFileName arguments must have the same name, geodatabases with different names from the .mdf file are not currently supported. The gdbFileName argument should contain the complete folder path to the location in which the .mdf file will be created. It should also correspond with the name of the geodatabase to be created and should have the ".mdf" suffix specified.

gdbFileSize is in megabytes and is an optional parameter. If you specify 0, the size of the database created will be set to the data server's defaults (which is generally around 7 MBs).

logFileName and logFileSize are also optional parameters. If you specify an empty string for the logFileName or 0 for the logFileSize, they will be set to the data server's defaults. If an empty string is supplied for logFileName, a file will be created in the same directory as that specified for the gdbFileName, but will conform to the following: gdbFileName & "_log.LDF". If the logFileName argument is supplied, a valid size (greater than 0), must be supplied for the logFileSize. The logFileName may have a different name and be created within a different location than the .mdf file, however, this is generally not recommeded.

You must be a server administrator to perform this operation.

After a geodatabase has been created, all server administrators, including the user who created the geodatabase will have access to it. Other users will need to be granted permission to the geodatabase.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
createGeodatabase in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
gdbFileName - The gdbFileName (in)
gdbFileSize - The gdbFileSize (in)
logFileName - The logFileName (in)
logFileSize - The logFileSize (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteGeodatabase

public void deleteGeodatabase(String gdbName)
                       throws IOException,
                              AutomationException
Deletes a Geodatabase.

Description

Deletes a Geodatabase.

Remarks

You must be a server administrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
deleteGeodatabase in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createLogin

public void createLogin(String loginName,
                        boolean isAdministrator)
                 throws IOException,
                        AutomationException
Creates a new login.

Description

The method creates a login on the server. Login names are Microsoft Windows logins.

Remarks

If the isAdministrator parameter is set to true, the new user is made an adminstrator and has full administration rights, such as creating or deleting Geodatabases, adding users, etc.

You must be a server administrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
createLogin in interface IDataServerManagerAdmin
Parameters:
loginName - The loginName (in)
isAdministrator - The isAdministrator (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

modifyLoginSecurity

public void modifyLoginSecurity(String loginName,
                                boolean isAdministrator)
                         throws IOException,
                                AutomationException
Modify a login's server security.

Description

This method allows you to make an existing login an administrator or not.

Remarks

You must be an server adminstrator to execute this method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
modifyLoginSecurity in interface IDataServerManagerAdmin
Parameters:
loginName - The loginName (in)
isAdministrator - The isAdministrator (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

modifyGeodatabaseSecurity

public void modifyGeodatabaseSecurity(String dbName,
                                      String loginName,
                                      int permission)
                               throws IOException,
                                      AutomationException
Modify a login's database security.

Description

This method modifies the permission type of a user at the Geodatabase level. Permissions include the read access to the data, read\write access including the ability to create data in the Geodatabase or read\write access with the ability to perform administrator tasks. You must be a server administrator or a user with Geodatabase administrator permissions to use this method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
modifyGeodatabaseSecurity in interface IDataServerManagerAdmin
Parameters:
dbName - The dbName (in)
loginName - The loginName (in)
permission - A com.esri.arcgis.datasourcesGDB.esriGeodatabasePermissionsType constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteLogin

public void deleteLogin(String loginName)
                 throws IOException,
                        AutomationException
Deletes a login.

Description

This method deletes a login from a database server. In order to delete a user or login, the user cannot own any data within the Database Server.

Remarks

You must be a server administrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
deleteLogin in interface IDataServerManagerAdmin
Parameters:
loginName - The loginName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGeodatabaseNames

public IEnumBSTR getGeodatabaseNames()
                              throws IOException,
                                     AutomationException
Returns a list of Geodatabse names.

Description

This method returns a list of Geodatabases on the Database Server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getGeodatabaseNames in interface IDataServerManagerAdmin
Returns:
A reference to a com.esri.arcgis.system.IEnumBSTR
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getLogins

public void getLogins(IEnumBSTR[] loginNames,
                      IEnumBSTR[] dbNames,
                      IEnumBSTR[] loginTypes,
                      IEnumBSTR[] languages)
               throws IOException,
                      AutomationException
Returns a list logins and associated information.

Description

This method returns a list of logins and their associated Geodatabase, login types, and default languages.

Remarks

The login types are: NTUser, NTGroup and Standard. They represent a Windows login, Windows group and a built-in database user, respectively.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getLogins in interface IDataServerManagerAdmin
Parameters:
loginNames - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
dbNames - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
loginTypes - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
languages - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

detachGeodatabase

public void detachGeodatabase(String dbName)
                       throws IOException,
                              AutomationException
Detachs a database from a server.

Description

This method detaches a Geodatabase from a database server. Once detached, the Geodatabase can be re-attached to this or some other database server. A Geodatabase cannot be detached while users are connected to it.

Remarks

You must be a server administrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
detachGeodatabase in interface IDataServerManagerAdmin
Parameters:
dbName - The dbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

attachGeodatabase

public void attachGeodatabase(String dbName,
                              String dataFileName,
                              String logFileName)
                       throws IOException,
                              AutomationException
Attachs an existing database to a server.

Remarks

The AttachGeodatabase method allows a Geodatabase to be attached to a Database Server. The dataFileName parameter must contain the full path name to the mdf file to be attached, for example: "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\MyDatabase.mdf". The logFileName is an optional parameter, i.e., you can set it to 0. If not specified, the log file will be re-created. The Geodatabase must first have been detached from a database server, before it can be attached.

You must be a server administrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
attachGeodatabase in interface IDataServerManagerAdmin
Parameters:
dbName - The dbName (in)
dataFileName - The dataFileName (in)
logFileName - The logFileName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

upgradeGeoDatabase

public void upgradeGeoDatabase(String gdbName)
                        throws IOException,
                               AutomationException
Upgrades a Geodatabase.

Description

This upgrades the ArcSDE and Geodatabase releases to the current release of the installed ArcGIS. Geodatabases must be upgraded in order to take advantage of new functionality when new releases of ArcGIS are available.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
upgradeGeoDatabase in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

upgradeSDESchema

public void upgradeSDESchema(String gdbName)
                      throws IOException,
                             AutomationException
Upgrades the SDE schema.

Remarks

The IDataServerManagerAdmin.UpgradeGeoDatabase should be used in place of this method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
upgradeSDESchema in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGeodatabaseName

public String getGeodatabaseName(String dataFileName)
                          throws IOException,
                                 AutomationException
Returns the Database name from the database file.

Description

This method returns the name of the Geodatabase inside a database server data file (.mdf). For Database Servers, the Geodatabase name will also be equal to the name of the .mdf file.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getGeodatabaseName in interface IDataServerManagerAdmin
Parameters:
dataFileName - The dataFileName (in)
Returns:
The dbName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

backupGeodatabase

public boolean backupGeodatabase(String gdbName,
                                 String backupFileName,
                                 String backupName,
                                 String description)
                          throws IOException,
                                 AutomationException
Performs a full backup on the specified Geodatabase.

Description

This method backs up a Geodatabase.

Remarks

You must specify the Geodatabase to be backed up, the name of the backup file to be created and a name identifying the backup itself. The description parameter is optional and may be set to 0.

If the Geodatabase has been set to something other than simple recovery model, then this method will fail and the IsSimpleRecoveryModel parameter will be set to TRUE.

You must be a server administrator or have geodatabase admin permissions (esriPermAdmin) to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
backupGeodatabase in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
backupFileName - The backupFileName (in)
backupName - The backupName (in)
description - The description (in)
Returns:
The isSimpleRecoveryModel
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

restoreGeodatabase

public void restoreGeodatabase(String gdbName,
                               String backupFileName,
                               String dbFilePath)
                        throws IOException,
                               AutomationException
Restores a backup for the specified Geodatabase.

Description

This method restores a Geodatabase from a previous backup.

Remarks

If the dbFilePath parameter is set to 0, the database will be backed up to it's original location. Specifying the dbFilePath parameter allows you to change the physical location of the data file. In this case, the dbFilePath parameter should specify the full path of the new location, including the new file name.

You must be a server adminstrator to perform this operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
restoreGeodatabase in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
backupFileName - The backupFileName (in)
dbFilePath - The dbFilePath (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isSimpleRecoveryModel

public void isSimpleRecoveryModel(String gdbName,
                                  boolean[] isSimpleRecoveryModel)
                           throws IOException,
                                  AutomationException
Returns whether the Geodatabase is in simple recovery model or not.

Description

This method returns whether the Geodatabase is in simple recovery model or not.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isSimpleRecoveryModel in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
isSimpleRecoveryModel - The isSimpleRecoveryModel (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setGeodatabaseToSimpleRecoveryModel

public void setGeodatabaseToSimpleRecoveryModel(String gdbName)
                                         throws IOException,
                                                AutomationException
Sets a Geodatabase to simple recovery model.

Description

This method sets the Geodatabase to simple recovery model, which is required for backup/restore tools to work. It is not necessary to use this method when calling the BackupGeodatabase or RestoreGeodatabase methods.

Executing this method is only necessary if the geodatabase recovery model option has been modified outside of ArcGIS. Geodatabase created within ArcGIS will always use the simple recovery method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
setGeodatabaseToSimpleRecoveryModel in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isConnectedUserAdministrator

public boolean isConnectedUserAdministrator()
                                     throws IOException,
                                            AutomationException
Indicates whether the connected user is an administrator or not.

Description

This method returns whether the connected user is an administrator or not.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isConnectedUserAdministrator in interface IDataServerManagerAdmin
Returns:
The isAdministrator
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

createWorkspaceName

public IWorkspaceName createWorkspaceName(String gdbName,
                                          String versionPropName,
                                          Object versionSpecifier)
                                   throws IOException,
                                          AutomationException
Creates a Workspace Name object to the Geodatabase.

Remarks

CreateWorkspaceName takes as input a geodatabase name (gdbName), type of version (versionPropName) and version name (versionSpecifier) and returns a WorkspaceName object to the specified geodatabase and version.

There are 3 valid values for the versionPropName property:

You must initialize the Data Server Manager object before using this method. The Data Server Manager can be initialized through the use of IDataServerManager.InitFromFile or IDataServerManager.ServerName and then calling IDataServerManager.Connect.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
createWorkspaceName in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
versionPropName - The versionPropName (in)
versionSpecifier - A Variant (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IWorkspaceName
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDBProperties

public void getDBProperties(String dbName,
                            String[] status,
                            int[] dbSize,
                            String[] owner,
                            Object[] createDate,
                            Object[] dbBackup)
                     throws IOException,
                            AutomationException
Returns various properties on a Database.

Description

This method returns properties on a Geodatabase. It can only be used on Geodatabases that are attached to a data server. If the dbName parameter does not correspond to a Geodatabase attached to the current data server, an error will be raised.

Remarks

The dbName input parameter specifies for which database the properites should be returned.

The Status value indicates the status of the Geodatabase; such as Online for an attached Geodatabase or Offline for a detached Geodatabase.

dbSize indicates the size in MB of the Geodatabase.

The Owner value corresponds to the owner who created the Geodatabase and will refer to the OS login, not the database login.

The createDate value is the creation date for the Geodatabase.

The DbBackup parameter is an optional parameter (you can specify 0 as an argument). The DbBackup parameter is the date in which the last backup was performed on this Geodatabase. If no backup has yet been performed on the Geodatabase, this value will be empty.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getDBProperties in interface IDataServerManagerAdmin
Parameters:
dbName - The dbName (in)
status - The status (out: use single element array)
dbSize - The dbSize (out: use single element array)
owner - The owner (out: use single element array)
createDate - A Variant (out: use single element array)
dbBackup - A Variant (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getFileProperties

public void getFileProperties(String dbName,
                              String[] dataName,
                              String[] dataPhysicalName,
                              int[] dataFileSize,
                              String[] logName,
                              String[] logPhysicalName,
                              int[] logFileSize)
                       throws IOException,
                              AutomationException
Return various properties on a database file.

Description

This method returns information about the data files associated with this Geodatabase.

Remarks

The dbName input parameter specifies for which database the properites should be returned.

The dataName value returns the name of the database, which should match the Geodatabase name, since ArcGIS does not support different database and datafile names. It does not include the .mdf extension.

dataPhysicalName returns the file path for the mdf file storing the Geodatabase. It includes the .mdf extension.

The dataFileSize value returns the size of the file in MBs.

The logName value returns the name of the log file for the database. It does not include the .ldf extension.

logPhysicalName returns the file path for the ldf file storing the database log file. It includes the .ldf extension.

The logFileSize value returns the size of the file in MBs.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getFileProperties in interface IDataServerManagerAdmin
Parameters:
dbName - The dbName (in)
dataName - The dataName (out: use single element array)
dataPhysicalName - The dataPhysicalName (out: use single element array)
dataFileSize - The dataFileSize (out: use single element array)
logName - The logName (out: use single element array)
logPhysicalName - The logPhysicalName (out: use single element array)
logFileSize - The logFileSize (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

analyze

public void analyze(String gdbName)
             throws IOException,
                    AutomationException
Updates the statistics for a Geodatabase.

Description

This method performs an analyze operation on the specified Geodatabase which updates all index statistics.

Remarks

Perform this periodically as a regular maintenance operation. Over time index statistics can become stale, especially in a heavily edited Geodatabase. Updating statistics can improve query performance.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
analyze in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

rebuildIndices

public void rebuildIndices(String gdbName)
                    throws IOException,
                           AutomationException
Rebuilds the indices on all tables in a Geodatabase.

Description

This method rebuilds all the indexes on all existing user tables within a Geodatabase. You must either be a server administrator or a geodatabase administrator to use this method.

Remarks

Perform this periodically as a regular maintenance operation.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
rebuildIndices in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

shrinkGeodatabase

public void shrinkGeodatabase(String gdbName)
                       throws IOException,
                              AutomationException
Shrinks the size of a Geodatabase and frees up unused space.

Description

This method frees up unused space in the Geodatabase data file (.mdf).

Remarks

Perform this periodically as a regular maintenance operation. You must be a server administrator to execute this method.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
shrinkGeodatabase in interface IDataServerManagerAdmin
Parameters:
gdbName - The gdbName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getConnectedUsers

public int getConnectedUsers(String dbName)
                      throws IOException,
                             AutomationException
Gets active users.

Description

This method returns the number of connected users in a particular Geodatabase.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getConnectedUsers in interface IDataServerManagerAdmin
Parameters:
dbName - The dbName (in)
Returns:
The nUsers
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServerAdministrators

public void getServerAdministrators(IEnumBSTR[] userNames)
                             throws IOException,
                                    AutomationException
Gets a list of server administrators.

Description

This method returns a list of users with server administrator permissions on the database server.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getServerAdministrators in interface IDataServerManagerAdmin
Parameters:
userNames - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getUsersByPermissionType

public void getUsersByPermissionType(String dbName,
                                     int permission,
                                     IEnumBSTR[] userNames)
                              throws IOException,
                                     AutomationException
Get Users in by the Permission type.

Description

Gets a list of user belonging to a particular permission type (esriGeodatabasePermissionsType).

Remarks

This method returns a list of users based on permission type.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getUsersByPermissionType in interface IDataServerManagerAdmin
Parameters:
dbName - The dbName (in)
permission - A com.esri.arcgis.datasourcesGDB.esriGeodatabasePermissionsType constant (in)
userNames - A reference to a com.esri.arcgis.system.IEnumBSTR (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getServerStatus

public int getServerStatus()
                    throws IOException,
                           AutomationException
The status of the server.

Remarks

This method returns the current status of the database service (see esriDataServerStatusType).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getServerStatus in interface IServiceControl
Returns:
A com.esri.arcgis.datasourcesGDB.esriDataServerStatusType constant
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isHasControlPermissions

public boolean isHasControlPermissions()
                                throws IOException,
                                       AutomationException
Indicates whether the user has permissions to control the service.

Remarks

This method returns whether a user has permissions to exercise control over the database service.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
isHasControlPermissions in interface IServiceControl
Returns:
The hasPermissions
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

stopServer

public void stopServer()
                throws IOException,
                       AutomationException
Stops the server.

Description

This method stops a database service.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
stopServer in interface IServiceControl
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startServer

public void startServer()
                 throws IOException,
                        AutomationException
Starts the server.

Description

This method starts a database service.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
startServer in interface IServiceControl
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

pauseServer

public void pauseServer()
                 throws IOException,
                        AutomationException
Pauses the server.

Description

This method pauses a database service.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
pauseServer in interface IServiceControl
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

continueServer

public void continueServer()
                    throws IOException,
                           AutomationException
Continues the server.

Description

This method continues a database service.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
continueServer in interface IServiceControl
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.