Mongo fixes & few other fixes

This commit is contained in:
mposolda committed 2015-06-05 17:52:56 +02:00
1 parent d958d85290
commit 0092d9f74d
7 files changed
+28 -23

No files matched your search

@@ -13,7 +13,7 @@ public class AuthenticationExecutionEntity {
protected AuthenticationExecutionModel.Requirement requirement;
protected int priority;
private boolean userSetupAllowed;
private boolean autheticatorFlow;
private boolean authenticatorFlow;
private String parentFlow;
public String getId() {
@@ -56,12 +56,12 @@ public class AuthenticationExecutionEntity {
this.userSetupAllowed = userSetupAllowed;
}
public boolean isAutheticatorFlow() {
return autheticatorFlow;
public boolean isAuthenticatorFlow() {
return authenticatorFlow;
}
public void setAutheticatorFlow(boolean autheticatorFlow) {
this.autheticatorFlow = autheticatorFlow;
public void setAuthenticatorFlow(boolean authenticatorFlow) {
this.authenticatorFlow = authenticatorFlow;
}
public String getParentFlow() {
@@ -1287,7 +1287,7 @@ public class RealmAdapter implements RealmModel {
model.setPriority(entity.getPriority());
model.setAuthenticator(entity.getAuthenticator());
model.setParentFlow(entity.getParentFlow());
model.setAutheticatorFlow(entity.isAutheticatorFlow());
model.setAutheticatorFlow(entity.isAuthenticatorFlow());
return model;
}
@@ -1317,7 +1317,7 @@ public class RealmAdapter implements RealmModel {
entity.setPriority(model.getPriority());
entity.setRequirement(model.getRequirement());
entity.setUserSetupAllowed(model.isUserSetupAllowed());
entity.setAutheticatorFlow(model.isAutheticatorFlow());
entity.setAuthenticatorFlow(model.isAutheticatorFlow());
AuthenticationFlowEntity flow = getFlowEntity(model.getId());
flow.getExecutions().add(entity);
model.setId(entity.getId());
@@ -1335,7 +1335,7 @@ public class RealmAdapter implements RealmModel {
}
}
if (entity == null) return;
entity.setAutheticatorFlow(model.isAutheticatorFlow());
entity.setAuthenticatorFlow(model.isAutheticatorFlow());
entity.setAuthenticator(model.getAuthenticator());
entity.setPriority(model.getPriority());
entity.setRequirement(model.getRequirement());
@@ -1236,7 +1236,6 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
@Override
public List<AuthenticationFlowModel> getAuthenticationFlows() {
List<AuthenticationFlowEntity> flows = getMongoEntity().getAuthenticationFlows();
if (flows.size() == 0) return Collections.EMPTY_LIST;
List<AuthenticationFlowModel> models = new LinkedList<>();
for (AuthenticationFlowEntity entity : flows) {
AuthenticationFlowModel model = entityToModel(entity);
@@ -1255,10 +1254,9 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
@Override
public AuthenticationFlowModel getAuthenticationFlowById(String id) {
for (AuthenticationFlowModel model : getAuthenticationFlows()) {
if (model.getId().equals(id)) return model;
}
return null;
AuthenticationFlowEntity entity = getFlowEntity(id);
if (entity == null) return null;
return entityToModel(entity);
}
protected AuthenticationFlowEntity getFlowEntity(String id) {
@@ -1280,7 +1278,6 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
@Override
public void updateAuthenticationFlow(AuthenticationFlowModel model) {
List<AuthenticationFlowEntity> flows = getMongoEntity().getAuthenticationFlows();
AuthenticationFlowEntity toUpdate = getFlowEntity(model.getId());;
if (toUpdate == null) return;
toUpdate.setAlias(model.getAlias());
@@ -1322,7 +1319,7 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
model.setPriority(entity.getPriority());
model.setAuthenticator(entity.getAuthenticator());
model.setParentFlow(entity.getParentFlow());
model.setAutheticatorFlow(entity.isAutheticatorFlow());
model.setAutheticatorFlow(entity.isAuthenticatorFlow());
return model;
}
@@ -1352,8 +1349,9 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
entity.setPriority(model.getPriority());
entity.setRequirement(model.getRequirement());
entity.setUserSetupAllowed(model.isUserSetupAllowed());
entity.setAutheticatorFlow(model.isAutheticatorFlow());
AuthenticationFlowEntity flow = getFlowEntity(model.getId());
entity.setAuthenticatorFlow(model.isAutheticatorFlow());
entity.setParentFlow(model.getParentFlow());
AuthenticationFlowEntity flow = getFlowEntity(model.getParentFlow());
flow.getExecutions().add(entity);
updateMongoEntity();
model.setId(entity.getId());
@@ -1371,7 +1369,7 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
}
}
if (entity == null) return;
entity.setAutheticatorFlow(model.isAutheticatorFlow());
entity.setAuthenticatorFlow(model.isAutheticatorFlow());
entity.setAuthenticator(model.getAuthenticator());
entity.setPriority(model.getPriority());
entity.setRequirement(model.getRequirement());