Package org.eclipse.jgit.transport
Class DaemonService
- java.lang.Object
-
- org.eclipse.jgit.transport.DaemonService
-
public abstract class DaemonService extends java.lang.ObjectA service exposed byDaemonover anonymousgit://.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classDaemonService.ServiceConfig
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringcommandprivate Config.SectionParser<DaemonService.ServiceConfig>configKeyprivate booleanenabledprivate booleanoverridable
-
Constructor Summary
Constructors Constructor Description DaemonService(java.lang.String cmdName, java.lang.String cfgName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) voidexecute(DaemonClient client, java.lang.String commandLine, java.util.Collection<java.lang.String> extraParameters)(package private) abstract voidexecute(DaemonClient client, Repository db, java.util.Collection<java.lang.String> extraParameters)java.lang.StringgetCommandName()Get name of the command requested by clients.booleanhandles(java.lang.String commandLine)Determine if this service can handle the requested command.booleanisEnabled()Whether this service is enabled for invocation.private booleanisEnabledFor(Repository db)booleanisOverridable()Whether this service can be configured in the repository config filevoidsetEnabled(boolean on)Set if it is allowed to use this servicevoidsetOverridable(boolean on)Whether to permit repositories to override this service's enabled state with thedaemon.servicenameconfig setting.
-
-
-
Field Detail
-
command
private final java.lang.String command
-
configKey
private final Config.SectionParser<DaemonService.ServiceConfig> configKey
-
enabled
private boolean enabled
-
overridable
private boolean overridable
-
-
Method Detail
-
isEnabled
public boolean isEnabled()
Whether this service is enabled for invocation.- Returns:
- whether this service is enabled for invocation.
-
setEnabled
public void setEnabled(boolean on)
Set if it is allowed to use this service- Parameters:
on-trueto allow this service to be used;falseto deny it.
-
isOverridable
public boolean isOverridable()
Whether this service can be configured in the repository config file- Returns:
- whether this service can be configured in the repository config file
-
setOverridable
public void setOverridable(boolean on)
Whether to permit repositories to override this service's enabled state with thedaemon.servicenameconfig setting.- Parameters:
on-trueto permit repositories to override this service's enabled state with thedaemon.servicenameconfig setting.
-
getCommandName
public java.lang.String getCommandName()
Get name of the command requested by clients.- Returns:
- name of the command requested by clients.
-
handles
public boolean handles(java.lang.String commandLine)
Determine if this service can handle the requested command.- Parameters:
commandLine- input line from the client.- Returns:
- true if this command can accept the given command line.
-
execute
void execute(DaemonClient client, java.lang.String commandLine, @Nullable java.util.Collection<java.lang.String> extraParameters) throws java.io.IOException, ServiceNotEnabledException, ServiceNotAuthorizedException
- Throws:
java.io.IOExceptionServiceNotEnabledExceptionServiceNotAuthorizedException
-
isEnabledFor
private boolean isEnabledFor(Repository db)
-
execute
abstract void execute(DaemonClient client, Repository db, @Nullable java.util.Collection<java.lang.String> extraParameters) throws java.io.IOException, ServiceNotEnabledException, ServiceNotAuthorizedException
- Throws:
java.io.IOExceptionServiceNotEnabledExceptionServiceNotAuthorizedException
-
-