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 WSRoutingOrderV2PK deleteRoutingOrderV2(WSDeleteRoutingOrderV2 wsDeleteRoutingOrder)
        throws RemoteException {
    try {//  www .  jav  a  2  s  .c o  m
        RoutingOrder ctrl = Util.getRoutingOrderV2CtrlLocal();
        return XConverter.POJO2WS(
                ctrl.removeRoutingOrder(XConverter.WS2POJO(wsDeleteRoutingOrder.getWsRoutingOrderPK())));
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            String err = "ERROR SYSTRACE: " + e.getMessage(); //$NON-NLS-1$
            LOGGER.debug(err, e);
        }
        throw new RemoteException(e.getClass().getName() + ": " + e.getLocalizedMessage(), e); //$NON-NLS-1$
    }
}

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

@Override
public WSRoutingOrderV2PK executeRoutingOrderV2Asynchronously(
        WSExecuteRoutingOrderV2Asynchronously wsExecuteRoutingOrderAsynchronously) throws RemoteException {
    try {/* w w  w.  j a  v  a  2  s.  co  m*/
        RoutingOrder ctrl = Util.getRoutingOrderV2CtrlLocal();
        AbstractRoutingOrderV2POJO ro = ctrl
                .getRoutingOrder(XConverter.WS2POJO(wsExecuteRoutingOrderAsynchronously.getRoutingOrderV2PK()));
        ctrl.executeRoutingOrder(ro);
        return XConverter.POJO2WS(ro.getAbstractRoutingOrderPOJOPK());
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            String err = "ERROR SYSTRACE: " + e.getMessage(); //$NON-NLS-1$
            LOGGER.debug(err, e);
        }
        throw new RemoteException(e.getClass().getName() + ": " + e.getLocalizedMessage(), e); //$NON-NLS-1$
    }
}

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

protected Collection<AbstractRoutingOrderV2POJOPK> getRoutingOrdersByCriteria(
        WSRoutingOrderV2SearchCriteria criteria) throws Exception {
    try {//  w  w w .  ja v a 2s .c o m
        RoutingOrder ctrl = Util.getRoutingOrderV2CtrlLocal();
        Class<? extends AbstractRoutingOrderV2POJO> clazz = null;
        if (criteria.getStatus().equals(WSRoutingOrderV2Status.COMPLETED)) {
            clazz = CompletedRoutingOrderV2POJO.class;
        } else if (criteria.getStatus().equals(WSRoutingOrderV2Status.FAILED)) {
            clazz = FailedRoutingOrderV2POJO.class;
        }
        return ctrl.getRoutingOrderPKsByCriteria(clazz, criteria.getAnyFieldContains(),
                criteria.getNameContains(), criteria.getTimeCreatedMin(), criteria.getTimeCreatedMax(),
                criteria.getTimeScheduledMin(), criteria.getTimeScheduledMax(),
                criteria.getTimeLastRunStartedMin(), criteria.getTimeLastRunStartedMax(),
                criteria.getTimeLastRunCompletedMin(), criteria.getTimeLastRunCompletedMax(),
                criteria.getItemPKConceptContains(), criteria.getItemPKIDFieldsContain(),
                criteria.getServiceJNDIContains(), criteria.getServiceParametersContain(),
                criteria.getMessageContain());
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(e.getMessage(), e);
        }
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

protected Collection<AbstractRoutingOrderV2POJOPK> getRoutingOrdersByCriteriaWithPaging(
        WSRoutingOrderV2SearchCriteriaWithPaging criteria) throws Exception {
    try {/*w w w.  ja v a 2 s.  co m*/
        RoutingOrder ctrl = Util.getRoutingOrderV2CtrlLocal();
        Class<? extends AbstractRoutingOrderV2POJO> clazz = null;
        if (criteria.getStatus().equals(WSRoutingOrderV2Status.COMPLETED)) {
            clazz = CompletedRoutingOrderV2POJO.class;
        } else if (criteria.getStatus().equals(WSRoutingOrderV2Status.FAILED)) {
            clazz = FailedRoutingOrderV2POJO.class;
        }

        return ctrl.getRoutingOrderPKsByCriteriaWithPaging(clazz, criteria.getAnyFieldContains(),
                criteria.getNameContains(), criteria.getTimeCreatedMin(), criteria.getTimeCreatedMax(),
                criteria.getTimeScheduledMin(), criteria.getTimeScheduledMax(),
                criteria.getTimeLastRunStartedMin(), criteria.getTimeLastRunStartedMax(),
                criteria.getTimeLastRunCompletedMin(), criteria.getTimeLastRunCompletedMax(),
                criteria.getItemPKConceptContains(), criteria.getItemPKIDFieldsContain(),
                criteria.getServiceJNDIContains(), criteria.getServiceParametersContain(),
                criteria.getMessageContain(), criteria.getSkip(), criteria.getMaxItems(),
                criteria.getTotalCountOnFirstResult());
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(e.getMessage(), e);
        }
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSRoutingOrderV2PKArray getRoutingOrderV2PKsByCriteria(
        WSGetRoutingOrderV2PKsByCriteria wsGetRoutingOrderV2PKsByCriteria) throws RemoteException {
    try {/*from   ww  w.j ava  2 s  .  c o m*/
        WSRoutingOrderV2PKArray wsPKArray = new WSRoutingOrderV2PKArray();
        ArrayList<WSRoutingOrderV2PK> list = new ArrayList<WSRoutingOrderV2PK>();
        // fetch results
        Collection<AbstractRoutingOrderV2POJOPK> pks = getRoutingOrdersByCriteria(
                wsGetRoutingOrderV2PKsByCriteria.getWsSearchCriteria());
        for (AbstractRoutingOrderV2POJOPK pk : pks) {
            list.add(XConverter.POJO2WS(pk));
        }
        wsPKArray.setWsRoutingOrder(list.toArray(new WSRoutingOrderV2PK[list.size()]));
        return wsPKArray;
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(e.getMessage(), e);
        }
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSRoutingOrderV2Array getRoutingOrderV2SByCriteria(
        WSGetRoutingOrderV2SByCriteria wsGetRoutingOrderV2SByCriteria) throws RemoteException {
    try {/* w  w  w  .jav a2  s.c o  m*/
        RoutingOrder ctrl = Util.getRoutingOrderV2CtrlLocal();
        WSRoutingOrderV2Array wsPKArray = new WSRoutingOrderV2Array();
        ArrayList<WSRoutingOrderV2> list = new ArrayList<WSRoutingOrderV2>();
        // fetch results
        Collection<AbstractRoutingOrderV2POJOPK> pks = getRoutingOrdersByCriteria(
                wsGetRoutingOrderV2SByCriteria.getWsSearchCriteria());
        for (AbstractRoutingOrderV2POJOPK pk : pks) {
            list.add(XConverter.POJO2WS(ctrl.getRoutingOrder(pk)));
        }
        wsPKArray.setWsRoutingOrder(list.toArray(new WSRoutingOrderV2[list.size()]));
        return wsPKArray;
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(e.getMessage(), e);
        }
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSRoutingOrderV2Array getRoutingOrderV2ByCriteriaWithPaging(
        WSGetRoutingOrderV2ByCriteriaWithPaging wsGetRoutingOrderV2ByCriteriaWithPaging)
        throws RemoteException {
    try {//from  w  w  w.j  a va  2s .c  om
        RoutingOrder ctrl = Util.getRoutingOrderV2CtrlLocal();
        WSRoutingOrderV2Array wsPKArray = new WSRoutingOrderV2Array();
        ArrayList<WSRoutingOrderV2> list = new ArrayList<WSRoutingOrderV2>();
        // fetch results
        Collection<AbstractRoutingOrderV2POJOPK> pks = getRoutingOrdersByCriteriaWithPaging(
                wsGetRoutingOrderV2ByCriteriaWithPaging.getWsSearchCriteriaWithPaging());
        boolean withTotalCount = wsGetRoutingOrderV2ByCriteriaWithPaging.getWsSearchCriteriaWithPaging()
                .getTotalCountOnFirstResult();
        boolean firstRecord = true;
        for (AbstractRoutingOrderV2POJOPK abstractRoutingOrderV2POJOPK : pks) {
            if (withTotalCount && firstRecord) {
                firstRecord = false;
                WSRoutingOrderV2 wsRoutingOrderV2 = new WSRoutingOrderV2();
                // record totalCount and wsRoutingOrderV2 need to initialize attribute value
                wsRoutingOrderV2.setName(abstractRoutingOrderV2POJOPK.getName());
                wsRoutingOrderV2.setBindingUniverseName(""); //$NON-NLS-1$
                wsRoutingOrderV2.setBindingUserToken(""); //$NON-NLS-1$
                wsRoutingOrderV2.setMessage(""); //$NON-NLS-1$
                wsRoutingOrderV2.setServiceJNDI(""); //$NON-NLS-1$
                wsRoutingOrderV2.setServiceParameters(""); //$NON-NLS-1$
                wsRoutingOrderV2.setStatus(WSRoutingOrderV2Status.COMPLETED);
                wsRoutingOrderV2.setWsItemPK(new WSItemPK(new WSDataClusterPK(""), "", new String[0])); //$NON-NLS-1$ //$NON-NLS-2$
                list.add(wsRoutingOrderV2);
                continue;
            }
            list.add(XConverter.POJO2WS(ctrl.getRoutingOrder(abstractRoutingOrderV2POJOPK)));
        }
        wsPKArray.setWsRoutingOrder(list.toArray(new WSRoutingOrderV2[list.size()]));
        return wsPKArray;
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(e.getMessage(), e);
        }
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSRoutingRulePKArray routeItemV2(WSRouteItemV2 wsRouteItem) throws RemoteException {
    try {//  ww w  . j  ava  2s  .c o m
        RoutingEngine ctrl = Util.getRoutingEngineV2CtrlLocal();
        RoutingRulePOJOPK[] rules = ctrl.route(XConverter.WS2POJO(wsRouteItem.getWsItemPK()));
        ArrayList<WSRoutingRulePK> list = new ArrayList<WSRoutingRulePK>();
        for (RoutingRulePOJOPK rule : rules) {
            list.add(new WSRoutingRulePK(rule.getUniqueId()));
        }
        return new WSRoutingRulePKArray(list.toArray(new WSRoutingRulePK[list.size()]));
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(e.getMessage(), e);
        }
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSRoutingEngineV2Status routingEngineV2Action(WSRoutingEngineV2Action wsRoutingEngineAction)
        throws RemoteException {
    try {//from  ww w.  j a v a 2s .  c om
        RoutingEngine ctrl = Util.getRoutingEngineV2CtrlLocal();
        if (wsRoutingEngineAction.getWsAction().equals(WSRoutingEngineV2ActionCode.START)) {
            ctrl.start();
        } else if (wsRoutingEngineAction.getWsAction().equals(WSRoutingEngineV2ActionCode.STOP)) {
            ctrl.stop();
        } else if (wsRoutingEngineAction.getWsAction().equals(WSRoutingEngineV2ActionCode.SUSPEND)) {
            ctrl.suspend(true);
        } else if (wsRoutingEngineAction.getWsAction().equals(WSRoutingEngineV2ActionCode.RESUME)) {
            ctrl.suspend(false);
        } else if (wsRoutingEngineAction.getWsAction().equals(WSRoutingEngineV2ActionCode.STATUS)) {
            // done below;
        }
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(e.getMessage(), e);
        }
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
    // get status
    try {
        RoutingEngine ctrl = Util.getRoutingEngineV2CtrlLocal();
        int status = ctrl.getStatus();
        switch (status) {
        case RoutingEngineV2POJO.RUNNING:
            return WSRoutingEngineV2Status.RUNNING;
        case RoutingEngineV2POJO.STOPPED:
            return WSRoutingEngineV2Status.STOPPED;
        case RoutingEngineV2POJO.SUSPENDED:
            return WSRoutingEngineV2Status.SUSPENDED;
        default:
            return WSRoutingEngineV2Status.DEAD;
        }
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(e.getMessage(), e);
        }
        throw new RemoteException(e.getLocalizedMessage(), e);
    }

}

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

@Override
public WSBoolean isItemModifiedByOther(WSIsItemModifiedByOther wsIsItemModifiedByOther) throws RemoteException {
    try {/*from www  .  j  a  v  a 2s  .  c  o m*/
        WSItem item = wsIsItemModifiedByOther.getWsItem();
        boolean ret = Util.getItemCtrl2Local()
                .isItemModifiedByOther(new ItemPOJOPK(new DataClusterPOJOPK(item.getWsDataClusterPK().getPk()),
                        item.getConceptName(), item.getIds()), item.getInsertionTime());
        return new WSBoolean(ret);
    } catch (Exception e) {
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}