com.esri.sde.sdk.client
Class SeLog

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

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

Used when managing a persistent set of rows from an ArcSDE table or layer. For example, after identifying a set of features, the application can maintain a list of these specific features so that subsequent operations process only the identified features. Persistent row subsets are managed through logfiles.

Logfiles are stored as DBMS tables in a user's tablespace. Logfiles maintain a list of row identifiers, and can be used as a data source for many data retrieval and geoprocessing operations. A logfile is tied to a specific table or layer.

Logfile operations use two types of names. Some require a simple name that is the logfile name only. These are operations that allow read/write access by the owner. The second type of name combines a username and the logfile name; for example, username\filename. Legal delimiters between the username and file name are the , . \ ; characters. Username file names are primarily used for read-only logfiles where other users are allowed access to the logfile. Set the logfile name using the setName method.

There are two types of logfiles: LAYER type and TABLE type. LAYER type logfiles record layer FID values; are usable only with layers; are created using the setTargetForLayer method; and have the limitation that only rows having a non-null feature can be recorded. TABLE type logfiles record SDE_ROW_ID values; are usable with any table, not just layers; and are created using the setTargetForTable method.

Logfiles also have a persistence property: Temporary or Persistent. Temporary logfiles are automatically deleted when the connection is dropped, while persistent logfiles are not deleted.


Nested Class Summary
 class SeLog.SeLogTargetInfo
           
 
Field Summary
static int SE_CREATE_AND_WRITE_MODE
          Opens the logfile for WRITE operations.
static int SE_LOG_DIFFERENCE
          Set operation that can be used when combining logfiles.
static int SE_LOG_FOR_LAYER
           
static int SE_LOG_FOR_TABLE
           
static int SE_LOG_INTERSECT
          Set operation that can be used when combining logfiles.
static int SE_LOG_PERSISTENT
          The logfile will not be deleted at the end of the user session.
static int SE_LOG_SYMDIFF
          Set operation that can be used when combining logfiles.
static int SE_LOG_TEMPORARY
          The logfile will be deleted at the end of the user session.
static int SE_LOG_UNION
          Set operation that can be used when combining logfiles.
static int SE_MODIFY_MODE
          Opens the logfile for WRITE operations.
static int SE_OVERWRITE_MODE
          Opens the logfile for WRITE operations.
static int SE_READ_MODE
          Opens the logfile for READ operations.
 
Constructor Summary
SeLog(SeConnection conn)
          Logfile constructor with an SeConnection handle.
SeLog(SeConnection conn, java.lang.String logfileName)
          SeLog constructor with a String parameter representing the name of an existing ArcSDE logfile, that retrieves the logfile definition from the server.
 
Method Summary
 void addId(SeObjectId rowId)
          Adds one row id to an open logfile.
 void addIds(SeObjectId[] rowIds)
          Adds a list of row ids to an open logfile.
 void alter()
          Alters the definition of the logfile on the server.
 SeExtent calculateExtent(SeSqlConstruct sqlC)
          Returns the extent (the minimum bounding box) of all the features specified by the logfile (which may be from multiple layers), and optionally, pass an SQL where clause as well.
 java.lang.Object clone()
          Clones the SeLog object.
 void close()
          Closes the open logfile.
 SeLog combine(java.lang.String secondLogfile, java.lang.String combinedLogfile, int operation)
          Performs a set operation (UNION, INTERSECTION, DIFFERENCE, SYMMETRICAL DIFFERENCE) on two logfiles (this one and the one named by the secondLogfile argument), yeilding a new (temporary) logfile (named according to the combinedLogfile argument).
 SeLog copy(java.lang.String newLogfile)
          Copies an existing logfile, described by the calling object, to a new logfile.
 int count()
          Counts the number of row ids in the logfile.
 void create()
          Creates this logfile on the server.
 void delete()
          Deletes this logfile on the server.
 void deleteIds(SeObjectId[] rowIds)
          Deletes a list of ids from an open logfile.
 SeObjectId getId()
          Retrieves the logfile ID.
 java.lang.String getName()
          Retrieves the logfile name.
 SeObjectId[] getRowIds(int maxNumIds)
          Retrieves a list of ids from an open logfile.
 SeLog.SeLogTargetInfo getTargetInfo()
          Returns an SeLog.SeLogTargetInfo object containing the target description.
static void grantAccess(SeConnection connection, java.lang.String owner, java.lang.String dbmsUser)
          Grants access for a specified user to an owner's logfiles.
 boolean isPersistent()
          Returns true if the logfile is persistent.
 void makeName()
          Creates a logfile name that does not currently exist.
 void openLog(int mode)
          Opens a logfile for read or write access.
static void revokeAccess(SeConnection connection, java.lang.String owner, java.lang.String dbmsUser)
          Revokes access for a specified user to an owner's logfiles.
 void setName(java.lang.String name)
          Sets the name of the logfile object.
 void setPersistence(boolean isPersistent)
          Sets the persistence attribute.
 void setTargetAsLayer(java.lang.String layerName, java.lang.String spatialColumn)
          Sets the logfile target as a layer.
 void setTargetAsTable(java.lang.String registeredTableName)
          Sets the logfile target as a table.
 void sort()
          Sorts the logfile.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SE_READ_MODE

public static final int SE_READ_MODE
Opens the logfile for READ operations. The logfile must currently exist.

See Also:
Constant Field Values

SE_OVERWRITE_MODE

public static final int SE_OVERWRITE_MODE
Opens the logfile for WRITE operations. If the logfile exists, it will be overwritten.

See Also:
Constant Field Values

SE_MODIFY_MODE

public static final int SE_MODIFY_MODE
Opens the logfile for WRITE operations. The logfile must currently exist.

See Also:
Constant Field Values

SE_CREATE_AND_WRITE_MODE

public static final int SE_CREATE_AND_WRITE_MODE
Opens the logfile for WRITE operations. If the logfile exists, it will not be overwritten and the open operation will fail.

See Also:
Constant Field Values

SE_LOG_PERSISTENT

public static final int SE_LOG_PERSISTENT
The logfile will not be deleted at the end of the user session.

See Also:
Constant Field Values

SE_LOG_TEMPORARY

public static final int SE_LOG_TEMPORARY
The logfile will be deleted at the end of the user session.

See Also:
Constant Field Values

SE_LOG_INTERSECT

public static final int SE_LOG_INTERSECT
Set operation that can be used when combining logfiles.

See Also:
Constant Field Values

SE_LOG_UNION

public static final int SE_LOG_UNION
Set operation that can be used when combining logfiles.

See Also:
Constant Field Values

SE_LOG_DIFFERENCE

public static final int SE_LOG_DIFFERENCE
Set operation that can be used when combining logfiles.

See Also:
Constant Field Values

SE_LOG_SYMDIFF

public static final int SE_LOG_SYMDIFF
Set operation that can be used when combining logfiles.

See Also:
Constant Field Values

SE_LOG_FOR_TABLE

public static final int SE_LOG_FOR_TABLE
See Also:
Constant Field Values

SE_LOG_FOR_LAYER

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

SeLog

public SeLog(SeConnection conn)
Logfile constructor with an SeConnection handle.

Parameters:
conn - SeConnection object handle.

SeLog

public SeLog(SeConnection conn,
             java.lang.String logfileName)
      throws SeException
SeLog constructor with a String parameter representing the name of an existing ArcSDE logfile, that retrieves the logfile definition from the server.

Parameters:
conn - SeConnection object handle.
logfileName - the name of the logfile.
Throws:
SeException
Method Detail

addId

public void addId(SeObjectId rowId)
           throws SeException
Adds one row id to an open logfile.

Parameters:
rowId - SeObjectId representing the row to add.
Throws:
SeException

addIds

public void addIds(SeObjectId[] rowIds)
            throws SeException
Adds a list of row ids to an open logfile.

Parameters:
rowIds - SeObjectId[] representing the rows to add.
Throws:
SeException

alter

public void alter()
           throws SeException
Alters the definition of the logfile on the server. Currently, only the persistence attribute can be altered. Set the persistence before calling this method.

Throws:
SeException

calculateExtent

public SeExtent calculateExtent(SeSqlConstruct sqlC)
                         throws SeException
Returns the extent (the minimum bounding box) of all the features specified by the logfile (which may be from multiple layers), and optionally, pass an SQL where clause as well. If a where clause is specified, the feature must have all columns specified in the where clause.

Parameters:
sqlC - An optional SeSqlConstruct object that contains the where clause.
Returns:
SeExtent
Throws:
SeException

clone

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

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

close

public void close()
           throws SeException
Closes the open logfile.

Throws:
SeException

combine

public SeLog combine(java.lang.String secondLogfile,
                     java.lang.String combinedLogfile,
                     int operation)
              throws SeException
Performs a set operation (UNION, INTERSECTION, DIFFERENCE, SYMMETRICAL DIFFERENCE) on two logfiles (this one and the one named by the secondLogfile argument), yeilding a new (temporary) logfile (named according to the combinedLogfile argument). If not already sorted, the input logfiles are sorted as a side effect of this operation, which means that the current user must own any unsorted logfile used in this operation.

Parameters:
secondLogfile - String naming the second logfile to combine with this one. May be prefixed with a user name.
combinedLogfile - String naming the resulting logfile. If identical to the name of this or the second logfile, that logfile will be replaced with the new one.
operation - The set operation to perform: SE_LOG_INTERSECT, SE_LOG_UNION, SE_LOG_DIFFERENCE, SE_LOG_SYMDIFF
Returns:
SeLog The definition of the combined logfile.
Throws:
SeException

copy

public SeLog copy(java.lang.String newLogfile)
           throws SeException
Copies an existing logfile, described by the calling object, to a new logfile. The copy occurs on the server. Any entries of the new logfile are replaced by the contents of this logfile. Neither logfile may be in an open state. The file's attributes, such as persistent vs. temporary, and whether sorted, are preserved. The new file is owned by the copier.

Parameters:
newLogfile - String naming the new logfile.
Returns:
SeLog An object representing the definition of the new logfile.
Throws:
SeException

count

public int count()
          throws SeException
Counts the number of row ids in the logfile.

Returns:
int Number of ids in the logfile.
Throws:
SeException

create

public void create()
            throws SeException
Creates this logfile on the server. The new logfile will be owned by the current user.

Throws:
SeException

delete

public void delete()
            throws SeException
Deletes this logfile on the server.

Throws:
SeException

deleteIds

public void deleteIds(SeObjectId[] rowIds)
               throws SeException
Deletes a list of ids from an open logfile.

Parameters:
rowIds - SeObjectId[] representing the rows to delete.
Throws:
SeException

grantAccess

public static void grantAccess(SeConnection connection,
                               java.lang.String owner,
                               java.lang.String dbmsUser)
                        throws SeException
Grants access for a specified user to an owner's logfiles.

Parameters:
connection - SeConnection to use for this operation.
owner - String indicating the owner of the logfiles.
dbmsUser - String indicating the user to grant access for.
Throws:
SeException

openLog

public void openLog(int mode)
             throws SeException
Opens a logfile for read or write access. A logfile opened for a write operation must be owned by the current user. A logfile opened for READ (read only access) can be owned by users other than the current user. Be sure to set the Qualified Logfile Name before calling this method. SE_READ_MODE - Opens the logfile for READ operations. The logfile must currently exist. SE_OVERWRITE_MODE - Opens the logfile for WRITE operations. If the logfile exists, it will be overwritten. SE_MODIFY_MODE - Opens the logfile for WRITE operations. The logfile must currently exist. SE_CREATE_AND_WRITE_MODE - Opens the logfile for WRITE operations. If the logfile exists, it will not be overwritten and the open operation will fail.

Parameters:
mode - SE_READ_MODE, SE_OVERWRITE_MODE, SE_CREATE_AND_WRITE_MODE, SE_MODIFY_MODE
Throws:
SeException

makeName

public void makeName()
              throws SeException
Creates a logfile name that does not currently exist. Useful for generating temporary logfiles.

Throws:
SeException

revokeAccess

public static void revokeAccess(SeConnection connection,
                                java.lang.String owner,
                                java.lang.String dbmsUser)
                         throws SeException
Revokes access for a specified user to an owner's logfiles.

Parameters:
connection - SeConnection to use in this operation.
owner - String indicating the owner of the logfiles.
dbmsUser - String indicating the user to revoke access for.
Throws:
SeException

sort

public void sort()
          throws SeException
Sorts the logfile.

Throws:
SeException

getId

public SeObjectId getId()
Retrieves the logfile ID.

Returns:
SeObjectId

getRowIds

public SeObjectId[] getRowIds(int maxNumIds)
                       throws SeException
Retrieves a list of ids from an open logfile.

Parameters:
maxNumIds - The number of ids to retrieve.
Throws:
SeException

getName

public java.lang.String getName()
Retrieves the logfile name.

Returns:
String

isPersistent

public boolean isPersistent()
Returns true if the logfile is persistent.

Returns:
boolean

getTargetInfo

public SeLog.SeLogTargetInfo getTargetInfo()
Returns an SeLog.SeLogTargetInfo object containing the target description. The target description consists of the type: SeLog.SE_LOG_FOR_TABLE if the target is a registered table SeLog.SE_LOG_FOR_LAYER if the target is a layer The table name, and, if the target is a layer, the spatial column.

Returns:
SeLogTargetType

setName

public void setName(java.lang.String name)
             throws SeException
Sets the name of the logfile object.

Parameters:
name - the qualified logfile name.
Throws:
SeException

setPersistence

public void setPersistence(boolean isPersistent)
Sets the persistence attribute. Persistence controls whether or not a logfile will exist past the endof an ArcSDE user session. Temporary logfiles will be deleted at the end of a session. Persistent logfiles will be saved.

Parameters:
isPersistent - The persistence of the logfile.

setTargetAsLayer

public void setTargetAsLayer(java.lang.String layerName,
                             java.lang.String spatialColumn)
Sets the logfile target as a layer.

Parameters:
layerName - the layer name.
spatialColumn - the name of the spatial column.

setTargetAsTable

public void setTargetAsTable(java.lang.String registeredTableName)
Sets the logfile target as a table.

Parameters:
registeredTableName - the registered table name.