Java 类hudson.model.UserProperty 实例源码

项目:gitlab-auth-plugin    文件:GitLabUserProperty.java   
/**
 * Creates a new instance of the GitLabUserInformation object containing information about the logged in user.
 * 
 * @return the UserPropery object
 */
@Override
public UserProperty newInstance(User user) {
    Authentication auth = Jenkins.getAuthentication();

    if (auth instanceof GitLabUserDetails) {
        GitLabUserInfo gitLabUser;
        try {
            gitLabUser = GitLab.getUser(((GitLabUserDetails) auth.getPrincipal()).getId());
            return new GitLabUserProperty(gitLabUser);
        } catch (GitLabApiException e) {
            LOGGER.warning(e.getMessage());
        }
    }
    return new GitLabUserProperty();
}
项目:flaky-test-handler-plugin    文件:TestGitRepo.java   
public TestGitRepo(String name, File tmpDir, TaskListener listener) throws IOException, InterruptedException {
  this.name = name;
  this.listener = listener;

  envVars = new EnvVars();

  gitDir = tmpDir;
  User john = User.get(johnDoe.getName(), true);
  UserProperty johnsMailerProperty = new Mailer.UserProperty(johnDoe.getEmailAddress());
  john.addProperty(johnsMailerProperty);

  User jane = User.get(janeDoe.getName(), true);
  UserProperty janesMailerProperty = new Mailer.UserProperty(janeDoe.getEmailAddress());
  jane.addProperty(janesMailerProperty);

  // initialize the git interface.
  gitDirPath = new FilePath(gitDir);
  git = Git.with(listener, envVars).in(gitDir).getClient();

  // finally: initialize the repo
  git.init();
}
项目:restricted-register-plugin    文件:RRHudsonUserProperty.java   
@Override
public UserProperty newInstance(User user) {
    return new RRHudsonUserProperty();
}
项目:display-url-api-plugin    文件:PreferredProviderUserPropertyDescriptor.java   
@Override
public UserProperty newInstance(User user) {
    return new PreferredProviderUserProperty(ProviderOption.DEFAULT_OPTION.getId());
}
项目:latch-plugin-jenkins    文件:LatchAccountProperty.java   
@Override
public UserProperty reconfigure(StaplerRequest red, net.sf.json.JSONObject form) throws Descriptor.FormException {
    return this;
}
项目:p4-jenkins    文件:P4UserProperty.java   
@Override
public UserProperty newInstance(User user) {
    return new P4UserProperty(null);
}
项目:p4-jenkins    文件:P4UserProperty.java   
@Override
public UserProperty
        newInstance(StaplerRequest req, JSONObject formData)
                throws FormException {
    return new P4UserProperty(formData.optString("email"));
}