public interface RepoTransportFactory
RepoTransport
.
Important: Implementors should not implement this interface directly. Instead,
AbstractRepoTransportFactory
should be sub-classed.
Modifier and Type | Method and Description |
---|---|
RepoTransport |
createRepoTransport(URL remoteRoot,
UUID clientRepositoryId)
Create a
RepoTransport instance. |
String |
getDescription()
Gets the human-readable long description of this factory.
|
String |
getName()
Gets the human-readable short name of this factory.
|
int |
getPriority()
Gets the priority of this factory.
|
boolean |
isSupported(URL remoteRoot)
Determine, whether the factory (or more precisely its
RepoTransport s) is able to handle the given URL. |
int getPriority()
Factories are sorted primarily by this priority (descending). Thus, the greater the priority as a number the more likely it will be used.
Or in other words: The factory with the highest priority is chosen.
The default implementation in AbstractRepoTransportFactory
returns 0. Thus, if you implement your
own factory and register it for a URL type that is already handled by another factory,
you must return a number greater than the other factory's priority (i.e. usually > 0).
String getName()
This should be a very short name like "File", "REST", "SOAP", etc. to be listed in a combo box or similar UI element.
null
, but
implementors are highly discouraged to return null
(or an empty string)!getDescription()
String getDescription()
In contrast to getName()
, this method should provide an elaborate decription. It may be
composed of multiple complete sentences and it may contain line breaks.
null
. But
implementors are encouraged to provide a meaningful description.getName()
boolean isSupported(URL remoteRoot)
RepoTransport
s) is able to handle the given URL.remoteRoot
- the URL of the repository. Must not be null
. This does not necessarily mean
the repository is on a remote machine. It just means it is somewhere beyond this abstraction layer and might
very well be on a remote server.true
, if the URL is supported (i.e. a RepoTransport
created by this factory will
operate with it); false
, if the URL is not supported.RepoTransport createRepoTransport(URL remoteRoot, UUID clientRepositoryId)
RepoTransport
instance.remoteRoot
- the remote-root. Must not be null
.clientRepositoryId
- the client-side repository's ID (i.e. the ID of the repo on the other side).
May be null
, if there is no repo (yet) on the other side. Note, that certain methods
are not usable, if this is null
.RepoTransport
instance. Never null
.Copyright © 2013–2018. All rights reserved.