public abstract class Repository extends Object
Constructor and Description |
---|
Repository() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
connect(String ip,
int port,
String repository)
Connects to a repository on a specified repository server.
|
abstract boolean |
disconnect()
Disconnects from the repository.
|
abstract QueryResult |
executeSQLQuery(String sql)
Executes a SQL command.
|
static int |
exportRepository(String rsHost,
int rsPort,
String repositoryName,
String destination,
boolean overwrite)
Export a repository to a file.
|
abstract Entity |
getEntityById(String id) |
static Repository |
getInstance()
Returns a repository instance.
|
static String |
getLastErrorMessage()
Returns the most recent error message.
|
abstract Project |
getProject(String name)
Returns a specific project with a given name.
|
abstract Collection |
getProjects()
Returns all projects residing under a repository.
|
static int |
importRepository(String rsHost,
int rsPort,
String repositoryName,
String filePath,
boolean overwrite)
Import a repository from a file.
|
abstract boolean |
login(String userName,
String password)
Log on to the repository.
|
abstract void |
logout()
Logs out of the repository.
|
public abstract boolean connect(String ip, int port, String repository)
ip
- - the hostname or IP address of the repository server where the repository resides.port
- - the port number of the repository server. If this argument is set to 0, the default port number 53400 is used.repository
- - the name of the repository on the repository server.public abstract boolean disconnect()
public abstract boolean login(String userName, String password)
userName
- the username to log on.password
- - the password to log on.public abstract void logout()
public abstract Collection getProjects()
public abstract Project getProject(String name)
name
- the name of the desired project.public abstract QueryResult executeSQLQuery(String sql)
sql
- a SQL query.public static String getLastErrorMessage()
public static int importRepository(String rsHost, int rsPort, String repositoryName, String filePath, boolean overwrite)
rsHost
- IP Address or computer name of repository server. Default value: "localhost".rsPort
- Port used for target repository server. Default value: 53404repositoryName
- Repository name to be assigned to the imported repository. Default value: The source repository's name.filePath
- Path to .dat file to be importedoverwrite
- true: Replace the existing repository, if any, without error messagepublic static int exportRepository(String rsHost, int rsPort, String repositoryName, String destination, boolean overwrite)
rsHost
- IP address or computer name of repository server. Default value: "localhost".rsPort
- Port used for target repository server. Default value: 53404repositoryName
- Name to be assigned to the exported repository. Default value: source repository name.destination
- file path (absolute ) of the exported file.overwrite
- true: Replace the existing destination file, if any, without error messagepublic static Repository getInstance()
Copyright © 2017. All rights reserved.