Search in sources :

Example 1 with DirectoryIdQueryParameters

use of org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters in project ovirt-engine by oVirt.

the class BackendDomainUserResource method get.

@Override
public User get() {
    String directoryId;
    try {
        directoryId = DirectoryEntryIdUtils.decode(id);
    } catch (IllegalArgumentException exception) {
        throw new WebApplicationException(Response.Status.NOT_FOUND);
    }
    String directory = parent.getDirectory().getName();
    DirectoryIdQueryParameters parameters = new DirectoryIdQueryParameters(directory, directoryId);
    return performGet(QueryType.GetDirectoryUserById, parameters, BaseResource.class);
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) DirectoryIdQueryParameters(org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters)

Example 2 with DirectoryIdQueryParameters

use of org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters in project ovirt-engine by oVirt.

the class BackendUsersResource method getUserById.

private DirectoryUser getUserById(String directoryName, String namespace, String userId) {
    DirectoryUser result;
    try {
        userId = DirectoryEntryIdUtils.decode(userId);
    } catch (IllegalArgumentException exception) {
        return null;
    }
    result = getEntity(DirectoryUser.class, QueryType.GetDirectoryUserById, new DirectoryIdQueryParameters(directoryName, namespace, userId), userId, true);
    return result;
}
Also used : DirectoryUser(org.ovirt.engine.core.aaa.DirectoryUser) DirectoryIdQueryParameters(org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters)

Example 3 with DirectoryIdQueryParameters

use of org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters in project ovirt-engine by oVirt.

the class BackendDomainGroupResource method get.

@Override
public Group get() {
    String directoryId;
    try {
        directoryId = DirectoryEntryIdUtils.decode(id);
    } catch (IllegalArgumentException exception) {
        throw new WebApplicationException(Response.Status.NOT_FOUND);
    }
    String directory = parent.getDirectory().getName();
    DirectoryIdQueryParameters parameters = new DirectoryIdQueryParameters(directory, directoryId);
    return performGet(QueryType.GetDirectoryGroupById, parameters, BaseResource.class);
}
Also used : WebApplicationException(javax.ws.rs.WebApplicationException) DirectoryIdQueryParameters(org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters)

Aggregations

DirectoryIdQueryParameters (org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters)3 WebApplicationException (javax.ws.rs.WebApplicationException)2 DirectoryUser (org.ovirt.engine.core.aaa.DirectoryUser)1