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


Java User类代码示例

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


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

示例1: doHandle

import jetbrains.buildServer.users.User; //导入依赖的package包/类
@Override
@Nullable
protected ModelAndView doHandle(@NotNull final HttpServletRequest request, @NotNull final HttpServletResponse response) throws Exception {
    final ModelAndView result = new ModelAndView(myJspPath);

    final User user = SessionUser.getUser(request);
    result.getModel().put("pluginName", NotifierConstants.NOTIFIER_TYPE);
    result.getModel().put("buildTypes", myServer.getStatusProvider().getWatchedBuildTypes(user, NotifierConstants.NOTIFIER_TYPE));
    result.getModel().put("runningBuilds", myServer.getRunningStatus(user, null));

    final long userId = user.getId();
    result.getModel().put("hasRules", !myRulesManager.getUserNotificationRules(userId, NotifierConstants.NOTIFIER_TYPE).isEmpty());
    result.getModel().put("userId", userId);

    return result;
}
 
开发者ID:dtretyakov,项目名称:teamcity-tray-notifier,代码行数:17,代码来源:UserBuildsController.java

示例2: testUserAccountRemoved_DoesNothing

import jetbrains.buildServer.users.User; //导入依赖的package包/类
@Test
public void testUserAccountRemoved_DoesNothing() throws Exception {

    final SBuildServer sBuildServer = mock(SBuildServer.class);
    final UsernameMapperConfig mapperConfig = mock(UsernameMapperConfig.class);

    final TfsUsernameMapperListener listener = new TfsUsernameMapperListener(sBuildServer, mapperConfig);

    User user = mock(User.class);

    listener.userAccountRemoved(user);

    verifyZeroInteractions(sBuildServer);
    verifyZeroInteractions(user);
    verifyZeroInteractions(mapperConfig);
    verifyZeroInteractions(user);
}
 
开发者ID:dpiessens,项目名称:tfs-worktiem-plugin,代码行数:18,代码来源:TfsUsernameMapperListenerTest.java

示例3: responsibleChanged

import jetbrains.buildServer.users.User; //导入依赖的package包/类
@Override
public void responsibleChanged(@NotNull SProject project, @NotNull Collection<BuildProblemInfo> buildProblems, @Nullable ResponsibilityEntry entry) {
  super.responsibleChanged(project, buildProblems, entry);

  if (entry == null) return;
  if (notifyInvestigationTaken(entry)) return;
  if (!notifyInvestigationDelegated(entry)) return;

  User responsible = entry.getResponsibleUser();

  for (BuildProblemInfo problem: buildProblems) {
    if (problem instanceof BuildProblem) {
      BuildProblem bp = (BuildProblem) problem;
      if (BuildProblemTypes.TC_COMPILATION_ERROR_TYPE.equals(bp.getBuildProblemData().getType())) {
        registerUserEvent(responsible, AchievementEvents.compilationBroken.name());
        break;
      }
    }
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-achievements,代码行数:21,代码来源:ServerEventsAdapter.java

示例4: getUserEvents

import jetbrains.buildServer.users.User; //导入依赖的package包/类
@NotNull
public UserEvents getUserEvents(@NotNull final User user) {
  UserEvents userEvents = myUserEvents.get(user.getId());
  if (userEvents == null) {
    userEvents = new UserEventsImpl(myTimeService) {
      @Override
      public synchronized void registerEvent(@NotNull String eventName) {
        super.registerEvent(eventName);
        myEventDispatcher.getMulticaster().userEventPublished(user, eventName, null);
      }

      public void registerEvent(@NotNull String eventName, @Nullable Object additionalData) {
        super.registerEvent(eventName);
        myEventDispatcher.getMulticaster().userEventPublished(user, eventName, additionalData);
      }
    };
    myUserEvents.put(user.getId(), userEvents);
  }
  return userEvents;
}
 
开发者ID:JetBrains,项目名称:teamcity-achievements,代码行数:21,代码来源:UserEventsRegistryImpl.java

示例5: fillModel

import jetbrains.buildServer.users.User; //导入依赖的package包/类
@Override
public void fillModel(@NotNull Map<String, Object> model, @NotNull HttpServletRequest request) {
  User user = SessionUser.getUser(request);
  final String userIdStr = request.getParameter("userId");
  if (userIdStr != null) {
    long userId = Long.parseLong(userIdStr);
    user = myUserModel.findUserById(userId);
    if (user == null) throw new UserNotFoundException(userId, "User with id " + userIdStr + " does not exist");
  }
  model.put("showPausedWarning", myConfig.isPaused());
  boolean showTeamRoomNotConfiguredWarning = false;
  boolean showCredentialsNotConfiguredWarning = false;
  if (myRulesManager.isRulesWithEventsConfigured(user.getId(), getPluginName())) {
    showTeamRoomNotConfiguredWarning = !VSOUserProperties.isTargetTeamRoomConfigured(user);
    showCredentialsNotConfiguredWarning = !VSOUserProperties.isCredentialsConfigured(user);
  }
  model.put("showTeamRoomNotConfiguredWarning", showTeamRoomNotConfiguredWarning);
  model.put("showCredentialsNotConfiguredWarning", showCredentialsNotConfiguredWarning);

  model.put("settingsBean", VSONotificationUserSettingsBean.createFromUserSettings(user));
}
 
开发者ID:JetBrains,项目名称:tc-vso-rooms,代码行数:22,代码来源:VSONotifierMySettingsPageExtension.java

示例6: testUserAccountCreated_whenUserMappingIsFound_DoesNothing

import jetbrains.buildServer.users.User; //导入依赖的package包/类
@Test
public void testUserAccountCreated_whenUserMappingIsFound_DoesNothing() throws Exception {

    long userId = 1;
    final SBuildServer sBuildServer = mock(SBuildServer.class);

    final UsernameMapperConfig mapperConfig = mock(UsernameMapperConfig.class);
    when(mapperConfig.getDomainName()).thenReturn("MYDOMAIN");

    final UserModel userModel = mock(UserModel.class);

    when(sBuildServer.getUserModel()).thenReturn(userModel);

    final VcsUsernamePropertyKey propertyKey = new VcsUsernamePropertyKey(new VcsRootImpl(1, "tfs"));
    final SUser sUser = mock(SUser.class);
    when(sUser.getVcsUsernameProperties()).thenReturn(new ArrayList<VcsUsernamePropertyKey>() {{
        add(propertyKey);
    }});

    when(userModel.findUserById(userId)).thenReturn(sUser);

    final TfsUsernameMapperListener listener = new TfsUsernameMapperListener(sBuildServer, mapperConfig);

    User user = mock(User.class);
    when(user.getId()).thenReturn(userId);
    when(user.getUsername()).thenReturn("bob");
    when(user.getPropertyValue(propertyKey)).thenReturn("MYDOMAIN\\bob");

    listener.userAccountCreated(user);

    verify(sBuildServer).getUserModel();
    verify(userModel).findUserById(userId);
    verify(sUser).getVcsUsernameProperties();
    verify(user).getUsername();

    verifyNoMoreInteractions(sBuildServer);
    verifyNoMoreInteractions(userModel);
    verifyNoMoreInteractions(sUser);
}
 
开发者ID:dpiessens,项目名称:tfs-worktiem-plugin,代码行数:40,代码来源:TfsUsernameMapperListenerTest.java

示例7: testUserAccountCreated_whenUserMappingIsFoundButEmpty_UpdatesMapping

import jetbrains.buildServer.users.User; //导入依赖的package包/类
@Test
public void testUserAccountCreated_whenUserMappingIsFoundButEmpty_UpdatesMapping() throws Exception {

    long userId = 1;
    final SBuildServer sBuildServer = mock(SBuildServer.class);

    final UsernameMapperConfig mapperConfig = mock(UsernameMapperConfig.class);
    when(mapperConfig.getDomainName()).thenReturn("MYDOMAIN");

    final UserModel userModel = mock(UserModel.class);

    when(sBuildServer.getUserModel()).thenReturn(userModel);

    final VcsUsernamePropertyKey propertyKey = new VcsUsernamePropertyKey(new VcsRootImpl(1, "tfs"));
    final SUser sUser = mock(SUser.class);
    when(sUser.getVcsUsernameProperties()).thenReturn(new ArrayList<VcsUsernamePropertyKey>() {{
        add(propertyKey);
    }});

    when(userModel.findUserById(userId)).thenReturn(sUser);

    final TfsUsernameMapperListener listener = new TfsUsernameMapperListener(sBuildServer, mapperConfig);

    User user = mock(User.class);
    when(user.getId()).thenReturn(userId);
    when(user.getUsername()).thenReturn("bob");
    when(user.getPropertyValue(propertyKey)).thenReturn(null);

    listener.userAccountCreated(user);

    verify(sBuildServer).getUserModel();
    verify(userModel).findUserById(userId);
    verify(sUser).getVcsUsernameProperties();
    verify(user).getUsername();
    verify(sUser).setUserProperty(propertyKey, "MYDOMAIN\\bob");

    verifyNoMoreInteractions(sBuildServer);
    verifyNoMoreInteractions(userModel);
    verifyNoMoreInteractions(sUser);
}
 
开发者ID:dpiessens,项目名称:tfs-worktiem-plugin,代码行数:41,代码来源:TfsUsernameMapperListenerTest.java

示例8: ProductivityBoost

import jetbrains.buildServer.users.User; //导入依赖的package包/类
public ProductivityBoost(@NotNull final UserEventsRegistry userEventsRegistry) {
  super(AchievementEvents.changeAdded.name(), 20);
  userEventsRegistry.addListener(new UserEventsListener() {
    public void userEventPublished(@NotNull User user, @NotNull String eventName, @Nullable Object additionalData) {
      if (!AchievementEvents.changeAdded.name().equals(eventName)) return;
      if (!(additionalData instanceof SVcsModification)) return;

      SVcsModification mod = (SVcsModification) additionalData;
      Date vcsDate = mod.getVcsDate();
      if (Calendar.getInstance().getTime().getTime() - vcsDate.getTime() < 24 * 3600 * 1000) {
        userEventsRegistry.getUserEvents(user).registerEvent(getId() + ":changeAdded");
      }
    }
  });
}
 
开发者ID:JetBrains,项目名称:teamcity-achievements,代码行数:16,代码来源:ProductivityBoost.java

示例9: buildUnpinned

import jetbrains.buildServer.users.User; //导入依赖的package包/类
@Override
public void buildUnpinned(@NotNull SBuild build, @Nullable User user, @Nullable String comment) {
  super.buildUnpinned(build, user, comment);

  if (user != null) {
    registerUserEvent(user, AchievementEvents.buildUnpinned.name());
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-achievements,代码行数:9,代码来源:ServerEventsAdapter.java

示例10: testsMuted

import jetbrains.buildServer.users.User; //导入依赖的package包/类
@Override
public void testsMuted(@NotNull MuteInfo muteInfo) {
  super.testsMuted(muteInfo);

  User user = muteInfo.getMutingUser();
  if (user == null) return;

  if (muteInfo.getAutoUnmuteOptions().getUnmuteByTime() == null) return;

  for (STest ignored : muteInfo.getTests()) {
    registerUserEvent(user, AchievementEvents.testBombed.name());
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-achievements,代码行数:14,代码来源:ServerEventsAdapter.java

示例11: buildTagsChanged

import jetbrains.buildServer.users.User; //导入依赖的package包/类
@Override
public void buildTagsChanged(@NotNull SBuild build, User user, @NotNull List<String> oldTags, @NotNull List<String> newTags) {
  super.buildTagsChanged(build, user, oldTags, newTags);

  if (user != null && !newTags.isEmpty()) {
    registerUserEvent(user, AchievementEvents.buildTagged.name());
  }
}
 
开发者ID:JetBrains,项目名称:teamcity-achievements,代码行数:9,代码来源:ServerEventsAdapter.java

示例12: notifyInvestigationDelegated

import jetbrains.buildServer.users.User; //导入依赖的package包/类
private boolean notifyInvestigationDelegated(@NotNull ResponsibilityEntry entry) {
  User responsible = entry.getResponsibleUser();
  User reporter = entry.getReporterUser();
  if (reporter != null && reporter.getId() != responsible.getId()) {
    registerUserEvent(reporter, AchievementEvents.investigationDelegated.name());
    return true;
  }

  return false;
}
 
开发者ID:JetBrains,项目名称:teamcity-achievements,代码行数:11,代码来源:ServerEventsAdapter.java

示例13: notifyInvestigationTaken

import jetbrains.buildServer.users.User; //导入依赖的package包/类
private boolean notifyInvestigationTaken(@NotNull ResponsibilityEntry entry) {
  User responsible = entry.getResponsibleUser();
  User reporter = entry.getReporterUser();
  if (reporter != null && reporter.getId() == responsible.getId()) {
    registerUserEvent(reporter, AchievementEvents.investigationTaken.name());
    return true;
  }

  return false;
}
 
开发者ID:JetBrains,项目名称:teamcity-achievements,代码行数:11,代码来源:ServerEventsAdapter.java

示例14: getUserDisplayName

import jetbrains.buildServer.users.User; //导入依赖的package包/类
@Nullable
private String getUserDisplayName(@Nullable User user) {
  if(user == null) return null;
  final String vsoUserName = VSOUserProperties.getUserDisplayName(user);
  if(vsoUserName != null){
    return "@" + vsoUserName;
  }
  return user.getDescriptiveName();
}
 
开发者ID:JetBrains,项目名称:tc-vso-rooms,代码行数:10,代码来源:VSONotificator.java

示例15: fillModel

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

  model.put("settingsBean", VSONotificationUserSettingsBean.createFromUserSettings(user));
}
 
开发者ID:JetBrains,项目名称:tc-vso-rooms,代码行数:13,代码来源:VSONotifierSettingsPageExtension.java


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