Search in sources :

Example 1 with CodeableDtoLookup

use of eu.bcvsolutions.idm.core.api.rest.lookup.CodeableDtoLookup in project CzechIdMng by bcvsolutions.

the class DefaultLookupService method getDtoLookup.

@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public <I extends BaseDto> DtoLookup<I> getDtoLookup(Class<? extends Identifiable> identifiableType) {
    ReadDtoService service = getDtoService(identifiableType);
    if (service == null) {
        LOG.debug("Service for identifiable type [{}] is not found, lookup not found.", identifiableType);
        return null;
    }
    // 
    DtoLookup<I> lookup = (DtoLookup<I>) dtoLookups.getPluginFor(service.getDtoClass());
    if (lookup == null) {
        if (service instanceof CodeableService) {
            return new CodeableDtoLookup<I>((CodeableService<I>) service);
        }
        return new DefaultDtoLookup<I>(service);
    }
    return lookup;
}
Also used : CodeableDtoLookup(eu.bcvsolutions.idm.core.api.rest.lookup.CodeableDtoLookup) CodeableDtoLookup(eu.bcvsolutions.idm.core.api.rest.lookup.CodeableDtoLookup) DtoLookup(eu.bcvsolutions.idm.core.api.rest.lookup.DtoLookup) DefaultDtoLookup(eu.bcvsolutions.idm.core.api.rest.lookup.DefaultDtoLookup) ReadDtoService(eu.bcvsolutions.idm.core.api.service.ReadDtoService) DefaultDtoLookup(eu.bcvsolutions.idm.core.api.rest.lookup.DefaultDtoLookup) CodeableService(eu.bcvsolutions.idm.core.api.service.CodeableService)

Aggregations

CodeableDtoLookup (eu.bcvsolutions.idm.core.api.rest.lookup.CodeableDtoLookup)1 DefaultDtoLookup (eu.bcvsolutions.idm.core.api.rest.lookup.DefaultDtoLookup)1 DtoLookup (eu.bcvsolutions.idm.core.api.rest.lookup.DtoLookup)1 CodeableService (eu.bcvsolutions.idm.core.api.service.CodeableService)1 ReadDtoService (eu.bcvsolutions.idm.core.api.service.ReadDtoService)1