提交 59456c73 编写于 作者: K Kohsuke Kawaguchi

Defined three remoting roles in Jenkins.

(This requires 82211d10bfc7d066121ba80c8a6755d1dae97bf2 in remoting)
上级 1295aa91
package jenkins.security;
import org.jenkinsci.remoting.Role;
import java.util.Collection;
import java.util.Collections;
/**
* Predefined {@link Role}s in Jenkins.
*
* <p>
* In Jenkins, there is really only one interesting role, which is the Jenkins master.
* Slaves, CLI, and Maven processes are all going to load classes from the master,
* which means it accepts anything that the master asks for, and thus they need
* not have any role.
*
* @author Kohsuke Kawaguchi
*/
public class Roles {
public static final Role MASTER = new Role("master");
/**
* Indicates that a callable runs on masters, requested by slaves/CLI/maven/whatever.
*/
public static final Collection<Role> FOR_MASTER = Collections.singleton(MASTER);
public static final Role SLAVE = new Role("slave");
/**
* Indicates that a callable is meant to run on slaves.
*
* This isn't used to reject callables to run on the slave, but rather to allow
* the master to promptly reject callables that are really not meant to be run on
* the master (as opposed to ones that do not have that information, which gets
* {@link Role#UNKNOWN})
*/
public static final Collection<Role> FOR_SLAVE = Collections.singleton(SLAVE);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册