public class FilterCommandRegistry
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.concurrent.ConcurrentHashMap<java.lang.String,FilterCommandFactory> |
filterCommandRegistry |
Constructor and Description |
---|
FilterCommandRegistry() |
Modifier and Type | Method and Description |
---|---|
static FilterCommand |
createFilterCommand(java.lang.String filterCommandName,
Repository db,
java.io.InputStream in,
java.io.OutputStream out)
Create a new
FilterCommand for the
given name. |
static java.util.Set<java.lang.String> |
getRegisteredFilterCommands()
Get registered filter commands
|
static boolean |
isRegistered(java.lang.String filterCommandName)
Check whether any
FilterCommandFactory is registered
for a given command name |
static FilterCommandFactory |
register(java.lang.String filterCommandName,
FilterCommandFactory factory)
Register a
FilterCommandFactory
responsible for creating
FilterCommand s for a certain command
name. |
static FilterCommandFactory |
unregister(java.lang.String filterCommandName)
Unregister the
FilterCommandFactory
registered for the given command name |
private static java.util.concurrent.ConcurrentHashMap<java.lang.String,FilterCommandFactory> filterCommandRegistry
public static FilterCommandFactory register(java.lang.String filterCommandName, FilterCommandFactory factory)
FilterCommandFactory
responsible for creating
FilterCommand
s for a certain command
name. If the factory f1 is registered for the name "jgit://builtin/x"
then a call to getCommand("jgit://builtin/x", ...)
will call
f1(...)
to create a new instance of
FilterCommand
filterCommandName
- the command name for which this factory is registeredfactory
- the factory responsible for creating
FilterCommand
s for the
specified namepublic static FilterCommandFactory unregister(java.lang.String filterCommandName)
FilterCommandFactory
registered for the given command namefilterCommandName
- the FilterCommandFactory's filter command namepublic static boolean isRegistered(java.lang.String filterCommandName)
FilterCommandFactory
is registered
for a given command namefilterCommandName
- the name for which the registry should be checkedtrue
if any factory was registered for the namepublic static java.util.Set<java.lang.String> getRegisteredFilterCommands()
FilterCommandFactory
is
registeredpublic static FilterCommand createFilterCommand(java.lang.String filterCommandName, Repository db, java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
FilterCommand
for the
given name. A factory must be registered for the name in advance.filterCommandName
- The name for which a new
FilterCommand
should be
createddb
- the repository this command should work onin
- the InputStream
this
FilterCommand
should read
fromout
- the OutputStream
this
FilterCommand
should write
tonull
if
there was no factory registered for that namejava.io.IOException