Example usage for java.rmi RemoteException getMessage

List of usage examples for java.rmi RemoteException getMessage

Introduction

In this page you can find the example usage for java.rmi RemoteException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message, including the message from the cause, if any, of this exception.

Usage

From source file:org.globus.workspace.remoting.admin.client.RemoteAdminToolsMain.java

private void cleanupVMs() {
    try {//  w ww  .ja  v  a2 s  .  com
        String result = "";
        String feedback;
        if (numOpts > 1) {
            result = "You must select only one of --all, --id, --user, --dn, --gid, --gname, or --host";
            System.err.println(result);
            return;
        }
        if (allVMs) {
            result = this.remoteAdminToolsManagement.cleanup(RemoteAdminToolsManagement.CLEANUP_ALL, null);
        } else if (vmIDs != null) {
            for (int i = 0; i < vmIDs.size(); i++) {
                feedback = this.remoteAdminToolsManagement.cleanup(RemoteAdminToolsManagement.CLEANUP_ID,
                        vmIDs.get(i));
                if (feedback != null)
                    result += feedback + "\n";
            }
        } else if (userList != null) {
            for (int i = 0; i < userList.size(); i++) {
                feedback = this.remoteAdminToolsManagement.cleanup(RemoteAdminToolsManagement.CLEANUP_UNAME,
                        userList.get(i));
                if (feedback != null)
                    result += feedback + "\n";
            }
        } else if (DNList != null) {
            for (int i = 0; i < DNList.size(); i++) {
                feedback = this.remoteAdminToolsManagement.cleanup(RemoteAdminToolsManagement.CLEANUP_DN,
                        DNList.get(i));
                if (feedback != null)
                    result += feedback + "\n";
            }
        } else if (gidList != null) {
            for (int i = 0; i < gidList.size(); i++) {
                feedback = this.remoteAdminToolsManagement.cleanup(RemoteAdminToolsManagement.CLEANUP_GID,
                        gidList.get(i));
                if (feedback != null)
                    result += feedback + "\n";
            }
        } else if (gnameList != null) {
            for (int i = 0; i < gnameList.size(); i++) {
                feedback = this.remoteAdminToolsManagement.cleanup(RemoteAdminToolsManagement.CLEANUP_GNAME,
                        gnameList.get(i));
                if (feedback != null)
                    result += feedback + "\n";
            }
        } else if (hostList != null) {
            for (int i = 0; i < hostList.size(); i++) {
                feedback = this.remoteAdminToolsManagement.cleanup(RemoteAdminToolsManagement.CLEANUP_HOST,
                        hostList.get(i));
                if (feedback != null)
                    result += feedback + "\n";
            }
        } else {
            result = "Cleanup requires either --all, --id, --user, --dn, --gid, --gname, or --host option";
        }
        if (result != null && !result.isEmpty())
            System.err.println(result);
    } catch (RemoteException e) {
        System.err.println(e.getMessage());
    }
}

From source file:org.globus.workspace.remoting.admin.client.RMIConfig.java

protected Remote setupRemoting() throws ExecutionProblem {

    final RemotingClient client = new RemotingClient();
    client.setSocketDirectory(this.socketDirectory);

    try {/*from   w ww.  ja  v a  2 s.  c om*/
        client.initialize();
    } catch (RemoteException e) {
        handleRemoteException(e);
    }

    try {
        final Remote remote = client.lookup(this.bindingName);
        logger.debug("Found remote object " + remote.toString());
        return remote;
    } catch (RemoteException e) {
        handleRemoteException(e);
        return null;
    } catch (NotBoundException e) {
        throw new ExecutionProblem("Failed to bind to object '" + this.bindingName
                + "'. There may be a configuration problem between the " + "client and service. Error: "
                + e.getMessage(), e);
    }
}

From source file:org.globus.workspace.remoting.admin.client.RMIConfig.java

protected void handleRemoteException(RemoteException e) throws ExecutionProblem {
    throw new ExecutionProblem("Failed to connect to Nimbus service over domain sockets. "
            + "Is the service running?\n\nSocket directory: " + this.socketDirectory.getAbsolutePath()
            + "\n\nError: " + e.getMessage(), e);
}

From source file:org.isatools.isacreator.ontologymanager.OLSClient.java

public Map<String, String> getOntologyNames() {
    Map<String, String> answer = new HashMap<String, String>();
    QueryServiceLocator locator = new QueryServiceLocator();

    try {/*from  w  ww.  jav  a 2 s.c om*/
        Query service = locator.getOntologyQuery();
        Map<String, String> ontologyNames = service.getOntologyNames();

        if (ontologyNames != null) {
            answer = ontologyNames;
        }
    } catch (RemoteException e) {
        log.error("remote exception thrown: " + e.getMessage());
    } catch (Exception e) {
        log.error("unexpected exception occurred. probably as a result of no internet connection!");
    }

    return answer;
}

From source file:org.isatools.isacreator.ontologymanager.OLSClient.java

/**
 * calls OLS webserver and gets metadata for a termId
 *
 * @param termId   - Term Id to search for
 * @param ontology - Ontology to search in.
 * @return Map of metadata - key is data type, value is data value.
 *         Map should not be null./*from   w ww .j a va2s.  c  o  m*/
 */
public Map<String, String> getTermMetadata(String termId, String ontology) {
    Map<String, String> answer = new ListOrderedMap<String, String>();
    QueryServiceLocator locator = new QueryServiceLocator();

    try {
        Query service = locator.getOntologyQuery();
        Map<String, String> metadata = service.getTermMetadata(termId, ontology);

        answer.put("accession", termId);
        if (metadata != null) {
            answer.putAll(metadata);
        }
    } catch (RemoteException e) {
        log.error("remote exception thrown " + e.getMessage());
    } catch (Exception e) {
        log.error("unexpected exception occurred. probably as a result of no internet connection!");
    }

    return answer;
}

From source file:org.isatools.isacreator.ontologymanager.OLSClient.java

/**
 * Search the OLS for a partial term in an ontology source.
 *
 * @param term         - Term to search for
 * @param source       - Ontology source to search in e.g. EFO
 * @param reverseOrder - Whether or not to flip the mappings from term -> source:accession to source:accession -> term.
 * @return - Mapping of source:accession to term, depending on reverse order being true or false.
 *///w  ww.  j ava2 s .  c  o  m
public Map<OntologySourceRefObject, List<OntologyTerm>> getTermsByPartialNameFromSource(String term,
        String source, boolean reverseOrder) {
    Map<String, String> answer = new HashMap<String, String>();

    try {
        QueryServiceLocator locator = new QueryServiceLocator();
        Query service = locator.getOntologyQuery();
        Map<String, String> matchingTerms = service.getTermsByName(term, source, reverseOrder);

        if (matchingTerms != null) {
            answer = matchingTerms;
        }
    } catch (RemoteException e) {
        log.error("remote exception thrown " + e.getMessage());
    } catch (Exception e) {
        log.error("unexpected exception occurred. probably as a result of no internet connection!");
    }
    return processOntologyResult(answer);
}

From source file:org.isatools.isacreator.ontologymanager.OLSClient.java

/**
 * Return the current version of the OLS
 *
 * @return a String representation of the version. String should not be null.
 *//*  w  w  w  .  j av  a2  s .c  om*/
public Map<String, String> getOntologyVersions() {
    QueryServiceLocator locator = new QueryServiceLocator();
    Map<String, String> versions = new HashMap<String, String>();

    try {
        Query service = locator.getOntologyQuery();
        String tempVersion = service.getVersion();
        Pattern p = Pattern.compile("[a-zA-Z]+ [0-9]+.[0-9]+");
        Matcher m = p.matcher(tempVersion);

        if (m.find()) {
            tempVersion = tempVersion.substring(m.start(), m.end());
        }
        versions.put(OntologyManager.OLS, tempVersion);
    } catch (RemoteException e) {
        log.error("remote exception thrown " + e.getMessage());
    } catch (Exception e) {
        log.error("unexpected exception occurred. probably as a result of no internet connection!");
    }

    return versions;
}

From source file:org.isatools.isacreator.ontologymanager.OLSClient.java

/**
 * Get the root terms of an Ontology//w w  w.  j a  v  a  2s.c  om
 *
 * @param ontologyAbbreviation - The ontology to get the root terms for e.g. EFO, ENVO, CHEBI
 * @return Map<String, String> representing the Root terms with the Source:Accession as the key and the Label as the Value
 */
public Map<String, OntologyTerm> getOntologyRoots(String ontologyAbbreviation) {
    QueryServiceLocator locator = new QueryServiceLocator();
    Map<String, String> answer = new HashMap<String, String>();
    try {
        Query service = locator.getOntologyQuery();
        Map<String, String> rootTerms = service.getRootTerms(ontologyAbbreviation);
        if (rootTerms != null) {
            answer = rootTerms;
        }
    } catch (RemoteException re) {
        log.error("remote exception thrown " + re.getMessage());
    } catch (ServiceException e) {
        log.error("service exception thrown " + e.getMessage());
    }
    return processOntologyHierarchyResult(answer);
}

From source file:org.isatools.isacreator.ontologymanager.OLSClient.java

/**
 * Get the parent terms of an Ontology//from   w w w .  jav  a2  s  .c om
 *
 * @param termAccession        - Source:Accession string for the term to get children for
 * @param ontologyAbbreviation - The ontology to get the root terms for e.g. EFO, ENVO, CHEBI
 * @return Map<String, String> representing the child terms with the Source:Accession as the key and the Label as the Value
 */
public Map<String, OntologyTerm> getTermParent(String termAccession, String ontologyAbbreviation) {
    QueryServiceLocator locator = new QueryServiceLocator();
    Map<String, String> answer = new HashMap<String, String>();
    try {
        Query service = locator.getOntologyQuery();
        Map<String, String> parentTerms = service.getTermParents(termAccession, ontologyAbbreviation);
        if (parentTerms != null) {
            answer = parentTerms;
        }
    } catch (RemoteException re) {
        log.error("remote exception thrown " + re.getMessage());
    } catch (ServiceException e) {
        log.error("service exception thrown " + e.getMessage());
    }
    return processOntologyHierarchyResult(answer);
}

From source file:org.isatools.isacreator.ontologymanager.OLSClient.java

/**
 * Get the root terms of an Ontology/*w  w w  .j  a  v a  2 s  . c  om*/
 *
 * @param termAccession        - Source:Accession string for the term to get children for
 * @param ontologyAbbreviation - The ontology to get the root terms for e.g. EFO, ENVO, CHEBI
 * @return Map<String, String> representing the child terms with the Source:Accession as the key and the Label as the Value
 */
public Map<String, OntologyTerm> getTermChildren(String termAccession, String ontologyAbbreviation) {
    QueryServiceLocator locator = new QueryServiceLocator();
    Map<String, String> answer = new HashMap<String, String>();
    try {
        Query service = locator.getOntologyQuery();
        Map<String, String> childTerms = service.getTermChildren(termAccession, ontologyAbbreviation, 1, null);
        if (childTerms != null) {
            answer = childTerms;
        }
    } catch (RemoteException re) {
        log.error("remote exception thrown " + re.getMessage());
    } catch (ServiceException e) {
        log.error("service exception thrown " + e.getMessage());
    }
    return processOntologyHierarchyResult(answer);
}