Examples of GuacamoleException


Examples of net.sourceforge.guacamole.GuacamoleException

    public synchronized void init() throws GuacamoleException {

        // Get user mapping file
        File mapFile = getUserMappingFile();
        if (mapFile == null)
            throw new GuacamoleException("Missing \"basic-user-mapping\" parameter required for basic login.");

        logger.info("Reading user mapping file: {}", mapFile);
       
        // Parse document
        try {

            BasicUserMappingContentHandler contentHandler = new BasicUserMappingContentHandler();

            XMLReader parser = XMLReaderFactory.createXMLReader();
            parser.setContentHandler(contentHandler);
            parser.parse(mapFile.getAbsolutePath());

            mappingTime = mapFile.lastModified();
            mapping = contentHandler.getUserMapping();

        }
        catch (IOException e) {
            throw new GuacamoleException("Error reading basic user mapping file.", e);
        }
        catch (SAXException e) {
            throw new GuacamoleException("Error parsing basic user mapping XML.", e);
        }

    }
View Full Code Here

Examples of net.sourceforge.guacamole.GuacamoleException

        }

        // If no mapping available, report as such
        if (mapping == null)
            throw new GuacamoleException("User mapping could not be read.");
       
        // Validate and return info for given user and pass
        AuthInfo info = mapping.get(username);
        if (info != null && info.validate(username, password))
            return info.getConfiguration();
View Full Code Here

Examples of net.sourceforge.guacamole.GuacamoleException

            throw e;
        }
       
        if (config == null) {
            logger.warn("Failed login from {} for user \"{}\".", request.getRemoteAddr(), username);
            throw new GuacamoleException("Invalid login");
        }

        logger.info("Successful login from {} for user \"{}\".", request.getRemoteAddr(), username);

        // Configure and connect socket
View Full Code Here

Examples of net.sourceforge.guacamole.GuacamoleException

        // Get auth provider instance
        try {

            Object obj = Class.forName(authProviderClassName).getConstructor().newInstance();
            if (!(obj instanceof AuthenticationProvider))
                throw new GuacamoleException("Specified authentication provider class is not a AuthenticationProvider.");

            return (AuthenticationProvider) obj;

        }
        catch (ClassNotFoundException e) {
            throw new GuacamoleException("Authentication provider class not found", e);
        }
        catch (NoSuchMethodException e) {
            throw new GuacamoleException("Default constructor for authentication provider not present", e);
        }
        catch (SecurityException e) {
            throw new GuacamoleException("Creation of authentication provider disallowed; check your security settings", e);
        }
        catch (InstantiationException e) {
            throw new GuacamoleException("Unable to instantiate authentication provider", e);
        }
        catch (IllegalAccessException e) {
            throw new GuacamoleException("Unable to access default constructor of authentication provider", e);
        }
        catch (InvocationTargetException e) {
            throw new GuacamoleException("Internal error in constructor of authentication provider", e.getTargetException());
        }

    }
View Full Code Here

Examples of org.glyptodon.guacamole.GuacamoleException

                        user_dn,
                        credentials.getPassword().getBytes("UTF-8")
                );
            }
            catch (UnsupportedEncodingException e) {
                throw new GuacamoleException(e);
            }

        }
        catch (LDAPException e) {
            logger.debug("LDAP bind failed.", e);
            return null;
        }

        // Get config base DN
        String config_base_dn = GuacamoleProperties.getRequiredProperty(
                LDAPGuacamoleProperties.LDAP_CONFIG_BASE_DN
        );

        // Pull all connections
        try {

            // Find all guac configs for this user
            LDAPSearchResults results = ldapConnection.search(
                    config_base_dn,
                    LDAPConnection.SCOPE_SUB,
                    "(&(objectClass=guacConfigGroup)(member=" + escapeLDAPSearchFilter(user_dn) + "))",
                    null,
                    false
            );

            // Add all configs
            Map<String, GuacamoleConfiguration> configs = new TreeMap<String, GuacamoleConfiguration>();
            while (results.hasMore()) {

                LDAPEntry entry = results.next();

                // New empty configuration
                GuacamoleConfiguration config = new GuacamoleConfiguration();

                // Get CN
                LDAPAttribute cn = entry.getAttribute("cn");
                if (cn == null)
                    throw new GuacamoleException("guacConfigGroup without cn");

                // Get protocol
                LDAPAttribute protocol = entry.getAttribute("guacConfigProtocol");
                if (protocol == null)
                    throw new GuacamoleException("guacConfigGroup without guacConfigProtocol");

                // Set protocol
                config.setProtocol(protocol.getStringValue());

                // Get parameters, if any
View Full Code Here

Examples of org.glyptodon.guacamole.GuacamoleException

            // Return parsed protocol
            return protocolTagHandler.asProtocolInfo();

        }
        catch (IOException e) {
            throw new GuacamoleException("Error reading basic user mapping file.", e);
        }
        catch (SAXException e) {
            throw new GuacamoleException("Error parsing basic user mapping XML.", e);
        }

    }
View Full Code Here

Examples of org.glyptodon.guacamole.GuacamoleException

                listeners.add(clazz);
            }

        }
        catch (ClassNotFoundException e) {
            throw new GuacamoleException("Listener class not found.", e);
        }
        catch (SecurityException e) {
            throw new GuacamoleException("Security settings prevent loading of listener class.", e);
        }

        return listeners;

    }
View Full Code Here

Examples of org.glyptodon.guacamole.GuacamoleException

            Object obj = GuacamoleClassLoader.getInstance().loadClass(authProviderClassName)
                            .getConstructor().newInstance();

            if (!(obj instanceof AuthenticationProvider))
                throw new GuacamoleException("Specified authentication provider class is not a AuthenticationProvider.");

            return (AuthenticationProvider) obj;

        }
        catch (ClassNotFoundException e) {
            throw new GuacamoleException("Authentication provider class not found", e);
        }
        catch (NoSuchMethodException e) {
            throw new GuacamoleException("Default constructor for authentication provider not present", e);
        }
        catch (SecurityException e) {
            throw new GuacamoleException("Creation of authentication provider disallowed; check your security settings", e);
        }
        catch (InstantiationException e) {
            throw new GuacamoleException("Unable to instantiate authentication provider", e);
        }
        catch (IllegalAccessException e) {
            throw new GuacamoleException("Unable to access default constructor of authentication provider", e);
        }
        catch (InvocationTargetException e) {
            throw new GuacamoleException("Internal error in constructor of authentication provider", e.getTargetException());
        }

    }
View Full Code Here

Examples of org.glyptodon.guacamole.GuacamoleException

        if (libDirectory == null)
            return;

        // Validate directory is indeed a directory
        if (!libDirectory.isDirectory())
            throw new GuacamoleException(libDirectory + " is not a directory.");

        // Get list of URLs for all .jar's in the lib directory
        Collection<URL> jarURLs = new ArrayList<URL>();
        for (File file : libDirectory.listFiles(new FilenameFilter() {

            @Override
            public boolean accept(File dir, String name) {

                // If it ends with .jar, accept the file
                return name.endsWith(".jar");

            }

        })) {

            try {

                // Add URL for the .jar to the jar URL list
                jarURLs.add(file.toURI().toURL());

            }
            catch (MalformedURLException e) {
                throw new GuacamoleException(e);
            }

        }

        // Set delegate classloader to new URLClassLoader which loads from the
View Full Code Here

Examples of org.glyptodon.guacamole.GuacamoleException

        // Find the correct connection group directory
        Directory<String, ConnectionGroup> directory =
                ConnectionGroupUtility.findConnectionGroupDirectory(context, parentID);
       
        if(directory == null)
            throw new GuacamoleException("Connection group directory not found.");

        // Create connection skeleton
        ConnectionGroup connectionGroup = new DummyConnectionGroup();
        connectionGroup.setName(name);
       
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.