com.esri.arcgis.geodatabase
Class RepresentationClass

java.lang.Object
  extended by com.esri.arcgis.geodatabase.RepresentationClass
All Implemented Interfaces:
IDataset, IDatasetComponent, IRepresentationClass, ISchemaLock, com.esri.arcgis.interop.RemoteObjRef, ISupportErrorInfo, Serializable

public class RepresentationClass
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IRepresentationClass, IDataset, IDatasetComponent, ISchemaLock, ISupportErrorInfo

A Feature Class Representation object.

Remarks

A RepresentationClass is a feature class that has been enabled with representation capability. Creating a new feature class representation will result in addition of two new fields correspoding to the RuleID which is of type long and Override which is of type binary larger object (blob). RuleID field has information about the RepresentationRule used to represent feature representations. Override field contains information about attribute and shape overrides present for representations. By default, the values in override field are null.

A representation class cannot exist on its own and needs to be created using a feature class. Representation classes will have same number of representations as there are features in the feature class. Deleting a feature class will result in the deletion of all representation classes associated with it. When new features are added to a feature class which already has a representation class, it is the responsibility of the user to update the RuleID value to correctly represent those new representations and add override information if necessary.

Use IRepresentationWorkspaceExtension.CreateRepresentationClass method to create new representation classes. Alternately, Drop Representation geoprocessing tool can be used to remove specific feature class representations.

A new RepresentationRules object has to be created or a reference to an existing representation rules has to be present prior to creation of a representation class. Representation rules are rules based on which feature representations are represented. A complex symbol can be created as a representation rule by combining one or more of basic symbols, geometric effects and marker placement styles.

Product Availability

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

See Also:
Serialized Form

Constructor Summary
RepresentationClass(Object obj)
          Construct a RepresentationClass using a reference to such an object returned from ArcGIS Engine or Server.
 
Method Summary
 boolean canCopy()
          True if this dataset can be copied.
 boolean canDelete()
          True if this dataset can be deleted.
 boolean canRename()
          True if this dataset can be renamed.
 void changeSchemaLock(int schemaLock)
          Changes a schema lock.
 IDataset copy(String copyName, IWorkspace copyWorkspace)
          Copies this dataset to a new dataset with the specified name.
 void delete()
          Deletes this dataset.
 boolean equals(Object o)
          Compare this object with another
 String getBrowseName()
          The browse name of the dataset.
 String getCategory()
          The category of the dataset.
 void getCurrentSchemaLocks(IEnumSchemaLockInfo[] schemaLockInfo)
          The list of current locks.
 IDEDataset getDataElement()
          The data element corresponding to the dataset component.
 IFeatureClass getFeatureClass()
          Feature class associated with this representation class.
 IName getFullName()
          The associated name object.
 IGraphicAttributes getGraphicAttributes()
          General attributes defined at the representation class level.
 int getID()
          ID of the representation class.
 String getName()
          The name of the Dataset.
 int getOverrideFieldIndex()
          Field index of the override field.
 IDataset getParent()
          The containing parent dataset.
 IPropertySet getPropertySet()
          The set of properties for the dataset.
 IRepresentation getRepresentation(IFeature feature, IMapContext mapContext)
          Returns the representation of a given feature.
 IRepresentationRules getRepresentationRules()
          RepresentationRules Property.
 int getRuleIDFieldIndex()
          Field index of the Rule ID field.
 IEnumDataset getSubsets()
          Datasets contained within this dataset.
 int getType()
          The type of the Dataset.
 IWorkspace getWorkspace()
          The workspace containing this dataset.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 boolean isRequireShapeOverride()
          Indicates if a shape override is required for feature representations.
 void prepareFilter(IQueryFilter filter)
          Adds the fields used by overrides to the query filter.
 void rename(String name)
          Renames this Dataset.
 void setBrowseName(String name)
          The browse name of the dataset.
 void setGraphicAttributesByRef(IGraphicAttributes attributes)
          General attributes defined at the representation class level.
 void setRepresentationRulesByRef(IRepresentationRules repRules)
          RepresentationRules Property.
 void setRequireShapeOverride(boolean requireShapeOverride)
          Indicates if a shape override is required for feature representations.
 
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

RepresentationClass

public RepresentationClass(Object obj)
                    throws IOException
Construct a RepresentationClass using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to RepresentationClass.
Casting to this class from the return value of a method will not work, as this class represents an abstract class in ArcObjects.
*
RepresentationClass o = (RepresentationClass)obj; // will not work

RepresentationClass o = new RepresentationClass(obj); // Use this constructor instead
* @param obj an object returned from ArcGIS Engine or Server

Throws:
IOException - if there are interop problems RepresentationClass theRepresentationClass = (RepresentationClass) obj;
Method Detail

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

getOverrideFieldIndex

public int getOverrideFieldIndex()
                          throws IOException,
                                 AutomationException
Field index of the override field.

Product Availability

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

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

getRuleIDFieldIndex

public int getRuleIDFieldIndex()
                        throws IOException,
                               AutomationException
Field index of the Rule ID field.

Product Availability

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

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

getFeatureClass

public IFeatureClass getFeatureClass()
                              throws IOException,
                                     AutomationException
Feature class associated with this representation class.

Description

FeatureClass property returns a reference to the feature class to which the representation class belongs.

Product Availability

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

Specified by:
getFeatureClass in interface IRepresentationClass
Returns:
A reference to a com.esri.arcgis.geodatabase.IFeatureClass
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getID

public int getID()
          throws IOException,
                 AutomationException
ID of the representation class.

Remarks

The Representation Class ID is a unique ID for the representation class and is used to identify it. Every representation class has an ID associated with it.

Product Availability

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

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

getRepresentation

public IRepresentation getRepresentation(IFeature feature,
                                         IMapContext mapContext)
                                  throws IOException,
                                         AutomationException
Returns the representation of a given feature.

Remarks

Use GetRepresentation method to get a reference to the feature representation for any feature with respect to its map context. Same features will have different representations when the map contexts change.

The following code snippet demonstrates the use of PrepareFilter and GetRepresentation methods. Reference to a RepresentationClass must be present to use this code:

Product Availability

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

Specified by:
getRepresentation in interface IRepresentationClass
Parameters:
feature - A reference to a com.esri.arcgis.geodatabase.IFeature (in)
mapContext - A reference to a com.esri.arcgis.display.IMapContext (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IRepresentation
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getRepresentationRules

public IRepresentationRules getRepresentationRules()
                                            throws IOException,
                                                   AutomationException
RepresentationRules Property.

Remarks

Use RepresentationRules property to get access to the members of the representation rules collection on a representation class. IRepresentationRules interface can be used to add, remove or modify rules present in the representation rules collection. To work with a specific rule within the collection, use esriDisplay.IRepresentationRule interface.

Product Availability

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

Specified by:
getRepresentationRules in interface IRepresentationClass
Returns:
A reference to a com.esri.arcgis.geodatabase.IRepresentationRules
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setRepresentationRulesByRef

public void setRepresentationRulesByRef(IRepresentationRules repRules)
                                 throws IOException,
                                        AutomationException
RepresentationRules Property.

Product Availability

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

Specified by:
setRepresentationRulesByRef in interface IRepresentationClass
Parameters:
repRules - A reference to a com.esri.arcgis.geodatabase.IRepresentationRules (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getGraphicAttributes

public IGraphicAttributes getGraphicAttributes()
                                        throws IOException,
                                               AutomationException
General attributes defined at the representation class level.

Remarks

GraphicAttributes property returns a reference to the graphic attributes present for the representation class namely, visibility. To make changes to this property, use IGraphicAttributes interface.

Changes made at representation class level are applied to all representations. Individual representation's visibility property can also be overriden using IRepresentation::Value property.

Product Availability

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

Specified by:
getGraphicAttributes in interface IRepresentationClass
Returns:
A reference to a com.esri.arcgis.display.IGraphicAttributes
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setGraphicAttributesByRef

public void setGraphicAttributesByRef(IGraphicAttributes attributes)
                               throws IOException,
                                      AutomationException
General attributes defined at the representation class level.

Product Availability

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

Specified by:
setGraphicAttributesByRef in interface IRepresentationClass
Parameters:
attributes - A reference to a com.esri.arcgis.display.IGraphicAttributes (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

isRequireShapeOverride

public boolean isRequireShapeOverride()
                               throws IOException,
                                      AutomationException
Indicates if a shape override is required for feature representations.

Remarks

RequireShapeOverride will return True when the feature representation's shape property can be overridden. Shape overrides are stored into the Override field. If this property returns False, then altering the shape of the feature representation will directly alter the feature's shape.

Note: It is necessary to set this property to True, if you wish to store the shape overrides into Override field rather than alter the actual feature's shape.

Product Availability

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

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

setRequireShapeOverride

public void setRequireShapeOverride(boolean requireShapeOverride)
                             throws IOException,
                                    AutomationException
Indicates if a shape override is required for feature representations.

Product Availability

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

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

prepareFilter

public void prepareFilter(IQueryFilter filter)
                   throws IOException,
                          AutomationException
Adds the fields used by overrides to the query filter.

Remarks

Use PrepareFilter method to add fields to a query filter which will be used by overrides. This method takes a reference to a QueryFilter and sets the SubFields to RepresentationRuleID (RID) and Override (Override). The returned QueryFilter can be used to filter data based on the Representation information contained in these two fields. Use this method in conjunction with GetRepresentation method to query all representations. Add additional fields to the QueryFilter object using AddField method on IQueryFilter interface.

The following code snippet demonstrates the use of PrepareFilter and GetRepresentation methods. Reference to a RepresentationClass must be present to use this code:

Product Availability

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

Specified by:
prepareFilter in interface IRepresentationClass
Parameters:
filter - A reference to a com.esri.arcgis.geodatabase.IQueryFilter (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getName

public String getName()
               throws IOException,
                      AutomationException
The name of the Dataset.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getFullName

public IName getFullName()
                  throws IOException,
                         AutomationException
The associated name object.

Remarks

The FullName property returns a Name object for the dataset. The Name object can be persisted and provides a way to get back to the dataset in a future session of the application, via the Open method on the Name object.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getBrowseName

public String getBrowseName()
                     throws IOException,
                            AutomationException
The browse name of the dataset.

Remarks

BrowseName returns file names without their extension. For example, States.shp would appear as States.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

setBrowseName

public void setBrowseName(String name)
                   throws IOException,
                          AutomationException
The browse name of the dataset.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getType

public int getType()
            throws IOException,
                   AutomationException
The type of the Dataset.

Remarks

The Type property returns the an esriDatasetType value indicating the dataset type, such as esriDTTable or esriDTFeatureClass.

Example:


// Assume we have a reference to an IfeatureClass (pFeatureClass) IDataset pDataset = null;
pDataset = new IDatasetProxy(pFeatureClass);
System.out.println(pDataset.getName() + " " + pDataset.getType());
if(pFeatureClass != null){
pDataset = pFeatureClass.getFeatureDataset();
System.out.println(pDataset.getName() + " " + pDataset.getType());
}
pDataset = new IDatasetProxy(pDataset.getWorkspace());
System.out.println(pDataset.getName() + " " +
pDataset.getType());

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getCategory

public String getCategory()
                   throws IOException,
                          AutomationException
The category of the dataset.

Remarks

IDataset::Category returns a description of the category of the dataset. The description returned from the Category property is the same value that is displayed in the Type column within the Contents tab in ArcCatalog. The value will contain a description of the dataset such as "Topology" prefixed with a description of the type of workspace containing the dataset such as "File Geodatabase".

The description returned from IDataset::Category may change between releases of ArcGIS. In addition to this, returned strings are localized, meaning that code relying on a specific string being provided may fail when deployed with a different version of ArcGIS than it was developed with, or when deployed to a client using a different language than it was developed with.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getSubsets

public IEnumDataset getSubsets()
                        throws IOException,
                               AutomationException
Datasets contained within this dataset.

Description

The Subsets property returns other Dataset objects contained in this dataset.

Remarks

IDataset::Subsets is not supported for Graph objects such as a Geometric Network. To return the feature classes contained in a Geometric Network, use the IFeatureClassContainer interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSubsets in interface IDataset
Returns:
A reference to a com.esri.arcgis.geodatabase.IEnumDataset
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getWorkspace

public IWorkspace getWorkspace()
                        throws IOException,
                               AutomationException
The workspace containing this dataset.

Description

The Workspace property returns the containing workspace for this dataset.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getWorkspace in interface IDataset
Returns:
A reference to a com.esri.arcgis.geodatabase.IWorkspace
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPropertySet

public IPropertySet getPropertySet()
                            throws IOException,
                                   AutomationException
The set of properties for the dataset.

Description

The PropertySet property is used to return any additional intrinsic properties (but not metadata properties) that may apply to the dataset. One use of this property is to distinguish between the types of File Geodatabase datafile formats. If called on a Feature Class or Table in a File Geodatabase the Datafile Format property can either be esriFGDBStandardDatafile or esriFGDBCompressedDatafile.

Most datasets do not implement this property and will either raise an error or return a null value if it's called. There are a handful of exceptions that will return property sets; these include the datasets from file geodatabases (as mentioned above) and coverages.

Remarks

Examples of intrinsic properties for which explicit methods exist include the SpatialReference and the Extent methods available on the IGeoDataset interface. In most cases this PropertySet will be empty.

IDataset::PropertySet is not supported for Graph objects such as a Geometric Network.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

canCopy

public boolean canCopy()
                throws IOException,
                       AutomationException
True if this dataset can be copied.

Remarks

The CanCopy, CanDelete, and CanRename properties are meant to be used in conjunction with the Copy, Delete, and Rename methods and signify whether a dataset is supported by these methods. For example, you may not delete a network feature class nor can you use the Copy method on a Geodatabase feature class. To copy Geodatabase datasets, including feature classes, geometric networks, topologies, etc., use the IGeoDBDataTransfer interface.

The CanCopy method is supported by:

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

copy

public IDataset copy(String copyName,
                     IWorkspace copyWorkspace)
              throws IOException,
                     AutomationException
Copies this dataset to a new dataset with the specified name.

Remarks

IDataset::Copy should only be used with datasets from file-based data sources, such as shapefiles and coverages.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
copy in interface IDataset
Parameters:
copyName - The copyName (in)
copyWorkspace - A reference to a com.esri.arcgis.geodatabase.IWorkspace (in)
Returns:
A reference to a com.esri.arcgis.geodatabase.IDataset
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

canDelete

public boolean canDelete()
                  throws IOException,
                         AutomationException
True if this dataset can be deleted.

Remarks

The CanCopy, CanDelete, and CanRename properties are meant to be used in conjunction with the Copy, Delete, and Rename methods and signify whether a dataset is supported by these methods. For example, you may not delete a network feature class nor can you use the Copy method on a Geodatabase feature class. To copy Geodatabase datasets, including feature classes, geometric networks, topologies, etc., use the IGeoDBDataTransfer interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

delete

public void delete()
            throws IOException,
                   AutomationException
Deletes this dataset.

Remarks

Certain feature classes, such as network and topology feature classes, cannot be deleted until their containing objects are deleted.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

canRename

public boolean canRename()
                  throws IOException,
                         AutomationException
True if this dataset can be renamed.

Remarks

The CanCopy, CanDelete, and CanRename properties are meant to be used in conjunction with the Copy, Delete, and Rename methods and signify whether a dataset is supported by these methods. For example, you may not delete or rename a network feature class nor can you use the Copy method on a Geodatabase feature class. To copy Geodatabase datasets, including feature classes, geometric networks, topologies, etc., use the IGeoDBDataTransfer interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

rename

public void rename(String name)
            throws IOException,
                   AutomationException
Renames this Dataset.

Remarks

IDataset::Rename does not support the renaming of Graph objects such as a Geometric Network. In addition, certain feature classes, such as network feature classes, cannot be renamed.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getDataElement

public IDEDataset getDataElement()
                          throws IOException,
                                 AutomationException
The data element corresponding to the dataset component.

Remarks

The DataElement method is used to access the data element for this dataset component.

Product Availability

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

Specified by:
getDataElement in interface IDatasetComponent
Returns:
A reference to a com.esri.arcgis.geodatabase.IDEDataset
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getParent

public IDataset getParent()
                   throws IOException,
                          AutomationException
The containing parent dataset.

Remarks

Returns the parent of the dataset component. For example, for geodatabase network datasets this will return the containing feature dataset.

Product Availability

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

Specified by:
getParent in interface IDatasetComponent
Returns:
A reference to a com.esri.arcgis.geodatabase.IDataset
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

changeSchemaLock

public void changeSchemaLock(int schemaLock)
                      throws IOException,
                             AutomationException
Changes a schema lock.

Remarks

There are two kinds of schema locks: shared and exclusive. Shared schema locks are applied automatically by the geodatabase when accessing a dataset and are removed when all references to the dataset are removed. For this reason, it's not necessary to explicitly apply or remove shared schema locks. There is no limit to the number of shared schema locks a dataset or object can have at any given time.
In contrast to shared schema locks, exclusive schema locks are controlled by the developer or ArcGIS application, such as ArcMap or ArcCatalog. An exclusive lock is used to lock a geodatabase dataset or object from use by others to make the necessary changes to it. An exclusive lock is promoted from a shared lock and demoted back to a shared lock when no longer needed. The presence of additional shared schema locks on a dataset or object prevents an exclusive schema lock from being applied and precludes the ability to make changes to the underlying dataset and its schema while it is in use. Only one exclusive schema lock is allowed per dataset. As opposed to shared schema locks, exclusive schema locks are not applied or removed automatically; it is the responsibility of the developer to apply or remove exclusive schema locks.
Limit the scope of exclusive schema locks to the operation that requires the lock. Gather the necessary information to perform the action, obtain the exclusive lock, make the change, and release the lock. Some examples of operations for which an exclusive schema lock should be obtained include:
  • Modifications to attribute domains, such as adding or removing values from a coded value domain or changing the range for range domains
  • Adding or deleting a field from a feature class or object class
  • Associating a class extension with a feature class
  • Creating a topology, geometric network, network dataset, terrain, schematic dataset, representation, or cadastral fabric on a set of feature classes
  • Any use of the IClassSchemaEdit interface
  • Putting a feature class into and taking it out of load-only mode with the IFeatureClassLoad.LoadOnlyMode method
  • Managing (creating, deleting, or modifying) spatial and attribute indexes
Once the action requiring an exclusive schema lock is complete, the exclusive schema lock must be demoted to a shared lock. This includes when errors are raised during the schema modification, for example, consider the case where a field is being deleted from a feature class. To delete the field, an exclusive schema lock is obtained. However, on the call to DeleteField, an error is thrown; that is, the field being deleted is a required field, such as the ObjectID field. In the handling of the error, the exclusive schema lock must be demoted to a shared lock before proceeding.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
changeSchemaLock in interface ISchemaLock
Parameters:
schemaLock - A com.esri.arcgis.geodatabase.esriSchemaLock constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCurrentSchemaLocks

public void getCurrentSchemaLocks(IEnumSchemaLockInfo[] schemaLockInfo)
                           throws IOException,
                                  AutomationException
The list of current locks.

Remarks

The ISchemaLockInfo interface is used in concert with ISchemaLock to provide information about a schema lock, for example, whether it is shared or exclusive and for ArcSDE geodatabases, the name of the user who has the lock. Note that there will always be at least one schema lock on the dataset. Also note that by checking the schema locks on a dataset a shared schema lock is applied to the data.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getCurrentSchemaLocks in interface ISchemaLock
Parameters:
schemaLockInfo - A reference to a com.esri.arcgis.geodatabase.IEnumSchemaLockInfo (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.