use of org.keycloak.models.map.authorization.entity.MapResourceServerEntity in project keycloak by keycloak.
the class MapResourceServerStore method findById.
@Override
public ResourceServer findById(String id) {
LOG.tracef("findById(%s)%s", id, getShortStackTrace());
if (id == null) {
return null;
}
MapResourceServerEntity entity = tx.read(id);
return entityToAdapter(entity);
}
use of org.keycloak.models.map.authorization.entity.MapResourceServerEntity in project keycloak by keycloak.
the class MapResourceServerStore method create.
@Override
public ResourceServer create(ClientModel client) {
String clientId = client.getId();
LOG.tracef("create(%s)%s", clientId, getShortStackTrace());
if (clientId == null)
return null;
if (!StorageId.isLocalStorage(clientId)) {
throw new ModelException("Creating resource server from federated ClientModel not supported");
}
if (tx.read(clientId) != null) {
throw new ModelDuplicateException("Resource server already exists: " + clientId);
}
MapResourceServerEntity entity = new MapResourceServerEntityImpl();
entity.setId(clientId);
return entityToAdapter(tx.create(entity));
}
Aggregations