Skip to main content

Class: CheckDatabaseConsistencyService

initialization/check-database-consistency.service.CheckDatabaseConsistencyService

Constructors

constructor

new CheckDatabaseConsistencyService(activeLoginService, loginUserService, strategyInstanceService, strategyService, userLoginDataService, userLoginDataImsUserService, backendUserService, imsUserFindingService)

Parameters

NameType
activeLoginServiceActiveLoginService
loginUserServiceLoginUserService
strategyInstanceServiceStrategyInstanceService
strategyServiceStrategiesService
userLoginDataServiceUserLoginDataService
userLoginDataImsUserServiceUserLoginDataImsUserService
backendUserServiceBackendUserService
imsUserFindingServiceImsUserFindingService

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:16

Properties

activeLoginService

Private Readonly activeLoginService: ActiveLoginService

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:17


backendUserService

Private Readonly backendUserService: BackendUserService

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:23


imsUserFindingService

Private Readonly imsUserFindingService: ImsUserFindingService

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:24


logger

Private Readonly logger: Logger

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:15


loginUserService

Private Readonly loginUserService: LoginUserService

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:18


strategyInstanceService

Private Readonly strategyInstanceService: StrategyInstanceService

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:19


strategyService

Private Readonly strategyService: StrategiesService

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:20


userLoginDataImsUserService

Private Readonly userLoginDataImsUserService: UserLoginDataImsUserService

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:22


userLoginDataService

Private Readonly userLoginDataService: UserLoginDataService

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:21

Methods

checkActiveLogin

Private checkActiveLogin(fixBroken): Promise<string>

Checks all active logins in the database for consistency.

Currently no inconsistent state is possible.

A warning is produced, if any active logins without login data are found. This is allowed, but should not happen in normal operation

Parameters

NameType
fixBrokenboolean

Returns

Promise<string>

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:35


checkDatabaseConsistency

checkDatabaseConsistency(): Promise<boolean>

Returns

Promise<boolean>

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:191


checkLoginUser

Private checkLoginUser(fixBroken): Promise<string>

Checks all login users in the database and the backend for consistency.

A login user in the database is inconsistent if

  • It has no neo4j id (NOT FIXABLE)
  • It doesn't exist in the backend (NOT FIXABLE)

Parameters

NameType
fixBrokenboolean

Returns

Promise<string>

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:54


checkStrategyInstance

Private checkStrategyInstance(fixBroken): Promise<string>

Checks if all strategy instances are consistent

A strategy instance is considered inconsistent when:

  • It has a type of a strategy that is unknown (NOT FIXABLE)

Parameters

NameType
fixBrokenboolean

Returns

Promise<string>

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:104


checkUserLoginData

Private checkUserLoginData(fixBroken): Promise<string>

Checks if all UserLoginData elements in the database are consistent

A UserLoginData is considered inconsistent when:

  • It is set to state VALID but has no user assigned (NOT FIXABLE)
  • It is set to state WAITING_FOR_REGISTER but has a user assigned (NOT FIXABLE)

Parameters

NameType
fixBrokenboolean

Returns

Promise<string>

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:122


checkUserLoginDataImsUser

Private checkUserLoginDataImsUser(fixBroken): Promise<string>

Checks if all UserLoginDataImsUser elements in the database are consistent

A UserLoginDataImsUser is considered inconsistent when:

  • The IMSUser referenced by its neo4j ID doesn't exist in the backend (NOT FIXABLE)

Parameters

NameType
fixBrokenboolean

Returns

Promise<string>

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:146


ensureDatabaseConsistency

ensureDatabaseConsistency(fixBrokenConsistency?): Promise<void>

Parameters

NameType
fixBrokenConsistencyboolean

Returns

Promise<void>

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:195


runDatabaseCheck

runDatabaseCheck(): Promise<void>

Returns

Promise<void>

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:204


testDatabaseForConsistency

Private testDatabaseForConsistency(fixBroken): Promise<string>

Parameters

NameType
fixBrokenboolean

Returns

Promise<string>

Defined in

gropius-login-service/backend/src/initialization/check-database-consistency.service.ts:162