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


Java SUser.getPropertyValue方法代码示例

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


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

示例1: populateCommits

import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
private void populateCommits(SRunningBuild sRunningBuild) {
     List<SVcsModification> changes = sRunningBuild.getContainingChanges();
     if(changes == null){
         return;
     }

     for(SVcsModification change : changes){
Collection<SUser> committers = change.getCommitters();
String msteamsUserName = null;
if(committers != null && !committers.isEmpty()){
	SUser committer = committers.iterator().next();
	msteamsUserName = committer.getPropertyValue(MsTeamsNotificator.USERNAME_KEY);
	Loggers.ACTIVITIES.debug("Resolved committer " + change.getUserName() + " to MsTeams User " + msteamsUserName);
}
commits.add(new Commit(change.getVersion(), change.getDescription(), change.getUserName(), msteamsUserName));
     }
 }
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:18,代码来源:MsTeamsNotificationPayloadContent.java

示例2: createNotification

import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
private MsTeamsNotification createNotification(SUser sUser){
    MsTeamsNotification notification = notificationFactory.getMsTeamsNotification();
    String userName = sUser.getPropertyValue(USERNAME_KEY);
    if(userName.substring(0,1) == "@"){
        userName = userName.substring(1);
    }
    notification.setToken(mainConfig.getToken());
    notification.setIconUrl(mainConfig.getIconUrl());
    notification.setBotName(mainConfig.getBotName());
    notification.setEnabled(mainConfig.getEnabled());
    notification.setShowBuildAgent(mainConfig.getShowBuildAgent());
    notification.setShowElapsedBuildTime(mainConfig.getShowElapsedBuildTime());
    notification.setShowCommits(mainConfig.getShowCommits());
    notification.setMaxCommitsToDisplay(mainConfig.getMaxCommitsToDisplay());
    notification.setMentionChannelEnabled(false);
    notification.setShowFailureReason(mainConfig.getShowFailureReason());

    return notification;

}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:21,代码来源:MsTeamsNotificator.java

示例3: fillModel

import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
public void fillModel(@NotNull Map<String, Object> model, @NotNull HttpServletRequest request) {
  SUser user = SessionUser.getUser(request);
  String userIdStr = request.getParameter("userId");
  if (userIdStr != null) {
    long userId = Long.parseLong(userIdStr);
    user = userModel.findUserById(userId);
    if (user == null) {
      throw new UserNotFoundException(userId, "User with id " + userIdStr + " does not exist");
    }
  }

  boolean telegramNotConfigured = true;
  if (rulesManager.isRulesWithEventsConfigured(user.getId(), this.getPluginName())) {
    String chatId = user.getPropertyValue(TelegramNotificator.TELEGRAM_PROP_KEY);
    telegramNotConfigured = StringUtil.isEmpty(chatId);
  }

  model.put("showTelegramNotConfiguredWarning", telegramNotConfigured);
  model.put("showTelegramPausedWarning", settingsManager.getSettings().isPaused());
}
 
开发者ID:dancing-elf,项目名称:teamcity-telegram-plugin,代码行数:21,代码来源:UserTelegramSettingsExtension.java

示例4: sendNotification

import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
private void sendNotification(String project, String build, String statusText, Set<SUser> users) {
    for (SUser user : users) {
        if(!userHasYammerUserNameConfigured(user)){
            continue;
        }
        YammerClient yammerClient = getYammerClient();
        if (yammerClient != null) {
            final String message = YammerMessage.doFormatMessage(project, build, statusText);
            try {
                String username = user.getPropertyValue(yammerUsername);
                UserInfo userInfo = yammerClient.getUserByEmail(username);
                yammerClient.sendPrivateMessage(userInfo.getId(), message);
            } catch (IOException e) {
                log.error("Could not send Yammer private message.");
            }
        }
    }
}
 
开发者ID:iguissouma,项目名称:teamcity-yammer-notifier,代码行数:19,代码来源:YammerNotificator.java

示例5: doNotify

import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
private void doNotify(@NotNull String text, @NotNull Set<SUser> users) {
    String jsonString = text
            .replace("\\", "\\\\")
            .replace("\"", "\\\"");

    for (SUser user : users) {
        String token = user.getPropertyValue(PROPERTY_TOKEN_ID);
        RequestBody body = RequestBody.create(MediaType.parse("application/json"), "{\"text\": \"" + jsonString + "\"}");
        Request request = new Request.Builder()
                .url(token)
                .post(body)
                .build();
        try {
            client.newCall(request).execute();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:dsaved,项目名称:africhat-platform-0.1,代码行数:20,代码来源:ActorNotifier.java

示例6: createNotification

import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
private SlackNotification createNotification(SUser sUser){
    SlackNotification notification = notificationFactory.getSlackNotification();
    String userName = sUser.getPropertyValue(USERNAME_KEY);
    if(userName.substring(0,1) == "@"){
        userName = userName.substring(1);
    }
    notification.setChannel("@" + userName);

    notification.setTeamName(mainConfig.getTeamName());
    notification.setToken(mainConfig.getToken());
    notification.setIconUrl(mainConfig.getIconUrl());
    notification.setBotName(mainConfig.getBotName());
    notification.setEnabled(mainConfig.getEnabled());
    notification.setShowBuildAgent(mainConfig.getShowBuildAgent());
    notification.setShowElapsedBuildTime(mainConfig.getShowElapsedBuildTime());
    notification.setShowCommits(mainConfig.getShowCommits());
    notification.setMaxCommitsToDisplay(mainConfig.getMaxCommitsToDisplay());
    notification.setMentionChannelEnabled(false);
    notification.setShowFailureReason(mainConfig.getShowFailureReason());

    return notification;

}
 
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:24,代码来源:SlackNotificator.java

示例7: populateCommits

import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
private void populateCommits(SRunningBuild sRunningBuild) {
     List<SVcsModification> changes = sRunningBuild.getContainingChanges();
     if(changes == null){
         return;
     }

     for(SVcsModification change : changes){
Collection<SUser> committers = change.getCommitters();
String slackUserName = null;
if(committers != null && !committers.isEmpty()){
	SUser committer = committers.iterator().next();
	slackUserName = committer.getPropertyValue(SlackNotificator.USERNAME_KEY);
	Loggers.ACTIVITIES.debug("Resolved committer " + change.getUserName() + " to Slack User " + slackUserName);
}
commits.add(new Commit(change.getVersion(), change.getDescription(), change.getUserName(), slackUserName));
     }
 }
 
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:18,代码来源:SlackNotificationPayloadContent.java

示例8: userHasMsTeamsNameConfigured

import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
private boolean userHasMsTeamsNameConfigured(SUser sUser){
    String userName = sUser.getPropertyValue(USERNAME_KEY);

    return userName != null && StringUtil.isNotEmpty(userName);
}
 
开发者ID:spyder007,项目名称:teamcity-msteams-notifier,代码行数:6,代码来源:MsTeamsNotificator.java

示例9: userHasYammerUserNameConfigured

import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
private boolean userHasYammerUserNameConfigured(SUser user) {
    String username = user.getPropertyValue(yammerUsername);
    return username != null && StringUtil.isNotEmpty(username);
}
 
开发者ID:iguissouma,项目名称:teamcity-yammer-notifier,代码行数:5,代码来源:YammerNotificator.java

示例10: getPortraitUrl

import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
static String getPortraitUrl(SUser user) {
    return user.getPropertyValue(PROPERTY_USER_IMAGE_KEY);
}
 
开发者ID:timomeinen,项目名称:team-piazza,代码行数:4,代码来源:PiazzaNotificator.java

示例11: userHasSlackNameConfigured

import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
private boolean userHasSlackNameConfigured(SUser sUser){
    String userName = sUser.getPropertyValue(USERNAME_KEY);

    return userName != null && StringUtil.isNotEmpty(userName);
}
 
开发者ID:PeteGoo,项目名称:tcSlackBuildNotifier,代码行数:6,代码来源:SlackNotificator.java


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