本文整理汇总了Java中com.atlassian.sal.api.pluginsettings.PluginSettings.get方法的典型用法代码示例。如果您正苦于以下问题:Java PluginSettings.get方法的具体用法?Java PluginSettings.get怎么用?Java PluginSettings.get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.atlassian.sal.api.pluginsettings.PluginSettings
的用法示例。
在下文中一共展示了PluginSettings.get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doGet
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
String username = userManager.getRemoteUsername(request);
if (username == null || !userManager.isSystemAdmin(username))
{
SettingsManager settingsManager = (SettingsManager) ContainerManager.getComponent("settingsManager");
String baseUrl = settingsManager.getGlobalSettings().getBaseUrl();
response.sendRedirect(baseUrl);
return;
}
PluginSettings pluginSettings = pluginSettingsFactory.createGlobalSettings();
String apiUrl = (String) pluginSettings.get("onlyoffice.apiUrl");
if (apiUrl == null || apiUrl.isEmpty())
{
apiUrl = "";
}
response.setContentType("text/html;charset=UTF-8");
PrintWriter writer = response.getWriter();
writer.write(getTemplate(apiUrl));
}
示例2: execute
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
@Override
public void execute(@NotNull final StageExecution stageExecution, @NotNull final BuildContext buildContext) {
PluginSettings pluginSettings = this.pluginSettingsFactory.createGlobalSettings();
String api_id = (String) pluginSettings.get(AdminServlet.API_ID);
String api_secret = (String) pluginSettings.get(AdminServlet.API_SECRET);
String serverUrl = (String) pluginSettings.get(AdminServlet.URL);
buildContext.getBuildDefinition().getTaskDefinitions().get(0).getPluginKey();
List<TaskDefinition> tds = buildContext.getBuildDefinition().getTaskDefinitions();
for (TaskDefinition d : tds) {
if (d.getPluginKey().equals(Constants.PLUGIN_KEY)) {
Map<String, String> conf = d.getConfiguration();
conf.put(AdminServlet.API_ID, api_id);
conf.put(AdminServlet.API_SECRET, api_secret);
conf.put(AdminServlet.URL, serverUrl);
}
}
}
示例3: populateContextForEdit
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
/**
* from backend to view
*/
public void populateContextForEdit(Map<String, Object> context, TaskDefinition taskDefinition) {
super.populateContextForEdit(context, taskDefinition);
PluginSettings pluginSettings = this.pluginSettingsFactory.createGlobalSettings();
String psai = (String) pluginSettings.get(AdminServlet.API_ID);
String psas = (String) pluginSettings.get(AdminServlet.API_SECRET);
String pssu = (String) pluginSettings.get(AdminServlet.URL);
Map<String, String> config = taskDefinition.getConfiguration();
context.put(AdminServlet.API_ID, psai);
context.put(AdminServlet.API_SECRET, psas);
context.put(AdminServlet.URL, psai);
context.put(Constants.SETTINGS_SELECTED_TEST_ID, config.get(Constants.SETTINGS_SELECTED_TEST_ID));
context.put(Constants.SETTINGS_NOTES, config.get(Constants.SETTINGS_NOTES));
context.put(Constants.SETTINGS_JUNIT_REPORT, config.get(Constants.SETTINGS_JUNIT_REPORT));
context.put(Constants.SETTINGS_JTL_REPORT, config.get(Constants.SETTINGS_JTL_REPORT));
context.put(Constants.SETTINGS_JMETER_PROPERTIES, config.get(Constants.SETTINGS_JMETER_PROPERTIES));
context.put(Constants.SETTINGS_JTL_PATH, config.get(Constants.SETTINGS_JTL_PATH));
context.put(Constants.SETTINGS_JUNIT_PATH, config.get(Constants.SETTINGS_JUNIT_PATH));
UserNotifier serverUserNotifier = new ServerUserNotifier();
Logger logger = new ServerLogger();
utils = new BambooBzmUtils(psai, psas, pssu, pssu, serverUserNotifier, logger);
logger.info("BlazeMeter task is opened for configuration.");
fillContextWithTests(context);
}
示例4: loadRepositoriesFromJiraProperties
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
/**
* Creates all GitManagers from stored configuration.
*/
@SuppressWarnings("unchecked")
private void loadRepositoriesFromJiraProperties() {
final PluginSettings globalSettings = pluginSettingsFactory.createGlobalSettings();
List<String> repositoryList = (List<String>)globalSettings.get(SETTINGS_REPOSITORY_LIST);
// New installation, settings don't exist yet
if (repositoryList == null) {
repositoryList = new ArrayList<String>();
globalSettings.put(SETTINGS_REPOSITORY_LIST, repositoryList);
}
for (final String repositoryId : repositoryList) {
final PluginSettings repositorySettings = pluginSettingsFactory.createSettingsForKey(repositoryId);
createRepositoryFromPropertySet(parseRepositoryId(repositoryId),
(Properties)repositorySettings.get(SETTINGS_REPOSITORY_VALUES));
}
}
示例5: saveRepository
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void saveRepository(final AbstractRepository repository) {
Validate.notNull(repository, "repository must not be null");
final Properties properties = new Properties();
properties.setProperty(PROPERTY_TYPE, RepositoryType.fromRepository(repository).name());
repository.saveToProperties(properties);
// Save identifier within global settings
final PluginSettings globalSettings = pluginSettingsFactory.createGlobalSettings();
@SuppressWarnings("unchecked")
final List<String> repositoryList = (List<String>)globalSettings.get(SETTINGS_REPOSITORY_LIST);
repositoryList.remove(String.valueOf(repository.getId()));
repositoryList.add(String.valueOf(repository.getId()));
globalSettings.put(SETTINGS_REPOSITORY_LIST, repositoryList);
// Save actual values within keyed settings
final PluginSettings repositorySettings = pluginSettingsFactory.createSettingsForKey(String.valueOf(repository.getId()));
repositorySettings.put(SETTINGS_REPOSITORY_VALUES, properties);
}
示例6: isUserAuthorized
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
private boolean isUserAuthorized(final HttpServletRequest request) {
final String username = userManager.getRemoteUsername(request);
if (username == null) {
return false;
}
if (userManager.isSystemAdmin(username)) {
return true;
}
final PluginSettings settings = pluginSettingsFactory.createGlobalSettings();
final String hubJiraGroupsString = (String) settings.get(HubConfigKeys.HUB_CONFIG_GROUPS);
if (StringUtils.isNotBlank(hubJiraGroupsString)) {
final String[] hubJiraGroups = hubJiraGroupsString.split(",");
boolean userIsInGroups = false;
for (final String hubJiraGroup : hubJiraGroups) {
if (userManager.isUserInGroup(username, hubJiraGroup.trim())) {
userIsInGroups = true;
break;
}
}
if (userIsInGroups) {
return true;
}
}
return false;
}
示例7: isUserAuthorized
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
private boolean isUserAuthorized(final HttpServletRequest request) {
final String username = userManager.getRemoteUsername(request);
if (username == null) {
return false;
}
if (userManager.isSystemAdmin(username)) {
return true;
}
final PluginSettings settings = pluginSettingsFactory.createGlobalSettings();
final String oldHubJiraGroupsString = (String) settings.get(HubJiraConfigKeys.HUB_CONFIG_JIRA_GROUPS);
final String hubJiraGroupsString;
if (StringUtils.isNotBlank(oldHubJiraGroupsString)) {
hubJiraGroupsString = oldHubJiraGroupsString;
} else {
hubJiraGroupsString = (String) settings.get(HubJiraConfigKeys.HUB_CONFIG_GROUPS);
}
if (StringUtils.isNotBlank(hubJiraGroupsString)) {
final String[] hubJiraGroups = hubJiraGroupsString.split(",");
boolean userIsInGroups = false;
for (final String hubJiraGroup : hubJiraGroups) {
if (userManager.isUserInGroup(username, hubJiraGroup.trim())) {
userIsInGroups = true;
break;
}
}
if (userIsInGroups) {
return true;
}
}
return false;
}
示例8: getIntervalMillisec
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
private long getIntervalMillisec() {
final PluginSettings settings = pluginSettingsFactory.createGlobalSettings();
if (settings == null) {
logger.error("Unable to get plugin settings");
return DEFAULT_INTERVAL_MILLISEC;
}
final String intervalString = (String) settings.get(HubJiraConfigKeys.HUB_CONFIG_JIRA_INTERVAL_BETWEEN_CHECKS);
if (intervalString == null) {
logger.error("Unable to get interval from plugin settings");
return DEFAULT_INTERVAL_MILLISEC;
}
int intervalMinutes;
try {
intervalMinutes = Integer.parseInt(intervalString);
} catch (final NumberFormatException e) {
logger.error("Unable to convert interval string '" + intervalString + "' to an integer");
return DEFAULT_INTERVAL_MILLISEC;
}
if (intervalMinutes < 1) {
logger.warn("Invalid interval string; setting interval to 1 minute");
intervalMinutes = 1;
}
logger.info("Interval in minutes: " + intervalMinutes);
// Lop off 30 seconds to give the task room to run. Otherwise, the
// runtime
// of the task pushes the next scheduled runtime out beyond the targeted
// once-a-minute opportunity to run
final long intervalSeconds = (intervalMinutes * 60) - 30;
final long intervalMillisec = intervalSeconds * 1000;
return intervalMillisec;
}
示例9: removeBitbucketIssueMappings
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
private void removeBitbucketIssueMappings(String projectKey, String repositoryUrl)
{
log.debug(" === removing issue mappings for Bitbucket repository {} === ", repositoryUrl);
PluginSettings ps = pluginSettingsFactory.createSettingsForKey(projectKey);
ArrayList<String> issueIds = (ArrayList<String>) ps.get("bitbucketIssueIDs" + repositoryUrl);
if (issueIds != null)
{
for (String issueId : issueIds)
{
ps.remove("bitbucketIssueCommitArray" + issueId);
}
}
}
示例10: removeGithubIssueMappings
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
private void removeGithubIssueMappings(String projectKey, String repositoryUrl)
{
log.debug(" === removing issue mappings for GitHub repository {} === ", repositoryUrl);
PluginSettings ps = pluginSettingsFactory.createSettingsForKey(projectKey);
ArrayList<String> issueIds = (ArrayList<String>) ps.get("githubIssueIDs" + repositoryUrl);
if (issueIds != null)
{
for (String issueId : issueIds)
{
ps.remove("githubIssueCommitArray" + issueId);
}
}
}
示例11: getUserList
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
/**
* Returns the list of users with config data in the system
*
* @return
*/
@SuppressWarnings("unchecked")
private List<String> getUserList() {
PluginSettings settings = pluginSettingsFactory.createGlobalSettings();
List<String> list = (List<String>) settings.get(USER_LIST);
return list == null ? Lists.<String>newArrayList() : list;
}
示例12: getIrcServerHost
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
private String getIrcServerHost(PluginSettings settings) // {{{
{
String ircServerHost = (String)settings.get(
IrcAdminConfig.class.getName() + ".ircServerHost"
);
if (ircServerHost == null || ircServerHost.equals(""))
{
return "127.0.0.1";
}
return ircServerHost;
}
示例13: getIrcServerPassword
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
private String getIrcServerPassword(PluginSettings settings) // {{{
{
String ircServerPassword = (String)settings.get(
IrcAdminConfig.class.getName() + ".ircServerPassword"
);
if (ircServerPassword == null || ircServerPassword.equals(""))
{
return null;
}
return ircServerPassword;
}
示例14: getIrcServerPort
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
private Integer getIrcServerPort(PluginSettings settings) // {{{
{
String ircServerPort = (String) settings.get(IrcAdminConfig.class.getName() + ".ircServerPort");
if (ircServerPort == null || ircServerPort.equals(""))
{
return Integer.parseInt("6667");
}
return Integer.parseInt(ircServerPort);
}
示例15: getIrcServerNick
import com.atlassian.sal.api.pluginsettings.PluginSettings; //导入方法依赖的package包/类
private String getIrcServerNick(PluginSettings settings) // {{{
{
String ircServerNick = (String)settings.get(
IrcAdminConfig.class.getName() + ".ircServerNick"
);
if (ircServerNick == null || ircServerNick.equals(""))
{
return "jira";
}
return ircServerNick;
}