use of org.cloudfoundry.identity.uaa.oauth.client.ClientDetailsModification in project uaa by cloudfoundry.
the class ClientAdminEventPublisher method modifyTx.
public void modifyTx(ClientDetailsModification[] clients) {
for (ClientDetailsModification client : clients) {
if (ClientDetailsModification.ADD.equals(client.getAction())) {
publish(new ClientCreateEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));
} else if (ClientDetailsModification.UPDATE.equals(client.getAction())) {
publish(new ClientUpdateEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));
} else if (ClientDetailsModification.DELETE.equals(client.getAction())) {
publish(new ClientDeleteEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));
} else if (ClientDetailsModification.UPDATE_SECRET.equals(client.getAction())) {
publish(new ClientUpdateEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));
if (client.isApprovalsDeleted()) {
publish(new SecretChangeEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));
publish(new ClientApprovalsDeletedEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));
}
} else if (ClientDetailsModification.SECRET.equals(client.getAction())) {
if (client.isApprovalsDeleted()) {
publish(new SecretChangeEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));
publish(new ClientApprovalsDeletedEvent(client, getPrincipal(), identityZoneManager.getCurrentIdentityZoneId()));
}
}
}
}
Aggregations