use of org.ovirt.engine.api.extensions.ExtUUID in project ovirt-engine by oVirt.
the class InternalAuthz method invoke.
@Override
public void invoke(ExtMap input, ExtMap output) {
try {
ExtUUID command = input.get(Base.InvokeKeys.COMMAND);
if (input.get(Base.InvokeKeys.COMMAND).equals(Base.InvokeCommands.LOAD)) {
doLoad(input);
} else if (input.get(Base.InvokeKeys.COMMAND).equals(Base.InvokeCommands.INITIALIZE)) {
// Do nothing
} else if (command.equals(Authz.InvokeCommands.FETCH_PRINCIPAL_RECORD)) {
doFetchPrincipalRecord(input, output);
} else if (command.equals(Authz.InvokeCommands.QUERY_CLOSE)) {
// Do nothing
} else if (command.equals(Authz.InvokeCommands.QUERY_OPEN)) {
doQueryOpen(input, output);
} else if (command.equals(Authz.InvokeCommands.QUERY_EXECUTE)) {
doQueryExecute(input, output);
} else {
output.put(Base.InvokeKeys.RESULT, Base.InvokeResult.UNSUPPORTED);
}
output.putIfAbsent(Authz.InvokeKeys.STATUS, Authz.Status.SUCCESS);
output.putIfAbsent(Base.InvokeKeys.RESULT, Base.InvokeResult.SUCCESS);
} catch (Exception ex) {
output.mput(Base.InvokeKeys.RESULT, Base.InvokeResult.FAILED).mput(Base.InvokeKeys.MESSAGE, ex.getMessage());
}
}
use of org.ovirt.engine.api.extensions.ExtUUID in project ovirt-engine by oVirt.
the class SearchParsingUtils method generateQueryMap.
public static ExtMap generateQueryMap(Collection<String> ids, ExtUUID queryEntity) {
ExtMap result = new ExtMap().mput(Authz.InvokeKeys.QUERY_ENTITY, queryEntity);
ExtKey key = queryEntity.equals(Authz.QueryEntity.GROUP) ? Authz.GroupRecord.ID : Authz.PrincipalRecord.ID;
List<ExtMap> filter = ids.stream().map((id) -> createMapForKeyAndValue(key, id)).collect(Collectors.toList());
result.mput(QueryFilterRecord.OPERATOR, QueryFilterOperator.OR).mput(QueryFilterRecord.FILTER, filter);
return result;
}
Aggregations