throw new IllegalStateException("Controller not initialized");
throw new IllegalStateException("Controller is not ready");
    public static String initiateAuthentication(final String[] attributes, final String returnURLPrefix,                                                final String returnURLPostfix, final boolean forceInteractiveAuthentication, final String servicePrincipal)            throws AuthorizationException, IllegalInputException, InoperableStateException {        if (!ready) {            throw new IllegalStateException("Controller not initialized");        }        /* Validate parameters */        if (servicePrincipal == null || servicePrincipal.equals("")) {            throw new IllegalInputException("servicePrincipal cannot be null or an empty string.");        }        if (attributes == null) {            throw new IllegalInputException("Attributes cannot be null.");        }        if (returnURLPrefix == null || returnURLPrefix.equals("")) {            throw new IllegalInputException("URLPrefix cannot be null or an empty string.");        }        if (returnURLPostfix == null) {            throw new IllegalInputException("URLPostfix cannot be null.");        }        /* Authorization */        try {            if (!authzManager.allowAccessTo(servicePrincipal, attributes)) {                accessLogger.logService(AccessStatusType.ATTRIBUTES_ACCESS_DENIED, servicePrincipal, null, null);                messageLogger.logInfo("Service '" + servicePrincipal                        + "' tried to access '" + attributes + "', but have only access to '" + authzManager.getAttributes(servicePrincipal)); // TODO: Finish                throw new AuthorizationException("Access to the requested attributes is denied.");            }            if (!authzManager.allowOperations(servicePrincipal, new String[]{"InteractiveAuth"})) {                throw new AuthorizationException("Access to the requested operations is denied.");            }        } catch (UnknownServicePrincipalException e) {            // TODO: Log event (Message log)            throw new AuthorizationException("Authorization failed for: " + servicePrincipal);        }        /* URL validation */        if (returnURLPrefix == null || returnURLPrefix.equals("")) {            throw new IllegalInputException("URLPrefix cannot be null or an empty string.");        }        if (returnURLPostfix == null) {            throw new IllegalInputException("URLPostfix cannot be null.");        }        if (!(isLegalURL(returnURLPrefix + "FakeMoriaID" + "urlPostfix"))) {            throw new IllegalInputException("URLPrefix and URLPostfix combined does not make a valid URL.");        }        /* Create authentication attempt */        try {            return store.createAuthnAttempt(attributes, returnURLPrefix, returnURLPostfix, forceInteractiveAuthentication, servicePrincipal);        } catch (MoriaStoreException e) {            throw new InoperableStateException("Moria is unavailable, store is down");        }    }