default ExtensionFeatureDescription getFeatureDescription() { return new ExtensionFeatureDescription( getId(), getName(), getDescription(), getVersion(), getOptions() ); }
public ArtifactoryExtensionFeature() { super("artifactory", "Artifactory", "Support for Artifactory", ExtensionFeatureOptions.DEFAULT.withGui(true)); } }
public ExtensionCycleException(List<List<String>> cycles) { super("There is a cycle of dependencies between the extensions:%n%s", displayCycles(cycles)); }
@Autowired public StashExtensionFeature(GitExtensionFeature gitExtensionFeature) { super("stash", "BitBucket", "Support for Atlassian BitBucket (Cloud & Server)", ExtensionFeatureOptions.DEFAULT .withGui(true) .withDependency(gitExtensionFeature) ); } }
/** * Startup: loads the extensions & features from the application context. * <p> * This cannot be done at construction time because of dependency cycle between * some extensions that need access to the extension manager. */ @Override public void start() { logger.info("[extensions] Loading the extensions"); extensions = applicationContext.getBeansOfType(Extension.class).values(); Collection<? extends ExtensionFeature> extensionFeatures = applicationContext.getBeansOfType(ExtensionFeature.class).values(); logger.info("[extensions] Number of loaded extension features: {}", extensionFeatures.size()); logger.info("[extensions] Number of loaded extensions: {}", extensions.size()); logger.info("[extensions] Extension features:"); for (ExtensionFeature feature : extensionFeatures) { logger.info("[extensions] * {} [{}]", feature.getName(), feature.getId()); } // Detects cycles getExtensionList(); }
g.addVertex(extensionFeatureDescription.getId()) ); source.getOptions().getDependencies().forEach(target -> g.addEdge(target, source.getId()) )); throw new ExtensionCycleException(cycles); return new ExtensionList( order.stream() .map(index::get)
/** * Adds a dependency */ public ExtensionFeatureOptions withDependency(ExtensionFeature feature) { Set<String> existing = this.dependencies; Set<String> newDependencies; if (existing == null) { newDependencies = new HashSet<>(); } else { newDependencies = new HashSet<>(existing); } newDependencies.add(feature.getId()); return withDependencies(newDependencies); }
/** * Given an action with a relative URI, gets a new Action with a fully resolved URI */ default Action resolveActionWithExtension(Extension extension, Action action) { return action.withUri( String.format("extension/%s/%s", extension.getFeature().getId(), action.getUri()) ); } }
/** * Extension feature description */ public ExtensionFeatureDescription getFeature() { return decorator.getFeature().getFeatureDescription(); }
@Autowired public GitLabExtensionFeature(GitExtensionFeature gitExtensionFeature) { super("gitlab", "GitLab", "Support for GitLab", ExtensionFeatureOptions.DEFAULT .withGui(true) .withDependency(gitExtensionFeature) ); } }
public LDAPExtensionFeature() { super("ldap", "LDAP", "LDAP support for authentication and authorisations", ExtensionFeatureOptions.DEFAULT.withGui(true)); } }
/** * Extension feature */ public ExtensionFeatureDescription getFeature() { return extension.getFeature().getFeatureDescription(); }
@Autowired public SVNExtensionFeature(SCMExtensionFeature scmExtensionFeature) { super("svn", "Subversion", "Support for Subversion", ExtensionFeatureOptions.DEFAULT .withGui(true) .withDependency(scmExtensionFeature) ); } }
public CombinedIssueServiceExtensionFeature() { super("combined", "Combined issue service", "This issue service allows to combine several issue services together", ExtensionFeatureOptions.DEFAULT.withGui(true)); } }
public static <T> PropertyTypeDescriptor of(PropertyType<T> type) { return new PropertyTypeDescriptor( type.getFeature().getFeatureDescription(), type.getClass().getName(), type.getName(), type.getDescription() ); }
@Autowired public GitHubExtensionFeature(GitExtensionFeature gitExtensionFeature) { super("github", "GitHub", "Support for GitHub", ExtensionFeatureOptions.DEFAULT .withGui(true) .withDependency(gitExtensionFeature) ); } }
public JenkinsExtensionFeature() { super("jenkins", "Jenkins", "Provides links with Jenkins", ExtensionFeatureOptions.DEFAULT.withGui(true)); }
public GeneralExtensionFeature() { super("general", "General", "Core extensions", ExtensionFeatureOptions.DEFAULT.withGui(true)); }
public SCMExtensionFeature() { super("scm", "SCM", "SCM common code", ExtensionFeatureOptions.DEFAULT.withGui(true)); } }
public JIRAExtensionFeature() { super("jira", "JIRA", "Provides links with JIRA", ExtensionFeatureOptions.DEFAULT.withGui(true)); }