|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IWorkspaceFactory
Provides access to members that create and open workspaces and supply workspace factory information.
A WorkspaceFactory is a dispenser of workspaces and allows a client to connect to a workspace specified by a set of connection properties. A workspace represents a database or a datasource that contains one or more datasets. Examples of datasets include tables, feature classes and relationship classes. A WorkspaceFactory is a cocreatable, singleton object. Connection properties are specified using a PropertySet object and can be saved to a connection file. A WorkspaceFactory also supports methods that can be used to browse and manage file system workspaces, and methods to manage connection files for remote database workspaces.
IWorkspaceFactory rasWkspFactory = new RasterWorkspaceFactory();
Method Summary | |
---|---|
boolean |
containsWorkspace(String parentDirectory,
IFileNames fileNames)
Indicates if parentDirectory contains a valid workspace, or is a valid file-system workspace. |
boolean |
copy(IWorkspaceName workspaceName,
String destinationFolder,
IWorkspaceName[] workspaceNameCopy)
Copies a workspace to the specified destination folder. |
IWorkspaceName |
create(String parentDirectory,
String name,
IPropertySet connectionProperties,
int hWnd)
Creates a new workspace specified by the directory, file name, and connection properties. |
IUID |
getClassID()
The class ID of the WorkspaceFactory. |
String |
getWorkspaceDescription(boolean plural)
A singular or plural description of the type of workspace the workspace factory opens/creates. |
IWorkspaceName |
getWorkspaceName(String parentDirectory,
IFileNames fileNames)
Retrieves the workspace name of a workspace from the given list of file names. |
int |
getWorkspaceType()
The type of workspace the workspace factory opens/creates. |
boolean |
isWorkspace(String fileName)
True if the specified file identifies a workspace supported by the workspace factory. |
boolean |
move(IWorkspaceName workspaceName,
String destinationFolder)
Moves a workspace to the specified destination folder. |
IWorkspace |
open(IPropertySet connectionProperties,
int hWnd)
Opens the workspace specified by the connection properties. |
IWorkspace |
openFromFile(String fileName,
int hWnd)
Opens the workspace specified by the given file name. |
IPropertySet |
readConnectionPropertiesFromFile(String fileName)
The connection properties from the specified file. |
Method Detail |
---|
IWorkspace open(IPropertySet connectionProperties, int hWnd) throws IOException, AutomationException
Open takes as input a property set of connection properties that specify the workspace to connect to. In the case of file system workspaces and local database workspaces, a single property named DATABASE, whose value is the pathname to the workspace, is usually all that is required. In the case of remote database workspaces accessed via ArcSDE the properties can include the USER, PASSWORD, DATABASE, SERVER, INSTANCE, VERSION, HISTORICAL_NAME, HISTORICAL_TIMESTAMP, and AUTHENTICATION_MODE properties of the database being connected to.
List of acceptable connection property names and a brief description of each
"SERVER" – SDE server name you are connecting to.
"INSTANCE" – Instance you are connection to.
"DATABASE" – Database connected to.
"USER" – Connected user.
"PASSWORD" – Connected password.
"AUTHENTICATION_MODE" – Credential authentication mode of the connection. Acceptable values are "OSA" and "DBMS".
"VERSION" – Transactional version to connect to. Acceptable value is a string that represents a transaction version name.
"HISTORICAL_NAME" – Historical version to connect to. Acceptable value is a string type that represents a historical marker name.
"HISTORICAL_TIMESTAMP" – Moment in history to establish an historical version connection. Acceptable value is a date time that represents a moment timestamp.
Notes:
connectionProperties
- A reference to a com.esri.arcgis.system.IPropertySet (in)hWnd
- The hWnd (A COM typedef) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IWorkspace openFromFile(String fileName, int hWnd) throws IOException, AutomationException
OpenFromFile takes the pathname of a file or directory that represents either a FileSystemWorkspace or LocalDatabaseWorkspace, or a connection file to a RemoteDatabase workspace and returns an interface on the specified workspace. Clients of these methods can then proceed to open and access datasets in the workspace. If these methods are called with insufficient properties, then the user will be presented with a connection dialog that will prompt for the required properties.
The hWnd argument is the parent window or application's window. The hWnd will guarantee that the connection dialog, if presented to you because of insufficient properties, has the correct parent.
fileName
- The fileName (in)hWnd
- The hWnd (A COM typedef) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IWorkspaceName create(String parentDirectory, String name, IPropertySet connectionProperties, int hWnd) throws IOException, AutomationException
parentDirectory
- The parentDirectory (in)name
- The name (in)connectionProperties
- A reference to a com.esri.arcgis.system.IPropertySet (in)hWnd
- The hWnd (A COM typedef) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean containsWorkspace(String parentDirectory, IFileNames fileNames) throws IOException, AutomationException
parentDirectory
- The parentDirectory (in)fileNames
- A reference to a com.esri.arcgis.system.IFileNames (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IWorkspaceName getWorkspaceName(String parentDirectory, IFileNames fileNames) throws IOException, AutomationException
GetWorkspaceName is useful when browsing the file system for workspaces. It is handed in a parent directory and the list of file names in the directory to be examined. It returns a WorkspaceName object representing the first workspace it finds in the list of filenames and removes any filenames representing the workspace from the input list of filenames.
parentDirectory
- The parentDirectory (in)fileNames
- A reference to a com.esri.arcgis.system.IFileNames (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IUID getClassID() throws IOException, AutomationException
GetClassID returns the unique identifier for the workspace factory. You can use this to distinguish different versions of the same type of factory, for example, whether you are working with an SDEWorkspace, FileGDBWorkspace or AccessWorkspace factory.
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean isWorkspace(String fileName) throws IOException, AutomationException
fileName
- The fileName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.IPropertySet readConnectionPropertiesFromFile(String fileName) throws IOException, AutomationException
The filename parameter represents the pathname of a file that contains the connection information to be placed into the IPropertySet variable.
fileName
- The fileName (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.String getWorkspaceDescription(boolean plural) throws IOException, AutomationException
plural
- The plural (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.int getWorkspaceType() throws IOException, AutomationException
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean copy(IWorkspaceName workspaceName, String destinationFolder, IWorkspaceName[] workspaceNameCopy) throws IOException, AutomationException
The Copy and Move methods can be used to copy or move workspaces or connection files between folders in the file system. The Boolean result indicates if the operation was successful. In the case of remote database workspaces, these operations work on the connection file representing the workspace.
workspaceName
- A reference to a com.esri.arcgis.geodatabase.IWorkspaceName (in)destinationFolder
- The destinationFolder (in)workspaceNameCopy
- A reference to a com.esri.arcgis.geodatabase.IWorkspaceName (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.boolean move(IWorkspaceName workspaceName, String destinationFolder) throws IOException, AutomationException
The Copy and Move methods can be used to copy or move workspaces or connection files between folders in the file system. The Boolean result indicates if the operation was successful. In the case of remote database workspaces, these operations work on the connection file representing the workspace.
workspaceName
- A reference to a com.esri.arcgis.geodatabase.IWorkspaceName (in)destinationFolder
- The destinationFolder (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |