当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationUser类代码示例

本文整理汇总了Java中com.atlassian.jira.user.ApplicationUser的典型用法代码示例。如果您正苦于以下问题:Java ApplicationUser类的具体用法?Java ApplicationUser怎么用?Java ApplicationUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ApplicationUser类属于com.atlassian.jira.user包,在下文中一共展示了ApplicationUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addHubWorkflowToJira

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
public JiraWorkflow addHubWorkflowToJira() {
    try {
        JiraWorkflow hubWorkflow = jiraServices.getWorkflowManager()
                .getWorkflow(HubJiraConstants.HUB_JIRA_WORKFLOW);
        if (hubWorkflow == null) {
            final WorkflowDescriptor workflowDescriptor = getWorkflowDescriptorFromResource();
            hubWorkflow = new ConfigurableJiraWorkflow(HubJiraConstants.HUB_JIRA_WORKFLOW, workflowDescriptor,
                    jiraServices.getWorkflowManager());
            final ApplicationUser jiraAppUser = getJiraSystemAdmin();
            if (jiraAppUser == null) {
                logger.error("Could not find any JIRA System Admins to create the workflow.");
                return null;
            }
            jiraServices.getWorkflowManager().createWorkflow(jiraAppUser, hubWorkflow);
            logger.debug("Created the Hub Workflow : " + HubJiraConstants.HUB_JIRA_WORKFLOW);
        }
        return hubWorkflow;
    } catch (final Exception e) {
        logger.error("Failed to add the Hub JIRA worflow.", e);
        settingService.addHubError(e, "addHubWorkflow");
    }
    return null;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:24,代码来源:HubWorkflowSetup.java

示例2: initJiraContext

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
private JiraContext initJiraContext(final String jiraAdminUsername, String jiraIssueCreatorUsername) {
    logger.debug(String.format("Checking JIRA users: Admin: %s; Issue creator: %s", jiraAdminUsername, jiraIssueCreatorUsername));
    if (jiraIssueCreatorUsername == null) {
        logger.warn(String.format(
                "The JIRA Issue Creator user has not been configured, using the admin user (%s) to create issues. This can be changed via the Issue Creation configuration",
                jiraAdminUsername));
        jiraIssueCreatorUsername = jiraAdminUsername;
    }
    final ApplicationUser jiraAdminUser = getJiraUser(jiraAdminUsername);
    final ApplicationUser jiraIssueCreatorUser = getJiraUser(jiraIssueCreatorUsername);
    if ((jiraAdminUser == null) || (jiraIssueCreatorUser == null)) {
        return null;
    }
    final JiraContext jiraContext = new JiraContext(jiraAdminUser, jiraIssueCreatorUser);
    return jiraContext;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:17,代码来源:JiraTaskTimed.java

示例3: hasAdminPermission

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
public boolean hasAdminPermission() {
    ApplicationUser user = getLoggedInUser();
    if (user == null) {
        return false;
    }
    return globalPermissionManager.hasPermission(GlobalPermissionKey.ADMINISTER, user);
}
 
开发者ID:AndreyVMarkelov,项目名称:jira-prometheus-exporter,代码行数:8,代码来源:SecureTokenConfigAction.java

示例4: getJiraSystemAdmin

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
private ApplicationUser getJiraSystemAdmin() {
    final Collection<ApplicationUser> jiraSysAdmins = getJiraServices().getUserUtil().getJiraSystemAdministrators();
    if (jiraSysAdmins == null || jiraSysAdmins.isEmpty()) {
        return null;
    }
    return jiraSysAdmins.iterator().next();
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:8,代码来源:HubWorkflowSetup.java

示例5: updateIssue

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
private Issue updateIssue(final MutableIssue issueToUpdate, final AssignValidationResult assignValidationResult, final ApplicationUser userMakingChange, final String assigneeId) {
    issueToUpdate.setAssigneeId(assigneeId);
    final UpdateIssueRequest issueUpdate = UpdateIssueRequest.builder().eventDispatchOption(EventDispatchOption.ISSUE_UPDATED).sendMail(false).build();
    logger.debug("Updating issue with assigned user ID: " + assigneeId);
    final Issue updatedIssue = jiraServices.getIssueManager().updateIssue(userMakingChange, issueToUpdate, issueUpdate);
    return updatedIssue;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:8,代码来源:JiraIssueHandler.java

示例6: getJiraUser

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
private ApplicationUser getJiraUser(final String jiraUsername) {
    final UserManager jiraUserManager = jiraServices.getUserManager();
    final ApplicationUser jiraUser = jiraUserManager.getUserByName(jiraUsername);
    if (jiraUser == null) {
        logger.error(String.format("Could not find the JIRA user %s", jiraUsername));
        return null;
    }
    return jiraUser;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:10,代码来源:IssueTrackerTask.java

示例7: printFields

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
public static void printFields(final HubJiraLogger logger, final FieldManager fieldManager, final ApplicationUser user, final Issue issue) {
    try {
        final Set<NavigableField> navFields = fieldManager.getAllAvailableNavigableFields();
        for (final NavigableField field : navFields) {
            logger.debug("NavigableField: Id: " + field.getId() + "; Name: " + field.getName() + "; nameKey: " + field.getNameKey());
        }
    } catch (final Exception e) {
        logger.debug("Error getting fields: " + e.getMessage());
    }
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:11,代码来源:JiraFieldUtils.java

示例8: getJiraSystemAdministrators

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@Override
public Collection<ApplicationUser> getJiraSystemAdministrators() {
    if (user != null) {
        final List<ApplicationUser> systemAdmins = new ArrayList<>();
        systemAdmins.add(user);
        return systemAdmins;
    }
    return null;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:10,代码来源:UserUtilMock.java

示例9: createIssue

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
private Issue createIssue(final Long id, final Long projectId, final String projectName, final Status status, final ApplicationUser assignee) {
    final IssueMock issue = new IssueMock();
    issue.setId(id);
    final ProjectMock project = new ProjectMock();
    project.setId(projectId);
    project.setName(projectName);
    issue.setProject(project);
    issue.setStatusObject(status);
    issue.setDescription(ISSUE_DESCRIPTION);
    issue.setCreated(new Timestamp(System.currentTimeMillis()));
    issue.setUpdated(new Timestamp(System.currentTimeMillis()));
    issue.setAssignee(assignee);

    return issue;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:16,代码来源:IssueEventListenerTest.java

示例10: validateClone

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@Override
public CloneValidationResult validateClone(final ApplicationUser arg0, final Issue arg1, final String arg2, final boolean arg3, final boolean arg4,
        final boolean arg5,
        final Map<CustomField, Optional<Boolean>> arg6) {
    // TODO Auto-generated method stub
    return null;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:8,代码来源:IssueServiceMock.java

示例11: onLoginEvent

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@EventListener
public void onLoginEvent(LoginEvent loginEvent) {
    ApplicationUser applicationUser = loginEvent.getUser();
    metricCollector.userLoginCounter((applicationUser != null) ? applicationUser.getUsername() : "");
}
 
开发者ID:AndreyVMarkelov,项目名称:jira-prometheus-exporter,代码行数:6,代码来源:MetricListener.java

示例12: onLogoutEvent

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@EventListener
public void onLogoutEvent(LogoutEvent logoutEvent) {
    ApplicationUser applicationUser = logoutEvent.getUser();
    metricCollector.userLogoutCounter((applicationUser != null) ? applicationUser.getUsername() : "");
}
 
开发者ID:AndreyVMarkelov,项目名称:jira-prometheus-exporter,代码行数:6,代码来源:MetricListener.java

示例13: getAssignee

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@Override
public ApplicationUser getAssignee() {
    return assignee;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:5,代码来源:IssueMock.java

示例14: hasPermissionToView

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@Override
public boolean hasPermissionToView(final ApplicationUser arg0, final Type arg1, final String arg2) {
    // TODO Auto-generated method stub
    return false;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:6,代码来源:AvatarManagerMock.java

示例15: hasPermissionToEdit

import com.atlassian.jira.user.ApplicationUser; //导入依赖的package包/类
@Override
public boolean hasPermissionToEdit(final ApplicationUser arg0, final Project arg1) {
    return false;
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:5,代码来源:AvatarManagerMock.java


注:本文中的com.atlassian.jira.user.ApplicationUser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。