class InitializationService {

    public void initialize(String securityServerCode, String ownerMemberClass, String ownerMemberCode,
            String softwareTokenPin, boolean ignoreWarnings) throws AnchorNotFoundException, WeakPinException,
            UnhandledWarningsException, InvalidCharactersException, SoftwareTokenInitException,
            InvalidInitParamsException, ServerAlreadyFullyInitializedException {
        if (!systemService.isAnchorImported()) {
            throw new AnchorNotFoundException("Configuration anchor was not found.");
        }
        boolean isServerCodeInitialized = serverConfService.isServerCodeInitialized();
        boolean isServerOwnerInitialized = serverConfService.isServerOwnerInitialized();
        boolean isSoftwareTokenInitialized = tokenService.isSoftwareTokenInitialized();
        if (isServerCodeInitialized && isServerOwnerInitialized && isSoftwareTokenInitialized) {
            throw new ServerAlreadyFullyInitializedException("Security server has already been fully initialized");
        }
        verifyInitializationPrerequisites(securityServerCode, ownerMemberClass, ownerMemberCode, softwareTokenPin,
                isServerCodeInitialized, isServerOwnerInitialized, isSoftwareTokenInitialized);
        String instanceIdentifier = globalConfFacade.getInstanceIdentifier();
        ClientId ownerClientId = null;
        if (isServerOwnerInitialized) {
            ownerClientId = serverConfService.getSecurityServerOwnerId();
        } else {
            ownerClientId = ClientId.create(instanceIdentifier, ownerMemberClass, ownerMemberCode);
        }
        auditDataHelper.put(OWNER_IDENTIFIER, ownerClientId);
        auditDataHelper.put(SERVER_CODE, securityServerCode);
        if (!ignoreWarnings) {
            checkForWarnings(ownerClientId, securityServerCode);
        }
        // --- Start the init ---
        ServerConfType serverConf = createInitialServerConf(ownerClientId, securityServerCode);
        if (!isSoftwareTokenInitialized) {
            initializeSoftwareToken(softwareTokenPin);
        }
        serverConfService.saveOrUpdate(serverConf);
    }

    @Autowired public  InitializationService(SystemService systemService, ServerConfService serverConfService,
            TokenService tokenService, GlobalConfFacade globalConfFacade, ClientService clientService,
            SignerProxyFacade signerProxyFacade, AuditDataHelper auditDataHelper);

}