findAll();
+}
diff --git a/src/main/java/net/hostsharing/hsadminng/rbac/rbacrole/RbacRoleType.java b/src/main/java/net/hostsharing/hsadminng/rbac/rbacrole/RbacRoleType.java
new file mode 100644
index 00000000..51d58bc6
--- /dev/null
+++ b/src/main/java/net/hostsharing/hsadminng/rbac/rbacrole/RbacRoleType.java
@@ -0,0 +1,5 @@
+package net.hostsharing.hsadminng.rbac.rbacrole;
+
+public enum RbacRoleType {
+ owner, admin, tenant
+}
diff --git a/src/main/java/org/hostsharing/hsadminng/ApplicationWebXml.java b/src/main/java/org/hostsharing/hsadminng/ApplicationWebXml.java
deleted file mode 100644
index d6b76fff..00000000
--- a/src/main/java/org/hostsharing/hsadminng/ApplicationWebXml.java
+++ /dev/null
@@ -1,23 +0,0 @@
-// Licensed under Apache-2.0
-package org.hostsharing.hsadminng;
-
-import org.hostsharing.hsadminng.config.DefaultProfileUtil;
-
-import org.springframework.boot.builder.SpringApplicationBuilder;
-import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
-
-/**
- * This is a helper Java class that provides an alternative to creating a web.xml.
- * This will be invoked only when the application is deployed to a Servlet container like Tomcat, JBoss etc.
- */
-public class ApplicationWebXml extends SpringBootServletInitializer {
-
- @Override
- protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
- /**
- * set a default to use when no profile is configured.
- */
- DefaultProfileUtil.addDefaultProfile(application.application());
- return application.sources(HsadminNgApp.class);
- }
-}
diff --git a/src/main/java/org/hostsharing/hsadminng/HsadminNgApp.java b/src/main/java/org/hostsharing/hsadminng/HsadminNgApp.java
deleted file mode 100644
index fcb5e760..00000000
--- a/src/main/java/org/hostsharing/hsadminng/HsadminNgApp.java
+++ /dev/null
@@ -1,111 +0,0 @@
-// Licensed under Apache-2.0
-package org.hostsharing.hsadminng;
-
-import org.hostsharing.hsadminng.config.ApplicationProperties;
-import org.hostsharing.hsadminng.config.DefaultProfileUtil;
-import org.hostsharing.hsadminng.service.accessfilter.Role;
-
-import io.github.jhipster.config.JHipsterConstants;
-
-import org.apache.commons.lang3.StringUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.liquibase.LiquibaseProperties;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.core.env.Environment;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Arrays;
-import java.util.Collection;
-
-import javax.annotation.PostConstruct;
-
-@SpringBootApplication
-@EnableConfigurationProperties({ LiquibaseProperties.class, ApplicationProperties.class })
-public class HsadminNgApp {
-
- private static final Logger log = LoggerFactory.getLogger(HsadminNgApp.class);
-
- private final Environment env;
-
- public HsadminNgApp(Environment env) {
- this.env = env;
-
- // TODO mhoennig rather use @PostConstruct or something more decentral
- Role.init();
- }
-
- /**
- * Initializes hsadminNg.
- *
- * Spring profiles can be configured with a program argument --spring.profiles.active=your-active-profile
- *
- * You can find more information on how profiles work with JHipster on
- * https://www.jhipster.tech/profiles/.
- */
- @PostConstruct
- public void initApplication() {
-
- Collection activeProfiles = Arrays.asList(env.getActiveProfiles());
- if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)
- && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_PRODUCTION)) {
- log.error(
- "You have misconfigured your application! It should not run " +
- "with both the 'dev' and 'prod' profiles at the same time.");
- }
- if (activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)
- && activeProfiles.contains(JHipsterConstants.SPRING_PROFILE_CLOUD)) {
- log.error(
- "You have misconfigured your application! It should not " +
- "run with both the 'dev' and 'cloud' profiles at the same time.");
- }
- }
-
- /**
- * Main method, used to run the application.
- *
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- SpringApplication app = new SpringApplication(HsadminNgApp.class);
- DefaultProfileUtil.addDefaultProfile(app);
- Environment env = app.run(args).getEnvironment();
- logApplicationStartup(env);
- }
-
- private static void logApplicationStartup(Environment env) {
- String protocol = "http";
- if (env.getProperty("server.ssl.key-store") != null) {
- protocol = "https";
- }
- String serverPort = env.getProperty("server.port");
- String contextPath = env.getProperty("server.servlet.context-path");
- if (StringUtils.isBlank(contextPath)) {
- contextPath = "/";
- }
- String hostAddress = "localhost";
- try {
- hostAddress = InetAddress.getLocalHost().getHostAddress();
- } catch (UnknownHostException e) {
- log.warn("The host name could not be determined, using `localhost` as fallback");
- }
- log.info(
- "\n----------------------------------------------------------\n\t" +
- "Application '{}' is running! Access URLs:\n\t" +
- "Local: \t\t{}://localhost:{}{}\n\t" +
- "External: \t{}://{}:{}{}\n\t" +
- "Profile(s): \t{}\n----------------------------------------------------------",
- env.getProperty("spring.application.name"),
- protocol,
- serverPort,
- contextPath,
- protocol,
- hostAddress,
- serverPort,
- contextPath,
- env.getActiveProfiles());
- }
-}
diff --git a/src/main/java/org/hostsharing/hsadminng/aop/logging/LoggingAspect.java b/src/main/java/org/hostsharing/hsadminng/aop/logging/LoggingAspect.java
deleted file mode 100644
index f6574ef4..00000000
--- a/src/main/java/org/hostsharing/hsadminng/aop/logging/LoggingAspect.java
+++ /dev/null
@@ -1,116 +0,0 @@
-// Licensed under Apache-2.0
-package org.hostsharing.hsadminng.aop.logging;
-
-import io.github.jhipster.config.JHipsterConstants;
-
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.ProceedingJoinPoint;
-import org.aspectj.lang.annotation.AfterThrowing;
-import org.aspectj.lang.annotation.Around;
-import org.aspectj.lang.annotation.Aspect;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.core.env.Environment;
-
-import java.util.Arrays;
-
-/**
- * Aspect for logging execution of service and repository Spring components.
- *
- * By default, it only runs with the "dev" profile.
- */
-@Aspect
-public class LoggingAspect {
-
- private final Logger log = LoggerFactory.getLogger(this.getClass());
-
- private final Environment env;
-
- public LoggingAspect(Environment env) {
- this.env = env;
- }
-
- /**
- * Pointcut that matches all repositories, services and Web REST endpoints.
- */
- @Pointcut("within(@org.springframework.stereotype.Repository *)" +
- " || within(@org.springframework.stereotype.Service *)" +
- " || within(@org.springframework.web.bind.annotation.RestController *)")
- public void springBeanPointcut() {
- // Method is empty as this is just a Pointcut, the implementations are in the advices.
- }
-
- /**
- * Pointcut that matches all Spring beans in the application's main packages.
- */
- @Pointcut("within(org.hostsharing.hsadminng.repository..*)" +
- " || within(org.hostsharing.hsadminng.service..*)" +
- " || within(org.hostsharing.hsadminng.web.rest..*)")
- public void applicationPackagePointcut() {
- // Method is empty as this is just a Pointcut, the implementations are in the advices.
- }
-
- /**
- * Advice that logs methods throwing exceptions.
- *
- * @param joinPoint join point for advice
- * @param e exception
- */
- @AfterThrowing(pointcut = "applicationPackagePointcut() && springBeanPointcut()", throwing = "e")
- public void logAfterThrowing(JoinPoint joinPoint, Throwable e) {
- if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {
- log.error(
- "Exception in {}.{}() with cause = \'{}\' and exception = \'{}\'",
- joinPoint.getSignature().getDeclaringTypeName(),
- joinPoint.getSignature().getName(),
- e.getCause() != null ? e.getCause() : "NULL",
- e.getMessage(),
- e);
-
- } else {
- log.error(
- "Exception in {}.{}() with cause = {}",
- joinPoint.getSignature().getDeclaringTypeName(),
- joinPoint.getSignature().getName(),
- e.getCause() != null ? e.getCause() : "NULL");
- }
- }
-
- /**
- * Advice that logs when a method is entered and exited.
- *
- * @param joinPoint join point for advice
- * @return result
- * @throws Throwable throws IllegalArgumentException
- */
- @Around("applicationPackagePointcut() && springBeanPointcut()")
- public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
- if (log.isDebugEnabled()) {
- log.debug(
- "Enter: {}.{}() with argument[s] = {}",
- joinPoint.getSignature().getDeclaringTypeName(),
- joinPoint.getSignature().getName(),
- Arrays.toString(joinPoint.getArgs()));
- }
- try {
- Object result = joinPoint.proceed();
- if (log.isDebugEnabled()) {
- log.debug(
- "Exit: {}.{}() with result = {}",
- joinPoint.getSignature().getDeclaringTypeName(),
- joinPoint.getSignature().getName(),
- result);
- }
- return result;
- } catch (IllegalArgumentException e) {
- log.error(
- "Illegal argument: {} in {}.{}()",
- Arrays.toString(joinPoint.getArgs()),
- joinPoint.getSignature().getDeclaringTypeName(),
- joinPoint.getSignature().getName());
-
- throw e;
- }
- }
-}
diff --git a/src/main/java/org/hostsharing/hsadminng/config/ApplicationProperties.java b/src/main/java/org/hostsharing/hsadminng/config/ApplicationProperties.java
deleted file mode 100644
index 19bc4cdb..00000000
--- a/src/main/java/org/hostsharing/hsadminng/config/ApplicationProperties.java
+++ /dev/null
@@ -1,15 +0,0 @@
-// Licensed under Apache-2.0
-package org.hostsharing.hsadminng.config;
-
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * Properties specific to Hsadmin Ng.
- *
- * Properties are configured in the application.yml file.
- * See {@link io.github.jhipster.config.JHipsterProperties} for a good example.
- */
-@ConfigurationProperties(prefix = "application", ignoreUnknownFields = false)
-public class ApplicationProperties {
-
-}
diff --git a/src/main/java/org/hostsharing/hsadminng/config/AsyncConfiguration.java b/src/main/java/org/hostsharing/hsadminng/config/AsyncConfiguration.java
deleted file mode 100644
index c87c3b44..00000000
--- a/src/main/java/org/hostsharing/hsadminng/config/AsyncConfiguration.java
+++ /dev/null
@@ -1,60 +0,0 @@
-// Licensed under Apache-2.0
-package org.hostsharing.hsadminng.config;
-
-import io.github.jhipster.async.ExceptionHandlingAsyncTaskExecutor;
-import io.github.jhipster.config.JHipsterProperties;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
-import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.annotation.*;
-import org.springframework.scheduling.annotation.SchedulingConfigurer;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import org.springframework.scheduling.config.ScheduledTaskRegistrar;
-
-import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
-
-@Configuration
-@EnableAsync
-@EnableScheduling
-public class AsyncConfiguration implements AsyncConfigurer, SchedulingConfigurer {
-
- private final Logger log = LoggerFactory.getLogger(AsyncConfiguration.class);
-
- private final JHipsterProperties jHipsterProperties;
-
- public AsyncConfiguration(JHipsterProperties jHipsterProperties) {
- this.jHipsterProperties = jHipsterProperties;
- }
-
- @Override
- @Bean(name = "taskExecutor")
- public Executor getAsyncExecutor() {
- log.debug("Creating Async Task Executor");
- ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
- executor.setCorePoolSize(jHipsterProperties.getAsync().getCorePoolSize());
- executor.setMaxPoolSize(jHipsterProperties.getAsync().getMaxPoolSize());
- executor.setQueueCapacity(jHipsterProperties.getAsync().getQueueCapacity());
- executor.setThreadNamePrefix("hsadmin-ng-Executor-");
- return new ExceptionHandlingAsyncTaskExecutor(executor);
- }
-
- @Override
- public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
- return new SimpleAsyncUncaughtExceptionHandler();
- }
-
- @Override
- public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
- taskRegistrar.setScheduler(scheduledTaskExecutor());
- }
-
- @Bean
- public Executor scheduledTaskExecutor() {
- return Executors.newScheduledThreadPool(jHipsterProperties.getAsync().getCorePoolSize());
- }
-}
diff --git a/src/main/java/org/hostsharing/hsadminng/config/CacheConfiguration.java b/src/main/java/org/hostsharing/hsadminng/config/CacheConfiguration.java
deleted file mode 100644
index 02c5479a..00000000
--- a/src/main/java/org/hostsharing/hsadminng/config/CacheConfiguration.java
+++ /dev/null
@@ -1,45 +0,0 @@
-// Licensed under Apache-2.0
-package org.hostsharing.hsadminng.config;
-
-import io.github.jhipster.config.JHipsterProperties;
-
-import org.ehcache.config.builders.*;
-import org.ehcache.jsr107.Eh107Configuration;
-import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer;
-import org.springframework.cache.annotation.EnableCaching;
-import org.springframework.context.annotation.*;
-
-import java.time.Duration;
-
-@Configuration
-@EnableCaching
-public class CacheConfiguration {
-
- private final javax.cache.configuration.Configuration