Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
reg-app
Regapp
Commits
c6f67b17
Commit
c6f67b17
authored
May 10, 2017
by
michael.simon
Browse files
Only deregister users, if IDP AttributeQuery status is good
parent
e31f0723
Changes
5
Hide whitespace changes
Inline
Side-by-side
bwreg-jpa/src/main/java/edu/kit/scc/webreg/dao/RegistryDao.java
View file @
c6f67b17
...
...
@@ -64,4 +64,7 @@ public interface RegistryDao extends BaseDao<RegistryEntity, Long> {
List
<
RegistryEntity
>
findByServiceAndNotStatus
(
ServiceEntity
service
,
RegistryStatus
...
status
);
List
<
RegistryEntity
>
findByServiceAndStatusAndIDPGood
(
String
serviceShortName
,
RegistryStatus
status
,
Date
date
,
int
limit
);
}
bwreg-jpa/src/main/java/edu/kit/scc/webreg/dao/jpa/JpaRegistryDao.java
View file @
c6f67b17
...
...
@@ -31,6 +31,7 @@ import edu.kit.scc.webreg.dao.RegistryDao;
import
edu.kit.scc.webreg.entity.RegistryEntity
;
import
edu.kit.scc.webreg.entity.RegistryEntity_
;
import
edu.kit.scc.webreg.entity.RegistryStatus
;
import
edu.kit.scc.webreg.entity.SamlIdpMetadataEntityStatus
;
import
edu.kit.scc.webreg.entity.ServiceEntity
;
import
edu.kit.scc.webreg.entity.ServiceEntity_
;
import
edu.kit.scc.webreg.entity.UserEntity
;
...
...
@@ -91,6 +92,17 @@ public class JpaRegistryDao extends JpaBaseDao<RegistryEntity, Long> implements
.
setMaxResults
(
limit
).
getResultList
();
}
@SuppressWarnings
(
"unchecked"
)
@Override
public
List
<
RegistryEntity
>
findByServiceAndStatusAndIDPGood
(
String
serviceShortName
,
RegistryStatus
status
,
Date
date
,
int
limit
)
{
return
em
.
createQuery
(
"select r from RegistryEntity r where r.service.shortName = :ssn and r.registryStatus = :status"
+
" and lastStatusChange < :is and r.user.idp.aqIdpStatus = :aqStatus order by lastStatusChange asc"
)
.
setParameter
(
"ssn"
,
serviceShortName
).
setParameter
(
"status"
,
status
)
.
setParameter
(
"is"
,
date
)
.
setParameter
(
"aqStatus"
,
SamlIdpMetadataEntityStatus
.
GOOD
)
.
setMaxResults
(
limit
).
getResultList
();
}
@SuppressWarnings
(
"unchecked"
)
@Override
public
List
<
RegistryEntity
>
findRegistriesForDepro
(
String
serviceShortName
)
{
...
...
bwreg-service/src/main/java/edu/kit/scc/webreg/job/DeregisterLostAccessRegistries.java
View file @
c6f67b17
...
...
@@ -70,7 +70,7 @@ public class DeregisterLostAccessRegistries extends AbstractExecutableJob {
UserService
userService
=
(
UserService
)
ic
.
lookup
(
"global/bwreg/bwreg-service/UserServiceImpl!edu.kit.scc.webreg.service.UserService"
);
KnowledgeSessionService
knowledgeSessionService
=
(
KnowledgeSessionService
)
ic
.
lookup
(
"global/bwreg/bwreg-service/KnowledgeSessionServiceImpl!edu.kit.scc.webreg.drools.KnowledgeSessionService"
);
List
<
RegistryEntity
>
registryList
=
registryService
.
findByServiceAndStatus
(
ssn
,
RegistryStatus
.
LOST_ACCESS
,
List
<
RegistryEntity
>
registryList
=
registryService
.
findByServiceAndStatus
AndIDPGood
(
ssn
,
RegistryStatus
.
LOST_ACCESS
,
new
Date
(
System
.
currentTimeMillis
()
-
lastUpdate
),
limit
);
if
(
registryList
.
size
()
==
0
)
...
...
bwreg-service/src/main/java/edu/kit/scc/webreg/service/RegistryService.java
View file @
c6f67b17
...
...
@@ -61,4 +61,7 @@ public interface RegistryService extends BaseService<RegistryEntity, Long> {
List
<
RegistryEntity
>
findByServiceAndNotStatus
(
ServiceEntity
service
,
RegistryStatus
...
status
);
List
<
RegistryEntity
>
findByServiceAndStatusAndIDPGood
(
String
serviceShortName
,
RegistryStatus
status
,
Date
date
,
int
limit
);
}
bwreg-service/src/main/java/edu/kit/scc/webreg/service/impl/RegistryServiceImpl.java
View file @
c6f67b17
...
...
@@ -49,6 +49,11 @@ public class RegistryServiceImpl extends BaseServiceImpl<RegistryEntity, Long> i
return
dao
.
findByServiceAndStatus
(
serviceShortName
,
status
,
date
,
limit
);
}
@Override
public
List
<
RegistryEntity
>
findByServiceAndStatusAndIDPGood
(
String
serviceShortName
,
RegistryStatus
status
,
Date
date
,
int
limit
)
{
return
dao
.
findByServiceAndStatusAndIDPGood
(
serviceShortName
,
status
,
date
,
limit
);
}
@Override
public
List
<
RegistryEntity
>
findRegistriesForDepro
(
String
serviceShortName
)
{
return
dao
.
findRegistriesForDepro
(
serviceShortName
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment