From: James Moger Date: Fri, 14 Mar 2014 16:49:50 +0000 (-0400) Subject: Renamed SshContext->SshCommandContext for clarity of purpose X-Git-Tag: v1.5.0~68^2~91 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=fea7c52e9584ff117be8529b431b40590deef0ca;p=gitblit.git Renamed SshContext->SshCommandContext for clarity of purpose --- diff --git a/src/main/java/com/gitblit/transport/ssh/SshCommandContext.java b/src/main/java/com/gitblit/transport/ssh/SshCommandContext.java new file mode 100644 index 00000000..de79dacc --- /dev/null +++ b/src/main/java/com/gitblit/transport/ssh/SshCommandContext.java @@ -0,0 +1,35 @@ +/* + * Copyright 2014 gitblit.com. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.gitblit.transport.ssh; + +public class SshCommandContext { + + private final SshDaemonClient client; + private final String commandLine; + + public SshCommandContext(SshDaemonClient client, String commandLine) { + this.client = client; + this.commandLine = commandLine; + } + + public SshDaemonClient getClient() { + return client; + } + + public String getCommandLine() { + return commandLine; + } +} diff --git a/src/main/java/com/gitblit/transport/ssh/SshCommandFactory.java b/src/main/java/com/gitblit/transport/ssh/SshCommandFactory.java index a52e62b8..788bdfb3 100644 --- a/src/main/java/com/gitblit/transport/ssh/SshCommandFactory.java +++ b/src/main/java/com/gitblit/transport/ssh/SshCommandFactory.java @@ -133,7 +133,7 @@ public class SshCommandFactory implements CommandFactory { private void onStart() throws IOException { synchronized (this) { - SshContext ctx = new SshContext(session.getAttribute(SshDaemonClient.KEY), cmdLine); + SshCommandContext ctx = new SshCommandContext(session.getAttribute(SshDaemonClient.KEY), cmdLine); try { cmd = dispatcher; cmd.setArguments(argv); diff --git a/src/main/java/com/gitblit/transport/ssh/SshContext.java b/src/main/java/com/gitblit/transport/ssh/SshContext.java deleted file mode 100644 index 4c5786e4..00000000 --- a/src/main/java/com/gitblit/transport/ssh/SshContext.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2014 gitblit.com. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.gitblit.transport.ssh; - -public class SshContext { - - private final SshDaemonClient client; - private final String commandLine; - - public SshContext(SshDaemonClient client, String commandLine) { - this.client = client; - this.commandLine = commandLine; - } - - public SshDaemonClient getClient() { - return client; - } - - public String getCommandLine() { - return commandLine; - } -} diff --git a/src/main/java/com/gitblit/transport/ssh/commands/BaseCommand.java b/src/main/java/com/gitblit/transport/ssh/commands/BaseCommand.java index a04c505f..f7ef2aa3 100644 --- a/src/main/java/com/gitblit/transport/ssh/commands/BaseCommand.java +++ b/src/main/java/com/gitblit/transport/ssh/commands/BaseCommand.java @@ -33,7 +33,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.gitblit.transport.ssh.AbstractSshCommand; -import com.gitblit.transport.ssh.SshContext; +import com.gitblit.transport.ssh.SshCommandContext; import com.gitblit.utils.IdGenerator; import com.gitblit.utils.WorkQueue; import com.gitblit.utils.WorkQueue.CancelableRunnable; @@ -52,7 +52,7 @@ public abstract class BaseCommand extends AbstractSshCommand { private String[] argv; /** Ssh context */ - protected SshContext ctx; + protected SshCommandContext ctx; /** The task, as scheduled on a worker thread. */ private final AtomicReference> task; @@ -66,7 +66,7 @@ public abstract class BaseCommand extends AbstractSshCommand { this.executor = w.getDefaultQueue(); } - public void setContext(SshContext ctx) { + public void setContext(SshCommandContext ctx) { this.ctx = ctx; }