com.esri.arcgis.geodatabase
Interface IWorkspaceDomains

All Superinterfaces:
Serializable
All Known Subinterfaces:
IWorkspaceDomains2
All Known Implementing Classes:
IWorkspaceDomains2Proxy, IWorkspaceDomainsProxy, Sde4Workspace, VersionedWorkspace, Workspace

public interface IWorkspaceDomains
extends Serializable

Provides access to members that return information about domains and allows you to add or delete domains.

Superseded By

IWorkspaceDomains2

Remarks

The IWorkspaceDomains interface is used for managing the collection of domains found within a workspace. Domains may be shared between fields in different object classes, thus they are managed (that is, created, deleted and modified) at the workspace level. It is important to keep in mind that a domain may not be deleted from a workspace if any field in an object class currently uses it. Domain names are also unique across a workspace; if you attempt to add a domain to a workspace and the specified name is already associated with an existing domain, an error will be returned.

Three of the four properties on the IWorkspaceDomain interface are used for returning to the user the domains that are currently associated with the workspace. The user can either request all of the domains (Domains), a particular domain by name (DomainByName), or all the domains that may be associated with a given field type (DomainsByFieldType).

Product Availability

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

Supported Platforms

Windows, Solaris, Linux


Method Summary
 int addDomain(IDomain domain)
          Adds the given domain to the workspace.
 void deleteDomain(String domainName)
          Deletes the given domain from the workspace.
 IDomain getDomainByName(String domainName)
          The domain with the given name from the workspace.
 IEnumDomain getDomains()
          All the domains in the workspace.
 IEnumDomain getDomainsByFieldType(int type)
          The domain with the given name from the workspace.
 boolean isCanDeleteDomain(String domainName)
          Indicates if the user can delete the domain.
 

Method Detail

addDomain

int addDomain(IDomain domain)
              throws IOException,
                     AutomationException
Adds the given domain to the workspace.

Remarks

The AddDomain method is used when adding a new domain to a workspace. An error will be returned if the domain name already exists on an existing domain within the workspace. AddDomain will return the identifier of the domain once it is added to the workspace.

An error will be raised if the domain name contains an invalid character when calling AddDomain. The list of invalid characters can be determined by using the ISQLSyntax::GetInvalidCharacters method, minus the slash (both / and \), hyphen (-), comma (,), and space characters.

If you are looking to assoicate an existing domain to a field (or subtype) see IClassSchemaEdit::AlterDomain (or ISubtypes::SetDomain).

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
domain - A reference to a com.esri.arcgis.geodatabase.IDomain (in)
Returns:
The domainID
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isCanDeleteDomain

boolean isCanDeleteDomain(String domainName)
                          throws IOException,
                                 AutomationException
Indicates if the user can delete the domain.

Product Availability

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

Parameters:
domainName - The domainName (in)
Returns:
The deletable
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteDomain

void deleteDomain(String domainName)
                  throws IOException,
                         AutomationException
Deletes the given domain from the workspace.

Remarks

This method will delete a domain from the workspace. For DeleteDomain to execute successfully, you must be connected to the workspace as the user who created the domain you are deleting, and the domain must not be in use by any object classes in the database. Use the CanDeleteDomain property to determine if a domain can be deleted. To unassociate a domain with a field, use the IClassSchemaEdit::AlterDomain method.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
domainName - The domainName (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDomains

IEnumDomain getDomains()
                       throws IOException,
                              AutomationException
All the domains in the workspace.

Description

The Domains property returns an IEnumDomains enumerator for all of the domains from the underlying workspace.

Remarks

This property return an enumeration of all of the domains on a workspace as an IEnumDomain. You can loop through this enumeration to get each domain.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumDomain
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDomainByName

IDomain getDomainByName(String domainName)
                        throws IOException,
                               AutomationException
The domain with the given name from the workspace.

Product Availability

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

Parameters:
domainName - The domainName (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IDomain
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDomainsByFieldType

IEnumDomain getDomainsByFieldType(int type)
                                  throws IOException,
                                         AutomationException
The domain with the given name from the workspace.

Product Availability

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

Parameters:
type - A com.esri.arcgis.geodatabase.esriFieldType constant (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumDomain
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.