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 WSBoolean existsView(WSExistsView wsExistsView) throws RemoteException {
    try {/*from   w  w  w  .  j  av a2 s  .c om*/
        return new WSBoolean(
                Util.getViewCtrlLocal().existsView(new ViewPOJOPK(wsExistsView.getWsViewPK().getPk())) != null);
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(e.getMessage(), e);
        }
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

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

@Override
public WSViewPKArray getViewPKs(WSGetViewPKs regexp) throws RemoteException {
    try {/*w ww .j  a v a  2s.  com*/
        WSViewPKArray array = new WSViewPKArray();
        String regex = ((regexp.getRegex() == null) || ("".equals(regexp.getRegex())) //$NON-NLS-1$
                || ("*".equals(regexp.getRegex())) ? ".*" //$NON-NLS-1$ //$NON-NLS-2$
                        : regexp.getRegex());
        Collection<ViewPOJOPK> pks = Util.getViewCtrlLocal().getViewPKs(regex);
        List<WSViewPK> list = new ArrayList<WSViewPK>();
        for (ViewPOJOPK pk : pks) {
            list.add(new WSViewPK(pk.getIds()[0]));
        }
        array.setWsViewPK(list.toArray(new WSViewPK[list.size()]));
        return array;
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

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

@Override
public WSViewPK deleteView(WSDeleteView wsDeleteView) throws RemoteException {
    try {/* w w  w  . j ava 2  s  .  c o m*/
        return new WSViewPK(Util.getViewCtrlLocal()
                .removeView(new ViewPOJOPK(wsDeleteView.getWsViewPK().getPk())).getIds()[0]);
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

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

@Override
public WSViewPK putView(WSPutView wsView) throws RemoteException {
    try {/*from www  . j a v  a 2  s  . co m*/
        return new WSViewPK(Util.getViewCtrlLocal().putView(XConverter.WS2VO(wsView.getWsView())).getIds()[0]);
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

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

@Override
public WSStringArray xPathsSearch(WSXPathsSearch wsXPathsSearch) throws RemoteException {
    try {//from  w w  w  .  j  a v a  2 s  .c o  m
        if (wsXPathsSearch.getReturnCount() == null) {
            wsXPathsSearch.setReturnCount(Boolean.FALSE);
        }
        Collection res = Util.getItemCtrl2Local().xPathsSearch(
                new DataClusterPOJOPK(wsXPathsSearch.getWsDataClusterPK().getPk()),
                wsXPathsSearch.getPivotPath(),
                new ArrayList<String>(Arrays.asList(wsXPathsSearch.getViewablePaths().getStrings())),
                XConverter.WS2VO(wsXPathsSearch.getWhereItem()), wsXPathsSearch.getSpellTreshold(),
                wsXPathsSearch.getOrderBy(), wsXPathsSearch.getDirection(), wsXPathsSearch.getSkip(),
                wsXPathsSearch.getMaxItems(), wsXPathsSearch.getReturnCount());
        return new WSStringArray((String[]) res.toArray(new String[res.size()]));
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

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

@Override
public WSString count(WSCount wsCount) throws RemoteException {
    try {/*from  w  w  w . ja  va 2  s  .c om*/
        String countPath = wsCount.getCountPath();
        Map wcfContext = new HashMap();
        wcfContext.put(WhereConditionForcePivotFilter.FORCE_PIVOT, countPath);
        long count = Util.getItemCtrl2Local().count(new DataClusterPOJOPK(wsCount.getWsDataClusterPK().getPk()),
                wsCount.getCountPath(),
                XConverter.WS2VO(wsCount.getWhereItem(), new WhereConditionForcePivotFilter(wcfContext)),
                wsCount.getSpellTreshold());
        return new WSString(count + ""); //$NON-NLS-1$
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

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

@Override
public WSStringArray getItems(WSGetItems wsGetItems) throws RemoteException {
    try {/*from w  w w .j ava2  s  . c om*/
        Map wcfContext = new HashMap();
        wcfContext.put(WhereConditionForcePivotFilter.FORCE_PIVOT, wsGetItems.getConceptName());
        Collection res = Util.getItemCtrl2Local().getItems(
                new DataClusterPOJOPK(wsGetItems.getWsDataClusterPK().getPk()), wsGetItems.getConceptName(),
                XConverter.WS2VO(wsGetItems.getWhereItem(), new WhereConditionForcePivotFilter(wcfContext)),
                wsGetItems.getSpellTreshold(), wsGetItems.getSkip(), wsGetItems.getMaxItems(),
                wsGetItems.getTotalCountOnFirstResult() == null ? false
                        : wsGetItems.getTotalCountOnFirstResult());
        return new WSStringArray((String[]) res.toArray(new String[res.size()]));
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

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

@Override
public WSStringArray getItemsSort(WSGetItemsSort wsGetItemsSort) throws RemoteException {
    try {/*from w w w . j  a  v a  2 s .  c o  m*/
        Map wcfContext = new HashMap();
        wcfContext.put(WhereConditionForcePivotFilter.FORCE_PIVOT, wsGetItemsSort.getConceptName());
        Collection res = Util.getItemCtrl2Local().getItems(
                new DataClusterPOJOPK(wsGetItemsSort.getWsDataClusterPK().getPk()),
                wsGetItemsSort.getConceptName(),
                XConverter.WS2VO(wsGetItemsSort.getWhereItem(), new WhereConditionForcePivotFilter(wcfContext)),
                wsGetItemsSort.getSpellTreshold(), wsGetItemsSort.getSort(), wsGetItemsSort.getDir(),
                wsGetItemsSort.getSkip(), wsGetItemsSort.getMaxItems(),
                wsGetItemsSort.getTotalCountOnFirstResult() == null ? false
                        : wsGetItemsSort.getTotalCountOnFirstResult());
        return new WSStringArray((String[]) res.toArray(new String[res.size()]));
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

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

@Override
public WSBoolean existsItem(WSExistsItem wsExistsItem) throws RemoteException {
    try {//from   w w  w .  j  a va 2 s  .com
        return new WSBoolean((Util.getItemCtrl2Local().existsItem(new ItemPOJOPK(
                new DataClusterPOJOPK(wsExistsItem.getWsItemPK().getWsDataClusterPK().getPk()),
                wsExistsItem.getWsItemPK().getConceptName(), wsExistsItem.getWsItemPK().getIds())) != null));
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

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

/**
 * /*from  w w  w .  j  a  va 2  s. c o  m*/
 */
@Override
public WSStringArray quickSearch(WSQuickSearch wsQuickSearch) throws RemoteException {
    try {
        Collection c = Util.getItemCtrl2Local().quickSearch(
                new DataClusterPOJOPK(wsQuickSearch.getWsDataClusterPK().getPk()),
                new ViewPOJOPK(wsQuickSearch.getWsViewPK().getPk()), wsQuickSearch.getSearchedValue(),
                wsQuickSearch.isMatchAllWords(), wsQuickSearch.getSpellTreshold(), wsQuickSearch.getOrderBy(),
                wsQuickSearch.getDirection(), wsQuickSearch.getSkip(), wsQuickSearch.getMaxItems());
        if (c == null) {
            return null;
        }
        return new WSStringArray((String[]) c.toArray(new String[c.size()]));
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}