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


Java ComponentAccessor.getComponentOfType方法代码示例

本文整理汇总了Java中com.atlassian.jira.component.ComponentAccessor.getComponentOfType方法的典型用法代码示例。如果您正苦于以下问题:Java ComponentAccessor.getComponentOfType方法的具体用法?Java ComponentAccessor.getComponentOfType怎么用?Java ComponentAccessor.getComponentOfType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.atlassian.jira.component.ComponentAccessor的用法示例。


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

示例1: shouldDisplay

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
public boolean shouldDisplay(User user, Issue issue, JiraHelper jiraHelper) {
  ProjectRoleManager roleManager = (ProjectRoleManager)ComponentAccessor.getComponentOfType(ProjectRoleManager.class); 
  Collection<ProjectRole> roles = roleManager.getProjectRoles(user, jiraHelper.getProjectObject());

  // Check if the user has the required role.
  boolean hasJamRole = false;
  for (ProjectRole role : roles) {
    if (role.getName().equals(JamUser)) {
      hasJamRole = true;
      break;
    }
  }

  if (!hasJamRole) {
    return false;
  }

  // Check if we are filtering based on creation time or not.
  if (displayIfNewerThanJam) {
    Long jamTs = JamClient.getProjectJamTimestamp(issue.getProjectObject());
    Long issueTs = issue.getCreated().getTime();
    return (jamTs <= issueTs);
  }

  return true;
}
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:27,代码来源:CanAccessJamPluginCondition.java

示例2: doExecute

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
@Override
protected String doExecute() throws Exception {
    if (request.getMethod().equals("POST")) {
        XsrfTokenGenerator xsrfTokenGenerator = ComponentAccessor.getComponentOfType(XsrfTokenGenerator.class);
        String token = request.getParameter(XsrfTokenGenerator.TOKEN_WEB_PARAMETER_KEY) != null ? request.getParameter(XsrfTokenGenerator.TOKEN_WEB_PARAMETER_KEY) : "";

        if (xsrfTokenGenerator.validateToken(request, token)) {
            String appId = request.getParameter("appId") != null ? request.getParameter("appId") : "";
            String secret = request.getParameter("secret") != null ? request.getParameter("secret") : "";

            if (!appId.matches("[a-zA-Z0-9]+")) {
                setError(getError() + i18nResolver.getText(APP_ID_ERROR_1));
            } else if (appId.length() != 20) {
                setError(getError() + i18nResolver.getText(APP_ID_ERROR_2));
            } else {
                if (!secret.matches("[a-zA-Z0-9]+")) {
                    setError(getError() + i18nResolver.getText(SECRET_ERROR_1));
                } else if (secret.length() != 40) {
                    setError(getError() + i18nResolver.getText(SECRET_ERROR_2));
                } else {
                    if (verifyAppIdAndSecret(appId, secret)) {
                        modelo.setAppId(appId);
                        modelo.setSecret(secret);
                        setMessage(i18nResolver.getText(SUCCES_MESSAGE));
                    } else {
                        setError(getError() + i18nResolver.getText(INVALID_CREDENTIALS));
                    }
                }
            }
        } else {
            setError(getError() + i18nResolver.getText(CSRF_ERROR));
        }
    }
    return SUCCESS;
}
 
开发者ID:ElevenPaths,项目名称:latch-plugin-jira,代码行数:36,代码来源:Admin.java

示例3: doExecute

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
@Override
protected String doExecute() throws Exception {
    if (request.getMethod().equals("POST")) {
        XsrfTokenGenerator xsrfTokenGenerator = ComponentAccessor.getComponentOfType(XsrfTokenGenerator.class);
        String token = request.getParameter(XsrfTokenGenerator.TOKEN_WEB_PARAMETER_KEY) != null ? request.getParameter(XsrfTokenGenerator.TOKEN_WEB_PARAMETER_KEY) : "";

        if (xsrfTokenGenerator.validateToken(request, token)) {
            Utilities.redirectTo(LATCH_PAIR);
        } else {
            setError(getError() + i18nResolver.getText(CSRF_ERROR));
        }
    }
    return SUCCESS;
}
 
开发者ID:ElevenPaths,项目名称:latch-plugin-jira,代码行数:15,代码来源:Index.java

示例4: updateUserAttributes

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
private void updateUserAttributes(ApplicationUser user) {
	LoginStore loginStore = ComponentAccessor.getComponentOfType(LoginStore.class);
	loginStore.recordLoginAttempt(user, true);
	try {
		ComponentAccessor.getCrowdService().setUserAttribute(user.getDirectoryUser(), AUTO_GROUPS_ATTR, "true");
	} catch (OperationNotPermittedException e) {
		log.warn("Could not set autoGroupsAdded value to user " + user.getName());
	}
}
 
开发者ID:Multimedia-Business-Services,项目名称:jira-shibboleth-connector,代码行数:10,代码来源:ShibbolethAuthenticator.java

示例5: getPropertyService

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
public IssuePropertyService getPropertyService() {
    return ComponentAccessor.getComponentOfType(IssuePropertyService.class);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:4,代码来源:JiraServices.java

示例6: getJsonEntityPropertyManager

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
public JsonEntityPropertyManager getJsonEntityPropertyManager() {
    return ComponentAccessor.getComponentOfType(JsonEntityPropertyManager.class);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:4,代码来源:JiraServices.java

示例7: getFieldScreenSchemeManager

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
public FieldScreenSchemeManager getFieldScreenSchemeManager() {
    return ComponentAccessor.getComponentOfType(FieldScreenSchemeManager.class);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:4,代码来源:JiraServices.java

示例8: getLabelManager

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
public LabelManager getLabelManager() {
    return ComponentAccessor.getComponentOfType(LabelManager.class);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:4,代码来源:JiraServices.java

示例9: getProjectPropertyService

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
public ProjectPropertyService getProjectPropertyService() {
    return ComponentAccessor.getComponentOfType(ProjectPropertyService.class);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:4,代码来源:JiraServices.java

示例10: doExecute

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
@Override
protected String doExecute() throws Exception {
	if (request.getMethod().equals("POST")) {
		XsrfTokenGenerator xsrfTokenGenerator = ComponentAccessor.getComponentOfType(XsrfTokenGenerator.class);
		String token = request.getParameter(XsrfTokenGenerator.TOKEN_WEB_PARAMETER_KEY) != null ? request.getParameter(XsrfTokenGenerator.TOKEN_WEB_PARAMETER_KEY) : "";

		if (xsrfTokenGenerator.validateToken(request, token)) {
			String username = Utilities.getUsername(jiraAuthenticationContext);
			String accountId = modelo.getAccountId(username);

			if (accountId != null) {
				String appId = modelo.getAppId();
				String secret = modelo.getSecret();
				if (appId != null && secret != null) {
					LatchApp latch = new LatchApp(appId, secret);
					LatchResponse unpairResponse = null;
					try {
						unpairResponse = latch.unpair(accountId);
					} catch (NullPointerException ignored) {
					}
					JsonObject jObject;
					if (unpairResponse != null) {
						jObject = unpairResponse.getData();
						if (jObject != null) {
							modelo.deleteAccountId(username);
						} else {
							com.elevenpaths.latch.Error error = unpairResponse.getError();
							if (error != null) {
								if (error.getCode() == 102) {
									setError(getError() + i18nResolver.getText(UNPAIR_ERROR_CONF));
								}
							}
						}
					}
					modelo.deleteAccountId(username);
				} else {
					setError(getError() + i18nResolver.getText(UNPAIR_ERROR_CONF));
				}
			}
			Utilities.redirectTo(LATCH_INDEX);
           }else {
			setError(getError() + i18nResolver.getText(CSRF_ERROR));
		}
	}
	return SUCCESS;
}
 
开发者ID:ElevenPaths,项目名称:latch-plugin-jira,代码行数:47,代码来源:Unpair.java


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