com.esri.sde.sdk.client
Class SeVersion

java.lang.Object
  extended by com.esri.sde.sdk.client.SeVersion
All Implemented Interfaces:
java.lang.Cloneable

public class SeVersion
extends java.lang.Object
implements java.lang.Cloneable

This class represents an ArcSDE version in the database. Versions represent different configurations of the database. These different configurations may represent user edit sessions, known database states, and organizational workflow states. Versions may be relatively small sets of changes, such as the correction of a few attribute values. Versions may also be very large sets of changes, such as the design of a subdivision plan. A versioned database allows several users to simultaneously edit the contents of the database. Each user edits their own version of the database, without interference from others. Using versions to separate user edit sessions allows an optimistic conflict model where users freely edit data, receiving notification of collisions only when versions are merged.


Nested Class Summary
static class SeVersion.SeVersionLock
          SeVersion inner class that retrieves the version locks information from the server.
 
Field Summary
static java.lang.String SE_DEFAULT_VERSION_NAME
          The name of the default ArcSDE version.
static java.lang.String SE_QUALIFIED_DEFAULT_VERSION_NAME
          The qualified name of the default ArcSDE version.
static int SE_VERSION_ACCESS_PRIVATE
           
static int SE_VERSION_ACCESS_PROTECTED
           
static int SE_VERSION_ACCESS_PUBLIC
           
static int SE_VERSION_EXCLUSIVE_AUTOLOCK
           
static int SE_VERSION_EXCLUSIVE_LOCK
           
static int SE_VERSION_PROTECTED_MASK
           
static int SE_VERSION_PUBLIC_MASK
           
static int SE_VERSION_SHARED_LOCK
           
 
Constructor Summary
SeVersion(SeConnection conn)
          SeVersion constructor, used when creating a new version.
SeVersion(SeConnection conn, SeObjectId versionId)
          SeVersion constructor, retrieves information for an existing version using the specified Version ID.
SeVersion(SeConnection conn, java.lang.String versionName)
          SeVersion constructor, retrieves information for for an existing version, specified by the version name parameter.
 
Method Summary
 void alter()
          Alters a version`s characteristics.
 void changeState(SeObjectId newStateId)
          Changes the underlying state of a version.
 java.lang.Object clone()
          Clones the SeVersion object.
 void create(boolean uniqueName, SeVersion version)
          Creates a child version from an existing version.
 void createInTransaction(boolean uniqueName, SeVersion version)
          creates a new version entry within the context of a user transaction, as the child of the existing version.
 void delete()
          Deletes a version.
 void freeLock()
          Releases the lock on a version.
 int getAccess()
          Returns the access type for a version.
 java.util.Date getCreationTime()
          Returns the creation time for a version.
 java.lang.String getDescription()
          Returns the version description.
 SeObjectId getId()
          Returns the ID of a version.
 void getInfo()
          Returns version information.
 SeVersion.SeVersionLock[] getLocks()
          Returns a list of current locks.
 java.lang.String getName()
          Returns the version name.
 java.lang.String getOwner()
          Returns the owner of the version.
 SeObjectId getParentId()
          Returns the parent ID of a version.
 java.lang.String getParentName()
          Returns the parent version name.
 SeObjectId getStateId()
          Returns the state ID of a version.
 void lock(int lockMode)
          Locks a version.
 void rename(java.lang.String newVersionName)
          Renames a version.
 void setAccess(int access)
          Returns the access type for a version.
 void setDescription(java.lang.String desc)
          Sets the version description.
 void setId(SeObjectId id)
          Sets the ID of a version.
 void setName(java.lang.String name)
          Sets the version name.
 void setOwner(java.lang.String name)
          Sets the version owner name.
 void setParentId(SeObjectId stateId)
          Sets the parent ID of a version.
 void setParentName(java.lang.String name)
          Sets the parent version name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SE_VERSION_PUBLIC_MASK

public static final int SE_VERSION_PUBLIC_MASK
See Also:
Constant Field Values

SE_VERSION_PROTECTED_MASK

public static final int SE_VERSION_PROTECTED_MASK
See Also:
Constant Field Values

SE_VERSION_ACCESS_PUBLIC

public static final int SE_VERSION_ACCESS_PUBLIC
See Also:
Constant Field Values

SE_VERSION_ACCESS_PROTECTED

public static final int SE_VERSION_ACCESS_PROTECTED
See Also:
Constant Field Values

SE_VERSION_ACCESS_PRIVATE

public static final int SE_VERSION_ACCESS_PRIVATE
See Also:
Constant Field Values

SE_DEFAULT_VERSION_NAME

public static final java.lang.String SE_DEFAULT_VERSION_NAME
The name of the default ArcSDE version. This can be used as an argument to the SeVersion(SeConnection conn, String versionName) constructor.

See Also:
Constant Field Values

SE_QUALIFIED_DEFAULT_VERSION_NAME

public static final java.lang.String SE_QUALIFIED_DEFAULT_VERSION_NAME
The qualified name of the default ArcSDE version. It can be used as an argument to the SeVersion(SeConnection conn, String versionName) constructor.

See Also:
Constant Field Values

SE_VERSION_SHARED_LOCK

public static final int SE_VERSION_SHARED_LOCK
See Also:
Constant Field Values

SE_VERSION_EXCLUSIVE_LOCK

public static final int SE_VERSION_EXCLUSIVE_LOCK
See Also:
Constant Field Values

SE_VERSION_EXCLUSIVE_AUTOLOCK

public static final int SE_VERSION_EXCLUSIVE_AUTOLOCK
See Also:
Constant Field Values
Constructor Detail

SeVersion

public SeVersion(SeConnection conn)
          throws SeException
SeVersion constructor, used when creating a new version.

Parameters:
conn - SeConnection object handle.
Throws:
SeException

SeVersion

public SeVersion(SeConnection conn,
                 SeObjectId versionId)
          throws SeException
SeVersion constructor, retrieves information for an existing version using the specified Version ID.

Parameters:
conn - SeConnection object handle.
versionId - the version ID.
Throws:
SeException

SeVersion

public SeVersion(SeConnection conn,
                 java.lang.String versionName)
          throws SeException
SeVersion constructor, retrieves information for for an existing version, specified by the version name parameter.

Parameters:
conn - SeConnection object handle.
versionName - the version name.
Throws:
SeException
Method Detail

alter

public void alter()
           throws SeException
Alters a version`s characteristics. The version to modify is specified by the version name. You can change the following characteristics: - Description - Access If you want to change the name of a version or the state ID, use rename() or changeState() methods .

Throws:
SeException

changeState

public void changeState(SeObjectId newStateId)
                 throws SeException
Changes the underlying state of a version.

Throws:
SeException

create

public void create(boolean uniqueName,
                   SeVersion version)
            throws SeException
Creates a child version from an existing version. The parent version must be closed and owned by the current user or public, or the current user is the ArcSDE DBA. You can require a unique name by setting unique_name to TRUE. If the name isn't unique, the ArcSDE software will append "01" or whatever value creates a unique version name. If the function succeeds information about the new version is retrieved into the current version object.

Parameters:
uniqueName - If the supplied version name is not unique, add a suffix onto it to make it unique. If this flag is FALSE and a version of this name already exists, then the create will fail.
version - the existing version object.
Throws:
SeException

createInTransaction

public void createInTransaction(boolean uniqueName,
                                SeVersion version)
                         throws SeException
creates a new version entry within the context of a user transaction, as the child of the existing version. The parent version must be closed and owned by the current user or public, or the current user is the ArcSDE DBA. You can require a unique name by setting unique_name to TRUE. If the name isn't unique, the ArcSDE software will append a suffix to create a unique version name. If the function succeeds information about the new version is retrieved into the current version object.

Parameters:
uniqueName - If the supplied version name is not unique, add a suffix onto it to make it unique. If this flag is FALSE and a version of this name already exists, then the create will fail.
version - the existing version object.
Throws:
SeException

delete

public void delete()
            throws SeException
Deletes a version. The version must be a leaf node and can't be a parent to another version. The current user must be the owner of the version or the ArcSDE DBA. All entries in the instance's adds and deletes tables for the version will be deleted.

Throws:
SeException

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Clones the SeVersion object.

Overrides:
clone in class java.lang.Object
Returns:
a SeVersion as type Object.
Throws:
java.lang.CloneNotSupportedException - if an error occurs

getInfo

public void getInfo()
             throws SeException
Returns version information.

Throws:
SeException

lock

public void lock(int lockMode)
          throws SeException
Locks a version. The lock modes are: - SE_VERSION_SHARED_LOCK - SE_VERSION_EXCLUSIVE_LOCK

Parameters:
lockMode - the lock type.
Throws:
SeException

freeLock

public void freeLock()
              throws SeException
Releases the lock on a version.

Throws:
SeException

getLocks

public SeVersion.SeVersionLock[] getLocks()
                                   throws SeException
Returns a list of current locks.

Returns:
SeVersionLock[]
Throws:
SeException

rename

public void rename(java.lang.String newVersionName)
            throws SeException
Renames a version. If the new name is qualified, it must have the same owner as the old version name.

Parameters:
newVersionName - the new name of version.
Throws:
SeException

getAccess

public int getAccess()
Returns the access type for a version.

Returns:
int

setAccess

public void setAccess(int access)
               throws SeException
Returns the access type for a version.

Parameters:
access - the access type.
Throws:
SeException

getCreationTime

public java.util.Date getCreationTime()
Returns the creation time for a version.

Returns:
java.util.Date

getDescription

public java.lang.String getDescription()
Returns the version description.

Returns:
String

setDescription

public void setDescription(java.lang.String desc)
Sets the version description.


getId

public SeObjectId getId()
Returns the ID of a version.

Returns:
SeObjectId

setId

public void setId(SeObjectId id)
Sets the ID of a version.


getOwner

public java.lang.String getOwner()
Returns the owner of the version.

Returns:
String

getName

public java.lang.String getName()
Returns the version name.

Returns:
String

setOwner

public void setOwner(java.lang.String name)
              throws SeException
Sets the version owner name.

Parameters:
name - the name of the owner.
Throws:
SeException

setName

public void setName(java.lang.String name)
             throws SeException
Sets the version name. The name can be qualified with the owner name. If the name is not qualified, and the owner name has not already been set using setOwner(), the owner will be the currently connected user.

Parameters:
name - the version name.
Throws:
SeException

getParentId

public SeObjectId getParentId()
Returns the parent ID of a version. If no parent version exists, returns 0.

Returns:
SeObjectId

getParentName

public java.lang.String getParentName()
Returns the parent version name.

Returns:
String

setParentName

public void setParentName(java.lang.String name)
Sets the parent version name.

Parameters:
name - the parent version name.

getStateId

public SeObjectId getStateId()
Returns the state ID of a version.

Returns:
SeObjectId

setParentId

public void setParentId(SeObjectId stateId)
                 throws SeException
Sets the parent ID of a version. If no parent version exists, returns 0.

Parameters:
stateId - the state ID of a version.
Throws:
SeException