Package com.sun.grid.jgdi

Examples of com.sun.grid.jgdi.JGDIException


        //This is the only call we want to make
        oi.optionDone();
        if (userList.size() == 0) {
            //We are missing the set list and used usernames as sets
            String msg = getErrorMessage("LessArguments", oi.getOd().getOption(), new ArrayList(setList));
            throw new JGDIException(msg, getCustomExitCode("LessArguments", oi.getOd().getOption()));
        }
        //We delete form all the sets
        for (String set : setList) {
            obj = jgdi.getUserSetWithAnswer(set, answer);
            printAnswers(answer);
View Full Code Here


            ClusterQueue q = jgdi.getClusterQueueWithAnswer(objectIdList, answer);
            printAnswers(answer);
            answer.clear();
            //TODO LP: This exception should have been thrown from the jgdi.getClusterQueueWithAnswer for invalid queue name!
            if (q == null) {
                throw new JGDIException("denied: cluster queue \""+objectIdList+"\" does not exist",1);
            }
            //TODO LP: Investigate if we should be allowed to add/modify/replace/delete ANY atribute!!!
            String val = GEObjectEditor.getPropertyAsText(q, EditorUtil.PROPERTIES_ALL, attrName);
            int pos = val.indexOf(attrValue);
            if (pos == -1) {
                throw new JGDIException("JGDI Error: value \""+attrValue+"\" is not present in attribute \""+attrName+"\" for "+objectName+" object "+"\""+objectIdList+"\"",1);
            }
            name = val.split(" ")[0].trim();
            val = val.replaceFirst(attrValue, "");
            //Look if we removed last value and add NONE in necessary
            if (val.trim().substring(name.length()).length() == 0) {
                val = name + " NONE";
            }
            //Change the object ifself
            q = GEObjectEditor.updateObjectWithText(jgdi, q, val);
            //And send it back to qmaster
            jgdi.updateClusterQueueWithAnswer(q, answer);
            printAnswers(answer);
        } else {
            throw new JGDIException("JGDI Error: Unsupported object_name \""+objectName+"\"",1);
        }
    }
View Full Code Here

                connector = JMXConnectorFactory.connect(url, env);
                connection = connector.getMBeanServerConnection();

                name = JGDIAgent.getObjectNameFromConnectionId(connector.getConnectionId());
                if (name == null) {
                    throw new JGDIException("jmx connection id contains no jgdi session id. Please check qmaster's JAAS configuration (JGDILoginModule)");
                }
                connection.addNotificationListener(name, this, null, null);
                connector.addConnectionNotificationListener(this, null, connector.getConnectionId());
            } catch (NullPointerException ex) {
                close();
                throw new JGDIException(ex, "jgdi mbean is null");
            } catch (InstanceNotFoundException ex) {
                close();
                throw new JGDIException(ex, "jgdi mbean not active in qmaster");
            } catch (IOException ex) {
                close();
                Throwable realError = null;
                if ((realError = findCause(ex, SSLHandshakeException.class)) != null) {
                    throw new JGDIException(realError, "SSL error: " + realError.getLocalizedMessage());
                } else if ((realError = findCause(ex, java.net.ConnectException.class)) != null) {
                    throw new JGDIException(realError, "Connection refused");
                }
                throw new JGDIException(ex, "connection to " + url + "failed");
            }
        }
    }
View Full Code Here

            return new String[]{
                username,
                bos.toString()
            };
        } catch (Exception ex) {
            throw new JGDIException("Can not create credentials from keystore", ex);
        }
    }
View Full Code Here

        log.entering("JGDISession", "getJGDI");
        JGDI ret = null;
        lock.lock();
        try {
            if (closed) {
                JGDIException ex = new JGDIException("session already closed");
                log.throwing("JGDISession", "getJGDI", ex);
                throw ex;
            }
            if (jgdi == null) {
                jgdi = JGDIFactory.newInstance(url);
View Full Code Here

            if (!ps.isEmpty()) {
                JGDIPrincipal p = ps.iterator().next();
                return p.getSessionId();
            }
        }
        throw new JGDIException("no active session found in subject " + sub);
    }
View Full Code Here

            ret = sessionMap.get(sessionId);
        } finally {
            sessionLock.readLock().unlock();
        }
        if (ret == null) {
            throw new JGDIException("no active session found");
        }
        log.exiting("JGDISession", "getCurrentSession", ret);
        return ret;
    }
View Full Code Here

TOP

Related Classes of com.sun.grid.jgdi.JGDIException

Copyright © 2018 www.massapicom. 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.