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


Java ComponentAccessor.getOSGiComponentInstanceOfType方法代码示例

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


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

示例1: checkWebSudo

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
protected boolean checkWebSudo(final HttpServletRequest req, final HttpServletResponse resp) {
  if (!isWebSudoNecessary()) {
    return true;
  }

  WebSudoManager webSudoManager =
      ComponentAccessor.getOSGiComponentInstanceOfType(WebSudoManager.class);

  if (!webSudoManager.canExecuteRequest(req)) {
    if ("XMLHttpRequest".equals(req.getHeader("X-Requested-With"))) {
      webSudoManager.enforceWebSudoProtection(req, new AjaxRedirectCatchServletResponse(resp));
    } else {
      webSudoManager.enforceWebSudoProtection(req, resp);
    }
    return false;
  }
  return true;
}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:19,代码来源:AbstractPageServlet.java

示例2: getProjectJamTimestamp

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
public static Long getProjectJamTimestamp(Project project) {
  AOWrapper aoWrapper = ComponentAccessor.getOSGiComponentInstanceOfType(AOWrapper.class);
  ActiveObjects activeObjects = aoWrapper.getActiveObjects();

  JamPluginTimestamp[] mappings = activeObjects.find(JamPluginTimestamp.class, "PROJECT_ID = ?", project.getId());
  if ( mappings.length > 0) {
    return mappings[0].getJamTimestamp();
  }

  Long now = System.currentTimeMillis();
  activeObjects.create(
      JamPluginTimestamp.class,
      new DBParam("JAM_TIMESTAMP", now),
      new DBParam("PROJECT_ID", project.getId())
  );

  return now;
}
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:19,代码来源:JamClient.java

示例3: AbstractPageServlet

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
/**
 * Initializes the compiled page template.
 */
public AbstractPageServlet() {
  try {
    querydslSupport = new QuerydslSupportImpl();
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
  transactionTemplate =
      ComponentAccessor.getOSGiComponentInstanceOfType(TransactionTemplate.class);

  ClassLoader classLoader = this.getClass().getClassLoader();
  pageTemplate = new LocalizedTemplate(getTemplateBase(), classLoader);
}
 
开发者ID:everit-org,项目名称:jira-hr-admin,代码行数:16,代码来源:AbstractPageServlet.java

示例4: ServiceProvider

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
private ServiceProvider(final String clientID, final String clientSecret, final String providerID, final String x509Cert, final PublicKey publicKey)
{
    this.clientID = clientID;
    this.clientSecret = clientSecret;
    this.providerID = providerID;
    this.publicKey = publicKey;
    this.x509Cert = x509Cert;
    
    AOWrapper aoWrapper = ComponentAccessor.getOSGiComponentInstanceOfType(AOWrapper.class);
    activeObjects = aoWrapper.getActiveObjects();
}
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:12,代码来源:ServiceProvider.java

示例5: JamConsumer

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
private JamConsumer(final ApplicationLink applicationLink, final String clientID, final String providerID, final X509Certificate certificate, final PrivateKey privateKey, final String certificateString, final String privateKeyString)
{
    this.applicationLink = applicationLink;
    this.tokenURL        = applicationLink.getRpcUrl().toString() + ACCESS_TOKEN_URL;
    
    this.clientID    = clientID;
    this.providerID  = providerID;
    this.certificate = certificate;
    this.privateKey  = privateKey;
    this.certificateString = certificateString;
    this.privateKeyString  = privateKeyString;

    AOWrapper aoWrapper = ComponentAccessor.getOSGiComponentInstanceOfType(AOWrapper.class);
    activeObjects = aoWrapper.getActiveObjects();
}
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:16,代码来源:JamConsumer.java

示例6: JamClient

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
public JamClient(ApplicationLinkService applicationLinkService,
                 HostApplication hostApplication,
                 IssueManager issueManager) {
   this.applicationLinkService = applicationLinkService;
   this.hostApplication = hostApplication;
   this.issueManager = issueManager;

   jamLink = this.applicationLinkService.getPrimaryApplicationLink(JamApplicationType.class);
   jiraODataURL = this.hostApplication.getBaseUrl().toString() + "/plugins/servlet/sapjam/api/OData/";
   
   AOWrapper aoWrapper = ComponentAccessor.getOSGiComponentInstanceOfType(AOWrapper.class);
   activeObjects = aoWrapper.getActiveObjects();

   i18n = new I18nBean();
}
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:16,代码来源:JamClient.java

示例7: authenticate

import com.atlassian.jira.component.ComponentAccessor; //导入方法依赖的package包/类
private void authenticate(HttpServletRequest request) throws ODataException
{
       final String authorization = request.getHeader("Authorization");
       
       if (authorization != null && authorization.startsWith("Bearer "))
       {
           String token = authorization.substring("Bearer".length()).trim();

           // Initialize JIRA services
           AuthenticationConfigurationManager authenticationConfigurationManager = ComponentAccessor.getOSGiComponentInstanceOfType(AuthenticationConfigurationManager.class);
           ApplicationLinkService applicationLinkService = ComponentAccessor.getOSGiComponentInstanceOfType(ApplicationLinkService.class);
           
           JamConsumerProviderStore jamConsumerProviderStore = new JamConsumerProviderStore(authenticationConfigurationManager);
           ServiceProvider jamServiceProvider = jamConsumerProviderStore.getServiceProvider(applicationLinkService.getPrimaryApplicationLink(JamApplicationType.class));
           
           if ( jamServiceProvider != null )
           {
               OAuth2Token jamToken = jamServiceProvider.getTokenFromBearerToken(token);
               if ( jamToken != null ) {
                   User user = ComponentAccessor.getUserUtil().getUserObject(jamToken.getUsername());
                   if ( user != null ) {
                       // Set the current user context to this user!
                       ComponentAccessor.getJiraAuthenticationContext().setLoggedInUser(user);
                       return;
                   }
               }
           }
       }
   	throw new ODataUnauthorizedException();
   }
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:31,代码来源:JiraODataProcessor.java


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