class InitializationApiController implements InitializationApi {

    @Override
    @PreAuthorize("hasAuthority('INIT_CONFIG')")
    @AuditEventMethod(event = INIT_SERVER_CONFIGURATION)
    public synchronized ResponseEntity<Void> initSecurityServer(InitialServerConf initialServerConf) {
        String securityServerCode = initialServerConf.getSecurityServerCode();
        String ownerMemberClass = initialServerConf.getOwnerMemberClass();
        String ownerMemberCode = initialServerConf.getOwnerMemberCode();
        String softwareTokenPin = initialServerConf.getSoftwareTokenPin();
        boolean ignoreWarnings = Boolean.TRUE.equals(initialServerConf.getIgnoreWarnings());
        try {
            initializationService.initialize(securityServerCode, ownerMemberClass, ownerMemberCode, softwareTokenPin,
                    ignoreWarnings);
        } catch (AnchorNotFoundException | InitializationService.ServerAlreadyFullyInitializedException e) {
            throw new ConflictException(e);
        } catch (UnhandledWarningsException | InitializationService.InvalidCharactersException
                | InitializationService.WeakPinException | InitializationService.InvalidInitParamsException e) {
            throw new BadRequestException(e);
        } catch (InitializationService.SoftwareTokenInitException e) {
            throw new InternalServerErrorException(e);
        }
        return new ResponseEntity<>(HttpStatus.CREATED);
    }

    @Autowired public  InitializationApiController(InitializationService initializationService);

}