com.esri.sde.sdk.client
Class SeState

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

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


Field Summary
static int SE_BASE_STATE_ID
           
static int SE_DEFAULT_STATE_ID
           
static int SE_NULL_STATE_ID
           
static int SE_STATE_DIFF_DELETE
           
static int SE_STATE_DIFF_INSERT
          Returns all features that were inserted into the source state and that never existed in the differences state.
static int SE_STATE_DIFF_INSERT_RESTORE
           
static int SE_STATE_DIFF_NOCHANGE_DELETE
          Returns all features that haven't changed in the source state, but have been deleted in the differences state.
static int SE_STATE_DIFF_NOCHANGE_UPDATE
          Returns all features that haven't changed in the source state, but have been updated in the differences state.
static int SE_STATE_DIFF_NOCHECK
          Returns all features in the source state.
static int SE_STATE_DIFF_RESTORE
           
static int SE_STATE_DIFF_UPDATE
           
static int SE_STATE_DIFF_UPDATE_DELETE
          Returns all features that have been updated in the source state but deleted in the difference states.
static int SE_STATE_DIFF_UPDATE_NOCHANGE
          Returns all features that have been updated in the source state, but unchanged in the differences state.
static int SE_STATE_DIFF_UPDATE_UPDATE
          Returns all features that have been updated in both the source and difference states.
static int SE_STATE_FOR_PREDEFINED
           
static int SE_VERSION_ACCESS_PRIVATE
           
static int SE_VERSION_ACCESS_PROTECTED
           
static int SE_VERSION_ACCESS_PUBLIC
           
 
Constructor Summary
SeState(SeConnection conn)
          SeState constructor with an SeConnection object.
SeState(SeConnection conn, SeObjectId stateId)
          SeState constructor with an SeConnection and state Id that retrives the state information for specified ID.
SeState(SeConnection conn, SeObjectId stateId, boolean getLineage)
          SeState constructor with an SeConnection and state Id that retrives the state information for specified ID.
 
Method Summary
 int archiveTables(SeObjectId lowStateId, SeObjectId highStateId, int archiveTIme)
          Archives rows on the archiving tables modified between low and high states.
 java.lang.Object clone()
          Clones the SeState object.
 void close()
          Closes the state.
 void compressTree()
          Compresses an instance's state tree by removing all states that aren't referenced by a version.
 void create(SeObjectId parentId)
          Creates a child state from an existing state.
 void delete()
          Deletes a state.
 void deleteRange(SeObjectId lowStateId, SeObjectId highStateId)
          Deletes a connected range of states.
 void freeLock()
          Releases the lock on a state.
 java.util.Date getClosingTime()
          Returns the closing date and time of a state.
 java.util.Date getCreationTime()
          Returns the creation date and time of a state.
 SeObjectId getId()
          Returns the state ID.
 SeObjectId[] getLineage()
          Returns the lineage of a state as an array consisting of an ordered list of state ids, from the base state to the state's immediate parent.
 java.lang.String getOwner()
          Returns the state's owner.
 SeObjectId getParentId()
          Returns the state ID of the parent.
 boolean isOpen()
          Returns TRUE if state is open.
 void lock()
          Locks a state.
 void merge(SeObjectId parentStateId, SeObjectId changesStateId)
          Merges two states to form a new state.
 void open()
          Opens a state.
 void saveToBase(SeObjectId highStateId, boolean commitEachTable)
          Save changes to base state.
 void setId(SeObjectId stateId)
          Set's the state ID.
 void trimTree(SeObjectId lowStateId, SeObjectId highStateId)
          Trims the instance's state tree between two specified states.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SE_BASE_STATE_ID

public static final int SE_BASE_STATE_ID
See Also:
Constant Field Values

SE_NULL_STATE_ID

public static final int SE_NULL_STATE_ID
See Also:
Constant Field Values

SE_DEFAULT_STATE_ID

public static final int SE_DEFAULT_STATE_ID
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_STATE_DIFF_NOCHECK

public static final int SE_STATE_DIFF_NOCHECK
Returns all features in the source state. It doesn't check the differences between source state and differences state.

See Also:
Constant Field Values

SE_STATE_DIFF_NOCHANGE_UPDATE

public static final int SE_STATE_DIFF_NOCHANGE_UPDATE
Returns all features that haven't changed in the source state, but have been updated in the differences state.

See Also:
Constant Field Values

SE_STATE_DIFF_NOCHANGE_DELETE

public static final int SE_STATE_DIFF_NOCHANGE_DELETE
Returns all features that haven't changed in the source state, but have been deleted in the differences state.

See Also:
Constant Field Values

SE_STATE_DIFF_UPDATE_NOCHANGE

public static final int SE_STATE_DIFF_UPDATE_NOCHANGE
Returns all features that have been updated in the source state, but unchanged in the differences state.

See Also:
Constant Field Values

SE_STATE_DIFF_UPDATE_UPDATE

public static final int SE_STATE_DIFF_UPDATE_UPDATE
Returns all features that have been updated in both the source and difference states.

See Also:
Constant Field Values

SE_STATE_DIFF_UPDATE_DELETE

public static final int SE_STATE_DIFF_UPDATE_DELETE
Returns all features that have been updated in the source state but deleted in the difference states.

See Also:
Constant Field Values

SE_STATE_DIFF_INSERT

public static final int SE_STATE_DIFF_INSERT
Returns all features that were inserted into the source state and that never existed in the differences state.

See Also:
Constant Field Values

SE_STATE_DIFF_RESTORE

public static final int SE_STATE_DIFF_RESTORE
See Also:
Constant Field Values

SE_STATE_DIFF_INSERT_RESTORE

public static final int SE_STATE_DIFF_INSERT_RESTORE
See Also:
Constant Field Values

SE_STATE_DIFF_UPDATE

public static final int SE_STATE_DIFF_UPDATE
See Also:
Constant Field Values

SE_STATE_DIFF_DELETE

public static final int SE_STATE_DIFF_DELETE
See Also:
Constant Field Values

SE_STATE_FOR_PREDEFINED

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

SeState

public SeState(SeConnection conn)
        throws SeException
SeState constructor with an SeConnection object.

Parameters:
conn - SeConnection object handle.
Throws:
SeException

SeState

public SeState(SeConnection conn,
               SeObjectId stateId)
        throws SeException
SeState constructor with an SeConnection and state Id that retrives the state information for specified ID. Use SE_BASE_STATE_ID in the state_id parameter to retrieve the root of the state tree.

Parameters:
conn - SeConnection object handle.
stateId - the state ID.
Throws:
SeException
SeException

SeState

public SeState(SeConnection conn,
               SeObjectId stateId,
               boolean getLineage)
        throws SeException
SeState constructor with an SeConnection and state Id that retrives the state information for specified ID. Use SE_BASE_STATE_ID in the state_id parameter to retrieve the root of the state tree.

Parameters:
conn - SeConnection object handle.
stateId - the state ID.
getLineage - if true, fetch the state's lineage information, if false, leave it off.
Throws:
SeException
SeException
Method Detail

close

public void close()
           throws SeException
Closes the state. Only the owner or the ArcSDE DBA may close a state.

Throws:
SeException

saveToBase

public void saveToBase(SeObjectId highStateId,
                       boolean commitEachTable)
                throws SeException
Save changes to base state. This function saves versioned changes of a base-save table to the base state. The user executing this function must either be the SDE DBA or the owner of the high state.

Parameters:
highStateId - The state to save to.
commitEachTable - Commit after each table is saved?
Throws:
SeException

compressTree

public void compressTree()
                  throws SeException
Compresses an instance's state tree by removing all states that aren't referenced by a version. Branches not referenced by a version are removed and non-branching sequences between versions are trimmed.

Currently, only the DBA can perform this operation.

The ArcSDE compress method must be invoked in a session that does not perform edits. This is because when a session (ArcSDE Connection) is opened to edit a state(s), it places MARK locks on the state(s) which remain in place until the session (connection) is closed. If the compress function is invoked on the same session that edited states, the compress operation will not compress the states with locks on them. When compressing an ArcSDE database using the APIs it is always best to create a new session specifically for the purpose of compress.

Throws:
SeException

create

public void create(SeObjectId parentId)
            throws SeException
Creates a child state from an existing state. The parent state must be closed and owned by the current user or public, or the current user is the ArcSDE DBA.

Parameters:
parentId - the parent state ID.
Throws:
SeException

clone

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

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

delete

public void delete()
            throws SeException
Deletes a state. The state must be a leaf node and can't be a parent to another state. The current user must be the owner of the state or the ArcSDE DBA.

Throws:
SeException

deleteRange

public void deleteRange(SeObjectId lowStateId,
                        SeObjectId highStateId)
                 throws SeException
Deletes a connected range of states. The high state id must be a leaf node and can't be a parent to another stat. All the states that are in the path that connects the lowStateId to the highStateId should not have more than one child state each, and should not be associated with a version. The current user must be the owner of the state or the ArcSDE DBA. All entries in the instance's adds, deletes, and equivalences tables for all the states will be deleted.

Parameters:
lowStateId - the ID of the first state to delete.
highStateId - the ID of the last state to delete.
Throws:
SeException

lock

public void lock()
          throws SeException
Locks a state. Only the owner or ArcSDE DBA can lock a state.

Throws:
SeException

freeLock

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

Throws:
SeException

merge

public void merge(SeObjectId parentStateId,
                  SeObjectId changesStateId)
           throws SeException
Merges two states to form a new state. The new state is the child of the parent state with the changes of the second state. Both input states must have the same parent state. When a row has been changed in both parent and second states, the row from the changes state is used. The parent and changes states must be open or owned by the current user unless the current user is the ArcSDE DBA.

Parameters:
parentStateId - the parent state ID.
changesStateId - the state ID of changed state.
Throws:
SeException

open

public void open()
          throws SeException
Opens a state. The state cannot have any children. Only the owner or the ArcSDE DBA may open a state.

Throws:
SeException

trimTree

public void trimTree(SeObjectId lowStateId,
                     SeObjectId highStateId)
              throws SeException
Trims the instance's state tree between two specified states. Both low and high states must be in a consistent state. The current user must be the owner of the state or the ArcSDE DBA.

Parameters:
lowStateId - the ID of the first state to delete.
highStateId - the ID of the last state to delete.
Throws:
SeException

getClosingTime

public java.util.Date getClosingTime()
Returns the closing date and time of a state.

Returns:
java.util.Date

getCreationTime

public java.util.Date getCreationTime()
Returns the creation date and time of a state.

Returns:
java.util.Date

getId

public SeObjectId getId()
Returns the state ID.

Returns:
SeObjectId

setId

public void setId(SeObjectId stateId)
           throws SeException
Set's the state ID.

Throws:
SeException

getParentId

public SeObjectId getParentId()
Returns the state ID of the parent.

Returns:
SeObjectId

getLineage

public SeObjectId[] getLineage()
Returns the lineage of a state as an array consisting of an ordered list of state ids, from the base state to the state's immediate parent.

Returns:
SeObjectId[]

archiveTables

public int archiveTables(SeObjectId lowStateId,
                         SeObjectId highStateId,
                         int archiveTIme)
                  throws SeException
Archives rows on the archiving tables modified between low and high states.

Parameters:
lowStateId - SeState The low state for archiving.
highStateId - SeState The high state for archiving.
archiveTIme - int Time archive occurred.
Throws:
SeException

getOwner

public java.lang.String getOwner()
Returns the state's owner.

Returns:
String

isOpen

public boolean isOpen()
Returns TRUE if state is open.

Returns:
boolean