public interface LocalRepoManager
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_CLOSE_DEFERRED_MILLIS |
static int |
DEFAULT_KEY_SIZE |
static String |
META_DIR_NAME |
static String |
PERSISTENCE_PROPERTIES_FILE_NAME |
static String |
PROP_REPOSITORY_ALIASES
Aliases separated by '/' (because '/' is an illegal character for an alias).
|
static String |
PROP_REPOSITORY_ID |
static String |
PROP_VERSION |
static String |
REPOSITORY_PROPERTIES_FILE_NAME |
static String |
SYSTEM_PROPERTY_CLOSE_DEFERRED_MILLIS |
static String |
SYSTEM_PROPERTY_KEY_SIZE |
static String |
TEMP_DIR_NAME |
static String |
TEMP_NEW_FILE_PREFIX |
static String |
VAR_LOCAL_ROOT |
static String |
VAR_META_DIR |
Modifier and Type | Method and Description |
---|---|
void |
addLocalRepoManagerCloseListener(LocalRepoManagerCloseListener listener) |
LocalRepoTransaction |
beginReadTransaction()
Begin a JDO transaction for read operations only in the underlying database.
|
LocalRepoTransaction |
beginWriteTransaction()
Begin a JDO transaction for read and write operations in the underlying database.
|
void |
close()
Closes this
LocalRepoManager . |
void |
deleteRemoteRepository(UUID repositoryId)
Deletes a remote repository from the local database.
|
void |
finalize()
Deprecated.
Do not invoke this method directly! It is declared in this interface to make sure the
proxy's
InvocationHandler is invoked when the garbage-collector collects the proxy. |
String |
getLocalPathPrefixOrFail(URL remoteRoot)
Gets the local path-prefix (of the local repository managed by this
LocalRepoManager ) when syncing with
the remote repository identified by the given remoteRoot . |
String |
getLocalPathPrefixOrFail(UUID repositoryId)
Gets the local path-prefix (of the local repository managed by this
LocalRepoManager ) when syncing with
the remote repository identified by the given remoteRoot . |
File |
getLocalRoot()
Gets the repository's local root directory.
|
Lock |
getLock() |
byte[] |
getPrivateKey()
Gets the local repository's private key.
|
byte[] |
getPublicKey()
Gets the local repository's public key.
|
UUID |
getRemoteRepositoryIdOrFail(URL remoteRoot)
Gets the unique ID of the remote repository identified by the given
remoteRoot . |
byte[] |
getRemoteRepositoryPublicKeyOrFail(UUID repositoryId)
Gets the remote repository's public key.
|
UUID |
getRepositoryId()
Gets the local repository's unique ID.
|
boolean |
isOpen()
Gets the open state.
|
void |
localSync(ProgressMonitor monitor)
Synchronises the local file system with the local database.
|
void |
putRemoteRepository(UUID repositoryId,
URL remoteRoot,
byte[] publicKey,
String localPathPrefix)
Adds or relocates a remote repository.
|
void |
putRepositoryAlias(String repositoryAlias) |
void |
removeLocalRepoManagerCloseListener(LocalRepoManagerCloseListener listener) |
void |
removeRepositoryAlias(String repositoryAlias) |
static final String SYSTEM_PROPERTY_KEY_SIZE
static final int DEFAULT_KEY_SIZE
static final String SYSTEM_PROPERTY_CLOSE_DEFERRED_MILLIS
static final long DEFAULT_CLOSE_DEFERRED_MILLIS
static final String META_DIR_NAME
static final String TEMP_DIR_NAME
static final String TEMP_NEW_FILE_PREFIX
static final String REPOSITORY_PROPERTIES_FILE_NAME
static final String PROP_REPOSITORY_ID
static final String PROP_VERSION
static final String PROP_REPOSITORY_ALIASES
To make scripting easier (e.g. using grep), the aliases start and end with a '/'. For example: "/alias1/alias2/alias3/"
static final String PERSISTENCE_PROPERTIES_FILE_NAME
static final String VAR_LOCAL_ROOT
static final String VAR_META_DIR
File getLocalRoot()
This file is canonical (absolute and symbolic links resolved).
null
.UUID getRepositoryId()
This is LocalRepository.entityID
in the local repository database.
null
.byte[] getPrivateKey()
This is always an RSA key - other key types are not (yet) supported.
null
.byte[] getPublicKey()
This is always an RSA key - other key types are not (yet) supported.
null
.byte[] getRemoteRepositoryPublicKeyOrFail(UUID repositoryId)
This is always an RSA key - other key types are not (yet) supported.
repositoryId
- the remote repository's unique ID. Must not be null
.null
.IllegalArgumentException
- if there is no remote-repository with the given repositoryId
.void addLocalRepoManagerCloseListener(LocalRepoManagerCloseListener listener)
void removeLocalRepoManagerCloseListener(LocalRepoManagerCloseListener listener)
boolean isOpen()
If this is false
, the LocalRepoManager
instance cannot be used anymore.
Due to the proxy-mechanism, this does, however, not mean that the backend is really shut down.
void close()
LocalRepoManager
.
Important: The LocalRepoManagerFactory
always returns a proxy. It never returns
the real backend-instance. Calling close()
closes the proxy and thus renders it unusable.
It decrements the real backend-instance's reference counter. As soon as this reaches 0, the backend
is really closed - which may happen delayed (for performance reasons).
LocalRepoTransaction beginReadTransaction()
null
.LocalRepoTransaction beginWriteTransaction()
null
.void localSync(ProgressMonitor monitor)
Registers every directory and file in the repository's local root
and its
sub-directories.
void putRemoteRepository(UUID repositoryId, URL remoteRoot, byte[] publicKey, String localPathPrefix)
repositoryId
- the remote repository's unique ID. Must not be null
. This is
LocalRepository.entityID
in the remote database and will become
RemoteRepository.entityID
in the local database.remoteRoot
- the URL of the remote repository. May be null
(in the server, a
RemoteRepository
never has a remoteRoot
).localPathPrefix
- TODOvoid deleteRemoteRepository(UUID repositoryId)
Does nothing, if the specified repository does not exist.
repositoryId
- the remote repository's unique ID. Must not be null
.String getLocalPathPrefixOrFail(URL remoteRoot)
LocalRepoManager
) when syncing with
the remote repository identified by the given remoteRoot
.remoteRoot
- the remote repository's root-URL (not necessarily its real root, but the root URL connected
to the local repository). Must not be null
.null
, but maybe empty.IllegalArgumentException
- if there is no remote-repository with the given remoteRoot
.String getLocalPathPrefixOrFail(UUID repositoryId)
LocalRepoManager
) when syncing with
the remote repository identified by the given remoteRoot
.repositoryId
- the remote repository's unique ID. Must not be null
.null
, but maybe empty.IllegalArgumentException
- if there is no remote-repository with the given remoteRoot
.UUID getRemoteRepositoryIdOrFail(URL remoteRoot)
remoteRoot
.remoteRoot
- the remote repository's root-URL (not necessarily its real root, but the root URL connected
to the local repository). Must not be null
.null
.IllegalArgumentException
- if there is no remote-repository with the given remoteRoot
.@Deprecated void finalize() throws Throwable
InvocationHandler
is invoked when the garbage-collector collects the proxy.Throwable
void putRepositoryAlias(String repositoryAlias)
void removeRepositoryAlias(String repositoryAlias)
Copyright © 2013-2014. All Rights Reserved.