kafka Persist
This commit is contained in:
@@ -9,8 +9,6 @@ dependencies {
|
||||
compile project(":maxkey-common")
|
||||
compile project(":maxkey-core")
|
||||
compile project(":maxkey-persistence")
|
||||
compile project(":maxkey-protocols:maxkey-protocol-oauth-2.0")
|
||||
compile project(":maxkey-protocols:maxkey-protocol-saml-2.0")
|
||||
compile project(":maxkey-authentications:maxkey-authentication-otp")
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
description = "maxkey-identity-kafka"
|
||||
|
||||
apply plugin: 'java'
|
||||
|
||||
dependencies {
|
||||
//local jars
|
||||
compile fileTree(dir: '../maxkey-lib/*/', include: '*.jar')
|
||||
|
||||
compile project(":maxkey-common")
|
||||
compile project(":maxkey-core")
|
||||
|
||||
}
|
||||
@@ -6,5 +6,4 @@ dependencies {
|
||||
|
||||
compile project(":maxkey-common")
|
||||
compile project(":maxkey-core")
|
||||
compile project(":maxkey-identitys:maxkey-identity-kafka")
|
||||
}
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
|
||||
package org.maxkey.identity.kafka;
|
||||
package org.maxkey.persistence.kafka;
|
||||
|
||||
public class KafkaIdentityAction {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
|
||||
package org.maxkey.identity.kafka;
|
||||
package org.maxkey.persistence.kafka;
|
||||
|
||||
public class KafkaIdentityTopic {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
|
||||
package org.maxkey.identity.kafka;
|
||||
package org.maxkey.persistence.kafka;
|
||||
|
||||
public class KafkaMessage {
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
|
||||
package org.maxkey.identity.kafka;
|
||||
package org.maxkey.persistence.kafka;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
@@ -29,9 +29,9 @@ import org.springframework.kafka.core.KafkaTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class KafkaProvisioningService {
|
||||
public class KafkaPersistService {
|
||||
|
||||
private static final Logger _logger = LoggerFactory.getLogger(KafkaProvisioningService.class);
|
||||
private static final Logger _logger = LoggerFactory.getLogger(KafkaPersistService.class);
|
||||
|
||||
@Autowired
|
||||
protected ApplicationConfig applicationConfig;
|
||||
@@ -34,9 +34,9 @@ import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.maxkey.domain.Organizations;
|
||||
import org.maxkey.identity.kafka.KafkaIdentityAction;
|
||||
import org.maxkey.identity.kafka.KafkaIdentityTopic;
|
||||
import org.maxkey.identity.kafka.KafkaProvisioningService;
|
||||
import org.maxkey.persistence.kafka.KafkaIdentityAction;
|
||||
import org.maxkey.persistence.kafka.KafkaIdentityTopic;
|
||||
import org.maxkey.persistence.kafka.KafkaPersistService;
|
||||
import org.maxkey.persistence.mapper.OrganizationsMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -49,7 +49,7 @@ import com.google.common.collect.Lists;
|
||||
public class OrganizationsService extends JpaBaseService<Organizations>{
|
||||
|
||||
@Autowired
|
||||
KafkaProvisioningService kafkaProvisioningService;
|
||||
KafkaPersistService kafkaPersistService;
|
||||
|
||||
public OrganizationsService() {
|
||||
super(OrganizationsMapper.class);
|
||||
@@ -66,7 +66,7 @@ public class OrganizationsService extends JpaBaseService<Organizations>{
|
||||
|
||||
public boolean insert(Organizations organization) {
|
||||
if(super.insert(organization)){
|
||||
kafkaProvisioningService.send(
|
||||
kafkaPersistService.send(
|
||||
KafkaIdentityTopic.ORG_TOPIC, organization, KafkaIdentityAction.CREATE_ACTION);
|
||||
return true;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ public class OrganizationsService extends JpaBaseService<Organizations>{
|
||||
|
||||
public boolean update(Organizations organization) {
|
||||
if(super.update(organization)){
|
||||
kafkaProvisioningService.send(
|
||||
kafkaPersistService.send(
|
||||
KafkaIdentityTopic.ORG_TOPIC, organization, KafkaIdentityAction.UPDATE_ACTION);
|
||||
return true;
|
||||
}
|
||||
@@ -84,7 +84,7 @@ public class OrganizationsService extends JpaBaseService<Organizations>{
|
||||
|
||||
public boolean delete(Organizations organization) {
|
||||
if(super.delete(organization)){
|
||||
kafkaProvisioningService.send(
|
||||
kafkaPersistService.send(
|
||||
KafkaIdentityTopic.ORG_TOPIC, organization, KafkaIdentityAction.DELETE_ACTION);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -40,10 +40,10 @@ import org.maxkey.crypto.ReciprocalUtils;
|
||||
import org.maxkey.crypto.password.PasswordReciprocal;
|
||||
import org.maxkey.domain.ChangePassword;
|
||||
import org.maxkey.domain.UserInfo;
|
||||
import org.maxkey.identity.kafka.KafkaIdentityAction;
|
||||
import org.maxkey.identity.kafka.KafkaIdentityTopic;
|
||||
import org.maxkey.identity.kafka.KafkaProvisioningService;
|
||||
import org.maxkey.persistence.db.PasswordPolicyValidator;
|
||||
import org.maxkey.persistence.kafka.KafkaIdentityAction;
|
||||
import org.maxkey.persistence.kafka.KafkaIdentityTopic;
|
||||
import org.maxkey.persistence.kafka.KafkaPersistService;
|
||||
import org.maxkey.persistence.mapper.UserInfoMapper;
|
||||
import org.maxkey.util.DateUtils;
|
||||
import org.maxkey.util.StringUtils;
|
||||
@@ -76,7 +76,7 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
PasswordPolicyValidator passwordPolicyValidator;
|
||||
|
||||
@Autowired
|
||||
KafkaProvisioningService kafkaProvisioningService;
|
||||
KafkaPersistService kafkaPersistService;
|
||||
|
||||
@Autowired
|
||||
protected JdbcTemplate jdbcTemplate;
|
||||
@@ -96,7 +96,7 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
public boolean insert(UserInfo userInfo) {
|
||||
userInfo = passwordEncoder(userInfo);
|
||||
if (super.insert(userInfo)) {
|
||||
kafkaProvisioningService.send(
|
||||
kafkaPersistService.send(
|
||||
KafkaIdentityTopic.USERINFO_TOPIC,
|
||||
userInfo,
|
||||
KafkaIdentityAction.CREATE_ACTION);
|
||||
@@ -109,7 +109,7 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
public boolean update(UserInfo userInfo) {
|
||||
userInfo = passwordEncoder(userInfo);
|
||||
if (super.update(userInfo)) {
|
||||
kafkaProvisioningService.send(
|
||||
kafkaPersistService.send(
|
||||
KafkaIdentityTopic.USERINFO_TOPIC,
|
||||
userInfo,
|
||||
KafkaIdentityAction.UPDATE_ACTION);
|
||||
@@ -122,7 +122,7 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
|
||||
public boolean delete(UserInfo userInfo) {
|
||||
if( super.delete(userInfo)){
|
||||
kafkaProvisioningService.send(
|
||||
kafkaPersistService.send(
|
||||
KafkaIdentityTopic.USERINFO_TOPIC,
|
||||
userInfo,
|
||||
KafkaIdentityAction.DELETE_ACTION);
|
||||
@@ -283,7 +283,7 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
|
||||
changePassword.setUsername(userInfo.getUsername());
|
||||
changePassword.setDecipherable(userInfo.getDecipherable());
|
||||
changePassword.setPassword(userInfo.getPassword());
|
||||
kafkaProvisioningService.send(
|
||||
kafkaPersistService.send(
|
||||
KafkaIdentityTopic.PASSWORD_TOPIC,
|
||||
changePassword,
|
||||
KafkaIdentityAction.PASSWORD_ACTION);
|
||||
|
||||
@@ -69,7 +69,6 @@ dependencies {
|
||||
compile project(":maxkey-protocols:maxkey-protocol-oauth-2.0")
|
||||
compile project(":maxkey-protocols:maxkey-protocol-saml-2.0")
|
||||
compile project(":maxkey-identitys:maxkey-identity-scim")
|
||||
compile project(":maxkey-identitys:maxkey-identity-kafka")
|
||||
compile project(":maxkey-identitys:maxkey-identity-rest")
|
||||
|
||||
}
|
||||
|
||||
@@ -80,7 +80,6 @@ dependencies {
|
||||
compile project(":maxkey-protocols:maxkey-protocol-oauth-2.0")
|
||||
compile project(":maxkey-protocols:maxkey-protocol-saml-2.0")
|
||||
compile project(":maxkey-protocols:maxkey-protocol-jwt")
|
||||
compile project(":maxkey-identitys:maxkey-identity-kafka")
|
||||
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -15,7 +15,6 @@ include 'maxkey-authentications:maxkey-authentication-otp'
|
||||
|
||||
//identity
|
||||
include 'maxkey-identitys:maxkey-identity-scim'
|
||||
include 'maxkey-identitys:maxkey-identity-kafka'
|
||||
include 'maxkey-identitys:maxkey-identity-rest'
|
||||
|
||||
//Protocol
|
||||
|
||||
Reference in New Issue
Block a user