Skip to content

Commit

Permalink
Merge branch 'removeDeprecatedProtocols' of github.com:jeffret-b/jenk…
Browse files Browse the repository at this point in the history
…ins into websocket
  • Loading branch information
jglick committed Jan 3, 2020
2 parents 37d33dc + 659f388 commit 4cb16c1
Show file tree
Hide file tree
Showing 45 changed files with 3 additions and 1,036 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,5 +216,5 @@ public void setLog(@Nonnull OutputStream log) {

private static final Logger LOGGER = Logger.getLogger(DefaultJnlpSlaveReceiver.class.getName());

private static final String COOKIE_NAME = JnlpSlaveAgentProtocol2.class.getName()+".cookie";
private static final String COOKIE_NAME = "JnlpAgentProtocol.cookie";
}

This file was deleted.

40 changes: 2 additions & 38 deletions core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,56 +42,20 @@
* @author Kohsuke Kawaguchi
* @since 1.467
*/
@Extension
@Symbol("jnlp")
public class JnlpSlaveAgentProtocol extends AgentProtocol {
/**
* Our logger
*/
private static final Logger LOGGER = Logger.getLogger(JnlpSlaveAgentProtocol.class.getName());
/**
* This secret value is used as a seed for agents.
*/
public static final HMACConfidentialKey SLAVE_SECRET =
new HMACConfidentialKey(JnlpSlaveAgentProtocol.class, "secret");

private NioChannelSelector hub;

private JnlpProtocol1Handler handler;

@Inject
public void setHub(NioChannelSelector hub) {
this.hub = hub;
this.handler = new JnlpProtocol1Handler(JnlpAgentReceiver.DATABASE, Computer.threadPoolForRemoting,
hub.getHub(), true);
}

@Override
public boolean isOptIn() {
return true;
}

@Override
public boolean isDeprecated() {
return true;
}

@Override
public String getName() {
return handler.isEnabled() ? handler.getName() : null;
}

@Override
public String getDisplayName() {
return Messages.JnlpSlaveAgentProtocol_displayName();
return null;
}

@Override
public void handle(Socket socket) throws IOException, InterruptedException {
handler.handle(socket,
Collections.singletonMap(JnlpConnectionState.COOKIE_KEY, JnlpAgentReceiver.generateCookie()),
ExtensionList.lookup(JnlpAgentReceiver.class));
}


}
}
67 changes: 0 additions & 67 deletions core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol2.java

This file was deleted.

64 changes: 0 additions & 64 deletions core/src/main/java/jenkins/slaves/JnlpSlaveAgentProtocol3.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4cb16c1

Please sign in to comment.