From 00d577b1bad87b5428bf4fc48f47964754b934b8 Mon Sep 17 00:00:00 2001 From: Antonin Abherve Date: Thu, 1 Feb 2018 12:32:17 +0100 Subject: [PATCH] Add AnalysisTool registration and configuration Remote API --- .../measure/platform/ApplicationStartup.java | 2 +- .../measure/platform/ApplicationWebXml.java | 2 +- .../measure/platform/MeasurePlatformApp.java | 6 +- .../core/api/entitys/AnalysisCardService.java | 45 ++++++ .../core/api/entitys/MeasureViewService.java | 3 +- .../platform/core/entity/AlertEvent.java | 2 +- .../platform/core/entity/AnalysisCard.java | 88 +++++++++++ .../platform/core/entity/MeasureView.java | 22 ++- .../measure/platform/core/entity/Project.java | 2 +- .../platform/core/entity/ProjectAnalysis.java | 13 +- .../core/impl/MeasureCatalogueService.java | 2 +- .../impl/entitys/AnalysisCardServiceImpl.java | 71 +++++++++ .../impl/entitys/MeasureViewServiceImpl.java | 14 +- .../core/impl/entitys/PhaseServiceImpl.java | 1 + .../entitys/ProjectAnalysisServiceImpl.java | 13 +- .../repository/AnalysisCardRepository.java | 18 +++ .../impl/repository/AuthorityRepository.java | 2 +- .../CustomAuditEventRepository.java | 4 +- .../repository/MeasureViewRepository.java | 5 +- .../PersistenceAuditEventRepository.java | 2 +- .../repository/PersistentTokenRepository.java | 4 +- .../core/impl/repository/UserRepository.java | 2 +- .../AnalysisConfigurationResource.java | 58 ++++++++ .../AnalysisRegistrationResource.java | 75 ++++++++++ .../analysis/NotificationResource.java | 9 ++ .../analysis/dto/AnalysisConfiguration.java | 38 +++++ .../analysis/dto/CardConfiguration.java | 24 +++ .../analysis/dto/NotificationSuscribtion.java | 15 ++ .../restapi/entitys/DashboardResource.java | 2 +- .../entitys/MeasureInstanceResource.java | 10 +- .../entitys/MeasurePropertyResource.java | 2 +- .../entitys/MeasureReferenceResource.java | 2 +- .../restapi/entitys/MeasureViewResource.java | 6 +- .../restapi/entitys/NotificationResource.java | 2 +- .../restapi/entitys/PhaseResource.java | 2 +- .../entitys/ProjectAnalysisResource.java | 139 ++++++++++++++++++ .../restapi/entitys/ProjectResource.java | 2 +- .../filter/CachingHttpHeadersFilter.java | 2 +- .../framework/rest/AccountResource.java | 12 +- .../restapi/framework/rest/AuditResource.java | 2 +- .../framework/rest/ProfileInfoResource.java | 4 +- .../restapi/framework/rest/UserResource.java | 10 +- .../framework/rest/vm/ManagedUserVM.java | 4 +- .../restapi/measure/AgentResource.java | 22 +-- .../measure/ConfigurationResource.java | 4 +- .../measure/MeasureExecutionResource.java | 10 +- .../measure/MeasureLoggerResource.java | 4 +- .../restapi/measure/MeasureResource.java | 6 +- .../measure/dto/KibanaVisualisation.java | 2 +- .../restapi/measure/dto/MeasureAgent.java | 2 +- .../measure/dto/MeasureUniteProperty.java | 2 +- .../measure/dto/PlatformConfiguration.java | 2 +- .../service/agent/api/IAgentManager.java | 4 +- .../agent/api/IRemoteCatalogueService.java | 4 +- .../service/agent/data/RemoteAgent.java | 2 +- .../agent/impl/AgentCatalogueService.java | 6 +- .../service/agent/impl/AgentManager.java | 14 +- .../api/IAnalysisCatalogueService.java | 36 +++++ .../analysis/api/INotificationService.java | 36 +++++ .../analysis/data/AnalysisService.java | 45 ++++++ .../service/analysis/data/Notification.java | 9 ++ .../data/RegistredAnalysisService.java | 22 +++ .../analysis/impl/AnalysisCatalogue.java | 49 ++++++ .../impl/AnalysisCatalogueManager.java | 34 +++++ .../api/IElasticsearchIndexManager.java | 2 +- .../measurement/api/IMeasurementStorage.java | 4 +- .../measurement/impl/ElasticConnection.java | 2 +- .../impl/ElasticMeasurementStorage.java | 8 +- .../impl/ElasticsearchIndexManager.java | 4 +- .../service/smmengine/api/ILoggerService.java | 2 +- .../api/IMeasureExecutionService.java | 2 +- .../api/IRemoteMeasureExecutionService.java | 2 +- .../smmengine/api/ISchedulingService.java | 4 +- .../smmengine/impl/logger/LoggerService.java | 4 +- .../MeasureExecutionService.java | 6 +- .../RemoteMeasureExecutionService.java | 12 +- .../MeasureSchedulingConfigurer.java | 5 +- .../impl/scheduler/SchedulingService.java | 26 ++-- .../utils/aop/logging/LoggingAspect.java | 4 +- .../ExceptionHandlingAsyncTaskExecutor.java | 2 +- .../platform/utils/async/package-info.java | 2 +- .../utils/config/AsyncConfiguration.java | 4 +- .../utils/config/CacheConfiguration.java | 2 +- .../config/CloudDatabaseConfiguration.java | 2 +- .../platform/utils/config/Constants.java | 2 +- .../utils/config/DatabaseConfiguration.java | 4 +- .../utils/config/DefaultProfileUtil.java | 2 +- .../utils/config/JHipsterProperties.java | 2 +- .../utils/config/LocaleConfiguration.java | 4 +- .../config/LoggingAspectConfiguration.java | 4 +- .../utils/config/LoggingConfiguration.java | 2 +- .../utils/config/MetricsConfiguration.java | 2 +- .../utils/config/SecurityConfiguration.java | 12 +- .../utils/config/ThymeleafConfiguration.java | 2 +- .../platform/utils/config/WebConfigurer.java | 2 +- .../PageableParameterBuilderPlugin.java | 4 +- .../config/apidoc/SwaggerConfiguration.java | 6 +- .../utils/config/apidoc/package-info.java | 2 +- .../config/audit/AuditEventConverter.java | 4 +- .../utils/config/audit/package-info.java | 2 +- .../liquibase/AsyncSpringLiquibase.java | 4 +- .../utils/config/liquibase/package-info.java | 2 +- .../locale/AngularCookieLocaleResolver.java | 2 +- .../utils/config/locale/package-info.java | 2 +- .../platform/utils/config/package-info.java | 2 +- .../utils/domain/AbstractAuditingEntity.java | 2 +- .../platform/utils/domain/Authority.java | 2 +- .../utils/domain/PersistentAuditEvent.java | 2 +- .../utils/domain/PersistentToken.java | 4 +- .../measure/platform/utils/domain/User.java | 4 +- .../platform/utils/domain/package-info.java | 2 +- .../utils/domain/util/FixedH2Dialect.java | 2 +- .../domain/util/JSR310DateConverters.java | 2 +- .../util/JSR310PersistenceConverters.java | 10 +- .../utils/repository/package-info.java | 2 +- .../AjaxAuthenticationFailureHandler.java | 2 +- .../AjaxAuthenticationSuccessHandler.java | 2 +- .../security/AjaxLogoutSuccessHandler.java | 2 +- .../utils/security/AuthoritiesConstants.java | 2 +- .../CustomPersistentRememberMeServices.java | 6 +- .../Http401UnauthorizedEntryPoint.java | 2 +- .../utils/security/SecurityUtils.java | 2 +- .../security/SpringSecurityAuditorAware.java | 4 +- .../utils/security/UserDetailsService.java | 4 +- .../security/UserNotActivatedException.java | 2 +- .../platform/utils/security/package-info.java | 2 +- .../utils/service/AuditEventService.java | 4 +- .../platform/utils/service/MailService.java | 6 +- .../platform/utils/service/UserService.java | 12 +- .../platform/utils/service/dto/UserDTO.java | 8 +- .../utils/service/dto/package-info.java | 2 +- .../utils/service/mapper/UserMapper.java | 8 +- .../utils/service/mapper/package-info.java | 2 +- .../platform/utils/service/package-info.java | 2 +- .../utils/service/util/RandomUtil.java | 2 +- .../resources/config/liquibase/master.xml | 48 +++--- .../liquibase/schema/entity_AnalysisCard.xml | 39 +++++ .../entity_AnalysisCard_constraints.xml | 18 +++ .../liquibase/schema/entity_MeasureView.xml | 4 +- .../schema/entity_MeasureView_constraints.xml | 6 +- .../entity_ProjectAnalysis_constraints.xml | 4 +- .../webapp/app/pages/catalogue/catalogue.html | 16 +- .../configuration/general/general.html | 21 +-- .../configuration/instances/instances.html | 6 +- .../project/notification/notification.html | 4 +- .../app/pages/project/overview/overview.html | 6 +- .../phasesoverview/phasesoverview.html | 4 +- 147 files changed, 1181 insertions(+), 328 deletions(-) create mode 100644 src/main/java/org/measure/platform/core/api/entitys/AnalysisCardService.java create mode 100644 src/main/java/org/measure/platform/core/entity/AnalysisCard.java create mode 100644 src/main/java/org/measure/platform/core/impl/entitys/AnalysisCardServiceImpl.java create mode 100644 src/main/java/org/measure/platform/core/impl/repository/AnalysisCardRepository.java create mode 100644 src/main/java/org/measure/platform/restapi/analysis/AnalysisConfigurationResource.java create mode 100644 src/main/java/org/measure/platform/restapi/analysis/AnalysisRegistrationResource.java create mode 100644 src/main/java/org/measure/platform/restapi/analysis/NotificationResource.java create mode 100644 src/main/java/org/measure/platform/restapi/analysis/dto/AnalysisConfiguration.java create mode 100644 src/main/java/org/measure/platform/restapi/analysis/dto/CardConfiguration.java create mode 100644 src/main/java/org/measure/platform/restapi/analysis/dto/NotificationSuscribtion.java create mode 100644 src/main/java/org/measure/platform/restapi/entitys/ProjectAnalysisResource.java create mode 100644 src/main/java/org/measure/platform/service/analysis/api/IAnalysisCatalogueService.java create mode 100644 src/main/java/org/measure/platform/service/analysis/api/INotificationService.java create mode 100644 src/main/java/org/measure/platform/service/analysis/data/AnalysisService.java create mode 100644 src/main/java/org/measure/platform/service/analysis/data/Notification.java create mode 100644 src/main/java/org/measure/platform/service/analysis/data/RegistredAnalysisService.java create mode 100644 src/main/java/org/measure/platform/service/analysis/impl/AnalysisCatalogue.java create mode 100644 src/main/java/org/measure/platform/service/analysis/impl/AnalysisCatalogueManager.java create mode 100644 src/main/resources/config/liquibase/schema/entity_AnalysisCard.xml create mode 100644 src/main/resources/config/liquibase/schema/entity_AnalysisCard_constraints.xml diff --git a/src/main/java/org/measure/platform/ApplicationStartup.java b/src/main/java/org/measure/platform/ApplicationStartup.java index 3db4726a..3e46728f 100644 --- a/src/main/java/org/measure/platform/ApplicationStartup.java +++ b/src/main/java/org/measure/platform/ApplicationStartup.java @@ -3,7 +3,7 @@ import javax.inject.Inject; import org.measure.platform.core.api.IMeasureCatalogueService; -import org.measure.platform.measurementstorage.api.IElasticsearchIndexManager; +import org.measure.platform.service.measurement.api.IElasticsearchIndexManager; import org.springframework.boot.context.event.ApplicationReadyEvent; import org.springframework.context.ApplicationListener; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/measure/platform/ApplicationWebXml.java b/src/main/java/org/measure/platform/ApplicationWebXml.java index 74dedcb0..933359c3 100644 --- a/src/main/java/org/measure/platform/ApplicationWebXml.java +++ b/src/main/java/org/measure/platform/ApplicationWebXml.java @@ -1,6 +1,6 @@ package org.measure.platform; -import org.measure.platform.framework.config.DefaultProfileUtil; +import org.measure.platform.utils.config.DefaultProfileUtil; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.support.SpringBootServletInitializer; diff --git a/src/main/java/org/measure/platform/MeasurePlatformApp.java b/src/main/java/org/measure/platform/MeasurePlatformApp.java index fbed03de..e838eece 100644 --- a/src/main/java/org/measure/platform/MeasurePlatformApp.java +++ b/src/main/java/org/measure/platform/MeasurePlatformApp.java @@ -8,9 +8,9 @@ import javax.annotation.PostConstruct; import javax.inject.Inject; -import org.measure.platform.framework.config.Constants; -import org.measure.platform.framework.config.DefaultProfileUtil; -import org.measure.platform.framework.config.JHipsterProperties; +import org.measure.platform.utils.config.Constants; +import org.measure.platform.utils.config.DefaultProfileUtil; +import org.measure.platform.utils.config.JHipsterProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; diff --git a/src/main/java/org/measure/platform/core/api/entitys/AnalysisCardService.java b/src/main/java/org/measure/platform/core/api/entitys/AnalysisCardService.java new file mode 100644 index 00000000..9d6c321c --- /dev/null +++ b/src/main/java/org/measure/platform/core/api/entitys/AnalysisCardService.java @@ -0,0 +1,45 @@ +package org.measure.platform.core.api.entitys; + +import java.util.List; + +import org.measure.platform.core.entity.AnalysisCard; +import org.measure.platform.core.entity.ProjectAnalysis; + +/** + * Service Interface for managing AnalysisCard. + */ +public interface AnalysisCardService { + /** + * Save a an AnalysisCard. + * @param card the entity to save + * @return the persisted entity + */ + AnalysisCard save(AnalysisCard card); + + /** + * Get all the AnalysisCard. + * @return the list of entities + */ + List findAll(); + + /** + * Get all the Project Analysis of current owner. + * @return the list of entities + */ + List findAllByProjectAnalysis(ProjectAnalysis projectAnalysis); + + /** + * Get the "id" AnalysisCard. + * @param id the id of the entity + * @return the entity + */ + AnalysisCard findOne(Long id); + + /** + * Delete the "id" project. + * @param id the id of the entity + */ + void delete(Long id); + + +} diff --git a/src/main/java/org/measure/platform/core/api/entitys/MeasureViewService.java b/src/main/java/org/measure/platform/core/api/entitys/MeasureViewService.java index 2468b2f5..aa8d2045 100644 --- a/src/main/java/org/measure/platform/core/api/entitys/MeasureViewService.java +++ b/src/main/java/org/measure/platform/core/api/entitys/MeasureViewService.java @@ -3,7 +3,6 @@ import java.util.List; import org.measure.platform.core.entity.MeasureView; -import org.measure.platform.core.entity.ProjectAnalysis; /** * Service Interface for managing MeasureView. @@ -45,6 +44,6 @@ public interface MeasureViewService { List findByDashboard(Long id); - List findByProjectAnalysis(Long id); + List findByAnalysisCard(Long id); } diff --git a/src/main/java/org/measure/platform/core/entity/AlertEvent.java b/src/main/java/org/measure/platform/core/entity/AlertEvent.java index 78dc8a0d..e011aa65 100644 --- a/src/main/java/org/measure/platform/core/entity/AlertEvent.java +++ b/src/main/java/org/measure/platform/core/entity/AlertEvent.java @@ -16,7 +16,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; -import org.measure.platform.framework.domain.User; +import org.measure.platform.utils.domain.User; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/src/main/java/org/measure/platform/core/entity/AnalysisCard.java b/src/main/java/org/measure/platform/core/entity/AnalysisCard.java new file mode 100644 index 00000000..234936c2 --- /dev/null +++ b/src/main/java/org/measure/platform/core/entity/AnalysisCard.java @@ -0,0 +1,88 @@ +package org.measure.platform.core.entity; + +import java.util.HashSet; +import java.util.Set; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.validation.constraints.NotNull; + +import org.hibernate.annotations.Cache; +import org.hibernate.annotations.CacheConcurrencyStrategy; + +import com.fasterxml.jackson.annotation.JsonIgnore; + + +@Entity +@Table(name = "analysiscard") +@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) +public class AnalysisCard { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + @NotNull + @Column(name = "card_label", nullable = false) + private String cardLabel; + + @NotNull + @Column(name = "card_url", nullable = false) + private String cardUrl; + + @ManyToOne + private ProjectAnalysis projectanalysis; + + @OneToMany(mappedBy = "analysiscard") + @JsonIgnore + @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) + private Set measureviews = new HashSet<>(); + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCardLabel() { + return cardLabel; + } + + public void setCardLabel(String cardLabel) { + this.cardLabel = cardLabel; + } + + public String getCardUrl() { + return cardUrl; + } + + public void setCardUrl(String cardUrl) { + this.cardUrl = cardUrl; + } + + public Set getMeasureviews() { + return measureviews; + } + + public void setMeasureviews(Set measureviews) { + this.measureviews = measureviews; + } + + public ProjectAnalysis getProjectanalysis() { + return projectanalysis; + } + + public void setProjectanalysis(ProjectAnalysis projectanalysis) { + this.projectanalysis = projectanalysis; + } + + +} diff --git a/src/main/java/org/measure/platform/core/entity/MeasureView.java b/src/main/java/org/measure/platform/core/entity/MeasureView.java index b7459cfc..bc040fd5 100644 --- a/src/main/java/org/measure/platform/core/entity/MeasureView.java +++ b/src/main/java/org/measure/platform/core/entity/MeasureView.java @@ -85,7 +85,7 @@ public class MeasureView implements Serializable { private MeasureInstance measureinstance; @ManyToOne - private ProjectAnalysis projectanalysis; + private AnalysisCard analysiscard; public String getName() { @@ -342,6 +342,19 @@ public Phase getPhaseoverview() { public void setPhaseoverview(Phase phaseOverview) { this.phaseoverview = phaseOverview; } + + + public AnalysisCard getAnalysiscard() { + return analysiscard; + } + + public void setAnalysiscard(AnalysisCard analysiscard) { + this.analysiscard = analysiscard; + } + + public Boolean getAuto() { + return auto; + } @Override public boolean equals(Object o) { @@ -364,13 +377,6 @@ public int hashCode() { } - public ProjectAnalysis getProjectanalysis() { - return projectanalysis; - } - - public void setProjectanalysis(ProjectAnalysis projectanalysis) { - this.projectanalysis = projectanalysis; - } @Override public String toString() { diff --git a/src/main/java/org/measure/platform/core/entity/Project.java b/src/main/java/org/measure/platform/core/entity/Project.java index 2fc11bb2..8547af23 100644 --- a/src/main/java/org/measure/platform/core/entity/Project.java +++ b/src/main/java/org/measure/platform/core/entity/Project.java @@ -18,7 +18,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; -import org.measure.platform.framework.domain.User; +import org.measure.platform.utils.domain.User; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/src/main/java/org/measure/platform/core/entity/ProjectAnalysis.java b/src/main/java/org/measure/platform/core/entity/ProjectAnalysis.java index 72680687..c90841ed 100644 --- a/src/main/java/org/measure/platform/core/entity/ProjectAnalysis.java +++ b/src/main/java/org/measure/platform/core/entity/ProjectAnalysis.java @@ -62,7 +62,7 @@ public class ProjectAnalysis implements Serializable { @OneToMany(mappedBy = "projectanalysis") @JsonIgnore @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) - private Set measureviews = new HashSet<>(); + private Set analysiscards = new HashSet<>(); public Long getId() { return id; @@ -128,14 +128,11 @@ public void setAlertevents(Set alertevents) { this.alertevents = alertevents; } - public Set getMeasureviews() { - return measureviews; + public Set getAnalysiscards() { + return analysiscards; } - public void setMeasureviews(Set measureviews) { - this.measureviews = measureviews; + public void setAnalysiscards(Set analysiscards) { + this.analysiscards = analysiscards; } - - - } diff --git a/src/main/java/org/measure/platform/core/impl/MeasureCatalogueService.java b/src/main/java/org/measure/platform/core/impl/MeasureCatalogueService.java index e2f00db9..e5db5fb0 100644 --- a/src/main/java/org/measure/platform/core/impl/MeasureCatalogueService.java +++ b/src/main/java/org/measure/platform/core/impl/MeasureCatalogueService.java @@ -19,7 +19,7 @@ import org.apache.commons.io.FileUtils; import org.measure.platform.core.api.IMeasureCatalogueService; import org.measure.platform.core.impl.utils.UnzipUtility; -import org.measure.platform.measurementstorage.api.IElasticsearchIndexManager; +import org.measure.platform.service.measurement.api.IElasticsearchIndexManager; import org.measure.smm.measure.api.IMeasure; import org.measure.smm.measure.model.SMMMeasure; import org.measure.smm.service.MeasurePackager; diff --git a/src/main/java/org/measure/platform/core/impl/entitys/AnalysisCardServiceImpl.java b/src/main/java/org/measure/platform/core/impl/entitys/AnalysisCardServiceImpl.java new file mode 100644 index 00000000..4e44c91d --- /dev/null +++ b/src/main/java/org/measure/platform/core/impl/entitys/AnalysisCardServiceImpl.java @@ -0,0 +1,71 @@ +package org.measure.platform.core.impl.entitys; + +import java.util.List; + +import javax.inject.Inject; + +import org.measure.platform.core.api.entitys.AnalysisCardService; +import org.measure.platform.core.api.entitys.MeasureViewService; +import org.measure.platform.core.entity.AnalysisCard; +import org.measure.platform.core.entity.MeasureView; +import org.measure.platform.core.entity.ProjectAnalysis; +import org.measure.platform.core.impl.repository.AnalysisCardRepository; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * Service Implementation for managing AnalysisCard. + */ +@Service +@Transactional +public class AnalysisCardServiceImpl implements AnalysisCardService { + private final Logger log = LoggerFactory.getLogger(AnalysisCardServiceImpl.class); + + @Inject + private AnalysisCardRepository analysisRepository; + + @Inject + private MeasureViewService measureViewService; + + @Override + public AnalysisCard save(AnalysisCard card) { + log.debug("Request to save AnalysisCard : {}", card); + AnalysisCard result = analysisRepository.save(card); + return result; + } + + @Override + @Transactional(readOnly = true) + public List findAll() { + List result = analysisRepository.findAll(); + return result; + } + + @Override + @Transactional(readOnly = true) + public List findAllByProjectAnalysis(ProjectAnalysis projectAnalysis) { + + List result = analysisRepository.findByProjectAnalysis(projectAnalysis); + return result; + } + + @Override + @Transactional(readOnly = true) + public AnalysisCard findOne(Long id) { + log.debug("Request to get Phase : {}", id); + AnalysisCard card = analysisRepository.findOne(id); + return card; + } + + @Override + public void delete(Long id) { + for (MeasureView view : measureViewService.findByAnalysisCard(id)) { + measureViewService.delete(view.getId()); + } + + analysisRepository.delete(id); + } + +} diff --git a/src/main/java/org/measure/platform/core/impl/entitys/MeasureViewServiceImpl.java b/src/main/java/org/measure/platform/core/impl/entitys/MeasureViewServiceImpl.java index de7a78ae..cc3e042b 100644 --- a/src/main/java/org/measure/platform/core/impl/entitys/MeasureViewServiceImpl.java +++ b/src/main/java/org/measure/platform/core/impl/entitys/MeasureViewServiceImpl.java @@ -5,18 +5,18 @@ import javax.inject.Inject; +import org.measure.platform.core.api.entitys.AnalysisCardService; import org.measure.platform.core.api.entitys.DashboardService; import org.measure.platform.core.api.entitys.MeasureViewService; import org.measure.platform.core.api.entitys.PhaseService; -import org.measure.platform.core.api.entitys.ProjectAnalysisService; import org.measure.platform.core.api.entitys.ProjectService; +import org.measure.platform.core.entity.AnalysisCard; import org.measure.platform.core.entity.Dashboard; import org.measure.platform.core.entity.MeasureView; import org.measure.platform.core.entity.Phase; import org.measure.platform.core.entity.Project; -import org.measure.platform.core.entity.ProjectAnalysis; import org.measure.platform.core.impl.repository.MeasureViewRepository; -import org.measure.platform.measurementstorage.api.IElasticsearchIndexManager; +import org.measure.platform.service.measurement.api.IElasticsearchIndexManager; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -46,7 +46,7 @@ public class MeasureViewServiceImpl implements MeasureViewService { private ProjectService projectService; @Inject - private ProjectAnalysisService projectAnalysisService; + private AnalysisCardService analysisCardService; @Inject private PhaseService phaseService; @@ -243,9 +243,9 @@ public List findByDashboard(Long id) { } @Override - public List findByProjectAnalysis(Long id) { - ProjectAnalysis projectAnalysis = projectAnalysisService.findOne(id); - return measureViewRepository.findByProjectAnalysis(projectAnalysis); + public List findByAnalysisCard(Long id) { + AnalysisCard analysisCard = analysisCardService.findOne(id); + return measureViewRepository.findByAnalysisCard(analysisCard); } diff --git a/src/main/java/org/measure/platform/core/impl/entitys/PhaseServiceImpl.java b/src/main/java/org/measure/platform/core/impl/entitys/PhaseServiceImpl.java index 9d9769f4..843f221c 100644 --- a/src/main/java/org/measure/platform/core/impl/entitys/PhaseServiceImpl.java +++ b/src/main/java/org/measure/platform/core/impl/entitys/PhaseServiceImpl.java @@ -56,6 +56,7 @@ public List findAll() { } @Override + @Transactional(readOnly = true) public List findByProject(Project project) { List result = phaseRepository.findByProject(project); return result; diff --git a/src/main/java/org/measure/platform/core/impl/entitys/ProjectAnalysisServiceImpl.java b/src/main/java/org/measure/platform/core/impl/entitys/ProjectAnalysisServiceImpl.java index 68985912..0ce229fe 100644 --- a/src/main/java/org/measure/platform/core/impl/entitys/ProjectAnalysisServiceImpl.java +++ b/src/main/java/org/measure/platform/core/impl/entitys/ProjectAnalysisServiceImpl.java @@ -5,10 +5,10 @@ import javax.inject.Inject; import org.measure.platform.core.api.entitys.AlertEventService; -import org.measure.platform.core.api.entitys.MeasureViewService; +import org.measure.platform.core.api.entitys.AnalysisCardService; import org.measure.platform.core.api.entitys.ProjectAnalysisService; import org.measure.platform.core.entity.AlertEvent; -import org.measure.platform.core.entity.MeasureView; +import org.measure.platform.core.entity.AnalysisCard; import org.measure.platform.core.entity.Project; import org.measure.platform.core.entity.ProjectAnalysis; import org.measure.platform.core.impl.repository.ProjectAnalysisRepository; @@ -32,7 +32,7 @@ public class ProjectAnalysisServiceImpl implements ProjectAnalysisService { private AlertEventService alertEventService; @Inject - private MeasureViewService measureViewService; + private AnalysisCardService analysisCardService; /** * Save a ProjectAnalysis. @@ -75,16 +75,15 @@ public ProjectAnalysis findOne(Long id) { */ public void delete(Long id) { ProjectAnalysis projectAnalysis = projectAnalysisRepository.findOne(id); - - for(MeasureView view : measureViewService.findByProjectAnalysis(id)){ - measureViewService.delete(view.getId()); + + for(AnalysisCard card : analysisCardService.findAllByProjectAnalysis(projectAnalysis)){ + analysisCardService.delete(card.getId()); } for(AlertEvent event : alertEventService.findAllByProjectAnalysis(projectAnalysis)){ alertEventService.delete(event.getId()); } - projectAnalysisRepository.delete(id); } diff --git a/src/main/java/org/measure/platform/core/impl/repository/AnalysisCardRepository.java b/src/main/java/org/measure/platform/core/impl/repository/AnalysisCardRepository.java new file mode 100644 index 00000000..2dd68f41 --- /dev/null +++ b/src/main/java/org/measure/platform/core/impl/repository/AnalysisCardRepository.java @@ -0,0 +1,18 @@ +package org.measure.platform.core.impl.repository; + +import java.util.List; + +import org.measure.platform.core.entity.AnalysisCard; +import org.measure.platform.core.entity.ProjectAnalysis; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +/** + * Spring Data JPA repository for the AnalysisCard entity. + */ +public interface AnalysisCardRepository extends JpaRepository { + @Query(value = "select i from AnalysisCard i where i.projectanalysis = :projectAnalysis") + List findByProjectAnalysis(@Param("projectAnalysis") ProjectAnalysis projectAnalysis); + +} diff --git a/src/main/java/org/measure/platform/core/impl/repository/AuthorityRepository.java b/src/main/java/org/measure/platform/core/impl/repository/AuthorityRepository.java index 947b53b2..878f3e6d 100644 --- a/src/main/java/org/measure/platform/core/impl/repository/AuthorityRepository.java +++ b/src/main/java/org/measure/platform/core/impl/repository/AuthorityRepository.java @@ -1,6 +1,6 @@ package org.measure.platform.core.impl.repository; -import org.measure.platform.framework.domain.Authority; +import org.measure.platform.utils.domain.Authority; import org.springframework.data.jpa.repository.JpaRepository; /** diff --git a/src/main/java/org/measure/platform/core/impl/repository/CustomAuditEventRepository.java b/src/main/java/org/measure/platform/core/impl/repository/CustomAuditEventRepository.java index f80656c9..1a42534a 100644 --- a/src/main/java/org/measure/platform/core/impl/repository/CustomAuditEventRepository.java +++ b/src/main/java/org/measure/platform/core/impl/repository/CustomAuditEventRepository.java @@ -8,8 +8,8 @@ import javax.inject.Inject; -import org.measure.platform.framework.config.audit.AuditEventConverter; -import org.measure.platform.framework.domain.PersistentAuditEvent; +import org.measure.platform.utils.config.audit.AuditEventConverter; +import org.measure.platform.utils.domain.PersistentAuditEvent; import org.springframework.boot.actuate.audit.AuditEvent; import org.springframework.boot.actuate.audit.AuditEventRepository; import org.springframework.stereotype.Repository; diff --git a/src/main/java/org/measure/platform/core/impl/repository/MeasureViewRepository.java b/src/main/java/org/measure/platform/core/impl/repository/MeasureViewRepository.java index 9edbae3e..905b93e8 100644 --- a/src/main/java/org/measure/platform/core/impl/repository/MeasureViewRepository.java +++ b/src/main/java/org/measure/platform/core/impl/repository/MeasureViewRepository.java @@ -2,6 +2,7 @@ import java.util.List; +import org.measure.platform.core.entity.AnalysisCard; import org.measure.platform.core.entity.Dashboard; import org.measure.platform.core.entity.MeasureInstance; import org.measure.platform.core.entity.MeasureView; @@ -35,7 +36,7 @@ public interface MeasureViewRepository extends JpaRepository { @Query(value = "select i from MeasureView i where i.measureinstance = :minstance") List findByMeasure(@Param("minstance") MeasureInstance minstance); - @Query(value = "select i from MeasureView i where i.projectanalysis = :projectAnalysis") - List findByProjectAnalysis(@Param("projectAnalysis") ProjectAnalysis projectAnalysis); + @Query(value = "select i from MeasureView i where i.analysiscard = :analysisCard") + List findByAnalysisCard(@Param("analysisCard") AnalysisCard analysisCard); } diff --git a/src/main/java/org/measure/platform/core/impl/repository/PersistenceAuditEventRepository.java b/src/main/java/org/measure/platform/core/impl/repository/PersistenceAuditEventRepository.java index 4480df85..3af1411d 100644 --- a/src/main/java/org/measure/platform/core/impl/repository/PersistenceAuditEventRepository.java +++ b/src/main/java/org/measure/platform/core/impl/repository/PersistenceAuditEventRepository.java @@ -3,7 +3,7 @@ import java.time.LocalDateTime; import java.util.List; -import org.measure.platform.framework.domain.PersistentAuditEvent; +import org.measure.platform.utils.domain.PersistentAuditEvent; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/org/measure/platform/core/impl/repository/PersistentTokenRepository.java b/src/main/java/org/measure/platform/core/impl/repository/PersistentTokenRepository.java index 362e53a4..d1b4888d 100644 --- a/src/main/java/org/measure/platform/core/impl/repository/PersistentTokenRepository.java +++ b/src/main/java/org/measure/platform/core/impl/repository/PersistentTokenRepository.java @@ -3,8 +3,8 @@ import java.time.LocalDate; import java.util.List; -import org.measure.platform.framework.domain.PersistentToken; -import org.measure.platform.framework.domain.User; +import org.measure.platform.utils.domain.PersistentToken; +import org.measure.platform.utils.domain.User; import org.springframework.data.jpa.repository.JpaRepository; /** diff --git a/src/main/java/org/measure/platform/core/impl/repository/UserRepository.java b/src/main/java/org/measure/platform/core/impl/repository/UserRepository.java index 6fef0e06..fc7435dc 100644 --- a/src/main/java/org/measure/platform/core/impl/repository/UserRepository.java +++ b/src/main/java/org/measure/platform/core/impl/repository/UserRepository.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Optional; -import org.measure.platform.framework.domain.User; +import org.measure.platform.utils.domain.User; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; diff --git a/src/main/java/org/measure/platform/restapi/analysis/AnalysisConfigurationResource.java b/src/main/java/org/measure/platform/restapi/analysis/AnalysisConfigurationResource.java new file mode 100644 index 00000000..54783eed --- /dev/null +++ b/src/main/java/org/measure/platform/restapi/analysis/AnalysisConfigurationResource.java @@ -0,0 +1,58 @@ +package org.measure.platform.restapi.analysis; + +import java.net.URISyntaxException; + +import javax.validation.Valid; + +import org.measure.platform.core.api.entitys.AnalysisCardService; +import org.measure.platform.core.api.entitys.ProjectAnalysisService; +import org.measure.platform.core.entity.AnalysisCard; +import org.measure.platform.core.entity.ProjectAnalysis; +import org.measure.platform.restapi.analysis.dto.AnalysisConfiguration; +import org.measure.platform.restapi.analysis.dto.CardConfiguration; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.codahale.metrics.annotation.Timed; + +@RestController +@RequestMapping(value = "api/analysis") +public class AnalysisConfigurationResource { + + private final Logger log = LoggerFactory.getLogger(AnalysisConfigurationResource.class); + + private ProjectAnalysisService projectAnalysisService; + + private AnalysisCardService analysisCardService; + + /** + * PUT /configure : Configure a project analysis + * + * @param analysisTool the AnalysisTool to update + * @return the ResponseEntity with status 200 (OK) and with body the updated AnalysisTool, or with status 400 (Bad Request) if the project is + * not valid, or with status 500 (Internal Server Error) if the project couldnt be updated + * @throws java.net.URISyntaxException if the Location URI syntax is incorrect + */ + @PutMapping("/configure") + @Timed + public void configureAnalysisTool(@Valid @RequestBody AnalysisConfiguration analysisConfiguration) throws URISyntaxException { + log.debug("REST request to configure the analysis servicee : {}", analysisConfiguration); + ProjectAnalysis analysis = projectAnalysisService.findOne(analysisConfiguration.getProjectAnalysisId()); + analysis.setViewUrl(analysisConfiguration.getViewUrl()); + analysis.setConfigurationUrl(analysisConfiguration.getConfigurationUrl()); + projectAnalysisService.save(analysis); + + for(CardConfiguration card : analysisConfiguration.getCards()){ + AnalysisCard mcard = new AnalysisCard(); + mcard.setCardLabel(card.getLabel()); + mcard.setCardUrl(card.getCardUrl()); + mcard.setProjectanalysis(analysis); + analysisCardService.save(mcard); + } + } + +} diff --git a/src/main/java/org/measure/platform/restapi/analysis/AnalysisRegistrationResource.java b/src/main/java/org/measure/platform/restapi/analysis/AnalysisRegistrationResource.java new file mode 100644 index 00000000..3dea34c2 --- /dev/null +++ b/src/main/java/org/measure/platform/restapi/analysis/AnalysisRegistrationResource.java @@ -0,0 +1,75 @@ +package org.measure.platform.restapi.analysis; + +import java.net.URISyntaxException; +import java.util.List; + +import javax.inject.Inject; +import javax.validation.Valid; + +import org.measure.platform.restapi.framework.rest.util.HeaderUtil; +import org.measure.platform.service.analysis.api.IAnalysisCatalogueService; +import org.measure.platform.service.analysis.data.AnalysisService; +import org.measure.platform.service.analysis.data.RegistredAnalysisService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.codahale.metrics.annotation.Timed; + +@RestController +@RequestMapping(value = "api/analysis") +public class AnalysisRegistrationResource { + + private final Logger log = LoggerFactory.getLogger(AnalysisRegistrationResource.class); + + + @Inject + IAnalysisCatalogueService analysisRepository; + + /** + * PUT /register : Register an external analysis tool + * @param analysisTool the AnalysisTool to update + * @return the ResponseEntity with status 200 (OK) and with body the updated + * AnalysisTool, or with status 400 (Bad Request) if the project is not + * valid, or with status 500 (Internal Server Error) if the project + * couldnt be updated + * @throws java.net.URISyntaxException if the Location URI syntax is incorrect + */ + @PutMapping("/register") + @Timed + public ResponseEntity registerAnalysisTool(@Valid @RequestBody AnalysisService analysisTool) throws URISyntaxException { + log.debug("REST request to update RegisterAnalysisTool : {}", analysisTool); + analysisRepository.registerAnalysisService(analysisTool); + return ResponseEntity.ok().headers(HeaderUtil.createAlert("AnalysisTool Registred", analysisTool.getName())).body(analysisTool); + } + + + /** + * GET /list : get all the registred analysis services. + * @return the ResponseEntity with status 200 (OK) and the list of analysis service in body + */ + @GetMapping("/list") + @Timed + public List getAllAnalysisService() { + log.debug("REST request to get all AnalysisService"); + return this.analysisRepository.getAllAnalysisService(); + } + + /** + * GET /list/{id} : get an analysis service by is name + * @param id id of the required analysis service + * @return the ResponseEntity with status 200 (OK) and the requested analysis service in body + */ + @GetMapping("/list/{id}") + @Timed + public AnalysisService getAnalysisByName(@PathVariable String id) { + return this.analysisRepository.getAnalysisServiceByName(id); + } + +} diff --git a/src/main/java/org/measure/platform/restapi/analysis/NotificationResource.java b/src/main/java/org/measure/platform/restapi/analysis/NotificationResource.java new file mode 100644 index 00000000..d7f1e05b --- /dev/null +++ b/src/main/java/org/measure/platform/restapi/analysis/NotificationResource.java @@ -0,0 +1,9 @@ +package org.measure.platform.restapi.analysis; + +public class NotificationResource { + + +// /notification/registration +// +// /notification/pooling +} diff --git a/src/main/java/org/measure/platform/restapi/analysis/dto/AnalysisConfiguration.java b/src/main/java/org/measure/platform/restapi/analysis/dto/AnalysisConfiguration.java new file mode 100644 index 00000000..13daf9b6 --- /dev/null +++ b/src/main/java/org/measure/platform/restapi/analysis/dto/AnalysisConfiguration.java @@ -0,0 +1,38 @@ +package org.measure.platform.restapi.analysis.dto; + +import java.util.List; + +public class AnalysisConfiguration { + private Long projectAnalysisId; + private String viewUrl; + private String configurationUrl; + private List cards; + + public Long getProjectAnalysisId() { + return this.projectAnalysisId; + } + public void setProjectAnalysisId(Long projectAnalysisId) { + this.projectAnalysisId = projectAnalysisId; + } + public String getViewUrl() { + return this.viewUrl; + } + public void setViewUrl(String viewUrl) { + this.viewUrl = viewUrl; + } + public String getConfigurationUrl() { + return this.configurationUrl; + } + public void setConfigurationUrl(String configurationUrl) { + this.configurationUrl = configurationUrl; + } + public List getCards() { + return this.cards; + } + public void setCards(List cards) { + this.cards = cards; + } + + + +} diff --git a/src/main/java/org/measure/platform/restapi/analysis/dto/CardConfiguration.java b/src/main/java/org/measure/platform/restapi/analysis/dto/CardConfiguration.java new file mode 100644 index 00000000..9dbfbfc9 --- /dev/null +++ b/src/main/java/org/measure/platform/restapi/analysis/dto/CardConfiguration.java @@ -0,0 +1,24 @@ +package org.measure.platform.restapi.analysis.dto; + + +public class CardConfiguration { + + private String cardUrl; + private String label; + + public String getCardUrl() { + return this.cardUrl; + } + + public void setCardUrl(String cardUrl) { + this.cardUrl = cardUrl; + } + + public String getLabel() { + return this.label; + } + + public void setLabel(String label) { + this.label = label; + } +} diff --git a/src/main/java/org/measure/platform/restapi/analysis/dto/NotificationSuscribtion.java b/src/main/java/org/measure/platform/restapi/analysis/dto/NotificationSuscribtion.java new file mode 100644 index 00000000..38bf156f --- /dev/null +++ b/src/main/java/org/measure/platform/restapi/analysis/dto/NotificationSuscribtion.java @@ -0,0 +1,15 @@ +package org.measure.platform.restapi.analysis.dto; + + +/** + * Suscribtion to a the Platform Alert System. + * + */ + +public class NotificationSuscribtion { + + + + + +} diff --git a/src/main/java/org/measure/platform/restapi/entitys/DashboardResource.java b/src/main/java/org/measure/platform/restapi/entitys/DashboardResource.java index e884add0..4fd11259 100644 --- a/src/main/java/org/measure/platform/restapi/entitys/DashboardResource.java +++ b/src/main/java/org/measure/platform/restapi/entitys/DashboardResource.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.entitys; +package org.measure.platform.restapi.entitys; import java.net.URI; import java.net.URISyntaxException; diff --git a/src/main/java/org/measure/platform/restapi/entitys/MeasureInstanceResource.java b/src/main/java/org/measure/platform/restapi/entitys/MeasureInstanceResource.java index c4ab8808..1810ca75 100644 --- a/src/main/java/org/measure/platform/restapi/entitys/MeasureInstanceResource.java +++ b/src/main/java/org/measure/platform/restapi/entitys/MeasureInstanceResource.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.entitys; +package org.measure.platform.restapi.entitys; import java.net.URI; import java.net.URISyntaxException; @@ -12,16 +12,16 @@ import javax.inject.Inject; import javax.validation.Valid; -import org.measure.platform.agent.api.IRemoteCatalogueService; import org.measure.platform.core.api.IMeasureCatalogueService; import org.measure.platform.core.api.entitys.MeasureInstanceService; import org.measure.platform.core.api.entitys.NotificationService; import org.measure.platform.core.api.entitys.enumeration.NotificationType; import org.measure.platform.core.entity.MeasureInstance; import org.measure.platform.core.entity.Notification; -import org.measure.platform.measurementstorage.api.IMeasurementStorage; import org.measure.platform.restapi.framework.rest.util.HeaderUtil; -import org.measure.platform.smmengine.api.IShedulingService; +import org.measure.platform.service.agent.api.IRemoteCatalogueService; +import org.measure.platform.service.measurement.api.IMeasurementStorage; +import org.measure.platform.service.smmengine.api.ISchedulingService; import org.measure.smm.measure.model.SMMMeasure; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,7 +50,7 @@ public class MeasureInstanceResource { private MeasureInstanceService measureInstanceService; @Inject - private IShedulingService shedulingService; + private ISchedulingService shedulingService; @Inject private NotificationService notificationService; diff --git a/src/main/java/org/measure/platform/restapi/entitys/MeasurePropertyResource.java b/src/main/java/org/measure/platform/restapi/entitys/MeasurePropertyResource.java index 1983ff4e..ba2a7b1c 100644 --- a/src/main/java/org/measure/platform/restapi/entitys/MeasurePropertyResource.java +++ b/src/main/java/org/measure/platform/restapi/entitys/MeasurePropertyResource.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.entitys; +package org.measure.platform.restapi.entitys; import java.net.URI; import java.net.URISyntaxException; diff --git a/src/main/java/org/measure/platform/restapi/entitys/MeasureReferenceResource.java b/src/main/java/org/measure/platform/restapi/entitys/MeasureReferenceResource.java index 87a53f38..3c0ccb8f 100644 --- a/src/main/java/org/measure/platform/restapi/entitys/MeasureReferenceResource.java +++ b/src/main/java/org/measure/platform/restapi/entitys/MeasureReferenceResource.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.entitys; +package org.measure.platform.restapi.entitys; import java.net.URI; import java.net.URISyntaxException; diff --git a/src/main/java/org/measure/platform/restapi/entitys/MeasureViewResource.java b/src/main/java/org/measure/platform/restapi/entitys/MeasureViewResource.java index f7978a2b..b22b3cc3 100644 --- a/src/main/java/org/measure/platform/restapi/entitys/MeasureViewResource.java +++ b/src/main/java/org/measure/platform/restapi/entitys/MeasureViewResource.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.entitys; +package org.measure.platform.restapi.entitys; import java.net.URI; import java.net.URISyntaxException; @@ -9,9 +9,9 @@ import org.measure.platform.core.api.entitys.MeasureViewService; import org.measure.platform.core.entity.MeasureView; -import org.measure.platform.measurementstorage.api.IMeasurementStorage; -import org.measure.platform.restapi.app.services.dto.KibanaVisualisation; import org.measure.platform.restapi.framework.rest.util.HeaderUtil; +import org.measure.platform.restapi.measure.dto.KibanaVisualisation; +import org.measure.platform.service.measurement.api.IMeasurementStorage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; diff --git a/src/main/java/org/measure/platform/restapi/entitys/NotificationResource.java b/src/main/java/org/measure/platform/restapi/entitys/NotificationResource.java index df0e8288..b92cc381 100644 --- a/src/main/java/org/measure/platform/restapi/entitys/NotificationResource.java +++ b/src/main/java/org/measure/platform/restapi/entitys/NotificationResource.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.entitys; +package org.measure.platform.restapi.entitys; import java.net.URI; import java.net.URISyntaxException; diff --git a/src/main/java/org/measure/platform/restapi/entitys/PhaseResource.java b/src/main/java/org/measure/platform/restapi/entitys/PhaseResource.java index 9f09f53b..fe8b1c61 100644 --- a/src/main/java/org/measure/platform/restapi/entitys/PhaseResource.java +++ b/src/main/java/org/measure/platform/restapi/entitys/PhaseResource.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.entitys; +package org.measure.platform.restapi.entitys; import java.net.URI; import java.net.URISyntaxException; diff --git a/src/main/java/org/measure/platform/restapi/entitys/ProjectAnalysisResource.java b/src/main/java/org/measure/platform/restapi/entitys/ProjectAnalysisResource.java new file mode 100644 index 00000000..88c7816d --- /dev/null +++ b/src/main/java/org/measure/platform/restapi/entitys/ProjectAnalysisResource.java @@ -0,0 +1,139 @@ +package org.measure.platform.restapi.entitys; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.List; +import java.util.Optional; + +import javax.inject.Inject; +import javax.validation.Valid; + +import org.measure.platform.core.api.entitys.ProjectAnalysisService; +import org.measure.platform.core.api.entitys.ProjectService; +import org.measure.platform.core.entity.ProjectAnalysis; +import org.measure.platform.restapi.framework.rest.util.HeaderUtil; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.codahale.metrics.annotation.Timed; + +/** + * REST controller for managing ProjectAnalysis. + */ +@RestController +@RequestMapping("/api") +public class ProjectAnalysisResource { + private final Logger log = LoggerFactory.getLogger(ProjectAnalysisResource.class); + + @Inject + private ProjectAnalysisService projectAnalysisService; + + @Inject + private ProjectService projecService; + + /** + * POST /projectAnalysis : Create a new projectAnalysis. + * + * @param projectAnalysis the projectAnalysis to create + * @return the ResponseEntity with status 201 (Created) and with body the new projectAnalysis, or with status 400 (Bad Request) if the projectAnalysis has already an ID + * @throws java.net.URISyntaxException if the Location URI syntax is incorrect + */ + @PostMapping("/projectAnalysis") + @Timed + public ResponseEntity createProjectAnalysis(@Valid @RequestBody ProjectAnalysis projectAnalysis) + throws URISyntaxException { + log.debug("REST request to save ProjectAnalysis : {}", projectAnalysis); + if (projectAnalysis.getId() != null) { + return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert("projectAnalysis", "idexists", + "A new projectAnalysis cannot already have an ID")).body(null); + } + ProjectAnalysis result = projectAnalysisService.save(projectAnalysis); + return ResponseEntity.created(new URI("/api/projectAnalysiss/" + result.getId())) + .headers(HeaderUtil.createEntityCreationAlert("projectAnalysis", result.getId().toString())) + .body(result); + } + + /** + * PUT /projectAnalysiss : Updates an existing projectAnalysis. + * + * @param projectAnalysis the projectAnalysis to update + * @return the ResponseEntity with status 200 (OK) and with body the updated projectAnalysis, or with status 400 (Bad Request) if the projectAnalysis is not valid, + * or with status 500 (Internal Server Error) if the projectAnalysis couldnt be updated + * @throws java.net.URISyntaxException if the Location URI syntax is incorrect + */ + @PutMapping("/projectAnalysiss") + @Timed + public ResponseEntity updateProjectAnalysis(@Valid @RequestBody ProjectAnalysis projectAnalysis) + throws URISyntaxException { + log.debug("REST request to update ProjectAnalysis : {}", projectAnalysis); + if (projectAnalysis.getId() == null) { + return createProjectAnalysis(projectAnalysis); + } + ProjectAnalysis result = projectAnalysisService.save(projectAnalysis); + return ResponseEntity.ok() + .headers(HeaderUtil.createEntityUpdateAlert("projectAnalysis", projectAnalysis.getId().toString())) + .body(result); + } + + /** + * GET /projectAnalysiss : get all the projectAnalysiss. + * + * @return the ResponseEntity with status 200 (OK) and the list of projectAnalysiss in body + */ + @GetMapping("/projectAnalysiss") + @Timed + public List getAllProjectAnalysiss() { + log.debug("REST request to get all ProjectAnalysiss"); + return projectAnalysisService.findAll(); + } + + @GetMapping("/projectAnalysis/byproject/{id}") + @Timed + public List getPhasesByProject(@PathVariable Long id) { + return projectAnalysisService.findAllByProject(projecService.findOne(id)); + } + + /** + * GET /projectAnalysiss/:id : get the "id" projectAnalysis. + * + * @param id + * the id of the projectAnalysis to retrieve + * @return the ResponseEntity with status 200 (OK) and with body the + * projectAnalysis, or with status 404 (Not Found) + */ + @GetMapping("/projectAnalysiss/{id}") + @Timed + public ResponseEntity getProjectAnalysis(@PathVariable Long id) { + log.debug("REST request to get ProjectAnalysis : {}", id); + ProjectAnalysis projectAnalysis = projectAnalysisService.findOne(id); + return Optional.ofNullable(projectAnalysis).map(result -> new ResponseEntity<>(result, HttpStatus.OK)) + .orElse(new ResponseEntity<>(HttpStatus.NOT_FOUND)); + } + + /** + * DELETE /projectAnalysiss/:id : delete the "id" projectAnalysis. + * + * @param id + * the id of the projectAnalysis to delete + * @return the ResponseEntity with status 200 (OK) + */ + @DeleteMapping("/projectAnalysiss/{id}") + @Timed + public ResponseEntity deleteProjectAnalysis(@PathVariable Long id) { + log.debug("REST request to delete ProjectAnalysis : {}", id); + projectAnalysisService.delete(id); + return ResponseEntity.ok().headers(HeaderUtil.createEntityDeletionAlert("projectAnalysis", id.toString())) + .build(); + } + +} diff --git a/src/main/java/org/measure/platform/restapi/entitys/ProjectResource.java b/src/main/java/org/measure/platform/restapi/entitys/ProjectResource.java index e63eb7e6..55217e58 100644 --- a/src/main/java/org/measure/platform/restapi/entitys/ProjectResource.java +++ b/src/main/java/org/measure/platform/restapi/entitys/ProjectResource.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.entitys; +package org.measure.platform.restapi.entitys; import java.net.URI; import java.net.URISyntaxException; diff --git a/src/main/java/org/measure/platform/restapi/framework/filter/CachingHttpHeadersFilter.java b/src/main/java/org/measure/platform/restapi/framework/filter/CachingHttpHeadersFilter.java index bf14d3f6..c5cc4adf 100644 --- a/src/main/java/org/measure/platform/restapi/framework/filter/CachingHttpHeadersFilter.java +++ b/src/main/java/org/measure/platform/restapi/framework/filter/CachingHttpHeadersFilter.java @@ -11,7 +11,7 @@ import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletResponse; -import org.measure.platform.framework.config.JHipsterProperties; +import org.measure.platform.utils.config.JHipsterProperties; /** * This filter is used in production, to put HTTP cache headers with a long (1 month) expiration time. diff --git a/src/main/java/org/measure/platform/restapi/framework/rest/AccountResource.java b/src/main/java/org/measure/platform/restapi/framework/rest/AccountResource.java index 96cc996d..db3e3828 100644 --- a/src/main/java/org/measure/platform/restapi/framework/rest/AccountResource.java +++ b/src/main/java/org/measure/platform/restapi/framework/rest/AccountResource.java @@ -12,15 +12,15 @@ import org.apache.commons.lang3.StringUtils; import org.measure.platform.core.impl.repository.PersistentTokenRepository; import org.measure.platform.core.impl.repository.UserRepository; -import org.measure.platform.framework.domain.PersistentToken; -import org.measure.platform.framework.domain.User; -import org.measure.platform.framework.security.SecurityUtils; -import org.measure.platform.framework.service.MailService; -import org.measure.platform.framework.service.UserService; -import org.measure.platform.framework.service.dto.UserDTO; import org.measure.platform.restapi.framework.rest.util.HeaderUtil; import org.measure.platform.restapi.framework.rest.vm.KeyAndPasswordVM; import org.measure.platform.restapi.framework.rest.vm.ManagedUserVM; +import org.measure.platform.utils.domain.PersistentToken; +import org.measure.platform.utils.domain.User; +import org.measure.platform.utils.security.SecurityUtils; +import org.measure.platform.utils.service.MailService; +import org.measure.platform.utils.service.UserService; +import org.measure.platform.utils.service.dto.UserDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpHeaders; diff --git a/src/main/java/org/measure/platform/restapi/framework/rest/AuditResource.java b/src/main/java/org/measure/platform/restapi/framework/rest/AuditResource.java index 26e28acf..7d2869e4 100644 --- a/src/main/java/org/measure/platform/restapi/framework/rest/AuditResource.java +++ b/src/main/java/org/measure/platform/restapi/framework/rest/AuditResource.java @@ -6,8 +6,8 @@ import javax.inject.Inject; -import org.measure.platform.framework.service.AuditEventService; import org.measure.platform.restapi.framework.rest.util.PaginationUtil; +import org.measure.platform.utils.service.AuditEventService; import org.springframework.boot.actuate.audit.AuditEvent; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/src/main/java/org/measure/platform/restapi/framework/rest/ProfileInfoResource.java b/src/main/java/org/measure/platform/restapi/framework/rest/ProfileInfoResource.java index b4b3442f..5af77b5d 100644 --- a/src/main/java/org/measure/platform/restapi/framework/rest/ProfileInfoResource.java +++ b/src/main/java/org/measure/platform/restapi/framework/rest/ProfileInfoResource.java @@ -6,8 +6,8 @@ import javax.inject.Inject; -import org.measure.platform.framework.config.DefaultProfileUtil; -import org.measure.platform.framework.config.JHipsterProperties; +import org.measure.platform.utils.config.DefaultProfileUtil; +import org.measure.platform.utils.config.JHipsterProperties; import org.springframework.core.env.Environment; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; diff --git a/src/main/java/org/measure/platform/restapi/framework/rest/UserResource.java b/src/main/java/org/measure/platform/restapi/framework/rest/UserResource.java index b757450a..b1667d49 100644 --- a/src/main/java/org/measure/platform/restapi/framework/rest/UserResource.java +++ b/src/main/java/org/measure/platform/restapi/framework/rest/UserResource.java @@ -10,14 +10,14 @@ import javax.servlet.http.HttpServletRequest; import org.measure.platform.core.impl.repository.UserRepository; -import org.measure.platform.framework.config.Constants; -import org.measure.platform.framework.domain.User; -import org.measure.platform.framework.security.AuthoritiesConstants; -import org.measure.platform.framework.service.MailService; -import org.measure.platform.framework.service.UserService; import org.measure.platform.restapi.framework.rest.util.HeaderUtil; import org.measure.platform.restapi.framework.rest.util.PaginationUtil; import org.measure.platform.restapi.framework.rest.vm.ManagedUserVM; +import org.measure.platform.utils.config.Constants; +import org.measure.platform.utils.domain.User; +import org.measure.platform.utils.security.AuthoritiesConstants; +import org.measure.platform.utils.service.MailService; +import org.measure.platform.utils.service.UserService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.data.domain.Page; diff --git a/src/main/java/org/measure/platform/restapi/framework/rest/vm/ManagedUserVM.java b/src/main/java/org/measure/platform/restapi/framework/rest/vm/ManagedUserVM.java index 8d780ce9..bb9e5f32 100644 --- a/src/main/java/org/measure/platform/restapi/framework/rest/vm/ManagedUserVM.java +++ b/src/main/java/org/measure/platform/restapi/framework/rest/vm/ManagedUserVM.java @@ -5,8 +5,8 @@ import javax.validation.constraints.Size; -import org.measure.platform.framework.domain.User; -import org.measure.platform.framework.service.dto.UserDTO; +import org.measure.platform.utils.domain.User; +import org.measure.platform.utils.service.dto.UserDTO; /** * View Model extending the UserDTO, which is meant to be used in the user management UI. diff --git a/src/main/java/org/measure/platform/restapi/measure/AgentResource.java b/src/main/java/org/measure/platform/restapi/measure/AgentResource.java index 329dd6cf..4a48a723 100644 --- a/src/main/java/org/measure/platform/restapi/measure/AgentResource.java +++ b/src/main/java/org/measure/platform/restapi/measure/AgentResource.java @@ -1,15 +1,15 @@ -package org.measure.platform.restapi.app.services; +package org.measure.platform.restapi.measure; import java.util.List; import javax.inject.Inject; import javax.validation.Valid; -import org.measure.platform.agent.api.IAgentManager; -import org.measure.platform.agent.api.IRemoteCatalogueService; -import org.measure.platform.restapi.app.services.dto.MeasureAgent; -import org.measure.platform.smmengine.api.IRemoteMeasureExecutionService; -import org.measure.platform.smmengine.api.IShedulingService; +import org.measure.platform.restapi.measure.dto.MeasureAgent; +import org.measure.platform.service.agent.api.IAgentManager; +import org.measure.platform.service.agent.api.IRemoteCatalogueService; +import org.measure.platform.service.smmengine.api.IRemoteMeasureExecutionService; +import org.measure.platform.service.smmengine.api.ISchedulingService; import org.measure.smm.log.MeasureLog; import org.measure.smm.measure.model.SMMMeasure; import org.measure.smm.remote.RemoteMeasureInstanceList; @@ -26,18 +26,18 @@ @RestController @RequestMapping(value = "api/remote-measure") -public class RemoteMeasureResource { +public class AgentResource { @Inject - IRemoteCatalogueService remoteCatalogue; + IRemoteCatalogueService remoteCatalogue; @Inject - IShedulingService schedulingService; + ISchedulingService schedulingService; @Inject - IRemoteMeasureExecutionService remoteExecutionService; + IRemoteMeasureExecutionService remoteExecutionService; @Inject - IAgentManager agentService; + IAgentManager agentService; @PutMapping("/registration") @Timed diff --git a/src/main/java/org/measure/platform/restapi/measure/ConfigurationResource.java b/src/main/java/org/measure/platform/restapi/measure/ConfigurationResource.java index 492ea21e..f0f5f590 100644 --- a/src/main/java/org/measure/platform/restapi/measure/ConfigurationResource.java +++ b/src/main/java/org/measure/platform/restapi/measure/ConfigurationResource.java @@ -1,6 +1,6 @@ -package org.measure.platform.restapi.app.services; +package org.measure.platform.restapi.measure; -import org.measure.platform.restapi.app.services.dto.PlatformConfiguration; +import org.measure.platform.restapi.measure.dto.PlatformConfiguration; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; diff --git a/src/main/java/org/measure/platform/restapi/measure/MeasureExecutionResource.java b/src/main/java/org/measure/platform/restapi/measure/MeasureExecutionResource.java index b78be1c0..83cd66bb 100644 --- a/src/main/java/org/measure/platform/restapi/measure/MeasureExecutionResource.java +++ b/src/main/java/org/measure/platform/restapi/measure/MeasureExecutionResource.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.services; +package org.measure.platform.restapi.measure; import java.util.Optional; @@ -6,9 +6,9 @@ import org.measure.platform.core.api.entitys.MeasureInstanceService; import org.measure.platform.core.entity.MeasureInstance; -import org.measure.platform.smmengine.api.ILoggerService; -import org.measure.platform.smmengine.api.IMeasureExecutionService; -import org.measure.platform.smmengine.api.IShedulingService; +import org.measure.platform.service.smmengine.api.ILoggerService; +import org.measure.platform.service.smmengine.api.IMeasureExecutionService; +import org.measure.platform.service.smmengine.api.ISchedulingService; import org.measure.smm.log.MeasureLog; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -26,7 +26,7 @@ public class MeasureExecutionResource { private IMeasureExecutionService measureExecutionService; @Inject - private IShedulingService shedulingService; + private ISchedulingService shedulingService; @Inject private MeasureInstanceService instanceService; diff --git a/src/main/java/org/measure/platform/restapi/measure/MeasureLoggerResource.java b/src/main/java/org/measure/platform/restapi/measure/MeasureLoggerResource.java index a7e1900d..a04fa44e 100644 --- a/src/main/java/org/measure/platform/restapi/measure/MeasureLoggerResource.java +++ b/src/main/java/org/measure/platform/restapi/measure/MeasureLoggerResource.java @@ -1,10 +1,10 @@ -package org.measure.platform.restapi.app.services; +package org.measure.platform.restapi.measure; import java.util.List; import javax.inject.Inject; -import org.measure.platform.smmengine.api.ILoggerService; +import org.measure.platform.service.smmengine.api.ILoggerService; import org.measure.smm.log.MeasureLog; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; diff --git a/src/main/java/org/measure/platform/restapi/measure/MeasureResource.java b/src/main/java/org/measure/platform/restapi/measure/MeasureResource.java index 0fdb921c..cbf1d67a 100644 --- a/src/main/java/org/measure/platform/restapi/measure/MeasureResource.java +++ b/src/main/java/org/measure/platform/restapi/measure/MeasureResource.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.services; +package org.measure.platform.restapi.measure; import java.io.BufferedOutputStream; import java.io.File; @@ -11,10 +11,10 @@ import javax.inject.Inject; import javax.xml.bind.DatatypeConverter; -import org.measure.platform.agent.api.IRemoteCatalogueService; import org.measure.platform.core.api.IMeasureCatalogueService; -import org.measure.platform.measurementstorage.impl.ElasticMeasurementStorage; import org.measure.platform.restapi.framework.rest.util.HeaderUtil; +import org.measure.platform.service.agent.api.IRemoteCatalogueService; +import org.measure.platform.service.measurement.impl.ElasticMeasurementStorage; import org.measure.smm.measure.model.SMMMeasure; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/measure/platform/restapi/measure/dto/KibanaVisualisation.java b/src/main/java/org/measure/platform/restapi/measure/dto/KibanaVisualisation.java index ae5781b3..d0983e02 100644 --- a/src/main/java/org/measure/platform/restapi/measure/dto/KibanaVisualisation.java +++ b/src/main/java/org/measure/platform/restapi/measure/dto/KibanaVisualisation.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.services.dto; +package org.measure.platform.restapi.measure.dto; public class KibanaVisualisation { private String name; diff --git a/src/main/java/org/measure/platform/restapi/measure/dto/MeasureAgent.java b/src/main/java/org/measure/platform/restapi/measure/dto/MeasureAgent.java index 2a478398..8b9e7d60 100644 --- a/src/main/java/org/measure/platform/restapi/measure/dto/MeasureAgent.java +++ b/src/main/java/org/measure/platform/restapi/measure/dto/MeasureAgent.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.services.dto; +package org.measure.platform.restapi.measure.dto; import java.util.ArrayList; import java.util.List; diff --git a/src/main/java/org/measure/platform/restapi/measure/dto/MeasureUniteProperty.java b/src/main/java/org/measure/platform/restapi/measure/dto/MeasureUniteProperty.java index 2d82d1c0..46019c62 100644 --- a/src/main/java/org/measure/platform/restapi/measure/dto/MeasureUniteProperty.java +++ b/src/main/java/org/measure/platform/restapi/measure/dto/MeasureUniteProperty.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.services.dto; +package org.measure.platform.restapi.measure.dto; public class MeasureUniteProperty { private String name; diff --git a/src/main/java/org/measure/platform/restapi/measure/dto/PlatformConfiguration.java b/src/main/java/org/measure/platform/restapi/measure/dto/PlatformConfiguration.java index b7201cb8..82296dc1 100644 --- a/src/main/java/org/measure/platform/restapi/measure/dto/PlatformConfiguration.java +++ b/src/main/java/org/measure/platform/restapi/measure/dto/PlatformConfiguration.java @@ -1,4 +1,4 @@ -package org.measure.platform.restapi.app.services.dto; +package org.measure.platform.restapi.measure.dto; public class PlatformConfiguration { private String kibanaAdress; diff --git a/src/main/java/org/measure/platform/service/agent/api/IAgentManager.java b/src/main/java/org/measure/platform/service/agent/api/IAgentManager.java index 526520b3..bace291a 100644 --- a/src/main/java/org/measure/platform/service/agent/api/IAgentManager.java +++ b/src/main/java/org/measure/platform/service/agent/api/IAgentManager.java @@ -1,8 +1,8 @@ -package org.measure.platform.agent.api; +package org.measure.platform.service.agent.api; import java.util.List; -import org.measure.platform.restapi.app.services.dto.MeasureAgent; +import org.measure.platform.restapi.measure.dto.MeasureAgent; public interface IAgentManager { List getAgents(); diff --git a/src/main/java/org/measure/platform/service/agent/api/IRemoteCatalogueService.java b/src/main/java/org/measure/platform/service/agent/api/IRemoteCatalogueService.java index 9e44dcce..04c9247b 100644 --- a/src/main/java/org/measure/platform/service/agent/api/IRemoteCatalogueService.java +++ b/src/main/java/org/measure/platform/service/agent/api/IRemoteCatalogueService.java @@ -1,9 +1,9 @@ -package org.measure.platform.agent.api; +package org.measure.platform.service.agent.api; import java.util.Collection; import java.util.List; -import org.measure.platform.agent.impl.data.RemoteAgent; +import org.measure.platform.service.agent.data.RemoteAgent; import org.measure.smm.measure.model.SMMMeasure; public interface IRemoteCatalogueService { diff --git a/src/main/java/org/measure/platform/service/agent/data/RemoteAgent.java b/src/main/java/org/measure/platform/service/agent/data/RemoteAgent.java index 2ce7116d..78562d88 100644 --- a/src/main/java/org/measure/platform/service/agent/data/RemoteAgent.java +++ b/src/main/java/org/measure/platform/service/agent/data/RemoteAgent.java @@ -1,4 +1,4 @@ -package org.measure.platform.agent.impl.data; +package org.measure.platform.service.agent.data; import java.util.Date; import java.util.HashMap; diff --git a/src/main/java/org/measure/platform/service/agent/impl/AgentCatalogueService.java b/src/main/java/org/measure/platform/service/agent/impl/AgentCatalogueService.java index cb76be0e..9196d2b1 100644 --- a/src/main/java/org/measure/platform/service/agent/impl/AgentCatalogueService.java +++ b/src/main/java/org/measure/platform/service/agent/impl/AgentCatalogueService.java @@ -1,4 +1,4 @@ -package org.measure.platform.agent.impl; +package org.measure.platform.service.agent.impl; import java.util.ArrayList; import java.util.Collection; @@ -6,8 +6,8 @@ import java.util.List; import java.util.Map; -import org.measure.platform.agent.api.IRemoteCatalogueService; -import org.measure.platform.agent.impl.data.RemoteAgent; +import org.measure.platform.service.agent.api.IRemoteCatalogueService; +import org.measure.platform.service.agent.data.RemoteAgent; import org.measure.smm.measure.model.SMMMeasure; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/measure/platform/service/agent/impl/AgentManager.java b/src/main/java/org/measure/platform/service/agent/impl/AgentManager.java index db87c506..d2b11cc1 100644 --- a/src/main/java/org/measure/platform/service/agent/impl/AgentManager.java +++ b/src/main/java/org/measure/platform/service/agent/impl/AgentManager.java @@ -1,4 +1,4 @@ -package org.measure.platform.agent.impl; +package org.measure.platform.service.agent.impl; import java.util.ArrayList; import java.util.Comparator; @@ -7,13 +7,13 @@ import javax.inject.Inject; -import org.measure.platform.agent.api.IAgentManager; -import org.measure.platform.agent.api.IRemoteCatalogueService; -import org.measure.platform.agent.impl.data.RemoteAgent; import org.measure.platform.core.api.entitys.MeasureInstanceService; import org.measure.platform.core.entity.MeasureInstance; -import org.measure.platform.restapi.app.services.dto.MeasureAgent; -import org.measure.platform.smmengine.api.IShedulingService; +import org.measure.platform.restapi.measure.dto.MeasureAgent; +import org.measure.platform.service.agent.api.IAgentManager; +import org.measure.platform.service.agent.api.IRemoteCatalogueService; +import org.measure.platform.service.agent.data.RemoteAgent; +import org.measure.platform.service.smmengine.api.ISchedulingService; import org.measure.smm.measure.model.SMMMeasure; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; @@ -31,7 +31,7 @@ public class AgentManager implements IAgentManager { MeasureInstanceService measureInstanceService; @Inject - IShedulingService shedulingService; + ISchedulingService shedulingService; @Scheduled(fixedRate = 20000) public void reportCurrentTime() { diff --git a/src/main/java/org/measure/platform/service/analysis/api/IAnalysisCatalogueService.java b/src/main/java/org/measure/platform/service/analysis/api/IAnalysisCatalogueService.java new file mode 100644 index 00000000..307efc4f --- /dev/null +++ b/src/main/java/org/measure/platform/service/analysis/api/IAnalysisCatalogueService.java @@ -0,0 +1,36 @@ +package org.measure.platform.service.analysis.api; + +import java.util.List; + +import org.measure.platform.service.analysis.data.AnalysisService; +import org.measure.platform.service.analysis.data.RegistredAnalysisService; + +public interface IAnalysisCatalogueService { + + + /** + * Register a new AnalysisService + * @param service The service to register + */ + public void registerAnalysisService(AnalysisService service); + + /** + * Unregister an analysis service + * @param service The service to unregister + */ + public void unregisterAnalysisService(AnalysisService service); + + /** + * Find an Analysis Service by is name + * @param name The name of the required service + * @return The find analysis service + */ + public AnalysisService getAnalysisServiceByName(String name); + + /** + * Find all registred analysis service + * @return List of all analysis services + */ + public List getAllAnalysisService(); + +} diff --git a/src/main/java/org/measure/platform/service/analysis/api/INotificationService.java b/src/main/java/org/measure/platform/service/analysis/api/INotificationService.java new file mode 100644 index 00000000..8fcd0709 --- /dev/null +++ b/src/main/java/org/measure/platform/service/analysis/api/INotificationService.java @@ -0,0 +1,36 @@ +package org.measure.platform.service.analysis.api; + +import java.util.List; + +import org.measure.platform.core.entity.AlertEvent; +import org.measure.platform.service.analysis.data.Notification; + +public interface INotificationService { + + /** + * Suscribe to a notificationn. + */ + public void suscribe(AlertEvent suscribtion); + + + /** + * Unsuscribe to a notification + */ + public void unsuscribe(); + + /** + * Get the list of notifications arrive between now and the last call of the service by the analysis tool. + * @return List of new Notifications. + * + */ + public List getNotifications(); + + /** + * Allow the platform to send notification to analysis tool which have suscribe to this notification + * + */ + public void notifyAnalysisTool(); + +} + + diff --git a/src/main/java/org/measure/platform/service/analysis/data/AnalysisService.java b/src/main/java/org/measure/platform/service/analysis/data/AnalysisService.java new file mode 100644 index 00000000..d90621f3 --- /dev/null +++ b/src/main/java/org/measure/platform/service/analysis/data/AnalysisService.java @@ -0,0 +1,45 @@ +package org.measure.platform.service.analysis.data; + +/** + * External data analysis service which is integrated with Measure Platform. + * COuld provide the url of a general configuration page + */ +public class AnalysisService { + + private String name; + + private String description; + + private String configurationURL; + + public AnalysisService(String name,String description){ + this.name = name; + this.description = description; + } + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getConfigurationURL() { + return configurationURL; + } + + public void setConfigurationURL(String configurationURL) { + this.configurationURL = configurationURL; + } + +} diff --git a/src/main/java/org/measure/platform/service/analysis/data/Notification.java b/src/main/java/org/measure/platform/service/analysis/data/Notification.java new file mode 100644 index 00000000..90958def --- /dev/null +++ b/src/main/java/org/measure/platform/service/analysis/data/Notification.java @@ -0,0 +1,9 @@ +package org.measure.platform.service.analysis.data; + + +/** + * Notification collected by the Measure Platform and consume by the external analysis tools. + */ +public class Notification { + +} diff --git a/src/main/java/org/measure/platform/service/analysis/data/RegistredAnalysisService.java b/src/main/java/org/measure/platform/service/analysis/data/RegistredAnalysisService.java new file mode 100644 index 00000000..243ba54f --- /dev/null +++ b/src/main/java/org/measure/platform/service/analysis/data/RegistredAnalysisService.java @@ -0,0 +1,22 @@ +package org.measure.platform.service.analysis.data; + +import java.util.Date; + +/** + * Analysis Service registre into Measure Platform + * + */ +public class RegistredAnalysisService extends AnalysisService { + + private Date liveSign; + public RegistredAnalysisService(AnalysisService service,Date liveSign) { + super(service.getName(), service.getDescription()); + } + public Date getLiveSign() { + return liveSign; + } + public void setLiveSign(Date liveSign) { + this.liveSign = liveSign; + } + +} diff --git a/src/main/java/org/measure/platform/service/analysis/impl/AnalysisCatalogue.java b/src/main/java/org/measure/platform/service/analysis/impl/AnalysisCatalogue.java new file mode 100644 index 00000000..93242eac --- /dev/null +++ b/src/main/java/org/measure/platform/service/analysis/impl/AnalysisCatalogue.java @@ -0,0 +1,49 @@ +package org.measure.platform.service.analysis.impl; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.measure.platform.service.analysis.api.IAnalysisCatalogueService; +import org.measure.platform.service.analysis.data.AnalysisService; +import org.measure.platform.service.analysis.data.RegistredAnalysisService; +import org.springframework.context.annotation.Scope; +import org.springframework.stereotype.Service; + + +@Service +@Scope(value = "singleton") +public class AnalysisCatalogue implements IAnalysisCatalogueService { + + + private Map analysisToolMap = new HashMap<>(); + + @Override + public void registerAnalysisService(AnalysisService service) { + if(!this.analysisToolMap.containsKey(service.getName())){ + RegistredAnalysisService rs = new RegistredAnalysisService(service,new Date()); + this.analysisToolMap.put(service.getName(), rs); + }else{ + this.analysisToolMap.get(service.getName()).setLiveSign(new Date()); + } + + } + + @Override + public void unregisterAnalysisService(AnalysisService service) { + this.analysisToolMap.remove(service.getName()); + + } + + @Override + public AnalysisService getAnalysisServiceByName(String serviceName) { + return this.analysisToolMap.get(serviceName); + } + + @Override + public List getAllAnalysisService() { + return new ArrayList(this.analysisToolMap.values()); + } +} diff --git a/src/main/java/org/measure/platform/service/analysis/impl/AnalysisCatalogueManager.java b/src/main/java/org/measure/platform/service/analysis/impl/AnalysisCatalogueManager.java new file mode 100644 index 00000000..da2a8e77 --- /dev/null +++ b/src/main/java/org/measure/platform/service/analysis/impl/AnalysisCatalogueManager.java @@ -0,0 +1,34 @@ +package org.measure.platform.service.analysis.impl; + +import java.util.Date; + +import javax.inject.Inject; + +import org.measure.platform.service.analysis.api.IAnalysisCatalogueService; +import org.measure.platform.service.analysis.data.RegistredAnalysisService; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Service; + +@Service +@Configuration +@EnableScheduling +public class AnalysisCatalogueManager { + + @Inject + private IAnalysisCatalogueService analyseCatalogue; + + /** + * Remove Analysis Service form Catalogue which are not active from more than 1 minute + */ + @Scheduled(fixedRate = 60000) + public void reportCurrentTime() { + for (RegistredAnalysisService service : analyseCatalogue.getAllAnalysisService()) { + if (new Date().getTime() - service.getLiveSign().getTime() > 60000) { + analyseCatalogue.unregisterAnalysisService(service); + } + } + } + +} diff --git a/src/main/java/org/measure/platform/service/measurement/api/IElasticsearchIndexManager.java b/src/main/java/org/measure/platform/service/measurement/api/IElasticsearchIndexManager.java index 2e4d9b7e..8c55d771 100644 --- a/src/main/java/org/measure/platform/service/measurement/api/IElasticsearchIndexManager.java +++ b/src/main/java/org/measure/platform/service/measurement/api/IElasticsearchIndexManager.java @@ -1,4 +1,4 @@ -package org.measure.platform.measurementstorage.api; +package org.measure.platform.service.measurement.api; import java.util.List; diff --git a/src/main/java/org/measure/platform/service/measurement/api/IMeasurementStorage.java b/src/main/java/org/measure/platform/service/measurement/api/IMeasurementStorage.java index 5e352293..bd2fafda 100644 --- a/src/main/java/org/measure/platform/service/measurement/api/IMeasurementStorage.java +++ b/src/main/java/org/measure/platform/service/measurement/api/IMeasurementStorage.java @@ -1,8 +1,8 @@ -package org.measure.platform.measurementstorage.api; +package org.measure.platform.service.measurement.api; import java.util.List; -import org.measure.platform.restapi.app.services.dto.KibanaVisualisation; +import org.measure.platform.restapi.measure.dto.KibanaVisualisation; import org.measure.smm.measure.api.IMeasurement; public interface IMeasurementStorage { diff --git a/src/main/java/org/measure/platform/service/measurement/impl/ElasticConnection.java b/src/main/java/org/measure/platform/service/measurement/impl/ElasticConnection.java index 3ca6af3b..1c42d791 100644 --- a/src/main/java/org/measure/platform/service/measurement/impl/ElasticConnection.java +++ b/src/main/java/org/measure/platform/service/measurement/impl/ElasticConnection.java @@ -1,4 +1,4 @@ -package org.measure.platform.measurementstorage.impl; +package org.measure.platform.service.measurement.impl; import java.net.InetAddress; diff --git a/src/main/java/org/measure/platform/service/measurement/impl/ElasticMeasurementStorage.java b/src/main/java/org/measure/platform/service/measurement/impl/ElasticMeasurementStorage.java index 30ff5f7d..ed6bf6f0 100644 --- a/src/main/java/org/measure/platform/service/measurement/impl/ElasticMeasurementStorage.java +++ b/src/main/java/org/measure/platform/service/measurement/impl/ElasticMeasurementStorage.java @@ -1,4 +1,4 @@ -package org.measure.platform.measurementstorage.impl; +package org.measure.platform.service.measurement.impl; import java.io.IOException; import java.util.ArrayList; @@ -16,9 +16,9 @@ import org.elasticsearch.index.query.QueryStringQueryBuilder; import org.elasticsearch.search.SearchHit; import org.elasticsearch.search.sort.SortOrder; -import org.measure.platform.measurementstorage.api.IElasticsearchIndexManager; -import org.measure.platform.measurementstorage.api.IMeasurementStorage; -import org.measure.platform.restapi.app.services.dto.KibanaVisualisation; +import org.measure.platform.restapi.measure.dto.KibanaVisualisation; +import org.measure.platform.service.measurement.api.IElasticsearchIndexManager; +import org.measure.platform.service.measurement.api.IMeasurementStorage; import org.measure.smm.measure.api.IMeasurement; import org.measure.smm.measure.defaultimpl.measurements.DefaultMeasurement; import org.slf4j.Logger; diff --git a/src/main/java/org/measure/platform/service/measurement/impl/ElasticsearchIndexManager.java b/src/main/java/org/measure/platform/service/measurement/impl/ElasticsearchIndexManager.java index 06149e57..694acbc5 100644 --- a/src/main/java/org/measure/platform/service/measurement/impl/ElasticsearchIndexManager.java +++ b/src/main/java/org/measure/platform/service/measurement/impl/ElasticsearchIndexManager.java @@ -1,4 +1,4 @@ -package org.measure.platform.measurementstorage.impl; +package org.measure.platform.service.measurement.impl; import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; @@ -15,7 +15,7 @@ import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse; import org.elasticsearch.client.transport.TransportClient; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.measure.platform.measurementstorage.api.IElasticsearchIndexManager; +import org.measure.platform.service.measurement.api.IElasticsearchIndexManager; import org.measure.smm.measure.model.MeasureUnitField; import org.measure.smm.measure.model.SMMMeasure; import org.springframework.beans.factory.annotation.Value; diff --git a/src/main/java/org/measure/platform/service/smmengine/api/ILoggerService.java b/src/main/java/org/measure/platform/service/smmengine/api/ILoggerService.java index daeb8071..8ed20adf 100644 --- a/src/main/java/org/measure/platform/service/smmengine/api/ILoggerService.java +++ b/src/main/java/org/measure/platform/service/smmengine/api/ILoggerService.java @@ -1,4 +1,4 @@ -package org.measure.platform.smmengine.api; +package org.measure.platform.service.smmengine.api; import java.util.List; diff --git a/src/main/java/org/measure/platform/service/smmengine/api/IMeasureExecutionService.java b/src/main/java/org/measure/platform/service/smmengine/api/IMeasureExecutionService.java index 5fcd4947..d3a9dd19 100644 --- a/src/main/java/org/measure/platform/service/smmengine/api/IMeasureExecutionService.java +++ b/src/main/java/org/measure/platform/service/smmengine/api/IMeasureExecutionService.java @@ -1,4 +1,4 @@ -package org.measure.platform.smmengine.api; +package org.measure.platform.service.smmengine.api; import org.measure.platform.core.entity.MeasureInstance; import org.measure.smm.log.MeasureLog; diff --git a/src/main/java/org/measure/platform/service/smmengine/api/IRemoteMeasureExecutionService.java b/src/main/java/org/measure/platform/service/smmengine/api/IRemoteMeasureExecutionService.java index c7a1c8ac..f3c453dd 100644 --- a/src/main/java/org/measure/platform/service/smmengine/api/IRemoteMeasureExecutionService.java +++ b/src/main/java/org/measure/platform/service/smmengine/api/IRemoteMeasureExecutionService.java @@ -1,4 +1,4 @@ -package org.measure.platform.smmengine.api; +package org.measure.platform.service.smmengine.api; import java.util.List; diff --git a/src/main/java/org/measure/platform/service/smmengine/api/ISchedulingService.java b/src/main/java/org/measure/platform/service/smmengine/api/ISchedulingService.java index e85d4660..f5a8f58f 100644 --- a/src/main/java/org/measure/platform/service/smmengine/api/ISchedulingService.java +++ b/src/main/java/org/measure/platform/service/smmengine/api/ISchedulingService.java @@ -1,11 +1,11 @@ -package org.measure.platform.smmengine.api; +package org.measure.platform.service.smmengine.api; import java.util.List; import org.measure.platform.core.entity.MeasureInstance; import org.measure.smm.remote.RemoteMeasureInstance; -public interface IShedulingService { +public interface ISchedulingService { Boolean scheduleMeasure(MeasureInstance measure); Boolean removeMeasure(Long measureInstanceId); diff --git a/src/main/java/org/measure/platform/service/smmengine/impl/logger/LoggerService.java b/src/main/java/org/measure/platform/service/smmengine/impl/logger/LoggerService.java index f483bb5e..5c53edd1 100644 --- a/src/main/java/org/measure/platform/service/smmengine/impl/logger/LoggerService.java +++ b/src/main/java/org/measure/platform/service/smmengine/impl/logger/LoggerService.java @@ -1,9 +1,9 @@ -package org.measure.platform.smmengine.impl.logger; +package org.measure.platform.service.smmengine.impl.logger; import java.util.ArrayList; import java.util.List; -import org.measure.platform.smmengine.api.ILoggerService; +import org.measure.platform.service.smmengine.api.ILoggerService; import org.measure.smm.log.MeasureLog; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/measure/platform/service/smmengine/impl/measureexecution/MeasureExecutionService.java b/src/main/java/org/measure/platform/service/smmengine/impl/measureexecution/MeasureExecutionService.java index 74b24084..2e9d3bdb 100644 --- a/src/main/java/org/measure/platform/service/smmengine/impl/measureexecution/MeasureExecutionService.java +++ b/src/main/java/org/measure/platform/service/smmengine/impl/measureexecution/MeasureExecutionService.java @@ -1,4 +1,4 @@ -package org.measure.platform.smmengine.impl.measureexecution; +package org.measure.platform.service.smmengine.impl.measureexecution; import java.util.ArrayList; import java.util.Date; @@ -17,8 +17,8 @@ import org.measure.platform.core.entity.MeasureInstance; import org.measure.platform.core.entity.MeasureProperty; import org.measure.platform.core.entity.MeasureReference; -import org.measure.platform.measurementstorage.api.IMeasurementStorage; -import org.measure.platform.smmengine.api.IMeasureExecutionService; +import org.measure.platform.service.measurement.api.IMeasurementStorage; +import org.measure.platform.service.smmengine.api.IMeasureExecutionService; import org.measure.smm.log.MeasureLog; import org.measure.smm.measure.api.IDerivedMeasure; import org.measure.smm.measure.api.IDirectMeasure; diff --git a/src/main/java/org/measure/platform/service/smmengine/impl/measureexecution/RemoteMeasureExecutionService.java b/src/main/java/org/measure/platform/service/smmengine/impl/measureexecution/RemoteMeasureExecutionService.java index b9585106..efb31921 100644 --- a/src/main/java/org/measure/platform/service/smmengine/impl/measureexecution/RemoteMeasureExecutionService.java +++ b/src/main/java/org/measure/platform/service/smmengine/impl/measureexecution/RemoteMeasureExecutionService.java @@ -1,4 +1,4 @@ -package org.measure.platform.smmengine.impl.measureexecution; +package org.measure.platform.service.smmengine.impl.measureexecution; import java.util.ArrayList; import java.util.HashMap; @@ -11,10 +11,10 @@ import org.measure.platform.core.api.entitys.MeasurePropertyService; import org.measure.platform.core.entity.MeasureInstance; import org.measure.platform.core.entity.MeasureProperty; -import org.measure.platform.measurementstorage.api.IMeasurementStorage; -import org.measure.platform.smmengine.api.ILoggerService; -import org.measure.platform.smmengine.api.IRemoteMeasureExecutionService; -import org.measure.platform.smmengine.api.IShedulingService; +import org.measure.platform.service.measurement.api.IMeasurementStorage; +import org.measure.platform.service.smmengine.api.ILoggerService; +import org.measure.platform.service.smmengine.api.IRemoteMeasureExecutionService; +import org.measure.platform.service.smmengine.api.ISchedulingService; import org.measure.smm.log.MeasureLog; import org.measure.smm.measure.api.IMeasurement; import org.measure.smm.remote.RemoteMeasureInstance; @@ -33,7 +33,7 @@ public class RemoteMeasureExecutionService implements IRemoteMeasureExecutionSer private IMeasurementStorage measurementStorage; @Inject - private IShedulingService shedulingService; + private ISchedulingService shedulingService; @Inject private MeasureInstanceService measureInstanceService; diff --git a/src/main/java/org/measure/platform/service/smmengine/impl/scheduler/MeasureSchedulingConfigurer.java b/src/main/java/org/measure/platform/service/smmengine/impl/scheduler/MeasureSchedulingConfigurer.java index 048a6ddc..d8bfd2af 100644 --- a/src/main/java/org/measure/platform/service/smmengine/impl/scheduler/MeasureSchedulingConfigurer.java +++ b/src/main/java/org/measure/platform/service/smmengine/impl/scheduler/MeasureSchedulingConfigurer.java @@ -1,9 +1,10 @@ -package org.measure.platform.smmengine.impl.sheduler; +package org.measure.platform.service.smmengine.impl.scheduler; import javax.inject.Inject; import org.measure.platform.core.api.entitys.MeasureInstanceService; import org.measure.platform.core.entity.MeasureInstance; +import org.measure.platform.service.smmengine.api.ISchedulingService; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableScheduling; @@ -15,7 +16,7 @@ @EnableScheduling public class MeasureSchedulingConfigurer implements SchedulingConfigurer { @Inject - private SchedulingService sheduleService; + private ISchedulingService sheduleService; @Inject private MeasureInstanceService measureInstanceService; diff --git a/src/main/java/org/measure/platform/service/smmengine/impl/scheduler/SchedulingService.java b/src/main/java/org/measure/platform/service/smmengine/impl/scheduler/SchedulingService.java index 90c221e7..48e5fc65 100644 --- a/src/main/java/org/measure/platform/service/smmengine/impl/scheduler/SchedulingService.java +++ b/src/main/java/org/measure/platform/service/smmengine/impl/scheduler/SchedulingService.java @@ -1,4 +1,4 @@ -package org.measure.platform.smmengine.impl.sheduler; +package org.measure.platform.service.smmengine.impl.scheduler; import java.util.ArrayList; import java.util.HashMap; @@ -9,15 +9,15 @@ import javax.annotation.PostConstruct; import javax.inject.Inject; -import org.measure.platform.agent.api.IAgentManager; import org.measure.platform.core.api.IMeasureCatalogueService; import org.measure.platform.core.api.entitys.MeasureInstanceService; import org.measure.platform.core.api.entitys.MeasurePropertyService; import org.measure.platform.core.entity.MeasureInstance; import org.measure.platform.core.entity.MeasureProperty; -import org.measure.platform.smmengine.api.ILoggerService; -import org.measure.platform.smmengine.api.IShedulingService; -import org.measure.platform.smmengine.impl.measureexecution.MeasureExecutionService; +import org.measure.platform.service.agent.api.IAgentManager; +import org.measure.platform.service.smmengine.api.ILoggerService; +import org.measure.platform.service.smmengine.api.IMeasureExecutionService; +import org.measure.platform.service.smmengine.api.ISchedulingService; import org.measure.smm.log.MeasureLog; import org.measure.smm.measure.api.IMeasure; import org.measure.smm.remote.RemoteMeasureInstance; @@ -28,12 +28,12 @@ @Component @Scope("singleton") -public class SchedulingService implements IShedulingService { +public class SchedulingService implements ISchedulingService { @Autowired private TaskScheduler taskScheduler; @Inject - private MeasureExecutionService measureExecutionService; + private IMeasureExecutionService measureExecutionService; @Inject private IMeasureCatalogueService measureCatalogue; @@ -45,7 +45,7 @@ public class SchedulingService implements IShedulingService { private MeasurePropertyService measurePropertyService; @Inject - IAgentManager agentService; + IAgentManager agentService; @Inject private ILoggerService logger; @@ -61,7 +61,7 @@ public void doSomething() { } @Override - public synchronized Boolean scheduleMeasure(MeasureInstance measure) { + public Boolean scheduleMeasure(MeasureInstance measure) { if (measure.isIsShedule() != null && measure.isIsShedule() && measure.getShedulingExpression() != null && measure.getShedulingExpression().matches("\\d+")) { if (measure.isIsRemote()) { @@ -78,7 +78,7 @@ public synchronized Boolean scheduleMeasure(MeasureInstance measure) { } @Override - public synchronized List getSheduledRemoteMeasure(String agentId) { + public List getSheduledRemoteMeasure(String agentId) { List result = new ArrayList<>(); List instances = this.remotsJobs.get(agentId); @@ -103,7 +103,7 @@ public synchronized List getSheduledRemoteMeasure(String return result; } - private synchronized void scheduleRemoteMeasure(MeasureInstance measure) { + private void scheduleRemoteMeasure(MeasureInstance measure) { List measures = this.remotsJobs.get(measure.getRemoteLabel()); if (measures == null) { measures = new ArrayList<>(); @@ -134,7 +134,7 @@ public void run() { } @Override - public synchronized Boolean removeMeasure(Long measureInstanceId) { + public Boolean removeMeasure(Long measureInstanceId) { // Stop Measures executed Localy ScheduledFuture job = jobs.get(measureInstanceId); if (job != null) { @@ -154,7 +154,7 @@ public synchronized Boolean removeMeasure(Long measureInstanceId) { } @Override - public synchronized Boolean isShedule(Long measureInstanceId) { + public Boolean isShedule(Long measureInstanceId) { if (jobs.containsKey(measureInstanceId)) { return true; } diff --git a/src/main/java/org/measure/platform/utils/aop/logging/LoggingAspect.java b/src/main/java/org/measure/platform/utils/aop/logging/LoggingAspect.java index 9fcf0be6..7baefb20 100644 --- a/src/main/java/org/measure/platform/utils/aop/logging/LoggingAspect.java +++ b/src/main/java/org/measure/platform/utils/aop/logging/LoggingAspect.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.aop.logging; +package org.measure.platform.utils.aop.logging; import java.util.Arrays; @@ -10,7 +10,7 @@ import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Pointcut; -import org.measure.platform.framework.config.Constants; +import org.measure.platform.utils.config.Constants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.env.Environment; diff --git a/src/main/java/org/measure/platform/utils/async/ExceptionHandlingAsyncTaskExecutor.java b/src/main/java/org/measure/platform/utils/async/ExceptionHandlingAsyncTaskExecutor.java index 56a93f76..aef929f3 100644 --- a/src/main/java/org/measure/platform/utils/async/ExceptionHandlingAsyncTaskExecutor.java +++ b/src/main/java/org/measure/platform/utils/async/ExceptionHandlingAsyncTaskExecutor.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.async; +package org.measure.platform.utils.async; import java.util.concurrent.Callable; import java.util.concurrent.Future; diff --git a/src/main/java/org/measure/platform/utils/async/package-info.java b/src/main/java/org/measure/platform/utils/async/package-info.java index 3642bd0b..50ad2d99 100644 --- a/src/main/java/org/measure/platform/utils/async/package-info.java +++ b/src/main/java/org/measure/platform/utils/async/package-info.java @@ -1,4 +1,4 @@ /** * Async helpers. */ -package org.measure.platform.framework.async; +package org.measure.platform.utils.async; diff --git a/src/main/java/org/measure/platform/utils/config/AsyncConfiguration.java b/src/main/java/org/measure/platform/utils/config/AsyncConfiguration.java index 51b1929e..daac53e8 100644 --- a/src/main/java/org/measure/platform/utils/config/AsyncConfiguration.java +++ b/src/main/java/org/measure/platform/utils/config/AsyncConfiguration.java @@ -1,10 +1,10 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; import java.util.concurrent.Executor; import javax.inject.Inject; -import org.measure.platform.framework.async.ExceptionHandlingAsyncTaskExecutor; +import org.measure.platform.utils.async.ExceptionHandlingAsyncTaskExecutor; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; diff --git a/src/main/java/org/measure/platform/utils/config/CacheConfiguration.java b/src/main/java/org/measure/platform/utils/config/CacheConfiguration.java index c5d5a3fb..1fba9a5a 100644 --- a/src/main/java/org/measure/platform/utils/config/CacheConfiguration.java +++ b/src/main/java/org/measure/platform/utils/config/CacheConfiguration.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; import java.util.SortedSet; import java.util.stream.Stream; diff --git a/src/main/java/org/measure/platform/utils/config/CloudDatabaseConfiguration.java b/src/main/java/org/measure/platform/utils/config/CloudDatabaseConfiguration.java index 731d7cba..80aaef9f 100644 --- a/src/main/java/org/measure/platform/utils/config/CloudDatabaseConfiguration.java +++ b/src/main/java/org/measure/platform/utils/config/CloudDatabaseConfiguration.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; import javax.sql.DataSource; diff --git a/src/main/java/org/measure/platform/utils/config/Constants.java b/src/main/java/org/measure/platform/utils/config/Constants.java index b4b898ca..d8df92ee 100644 --- a/src/main/java/org/measure/platform/utils/config/Constants.java +++ b/src/main/java/org/measure/platform/utils/config/Constants.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; /** * Application constants. diff --git a/src/main/java/org/measure/platform/utils/config/DatabaseConfiguration.java b/src/main/java/org/measure/platform/utils/config/DatabaseConfiguration.java index 5c4c20c6..4fdaf1d0 100644 --- a/src/main/java/org/measure/platform/utils/config/DatabaseConfiguration.java +++ b/src/main/java/org/measure/platform/utils/config/DatabaseConfiguration.java @@ -1,9 +1,9 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; import javax.inject.Inject; import javax.sql.DataSource; -import org.measure.platform.framework.config.liquibase.AsyncSpringLiquibase; +import org.measure.platform.utils.config.liquibase.AsyncSpringLiquibase; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties; diff --git a/src/main/java/org/measure/platform/utils/config/DefaultProfileUtil.java b/src/main/java/org/measure/platform/utils/config/DefaultProfileUtil.java index f9adff81..f6ee8eae 100644 --- a/src/main/java/org/measure/platform/utils/config/DefaultProfileUtil.java +++ b/src/main/java/org/measure/platform/utils/config/DefaultProfileUtil.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/org/measure/platform/utils/config/JHipsterProperties.java b/src/main/java/org/measure/platform/utils/config/JHipsterProperties.java index 0ba3e98e..fdc7a7dc 100644 --- a/src/main/java/org/measure/platform/utils/config/JHipsterProperties.java +++ b/src/main/java/org/measure/platform/utils/config/JHipsterProperties.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; import javax.validation.constraints.NotNull; diff --git a/src/main/java/org/measure/platform/utils/config/LocaleConfiguration.java b/src/main/java/org/measure/platform/utils/config/LocaleConfiguration.java index 4b8cf8b9..384eb90a 100644 --- a/src/main/java/org/measure/platform/utils/config/LocaleConfiguration.java +++ b/src/main/java/org/measure/platform/utils/config/LocaleConfiguration.java @@ -1,6 +1,6 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; -import org.measure.platform.framework.config.locale.AngularCookieLocaleResolver; +import org.measure.platform.utils.config.locale.AngularCookieLocaleResolver; import org.springframework.boot.bind.RelaxedPropertyResolver; import org.springframework.context.EnvironmentAware; import org.springframework.context.annotation.Bean; diff --git a/src/main/java/org/measure/platform/utils/config/LoggingAspectConfiguration.java b/src/main/java/org/measure/platform/utils/config/LoggingAspectConfiguration.java index 6d98a0e3..b37af8a6 100644 --- a/src/main/java/org/measure/platform/utils/config/LoggingAspectConfiguration.java +++ b/src/main/java/org/measure/platform/utils/config/LoggingAspectConfiguration.java @@ -1,6 +1,6 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; -import org.measure.platform.framework.aop.logging.LoggingAspect; +import org.measure.platform.utils.aop.logging.LoggingAspect; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.EnableAspectJAutoProxy; diff --git a/src/main/java/org/measure/platform/utils/config/LoggingConfiguration.java b/src/main/java/org/measure/platform/utils/config/LoggingConfiguration.java index 0c1f320b..f2dd7ffc 100644 --- a/src/main/java/org/measure/platform/utils/config/LoggingConfiguration.java +++ b/src/main/java/org/measure/platform/utils/config/LoggingConfiguration.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; import javax.annotation.PostConstruct; import javax.inject.Inject; diff --git a/src/main/java/org/measure/platform/utils/config/MetricsConfiguration.java b/src/main/java/org/measure/platform/utils/config/MetricsConfiguration.java index ba3357d4..90b8f9f6 100644 --- a/src/main/java/org/measure/platform/utils/config/MetricsConfiguration.java +++ b/src/main/java/org/measure/platform/utils/config/MetricsConfiguration.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; import java.lang.management.ManagementFactory; import java.net.InetSocketAddress; diff --git a/src/main/java/org/measure/platform/utils/config/SecurityConfiguration.java b/src/main/java/org/measure/platform/utils/config/SecurityConfiguration.java index 0ba37104..6c1d056a 100644 --- a/src/main/java/org/measure/platform/utils/config/SecurityConfiguration.java +++ b/src/main/java/org/measure/platform/utils/config/SecurityConfiguration.java @@ -1,12 +1,12 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; import javax.inject.Inject; -import org.measure.platform.framework.security.AjaxAuthenticationFailureHandler; -import org.measure.platform.framework.security.AjaxAuthenticationSuccessHandler; -import org.measure.platform.framework.security.AjaxLogoutSuccessHandler; -import org.measure.platform.framework.security.AuthoritiesConstants; -import org.measure.platform.framework.security.Http401UnauthorizedEntryPoint; +import org.measure.platform.utils.security.AjaxAuthenticationFailureHandler; +import org.measure.platform.utils.security.AjaxAuthenticationSuccessHandler; +import org.measure.platform.utils.security.AjaxLogoutSuccessHandler; +import org.measure.platform.utils.security.AuthoritiesConstants; +import org.measure.platform.utils.security.Http401UnauthorizedEntryPoint; import org.springframework.beans.factory.BeanInitializationException; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/src/main/java/org/measure/platform/utils/config/ThymeleafConfiguration.java b/src/main/java/org/measure/platform/utils/config/ThymeleafConfiguration.java index a284e684..aea2d572 100644 --- a/src/main/java/org/measure/platform/utils/config/ThymeleafConfiguration.java +++ b/src/main/java/org/measure/platform/utils/config/ThymeleafConfiguration.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; import org.apache.commons.lang3.CharEncoding; import org.slf4j.Logger; diff --git a/src/main/java/org/measure/platform/utils/config/WebConfigurer.java b/src/main/java/org/measure/platform/utils/config/WebConfigurer.java index 8788b93f..a9e8abbd 100644 --- a/src/main/java/org/measure/platform/utils/config/WebConfigurer.java +++ b/src/main/java/org/measure/platform/utils/config/WebConfigurer.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; import java.io.File; import java.nio.file.Paths; diff --git a/src/main/java/org/measure/platform/utils/config/apidoc/PageableParameterBuilderPlugin.java b/src/main/java/org/measure/platform/utils/config/apidoc/PageableParameterBuilderPlugin.java index 060f986a..c56ebf97 100644 --- a/src/main/java/org/measure/platform/utils/config/apidoc/PageableParameterBuilderPlugin.java +++ b/src/main/java/org/measure/platform/utils/config/apidoc/PageableParameterBuilderPlugin.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config.apidoc; +package org.measure.platform.utils.config.apidoc; import static com.google.common.collect.Lists.newArrayList; import static springfox.documentation.schema.ResolvedTypes.modelRefFactory; @@ -6,7 +6,7 @@ import java.util.List; -import org.measure.platform.framework.config.Constants; +import org.measure.platform.utils.config.Constants; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Profile; import org.springframework.core.MethodParameter; diff --git a/src/main/java/org/measure/platform/utils/config/apidoc/SwaggerConfiguration.java b/src/main/java/org/measure/platform/utils/config/apidoc/SwaggerConfiguration.java index f3fc6be5..768b9b12 100644 --- a/src/main/java/org/measure/platform/utils/config/apidoc/SwaggerConfiguration.java +++ b/src/main/java/org/measure/platform/utils/config/apidoc/SwaggerConfiguration.java @@ -1,11 +1,11 @@ -package org.measure.platform.framework.config.apidoc; +package org.measure.platform.utils.config.apidoc; import static springfox.documentation.builders.PathSelectors.regex; import java.util.Date; -import org.measure.platform.framework.config.Constants; -import org.measure.platform.framework.config.JHipsterProperties; +import org.measure.platform.utils.config.Constants; +import org.measure.platform.utils.config.JHipsterProperties; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Bean; diff --git a/src/main/java/org/measure/platform/utils/config/apidoc/package-info.java b/src/main/java/org/measure/platform/utils/config/apidoc/package-info.java index 4c4e7421..88bcc97b 100644 --- a/src/main/java/org/measure/platform/utils/config/apidoc/package-info.java +++ b/src/main/java/org/measure/platform/utils/config/apidoc/package-info.java @@ -1,4 +1,4 @@ /** * Swagger api specific code. */ -package org.measure.platform.framework.config.apidoc; \ No newline at end of file +package org.measure.platform.utils.config.apidoc; \ No newline at end of file diff --git a/src/main/java/org/measure/platform/utils/config/audit/AuditEventConverter.java b/src/main/java/org/measure/platform/utils/config/audit/AuditEventConverter.java index 868a5d4a..e4bdfa20 100644 --- a/src/main/java/org/measure/platform/utils/config/audit/AuditEventConverter.java +++ b/src/main/java/org/measure/platform/utils/config/audit/AuditEventConverter.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config.audit; +package org.measure.platform.utils.config.audit; import java.time.Instant; import java.time.ZoneId; @@ -9,7 +9,7 @@ import java.util.List; import java.util.Map; -import org.measure.platform.framework.domain.PersistentAuditEvent; +import org.measure.platform.utils.domain.PersistentAuditEvent; import org.springframework.boot.actuate.audit.AuditEvent; import org.springframework.security.web.authentication.WebAuthenticationDetails; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/measure/platform/utils/config/audit/package-info.java b/src/main/java/org/measure/platform/utils/config/audit/package-info.java index 49cf024a..b24d0d9b 100644 --- a/src/main/java/org/measure/platform/utils/config/audit/package-info.java +++ b/src/main/java/org/measure/platform/utils/config/audit/package-info.java @@ -1,4 +1,4 @@ /** * Audit specific code. */ -package org.measure.platform.framework.config.audit; +package org.measure.platform.utils.config.audit; diff --git a/src/main/java/org/measure/platform/utils/config/liquibase/AsyncSpringLiquibase.java b/src/main/java/org/measure/platform/utils/config/liquibase/AsyncSpringLiquibase.java index c4f64fdd..64a97c0e 100644 --- a/src/main/java/org/measure/platform/utils/config/liquibase/AsyncSpringLiquibase.java +++ b/src/main/java/org/measure/platform/utils/config/liquibase/AsyncSpringLiquibase.java @@ -1,8 +1,8 @@ -package org.measure.platform.framework.config.liquibase; +package org.measure.platform.utils.config.liquibase; import javax.inject.Inject; -import org.measure.platform.framework.config.Constants; +import org.measure.platform.utils.config.Constants; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Qualifier; diff --git a/src/main/java/org/measure/platform/utils/config/liquibase/package-info.java b/src/main/java/org/measure/platform/utils/config/liquibase/package-info.java index a40c2f04..52a2c01c 100644 --- a/src/main/java/org/measure/platform/utils/config/liquibase/package-info.java +++ b/src/main/java/org/measure/platform/utils/config/liquibase/package-info.java @@ -1,4 +1,4 @@ /** * Liquibase specific code. */ -package org.measure.platform.framework.config.liquibase; +package org.measure.platform.utils.config.liquibase; diff --git a/src/main/java/org/measure/platform/utils/config/locale/AngularCookieLocaleResolver.java b/src/main/java/org/measure/platform/utils/config/locale/AngularCookieLocaleResolver.java index c07c7a20..7f3fc1f7 100644 --- a/src/main/java/org/measure/platform/utils/config/locale/AngularCookieLocaleResolver.java +++ b/src/main/java/org/measure/platform/utils/config/locale/AngularCookieLocaleResolver.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.config.locale; +package org.measure.platform.utils.config.locale; import java.util.Locale; import java.util.TimeZone; diff --git a/src/main/java/org/measure/platform/utils/config/locale/package-info.java b/src/main/java/org/measure/platform/utils/config/locale/package-info.java index ba405fd4..45a4fd0e 100644 --- a/src/main/java/org/measure/platform/utils/config/locale/package-info.java +++ b/src/main/java/org/measure/platform/utils/config/locale/package-info.java @@ -1,4 +1,4 @@ /** * Locale specific code. */ -package org.measure.platform.framework.config.locale; +package org.measure.platform.utils.config.locale; diff --git a/src/main/java/org/measure/platform/utils/config/package-info.java b/src/main/java/org/measure/platform/utils/config/package-info.java index 77b6b51d..28db8eb9 100644 --- a/src/main/java/org/measure/platform/utils/config/package-info.java +++ b/src/main/java/org/measure/platform/utils/config/package-info.java @@ -1,4 +1,4 @@ /** * Spring Framework configuration files. */ -package org.measure.platform.framework.config; +package org.measure.platform.utils.config; diff --git a/src/main/java/org/measure/platform/utils/domain/AbstractAuditingEntity.java b/src/main/java/org/measure/platform/utils/domain/AbstractAuditingEntity.java index 00edf1ec..1e5e1ad5 100644 --- a/src/main/java/org/measure/platform/utils/domain/AbstractAuditingEntity.java +++ b/src/main/java/org/measure/platform/utils/domain/AbstractAuditingEntity.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.domain; +package org.measure.platform.utils.domain; import java.io.Serializable; import java.time.ZonedDateTime; diff --git a/src/main/java/org/measure/platform/utils/domain/Authority.java b/src/main/java/org/measure/platform/utils/domain/Authority.java index ad0fd520..32bec35f 100644 --- a/src/main/java/org/measure/platform/utils/domain/Authority.java +++ b/src/main/java/org/measure/platform/utils/domain/Authority.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.domain; +package org.measure.platform.utils.domain; import java.io.Serializable; diff --git a/src/main/java/org/measure/platform/utils/domain/PersistentAuditEvent.java b/src/main/java/org/measure/platform/utils/domain/PersistentAuditEvent.java index 2e8d566e..831eb1ca 100644 --- a/src/main/java/org/measure/platform/utils/domain/PersistentAuditEvent.java +++ b/src/main/java/org/measure/platform/utils/domain/PersistentAuditEvent.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.domain; +package org.measure.platform.utils.domain; import java.time.LocalDateTime; import java.util.HashMap; diff --git a/src/main/java/org/measure/platform/utils/domain/PersistentToken.java b/src/main/java/org/measure/platform/utils/domain/PersistentToken.java index c1634d80..eb0a69ca 100644 --- a/src/main/java/org/measure/platform/utils/domain/PersistentToken.java +++ b/src/main/java/org/measure/platform/utils/domain/PersistentToken.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.domain; +package org.measure.platform.utils.domain; import java.io.Serializable; import java.time.LocalDate; @@ -19,7 +19,7 @@ /** * Persistent tokens are used by Spring Security to automatically log in users. * - * @see org.measure.platform.framework.security.CustomPersistentRememberMeServices + * @see org.measure.platform.utils.security.CustomPersistentRememberMeServices */ @Entity @Table(name = "jhi_persistent_token") diff --git a/src/main/java/org/measure/platform/utils/domain/User.java b/src/main/java/org/measure/platform/utils/domain/User.java index f62f4c00..6cc553a5 100644 --- a/src/main/java/org/measure/platform/utils/domain/User.java +++ b/src/main/java/org/measure/platform/utils/domain/User.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.domain; +package org.measure.platform.utils.domain; import java.io.Serializable; import java.time.ZonedDateTime; @@ -24,7 +24,7 @@ import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.validator.constraints.Email; -import org.measure.platform.framework.config.Constants; +import org.measure.platform.utils.config.Constants; import com.fasterxml.jackson.annotation.JsonIgnore; diff --git a/src/main/java/org/measure/platform/utils/domain/package-info.java b/src/main/java/org/measure/platform/utils/domain/package-info.java index 08887f69..90bca4c4 100644 --- a/src/main/java/org/measure/platform/utils/domain/package-info.java +++ b/src/main/java/org/measure/platform/utils/domain/package-info.java @@ -1,4 +1,4 @@ /** * JPA domain objects. */ -package org.measure.platform.framework.domain; +package org.measure.platform.utils.domain; diff --git a/src/main/java/org/measure/platform/utils/domain/util/FixedH2Dialect.java b/src/main/java/org/measure/platform/utils/domain/util/FixedH2Dialect.java index d97f4cd9..5f3940bf 100644 --- a/src/main/java/org/measure/platform/utils/domain/util/FixedH2Dialect.java +++ b/src/main/java/org/measure/platform/utils/domain/util/FixedH2Dialect.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.domain.util; +package org.measure.platform.utils.domain.util; import java.sql.Types; diff --git a/src/main/java/org/measure/platform/utils/domain/util/JSR310DateConverters.java b/src/main/java/org/measure/platform/utils/domain/util/JSR310DateConverters.java index 64001f56..b8f8843f 100644 --- a/src/main/java/org/measure/platform/utils/domain/util/JSR310DateConverters.java +++ b/src/main/java/org/measure/platform/utils/domain/util/JSR310DateConverters.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.domain.util; +package org.measure.platform.utils.domain.util; import java.time.LocalDate; import java.time.LocalDateTime; diff --git a/src/main/java/org/measure/platform/utils/domain/util/JSR310PersistenceConverters.java b/src/main/java/org/measure/platform/utils/domain/util/JSR310PersistenceConverters.java index 21da8abe..871adb06 100644 --- a/src/main/java/org/measure/platform/utils/domain/util/JSR310PersistenceConverters.java +++ b/src/main/java/org/measure/platform/utils/domain/util/JSR310PersistenceConverters.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.domain.util; +package org.measure.platform.utils.domain.util; import java.time.LocalDate; import java.time.LocalDateTime; @@ -8,10 +8,10 @@ import javax.persistence.AttributeConverter; import javax.persistence.Converter; -import org.measure.platform.framework.domain.util.JSR310DateConverters.DateToLocalDateTimeConverter; -import org.measure.platform.framework.domain.util.JSR310DateConverters.DateToZonedDateTimeConverter; -import org.measure.platform.framework.domain.util.JSR310DateConverters.LocalDateTimeToDateConverter; -import org.measure.platform.framework.domain.util.JSR310DateConverters.ZonedDateTimeToDateConverter; +import org.measure.platform.utils.domain.util.JSR310DateConverters.DateToLocalDateTimeConverter; +import org.measure.platform.utils.domain.util.JSR310DateConverters.DateToZonedDateTimeConverter; +import org.measure.platform.utils.domain.util.JSR310DateConverters.LocalDateTimeToDateConverter; +import org.measure.platform.utils.domain.util.JSR310DateConverters.ZonedDateTimeToDateConverter; public final class JSR310PersistenceConverters { private JSR310PersistenceConverters() { diff --git a/src/main/java/org/measure/platform/utils/repository/package-info.java b/src/main/java/org/measure/platform/utils/repository/package-info.java index be06457e..a8273b38 100644 --- a/src/main/java/org/measure/platform/utils/repository/package-info.java +++ b/src/main/java/org/measure/platform/utils/repository/package-info.java @@ -1,4 +1,4 @@ /** * Spring Data JPA repositories. */ -package org.measure.platform.framework.repository; +package org.measure.platform.utils.repository; diff --git a/src/main/java/org/measure/platform/utils/security/AjaxAuthenticationFailureHandler.java b/src/main/java/org/measure/platform/utils/security/AjaxAuthenticationFailureHandler.java index 4b719210..04a68ffd 100644 --- a/src/main/java/org/measure/platform/utils/security/AjaxAuthenticationFailureHandler.java +++ b/src/main/java/org/measure/platform/utils/security/AjaxAuthenticationFailureHandler.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.security; +package org.measure.platform.utils.security; import java.io.IOException; diff --git a/src/main/java/org/measure/platform/utils/security/AjaxAuthenticationSuccessHandler.java b/src/main/java/org/measure/platform/utils/security/AjaxAuthenticationSuccessHandler.java index 39508fcd..0a82572c 100644 --- a/src/main/java/org/measure/platform/utils/security/AjaxAuthenticationSuccessHandler.java +++ b/src/main/java/org/measure/platform/utils/security/AjaxAuthenticationSuccessHandler.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.security; +package org.measure.platform.utils.security; import java.io.IOException; diff --git a/src/main/java/org/measure/platform/utils/security/AjaxLogoutSuccessHandler.java b/src/main/java/org/measure/platform/utils/security/AjaxLogoutSuccessHandler.java index 8e07c547..bdd1c934 100644 --- a/src/main/java/org/measure/platform/utils/security/AjaxLogoutSuccessHandler.java +++ b/src/main/java/org/measure/platform/utils/security/AjaxLogoutSuccessHandler.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.security; +package org.measure.platform.utils.security; import java.io.IOException; diff --git a/src/main/java/org/measure/platform/utils/security/AuthoritiesConstants.java b/src/main/java/org/measure/platform/utils/security/AuthoritiesConstants.java index 94122072..f2ea5cd9 100644 --- a/src/main/java/org/measure/platform/utils/security/AuthoritiesConstants.java +++ b/src/main/java/org/measure/platform/utils/security/AuthoritiesConstants.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.security; +package org.measure.platform.utils.security; /** * Constants for Spring Security authorities. diff --git a/src/main/java/org/measure/platform/utils/security/CustomPersistentRememberMeServices.java b/src/main/java/org/measure/platform/utils/security/CustomPersistentRememberMeServices.java index af2d51c9..02d3de96 100644 --- a/src/main/java/org/measure/platform/utils/security/CustomPersistentRememberMeServices.java +++ b/src/main/java/org/measure/platform/utils/security/CustomPersistentRememberMeServices.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.security; +package org.measure.platform.utils.security; import java.security.SecureRandom; import java.time.LocalDate; @@ -10,8 +10,8 @@ import org.measure.platform.core.impl.repository.PersistentTokenRepository; import org.measure.platform.core.impl.repository.UserRepository; -import org.measure.platform.framework.config.JHipsterProperties; -import org.measure.platform.framework.domain.PersistentToken; +import org.measure.platform.utils.config.JHipsterProperties; +import org.measure.platform.utils.domain.PersistentToken; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.dao.DataAccessException; diff --git a/src/main/java/org/measure/platform/utils/security/Http401UnauthorizedEntryPoint.java b/src/main/java/org/measure/platform/utils/security/Http401UnauthorizedEntryPoint.java index f1ef7ec2..1750a841 100644 --- a/src/main/java/org/measure/platform/utils/security/Http401UnauthorizedEntryPoint.java +++ b/src/main/java/org/measure/platform/utils/security/Http401UnauthorizedEntryPoint.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.security; +package org.measure.platform.utils.security; import java.io.IOException; diff --git a/src/main/java/org/measure/platform/utils/security/SecurityUtils.java b/src/main/java/org/measure/platform/utils/security/SecurityUtils.java index 29676840..c35a2f69 100644 --- a/src/main/java/org/measure/platform/utils/security/SecurityUtils.java +++ b/src/main/java/org/measure/platform/utils/security/SecurityUtils.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.security; +package org.measure.platform.utils.security; import java.util.Collection; diff --git a/src/main/java/org/measure/platform/utils/security/SpringSecurityAuditorAware.java b/src/main/java/org/measure/platform/utils/security/SpringSecurityAuditorAware.java index 480eac8c..c93b5cb4 100644 --- a/src/main/java/org/measure/platform/utils/security/SpringSecurityAuditorAware.java +++ b/src/main/java/org/measure/platform/utils/security/SpringSecurityAuditorAware.java @@ -1,6 +1,6 @@ -package org.measure.platform.framework.security; +package org.measure.platform.utils.security; -import org.measure.platform.framework.config.Constants; +import org.measure.platform.utils.config.Constants; import org.springframework.data.domain.AuditorAware; import org.springframework.stereotype.Component; diff --git a/src/main/java/org/measure/platform/utils/security/UserDetailsService.java b/src/main/java/org/measure/platform/utils/security/UserDetailsService.java index 099c67f0..1c647734 100644 --- a/src/main/java/org/measure/platform/utils/security/UserDetailsService.java +++ b/src/main/java/org/measure/platform/utils/security/UserDetailsService.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.security; +package org.measure.platform.utils.security; import java.util.List; import java.util.Locale; @@ -8,7 +8,7 @@ import javax.inject.Inject; import org.measure.platform.core.impl.repository.UserRepository; -import org.measure.platform.framework.domain.User; +import org.measure.platform.utils.domain.User; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core.GrantedAuthority; diff --git a/src/main/java/org/measure/platform/utils/security/UserNotActivatedException.java b/src/main/java/org/measure/platform/utils/security/UserNotActivatedException.java index 2290795e..ed8700ba 100644 --- a/src/main/java/org/measure/platform/utils/security/UserNotActivatedException.java +++ b/src/main/java/org/measure/platform/utils/security/UserNotActivatedException.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.security; +package org.measure.platform.utils.security; import org.springframework.security.core.AuthenticationException; diff --git a/src/main/java/org/measure/platform/utils/security/package-info.java b/src/main/java/org/measure/platform/utils/security/package-info.java index c24bef7b..4734c8a9 100644 --- a/src/main/java/org/measure/platform/utils/security/package-info.java +++ b/src/main/java/org/measure/platform/utils/security/package-info.java @@ -1,4 +1,4 @@ /** * Spring Security configuration. */ -package org.measure.platform.framework.security; +package org.measure.platform.utils.security; diff --git a/src/main/java/org/measure/platform/utils/service/AuditEventService.java b/src/main/java/org/measure/platform/utils/service/AuditEventService.java index 61e05509..9ac8de60 100644 --- a/src/main/java/org/measure/platform/utils/service/AuditEventService.java +++ b/src/main/java/org/measure/platform/utils/service/AuditEventService.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.service; +package org.measure.platform.utils.service; import java.time.LocalDateTime; import java.util.Optional; @@ -6,7 +6,7 @@ import javax.inject.Inject; import org.measure.platform.core.impl.repository.PersistenceAuditEventRepository; -import org.measure.platform.framework.config.audit.AuditEventConverter; +import org.measure.platform.utils.config.audit.AuditEventConverter; import org.springframework.boot.actuate.audit.AuditEvent; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; diff --git a/src/main/java/org/measure/platform/utils/service/MailService.java b/src/main/java/org/measure/platform/utils/service/MailService.java index cd57df02..d0c25e18 100644 --- a/src/main/java/org/measure/platform/utils/service/MailService.java +++ b/src/main/java/org/measure/platform/utils/service/MailService.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.service; +package org.measure.platform.utils.service; import java.util.Locale; @@ -6,8 +6,8 @@ import javax.mail.internet.MimeMessage; import org.apache.commons.lang3.CharEncoding; -import org.measure.platform.framework.config.JHipsterProperties; -import org.measure.platform.framework.domain.User; +import org.measure.platform.utils.config.JHipsterProperties; +import org.measure.platform.utils.domain.User; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.MessageSource; diff --git a/src/main/java/org/measure/platform/utils/service/UserService.java b/src/main/java/org/measure/platform/utils/service/UserService.java index 8a25a572..be905f4f 100644 --- a/src/main/java/org/measure/platform/utils/service/UserService.java +++ b/src/main/java/org/measure/platform/utils/service/UserService.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.service; +package org.measure.platform.utils.service; import java.time.LocalDate; import java.time.ZonedDateTime; @@ -12,12 +12,12 @@ import org.measure.platform.core.impl.repository.AuthorityRepository; import org.measure.platform.core.impl.repository.PersistentTokenRepository; import org.measure.platform.core.impl.repository.UserRepository; -import org.measure.platform.framework.domain.Authority; -import org.measure.platform.framework.domain.User; -import org.measure.platform.framework.security.AuthoritiesConstants; -import org.measure.platform.framework.security.SecurityUtils; -import org.measure.platform.framework.service.util.RandomUtil; import org.measure.platform.restapi.framework.rest.vm.ManagedUserVM; +import org.measure.platform.utils.domain.Authority; +import org.measure.platform.utils.domain.User; +import org.measure.platform.utils.security.AuthoritiesConstants; +import org.measure.platform.utils.security.SecurityUtils; +import org.measure.platform.utils.service.util.RandomUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.annotation.Scheduled; diff --git a/src/main/java/org/measure/platform/utils/service/dto/UserDTO.java b/src/main/java/org/measure/platform/utils/service/dto/UserDTO.java index 8df3ad7f..4114c77c 100644 --- a/src/main/java/org/measure/platform/utils/service/dto/UserDTO.java +++ b/src/main/java/org/measure/platform/utils/service/dto/UserDTO.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.service.dto; +package org.measure.platform.utils.service.dto; import java.util.Set; import java.util.stream.Collectors; @@ -7,9 +7,9 @@ import javax.validation.constraints.Size; import org.hibernate.validator.constraints.Email; -import org.measure.platform.framework.config.Constants; -import org.measure.platform.framework.domain.Authority; -import org.measure.platform.framework.domain.User; +import org.measure.platform.utils.config.Constants; +import org.measure.platform.utils.domain.Authority; +import org.measure.platform.utils.domain.User; /** * A DTO representing a user, with his authorities. diff --git a/src/main/java/org/measure/platform/utils/service/dto/package-info.java b/src/main/java/org/measure/platform/utils/service/dto/package-info.java index 8a705752..1e60af37 100644 --- a/src/main/java/org/measure/platform/utils/service/dto/package-info.java +++ b/src/main/java/org/measure/platform/utils/service/dto/package-info.java @@ -1,4 +1,4 @@ /** * Data Transfer Objects. */ -package org.measure.platform.framework.service.dto; +package org.measure.platform.utils.service.dto; diff --git a/src/main/java/org/measure/platform/utils/service/mapper/UserMapper.java b/src/main/java/org/measure/platform/utils/service/mapper/UserMapper.java index a4f12463..14c86855 100644 --- a/src/main/java/org/measure/platform/utils/service/mapper/UserMapper.java +++ b/src/main/java/org/measure/platform/utils/service/mapper/UserMapper.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.service.mapper; +package org.measure.platform.utils.service.mapper; import java.util.List; import java.util.Set; @@ -6,9 +6,9 @@ import org.mapstruct.Mapper; import org.mapstruct.Mapping; -import org.measure.platform.framework.domain.Authority; -import org.measure.platform.framework.domain.User; -import org.measure.platform.framework.service.dto.UserDTO; +import org.measure.platform.utils.domain.Authority; +import org.measure.platform.utils.domain.User; +import org.measure.platform.utils.service.dto.UserDTO; /** * Mapper for the entity User and its DTO UserDTO. diff --git a/src/main/java/org/measure/platform/utils/service/mapper/package-info.java b/src/main/java/org/measure/platform/utils/service/mapper/package-info.java index 26f7b83c..ceb5631a 100644 --- a/src/main/java/org/measure/platform/utils/service/mapper/package-info.java +++ b/src/main/java/org/measure/platform/utils/service/mapper/package-info.java @@ -1,4 +1,4 @@ /** * MapStruct mappers for mapping domain objects and Data Transfer Objects. */ -package org.measure.platform.framework.service.mapper; +package org.measure.platform.utils.service.mapper; diff --git a/src/main/java/org/measure/platform/utils/service/package-info.java b/src/main/java/org/measure/platform/utils/service/package-info.java index fea4be26..632b96db 100644 --- a/src/main/java/org/measure/platform/utils/service/package-info.java +++ b/src/main/java/org/measure/platform/utils/service/package-info.java @@ -1,4 +1,4 @@ /** * Service layer beans. */ -package org.measure.platform.framework.service; +package org.measure.platform.utils.service; diff --git a/src/main/java/org/measure/platform/utils/service/util/RandomUtil.java b/src/main/java/org/measure/platform/utils/service/util/RandomUtil.java index 2d8ac1b7..76696876 100644 --- a/src/main/java/org/measure/platform/utils/service/util/RandomUtil.java +++ b/src/main/java/org/measure/platform/utils/service/util/RandomUtil.java @@ -1,4 +1,4 @@ -package org.measure.platform.framework.service.util; +package org.measure.platform.utils.service.util; import org.apache.commons.lang3.RandomStringUtils; diff --git a/src/main/resources/config/liquibase/master.xml b/src/main/resources/config/liquibase/master.xml index e7fb9ce7..a247eea1 100644 --- a/src/main/resources/config/liquibase/master.xml +++ b/src/main/resources/config/liquibase/master.xml @@ -4,28 +4,30 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd"> - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/config/liquibase/schema/entity_AnalysisCard.xml b/src/main/resources/config/liquibase/schema/entity_AnalysisCard.xml new file mode 100644 index 00000000..4c5c3633 --- /dev/null +++ b/src/main/resources/config/liquibase/schema/entity_AnalysisCard.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/config/liquibase/schema/entity_AnalysisCard_constraints.xml b/src/main/resources/config/liquibase/schema/entity_AnalysisCard_constraints.xml new file mode 100644 index 00000000..6b1e8d9c --- /dev/null +++ b/src/main/resources/config/liquibase/schema/entity_AnalysisCard_constraints.xml @@ -0,0 +1,18 @@ + + + + + + + + + diff --git a/src/main/resources/config/liquibase/schema/entity_MeasureView.xml b/src/main/resources/config/liquibase/schema/entity_MeasureView.xml index ae68bf66..c2a68c85 100644 --- a/src/main/resources/config/liquibase/schema/entity_MeasureView.xml +++ b/src/main/resources/config/liquibase/schema/entity_MeasureView.xml @@ -98,12 +98,10 @@ - + - - diff --git a/src/main/resources/config/liquibase/schema/entity_MeasureView_constraints.xml b/src/main/resources/config/liquibase/schema/entity_MeasureView_constraints.xml index 8ca12bb8..c9ce61f6 100644 --- a/src/main/resources/config/liquibase/schema/entity_MeasureView_constraints.xml +++ b/src/main/resources/config/liquibase/schema/entity_MeasureView_constraints.xml @@ -29,9 +29,9 @@ baseTableName="measure_view" constraintName="fk_measure_view_measureinstance_id" referencedColumnNames="id" referencedTableName="measure_instance" /> - + diff --git a/src/main/resources/config/liquibase/schema/entity_ProjectAnalysis_constraints.xml b/src/main/resources/config/liquibase/schema/entity_ProjectAnalysis_constraints.xml index 3d630cde..5e367fc4 100644 --- a/src/main/resources/config/liquibase/schema/entity_ProjectAnalysis_constraints.xml +++ b/src/main/resources/config/liquibase/schema/entity_ProjectAnalysis_constraints.xml @@ -12,8 +12,6 @@ baseTableName="project_analysis" constraintName="fk_project_analysis_project_id" referencedColumnNames="id" - referencedTableName="project"/> - - + referencedTableName="project"/> diff --git a/src/main/webapp/app/pages/catalogue/catalogue.html b/src/main/webapp/app/pages/catalogue/catalogue.html index d44911da..2d1ee814 100644 --- a/src/main/webapp/app/pages/catalogue/catalogue.html +++ b/src/main/webapp/app/pages/catalogue/catalogue.html @@ -1,18 +1,8 @@ -
+
- - - - - -
-

Create New Project

+
+