Example usage for java.rmi RemoteException RemoteException

List of usage examples for java.rmi RemoteException RemoteException

Introduction

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

Prototype

public RemoteException(String s, Throwable cause) 

Source Link

Document

Constructs a RemoteException with the specified detail message and cause.

Usage

From source file:com.amalto.core.delegator.IXtentisWSDelegator.java

@Override
public WSString deleteBusinessConcept(WSDeleteBusinessConcept wsDeleteBusinessConcept) throws RemoteException {
    try {//from  www. j a  v  a 2 s.  co m
        return new WSString(Util.getDataModelCtrlLocal().deleteBusinessConcept(
                new DataModelPOJOPK(wsDeleteBusinessConcept.getWsDataModelPK().getPk()),
                wsDeleteBusinessConcept.getBusinessConceptName()));
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

From source file:gov.nih.nci.caarray.services.external.v1_0.grid.service.CaArraySvc_v1_0Impl.java

public gov.nih.nci.cagrid.enumeration.stubs.response.EnumerationResponseContainer enumerateFiles(
        gov.nih.nci.caarray.external.v1_0.query.FileSearchCriteria criteria) throws RemoteException {
    try {//w  w  w .  ja  v  a2s.co  m
        return EnumerateResponseFactory.createEnumerationResponse(new SearchEnumIterator<File>(File.class,
                getSearchUtils().filesByCriteria(criteria).iterator()));
    } catch (Exception e) {
        throw new RemoteException("Unable to create enumeration", e);
    }
}

From source file:org.molgenis.wikipathways.client.WikiPathwaysRESTBindingStub.java

@Override
public boolean removeOntologyTag(String pwId, String termId, WSAuth auth) throws RemoteException {
    try {/*from ww  w .  j a  v a 2  s. c  o m*/
        String url = baseUrl + "/removeOntologyTag?pwId=" + pwId + "&termId=" + termId + "&auth="
                + auth.getKey() + "&user=" + auth.getUser();
        Document jdomDocument = Utils.connect(url, client);
        String success = jdomDocument.getRootElement().getChild("success", WSNamespaces.NS1).getValue();
        if (success.equals("1")) {
            return true;
        }
        return false;
    } catch (Exception e) {
        throw new RemoteException(e.getMessage(), e.getCause());
    }
}

From source file:com.amalto.core.delegator.IXtentisWSDelegator.java

@Override
public WSStringArray getBusinessConcepts(WSGetBusinessConcepts wsGetBusinessConcepts) throws RemoteException {
    try {/*from  w  w  w .j  a  v a2s.  c o m*/
        return new WSStringArray(Util.getDataModelCtrlLocal().getAllBusinessConceptsNames(
                new DataModelPOJOPK(wsGetBusinessConcepts.getWsDataModelPK().getPk())));
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

From source file:org.pathvisio.wikipathways.webservice.WikiPathwaysRESTBindingStub.java

public boolean removeOntologyTag(String pwId, String termId, WSAuth auth) throws RemoteException {
    try {/*from www. j a  va2 s. c o  m*/
        String url = baseUrl + "/removeOntologyTag?pwId=" + pwId + "&termId=" + termId + "&auth="
                + auth.getKey() + "&user=" + auth.getUser();
        Document jdomDocument = Utils.connect(url, client);
        String success = jdomDocument.getRootElement().getChild("success", WSNamespaces.NS1).getValue();
        if (success.equals("1")) {
            return true;
        }
        return false;
    } catch (Exception e) {
        throw new RemoteException(e.getMessage(), e.getCause());
    }
}

From source file:gov.nih.nci.caarray.services.external.v1_0.grid.service.CaArraySvc_v1_0Impl.java

@SuppressWarnings("unchecked")
public gov.nih.nci.cagrid.enumeration.stubs.response.EnumerationResponseContainer enumerateByExample(
        gov.nih.nci.caarray.external.v1_0.query.ExampleSearchCriteria criteria) throws RemoteException {
    try {/*from   ww  w  .ja v a2  s  . co m*/
        return EnumerateResponseFactory.createEnumerationResponse(new SearchEnumIterator(
                criteria.getExample().getClass(), getSearchUtils().byExample(criteria).iterator()));
    } catch (Exception e) {
        throw new RemoteException("Unable to create enumeration", e);
    }
}

From source file:gov.loc.www.zing.srw.srw_bindings.SRWSoapBindingImpl.java

public ScanResponseType scanOperation(ScanRequestType request) throws java.rmi.RemoteException {
    log.debug("Enter: scanOperation");
    if (log.isInfoEnabled()) {
        log.info("request: maximumTerms:" + request.getMaximumTerms() + " scanClause:" + request.getScanClause()
                + " stylesheet:" + request.getStylesheet() + " responsePosition:"
                + request.getResponsePosition() + " version:" + request.getVersion());
    }/*w  ww.j ava 2s .c o  m*/
    MessageContext msgContext = MessageContext.getCurrentContext();
    ScanResponseType response;
    String dbname = (String) msgContext.getProperty("dbname");
    SRWDatabase db = (SRWDatabase) msgContext.getProperty("db");
    if (log.isDebugEnabled())
        log.debug("db=" + db);
    if (request.getScanClause() == null) {
        response = new ScanResponseType();
        db.diagnostic(SRWDiagnostic.MandatoryParameterNotSupplied, "scanClause", response);
    } else if (request.getResponsePosition() != null
            && request.getResponsePosition().intValue() == Integer.MAX_VALUE) {
        response = new ScanResponseType();
        db.diagnostic(SRWDiagnostic.UnsupportedParameterValue, "responsePosition", response);
    } else if (request.getMaximumTerms() != null && request.getMaximumTerms().intValue() == Integer.MAX_VALUE) {
        response = new ScanResponseType();
        db.diagnostic(SRWDiagnostic.UnsupportedParameterValue, "maximumTerms", response);
    } else
        try {
            response = db.doRequest(request);

            // set extraResponseData
            StringBuffer extraResponseData = new StringBuffer();

            // we're going to stick the database name in extraResponseData every time
            if (db.databaseTitle != null)
                extraResponseData.append("<databaseTitle>").append(db.databaseTitle).append("</databaseTitle>");
            else
                extraResponseData.append("<databaseTitle>").append(dbname).append("</databaseTitle>");

            Hashtable extraRequestDataElements = SRWDatabase.parseElements(request.getExtraRequestData());
            String s = (String) extraRequestDataElements.get("returnTargetURL");
            log.info("returnTargetURL=" + s);
            if (s != null && !s.equals("false")) {
                String targetStr = (String) msgContext.getProperty("targetURL");
                log.info("targetStr=" + targetStr);
                if (targetStr != null && targetStr.length() > 0) {
                    URL target = new URL(targetStr);
                    extraResponseData.append("<targetURL>").append("<host>").append(target.getHost())
                            .append("</host>").append("<port>").append(target.getPort()).append("</port>")
                            .append("<path>").append(target.getPath()).append("</path>").append("<query>")
                            .append(Utilities.xmlEncode(target.getQuery())).append("</query>")
                            .append("</targetURL>");
                }
            }

            // set extraResponseData
            SRWDatabase.setExtraResponseData(response, extraResponseData.toString());
        } catch (Exception e) {
            log.error(e, e);
            throw new RemoteException(e.getMessage(), e);
        } finally {
            SRWDatabase.putDb(dbname, db);
        }
    if (response != null) {
        log.info("calling setEchoedScanRequestType");
        setEchoedScanRequestType(request, response);
        log.info("called setEchoedScanRequestType");
        response.setVersion("1.1");
    }
    log.debug("Exit: scanOperation");
    return response;
}

From source file:org.pathvisio.wikipathways.webservice.WikiPathwaysRESTBindingStub.java

@Override
public String updatePathway(String pwId, String description, String gpml, int revision, WSAuth auth)
        throws RemoteException {
    try {/*from  w ww  . j  ava 2s  .c o  m*/
        Map<String, String> map = new HashMap<String, String>();
        map.put("pwId", pwId);
        map.put("description", description);
        map.put("gpml", gpml);
        map.put("revision", revision + "");
        map.put("auth", auth.getKey());
        map.put("username", auth.getUser());

        String url = baseUrl + "/updatePathway";
        return Utils.update(url, client, map);
    } catch (Exception e) {
        e.printStackTrace();
        throw new RemoteException(e.getMessage(), e.getCause());
    }
}

From source file:org.molgenis.wikipathways.client.WikiPathwaysRESTBindingStub.java

@Override
public boolean updatePathway(String pwId, String description, String gpml, int revision, WSAuth auth)
        throws RemoteException {
    try {/*from   ww w. jav  a  2 s  .c om*/
        Map<String, String> map = new HashMap<String, String>();
        map.put("pwId", pwId);
        map.put("description", description);
        map.put("gpml", gpml);
        map.put("revision", revision + "");
        map.put("auth", auth.getKey());
        map.put("username", auth.getUser());

        String url = baseUrl + "/updatePathway";
        String success = Utils.update(url, client, map);
        if (success.equals("1")) {
            return true;
        }
    } catch (Exception e) {
        e.printStackTrace();
        throw new RemoteException(e.getMessage(), e.getCause());
    }
    return false;
}

From source file:com.amalto.core.delegator.IXtentisWSDelegator.java

@Override
public WSConceptKey getBusinessConceptKey(WSGetBusinessConceptKey wsGetBusinessConceptKey)
        throws RemoteException {
    try {/*from  ww  w . ja v a 2 s.c o  m*/
        MetadataRepositoryAdmin metadataRepositoryAdmin = ServerContext.INSTANCE.get()
                .getMetadataRepositoryAdmin();
        MetadataRepository repository = metadataRepositoryAdmin
                .get(wsGetBusinessConceptKey.getWsDataModelPK().getPk());
        ComplexTypeMetadata type = repository.getComplexType(wsGetBusinessConceptKey.getConcept());
        Collection<FieldMetadata> keyFields = type.getKeyFields();
        String[] fields = new String[keyFields.size()];
        int i = 0;
        for (FieldMetadata keyField : keyFields) {
            fields[i++] = keyField.getName();
        }
        return new WSConceptKey(".", fields); //$NON-NLS-1$
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}