Tabnine Logo
Username.valueOf
Code IndexAdd Tabnine to your IDE (free)

How to use
valueOf
method
in
com.thoughtworks.go.server.domain.Username

Best Java code snippets using com.thoughtworks.go.server.domain.Username.valueOf (Showing top 5 results out of 315)

origin: gocd/gocd

public Username getUsername() {
  return Username.valueOf(name);
}
origin: gocd/gocd

public Stage findStageWithIdentifier(String pipelineName,
                   int pipelineCounter,
                   String stageName,
                   String stageCounter,
                   String username,
                   OperationResult result) {
  if (!goConfigService.currentCruiseConfig().hasPipelineNamed(new CaseInsensitiveString(pipelineName))) {
    String message = String.format("Pipeline '%s' not found", pipelineName);
    result.notFound("Not Found", message, HealthStateType.general(HealthStateScope.GLOBAL));
    return null;
  }
  if (!securityService.hasViewPermissionForPipeline(Username.valueOf(username), pipelineName)) {
    result.forbidden("Unauthorized", NOT_AUTHORIZED_TO_VIEW_PIPELINE, HealthStateType.general(HealthStateScope.forPipeline(pipelineName)));
    return null;
  }
  Pipeline pipeline = pipelineDao.findPipelineByNameAndCounter(pipelineName, pipelineCounter);
  if (pipeline == null) {
    String message = String.format("Pipeline '%s' with counter '%s' not found", pipelineName, pipelineCounter);
    result.notFound("Not Found", message, HealthStateType.general(HealthStateScope.GLOBAL));
    return null;
  }
  return findStageWithIdentifier(new StageIdentifier(pipelineName, pipelineCounter, stageName, stageCounter));
}
origin: gocd/gocd

public StageInstanceModels findDetailedStageHistoryByOffset(String pipelineName,
                              String stageName,
                              Pagination pagination,
                              String username,
                              OperationResult result) {
  if (!goConfigService.currentCruiseConfig().hasPipelineNamed(new CaseInsensitiveString(pipelineName))) {
    result.notFound("Not Found", "Pipeline not found", HealthStateType.general(HealthStateScope.GLOBAL));
    return null;
  }
  if (!securityService.hasViewPermissionForPipeline(Username.valueOf(username), pipelineName)) {
    result.forbidden("Unauthorized", NOT_AUTHORIZED_TO_VIEW_PIPELINE, HealthStateType.general(HealthStateScope.forPipeline(pipelineName)));
    return null;
  }
  return stageDao.findDetailedStageHistoryByOffset(pipelineName, stageName, pagination);
}
origin: gocd/gocd

public JobInstances findJobHistoryPage(String pipelineName, String stageName, String jobConfigName, Pagination pagination, String username, OperationResult result) {
  if (!goConfigService.currentCruiseConfig().hasPipelineNamed(new CaseInsensitiveString(pipelineName))) {
    result.notFound("Not Found", "Pipeline not found", HealthStateType.general(HealthStateScope.GLOBAL));
    return null;
  }
  if (!securityService.hasViewPermissionForPipeline(Username.valueOf(username), pipelineName)) {
    result.forbidden("Unauthorized", NOT_AUTHORIZED_TO_VIEW_PIPELINE, HealthStateType.general(HealthStateScope.forPipeline(pipelineName)));
    return null;
  }
  return jobInstanceDao.findJobHistoryPage(pipelineName, stageName, jobConfigName, pagination.getPageSize(), pagination.getOffset());
}
origin: gocd/gocd

public PipelineStatusModel getPipelineStatus(String pipelineName, String username, OperationResult result) {
  PipelineConfig pipelineConfig = goConfigService.currentCruiseConfig().getPipelineConfigByName(new CaseInsensitiveString(pipelineName));
  if (pipelineConfig == null) {
    result.notFound("Not Found", "Pipeline not found", HealthStateType.general(HealthStateScope.GLOBAL));
    return null;
  }
  if (!securityService.hasViewPermissionForPipeline(Username.valueOf(username), pipelineName)) {
    result.forbidden("Forbidden", NOT_AUTHORIZED_TO_VIEW_PIPELINE, HealthStateType.general(HealthStateScope.forPipeline(pipelineName)));
    return null;
  }
  PipelinePauseInfo pipelinePauseInfo = pipelinePauseService.pipelinePauseInfo(pipelineName);
  boolean isCurrentlyLocked = pipelineLockService.isLocked(pipelineName);
  boolean isSchedulable = schedulingCheckerService.canManuallyTrigger(pipelineConfig, username, new ServerHealthStateOperationResult());
  return new PipelineStatusModel(isCurrentlyLocked, isSchedulable, pipelinePauseInfo);
}
com.thoughtworks.go.server.domainUsernamevalueOf

Popular methods of Username

  • getUsername
  • <init>
  • equals
  • getDisplayName
  • isAnonymous
  • hashCode
  • isGoAgentUser

Popular in Java

  • Updating database using SQL prepared statement
  • getSharedPreferences (Context)
  • runOnUiThread (Activity)
  • onRequestPermissionsResult (Fragment)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now