Пример #1
0
  private String getAdditionalInfo(ProjectDeployedEvent event) {

    StringBuilder info = new StringBuilder();

    if (event.getDeployType() == ProjectDeployedEvent.DeployType.MAVEN) {
      if (!event.hasErrors()) {
        info.append(constants.build_project_deploy_maven_success(event.getProjectName()));
      } else {
        info.append(constants.build_project_deploy_maven_failed(event.getProjectName()));
      }
    } else if (event.getDeployType() == ProjectDeployedEvent.DeployType.RUNTIME) {
      // TODO COMPLETE this info.
    }

    return info.toString();
  }
Пример #2
0
  @Override
  public SocialActivitiesEvent toSocial(Object object) {
    ProjectDeployedEvent event = (ProjectDeployedEvent) object;

    return new SocialActivitiesEvent(
            socialUserRepository.systemUser(),
            AssetManagementEventTypes.PROJECT_DEPLOYED.name(),
            new Date(event.getTimestamp()))
        .withLink(
            event.getRepositoryAlias() != null ? event.getRepositoryAlias() : "<unknown>",
            event.getRootURI() != null ? event.getRootURI() : "<unknown>")
        .withAdicionalInfo(getAdditionalInfo(event));
  }