public abstract class DaemonService
extends java.lang.Object
Daemon
over anonymous
git://
.Modifier and Type | Class and Description |
---|---|
private static class |
DaemonService.ServiceConfig |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
command |
private Config.SectionParser<DaemonService.ServiceConfig> |
configKey |
private boolean |
enabled |
private boolean |
overridable |
Constructor and Description |
---|
DaemonService(java.lang.String cmdName,
java.lang.String cfgName) |
Modifier and Type | Method and Description |
---|---|
(package private) abstract void |
execute(DaemonClient client,
Repository db,
java.util.Collection<java.lang.String> extraParameters) |
(package private) void |
execute(DaemonClient client,
java.lang.String commandLine,
java.util.Collection<java.lang.String> extraParameters) |
java.lang.String |
getCommandName()
Get name of the command requested by clients.
|
boolean |
handles(java.lang.String commandLine)
Determine if this service can handle the requested command.
|
boolean |
isEnabled()
Whether this service is enabled for invocation.
|
private boolean |
isEnabledFor(Repository db) |
boolean |
isOverridable()
Whether this service can be configured in the repository config file
|
void |
setEnabled(boolean on)
Set if it is allowed to use this service
|
void |
setOverridable(boolean on)
Whether to permit repositories to override this service's enabled state
with the
daemon.servicename config setting. |
private final java.lang.String command
private final Config.SectionParser<DaemonService.ServiceConfig> configKey
private boolean enabled
private boolean overridable
public boolean isEnabled()
public void setEnabled(boolean on)
on
- true
to allow this service to be used; false
to deny it.public boolean isOverridable()
public void setOverridable(boolean on)
daemon.servicename
config setting.on
- true
to permit repositories to override this service's
enabled state with the daemon.servicename
config
setting.public java.lang.String getCommandName()
public boolean handles(java.lang.String commandLine)
commandLine
- input line from the client.void execute(DaemonClient client, java.lang.String commandLine, @Nullable java.util.Collection<java.lang.String> extraParameters) throws java.io.IOException, ServiceNotEnabledException, ServiceNotAuthorizedException
java.io.IOException
ServiceNotEnabledException
ServiceNotAuthorizedException
private boolean isEnabledFor(Repository db)
abstract void execute(DaemonClient client, Repository db, @Nullable java.util.Collection<java.lang.String> extraParameters) throws java.io.IOException, ServiceNotEnabledException, ServiceNotAuthorizedException
java.io.IOException
ServiceNotEnabledException
ServiceNotAuthorizedException