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


Java PluginName类代码示例

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


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

示例1: CreateBatchUser

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
public CreateBatchUser(@PluginName String pluginName, SchemaFactory<ReviewDb> schema,
					   PluginConfigFactory configFactory, SshKeyCache sshKeyCache, VersionedAuthorizedKeys.Accessor authorizedKeys,
					   AccountCache accountCache, AccountByEmailCache byEmailCache, AccountLoader.Factory infoLoader,
					   GroupsCollection groupsCollection, WorkQueue queue, ThreadLocalRequestContext context,
					   IdentifiedUser.GenericFactory userFactory) {
	this.schema = schema;
	this.sshKeyCache = sshKeyCache;
	this.authorizedKeys = authorizedKeys;
	this.accountCache = accountCache;
	this.byEmailCache = byEmailCache;
	this.infoLoader = infoLoader;
	this.groupsCollection = groupsCollection;
	this.context = context;
	this.userFactory = userFactory;
	pluginConfig = configFactory.getFromGerritConfig(pluginName);
	username = pluginConfig.getString("username", "jenkins");
	sshKey = pluginConfig.getString("sshKey");
	name = pluginConfig.getString("name", "Batch user");
	executor = queue.getDefaultQueue();

	createBatchUserIfNotExistsYet();
}
 
开发者ID:atteo,项目名称:jfactory,代码行数:24,代码来源:CreateBatchUser.java

示例2: CiDataSourceProvider

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
protected CiDataSourceProvider(SitePaths site,
    @PluginName String pluginName,
    @Nullable MetricMaker metrics,
    Context ctx,
    CiDataSourceType dst) {
  File file = site.gerrit_config.toFile();
  FileBasedConfig cfg = new FileBasedConfig(file, FS.DETECTED);
  try {
    cfg.load();
  } catch (IOException | ConfigInvalidException e) {
    throw new ProvisionException(e.getMessage(), e);
  }
  this.config = new PluginConfig(pluginName, cfg);
  this.metrics = metrics;
  this.ctx = ctx;
  this.dst = dst;
}
 
开发者ID:davido,项目名称:gerrit-ci-plugin,代码行数:19,代码来源:CiDataSourceProvider.java

示例3: CasOAuthService

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
CasOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  rootUrl = cfg.getString(InitOAuth.ROOT_URL);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";
  fixLegacyUserId = cfg.getBoolean(InitOAuth.FIX_LEGACY_USER_ID, false);
  service =
      new ServiceBuilder()
          .provider(new CasApi(rootUrl))
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .callback(canonicalWebUrl + "oauth")
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:18,代码来源:CasOAuthService.java

示例4: BitbucketOAuthService

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
BitbucketOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);

  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";
  fixLegacyUserId = cfg.getBoolean(InitOAuth.FIX_LEGACY_USER_ID, false);
  service =
      new ServiceBuilder()
          .provider(BitbucketApi.class)
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .callback(canonicalWebUrl + "oauth")
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:18,代码来源:BitbucketOAuthService.java

示例5: GitLabOAuthService

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
GitLabOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";
  rootUrl = cfg.getString(InitOAuth.ROOT_URL);
  service =
      new ServiceBuilder()
          .provider(new GitLabApi(rootUrl))
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .callback(canonicalWebUrl + "oauth")
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:17,代码来源:GitLabOAuthService.java

示例6: DexOAuthService

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
DexOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";

  rootUrl = cfg.getString(InitOAuth.ROOT_URL);
  domain = cfg.getString(InitOAuth.DOMAIN, null);
  serviceName = cfg.getString(InitOAuth.SERVICE_NAME, "Dex OAuth2");

  service =
      new ServiceBuilder()
          .provider(new DexApi(rootUrl))
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .scope("openid profile email offline_access")
          .callback(canonicalWebUrl + "oauth")
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:22,代码来源:DexOAuthService.java

示例7: FacebookOAuthService

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
FacebookOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {

  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";

  service =
      new ServiceBuilder()
          .provider(FacebookApi.class)
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .callback(canonicalWebUrl + "oauth")
          .scope(SCOPE)
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:19,代码来源:FacebookOAuthService.java

示例8: GitHubOAuthService

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
GitHubOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";
  fixLegacyUserId = cfg.getBoolean(InitOAuth.FIX_LEGACY_USER_ID, false);
  service =
      new ServiceBuilder()
          .provider(GitHub2Api.class)
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .callback(canonicalWebUrl + "oauth")
          .scope(SCOPE)
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:18,代码来源:GitHubOAuthService.java

示例9: KeycloakOAuthService

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
KeycloakOAuthService(
    PluginConfigFactory cfgFactory,
    @PluginName String pluginName,
    @CanonicalWebUrl Provider<String> urlProvider) {
  PluginConfig cfg = cfgFactory.getFromGerritConfig(pluginName + CONFIG_SUFFIX);
  String canonicalWebUrl = CharMatcher.is('/').trimTrailingFrom(urlProvider.get()) + "/";

  String rootUrl = cfg.getString(InitOAuth.ROOT_URL);
  String realm = cfg.getString(InitOAuth.REALM);
  serviceName = cfg.getString(InitOAuth.SERVICE_NAME, "Keycloak OAuth2");

  service =
      new ServiceBuilder()
          .provider(new KeycloakApi(rootUrl, realm))
          .apiKey(cfg.getString(InitOAuth.CLIENT_ID))
          .apiSecret(cfg.getString(InitOAuth.CLIENT_SECRET))
          .scope("openid")
          .callback(canonicalWebUrl + "oauth")
          .build();
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:22,代码来源:KeycloakOAuthService.java

示例10: InitOAuth

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
InitOAuth(ConsoleUI ui, Section.Factory sections, @PluginName String pluginName) {
  this.ui = ui;
  this.googleOAuthProviderSection =
      sections.get(PLUGIN_SECTION, pluginName + GoogleOAuthService.CONFIG_SUFFIX);
  this.githubOAuthProviderSection =
      sections.get(PLUGIN_SECTION, pluginName + GitHubOAuthService.CONFIG_SUFFIX);
  this.bitbucketOAuthProviderSection =
      sections.get(PLUGIN_SECTION, pluginName + BitbucketOAuthService.CONFIG_SUFFIX);
  this.casOAuthProviderSection =
      sections.get(PLUGIN_SECTION, pluginName + CasOAuthService.CONFIG_SUFFIX);
  this.facebookOAuthProviderSection =
      sections.get(PLUGIN_SECTION, pluginName + FacebookOAuthService.CONFIG_SUFFIX);
  this.gitlabOAuthProviderSection =
      sections.get(PLUGIN_SECTION, pluginName + GitLabOAuthService.CONFIG_SUFFIX);
  this.dexOAuthProviderSection =
      sections.get(PLUGIN_SECTION, pluginName + DexOAuthService.CONFIG_SUFFIX);
  this.keycloakOAuthProviderSection =
      sections.get(PLUGIN_SECTION, pluginName + KeycloakOAuthService.CONFIG_SUFFIX);
}
 
开发者ID:davido,项目名称:gerrit-oauth-provider,代码行数:21,代码来源:InitOAuth.java

示例11: configure

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Override
protected void configure() {
  bind(PluginUser.class).toInstance(plugin.getPluginUser());
  bind(String.class).annotatedWith(PluginName.class).toInstance(plugin.getName());
  bind(String.class)
      .annotatedWith(PluginCanonicalWebUrl.class)
      .toInstance(plugin.getPluginCanonicalWebUrl());

  install(
      new LifecycleModule() {
        @Override
        public void configure() {
          PluginMetricMaker metrics =
              new PluginMetricMaker(
                  serverMetrics,
                  MoreObjects.firstNonNull(
                      plugin.getMetricsPrefix(), String.format("plugins/%s/", plugin.getName())));
          bind(MetricMaker.class).toInstance(metrics);
          listener().toInstance(metrics);
        }
      });
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:23,代码来源:ServerPluginInfoModule.java

示例12: GitHubTopMenu

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
public GitHubTopMenu(
    @PluginName String pluginName,
    Provider<CurrentUser> userProvider,
    AuthConfig authConfig,
    GitHubConfig ghConfig) {
  String baseUrl = "/plugins/" + pluginName;
  this.menuEntries =
      Arrays.asList(
          new MenuEntry(
              "GitHub",
              Arrays.asList(
                  getItem("Scope", ghConfig.getScopeSelectionUrl(null)),
                  getItem("Profile", baseUrl + "/static/account.html"),
                  getItem("Repositories", baseUrl + "/static/repositories.html"),
                  getItem("Pull Requests", baseUrl + "/static/pullrequests.html"))));
  this.userProvider = userProvider;
  this.authConfig = authConfig;
}
 
开发者ID:GerritCodeReview,项目名称:plugins_github,代码行数:20,代码来源:GitHubTopMenu.java

示例13: ChangeUpdatedListener

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
ChangeUpdatedListener(final SmartReviewers.Factory smartReviewersFactory,
    final GitRepositoryManager repoManager, final WorkQueue workQueue,
    final IdentifiedUser.GenericFactory identifiedUserFactory,
    final ThreadLocalRequestContext tl,
    final SchemaFactory<ReviewDb> schemaFactory,
    final PluginConfigFactory cfg,
    final @PluginName String pluginName) {
  this.smartReviewersFactory = smartReviewersFactory;
  this.repoManager = repoManager;
  this.workQueue = workQueue;
  this.identifiedUserFactory = identifiedUserFactory;
  this.tl = tl;
  this.schemaFactory = schemaFactory;
  this.cfg = cfg;
  this.pluginName = pluginName;
}
 
开发者ID:Intersec,项目名称:smart-reviewers,代码行数:18,代码来源:ChangeUpdatedListener.java

示例14: Manager

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
public Manager(
    @PluginName final String pluginName,
    @PluginData final File pluginData,
    final DefaultEventWorker defaultEventWorker,
    final EventWorkerFactory eventWorkerFactory,
    final PublisherFactory publisherFactory,
    final PropertiesFactory propFactory,
    final Set<Solver> solvers) {
  this.pluginName = pluginName;
  this.pluginDataDir = pluginData.toPath();
  this.defaultEventWorker = defaultEventWorker;
  this.userEventWorker = eventWorkerFactory.create();
  this.publisherFactory = publisherFactory;
  this.propFactory = propFactory;
  this.solvers = solvers;
}
 
开发者ID:rinrinne,项目名称:gerrit-rabbitmq-plugin,代码行数:18,代码来源:Manager.java

示例15: PluginActivator

import com.google.gerrit.extensions.annotations.PluginName; //导入依赖的package包/类
@Inject
public PluginActivator(@PluginName String pluginName, GerritWicketFilter filter) {
	this.pluginName = pluginName;
	this.filter = filter;
	// Just some string that is unique per plugin instance. This is used ultimately in
	// GerritGitBlitWebApp.newRequestCycleProcessor to expunge stale Java objects attached to the
	// HTTP session by Wicket. They become "stale" in a plugin reload, because they will have
	// been loaded by the class loader of the unloaded plugin instance, but then are accessed
	// by the new plugin instance, which has a new classloader. The result is funny
	// ClassCastExceptions telling you that "GitBlitWebSession cannot be cast to Session" even
	// though, if you look at the source code, GitBlitWebSession very clearly is derived from
	// Session. I think I understand why the GitBlit author, James Moger, has said several times
	// he finds Wicket's stateful model a pain.
	filter.setPluginInstanceKey(Long.toHexString(new SecureRandom().nextLong()) + Long.toHexString(System.nanoTime())
			+ Long.toHexString(System.currentTimeMillis()));
}
 
开发者ID:tomaswolf,项目名称:gerrit-gitblit-plugin,代码行数:17,代码来源:PluginActivator.java


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