Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

2 changes: 1 addition & 1 deletion core/src/main/java/jenkins/slaves/JnlpAgentReceiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.jenkinsci.remoting.engine.JnlpConnectionStateListener;

/**
* Receives incoming agents connecting through {@link JnlpSlaveAgentProtocol2}, {@link JnlpSlaveAgentProtocol3}, {@link JnlpSlaveAgentProtocol4}.
* Receives incoming agents connecting through {@link JnlpSlaveAgentProtocol4}.
*
* <p>
* This is useful to establish the communication with other JVMs and use them
Expand Down
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