本文整理汇总了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));
}
}
示例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;
}
示例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());
}
示例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.");
}
}
}
}
示例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();
}
}
}
示例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;
}
示例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));
}
}
示例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);
}
示例9: userHasYammerUserNameConfigured
import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
private boolean userHasYammerUserNameConfigured(SUser user) {
String username = user.getPropertyValue(yammerUsername);
return username != null && StringUtil.isNotEmpty(username);
}
示例10: getPortraitUrl
import jetbrains.buildServer.users.SUser; //导入方法依赖的package包/类
static String getPortraitUrl(SUser user) {
return user.getPropertyValue(PROPERTY_USER_IMAGE_KEY);
}
示例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);
}