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 WSDroppedItemPK removeDroppedItem(WSRemoveDroppedItem wsRemoveDroppedItem) throws RemoteException {
    try {/*from  w ww  .ja v  a 2 s.co  m*/
        WSItemPK itemPK = wsRemoveDroppedItem.getWsDroppedItemPK().getWsItemPK();
        String clusterName = itemPK.getWsDataClusterPK().getPk();
        String dataModelName = clusterName;
        String conceptName = itemPK.getConceptName();
        String[] ids = itemPK.getIds();
        String operationType = UpdateReportPOJO.OPERATION_TYPE_PHYSICAL_DELETE;
        // Call beforeDelete process (if any).
        Util.BeforeDeleteResult result = Util.beforeDeleting(clusterName, conceptName, ids, operationType);
        if (result != null && ERROR_KEYWORD.equalsIgnoreCase(result.type)) {
            throw new BeforeDeletingErrorException(ERROR_KEYWORD, result.message);
        }
        // Generate physical delete event in journal
        WSDroppedItemPK droppedItemPK = wsRemoveDroppedItem.getWsDroppedItemPK();
        pushToUpdateReport(clusterName, dataModelName, conceptName, ids, true,
                UpdateReportPOJO.GENERIC_UI_SOURCE, operationType, null);
        // Removes item from recycle bin
        DroppedItem droppedItemCtrl = Util.getDroppedItemCtrlLocal();
        DroppedItemPOJOPK droppedItemPOJOPK = droppedItemCtrl
                .removeDroppedItem(XConverter.WS2POJO(droppedItemPK));
        if (result != null && INFO_KEYWORD.equalsIgnoreCase(result.type)) {
            throw new BeforeDeletingErrorException(INFO_KEYWORD, result.message);
        }
        return XConverter.POJO2WS(droppedItemPOJOPK);
    } catch (XtentisException e) {
        throw (new RemoteException(e.getLocalizedMessage(), e));
    } catch (BeforeDeletingErrorException e) {
        throw new RemoteException(e.getLocalizedMessage(), e);
    } 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 WSRoutingRule getRoutingRule(WSGetRoutingRule wsRoutingRuleGet) throws RemoteException {
    try {//from   w  ww.  j av a 2  s .c  om
        RoutingRule routingRuleCtrlLocal = Util.getRoutingRuleCtrlLocal();
        RoutingRulePOJOPK pk = new RoutingRulePOJOPK(wsRoutingRuleGet.getWsRoutingRulePK().getPk());
        if (routingRuleCtrlLocal.existsRoutingRule(pk) == null) {
            return null;
        }
        return XConverter.VO2WS(routingRuleCtrlLocal.getRoutingRule(pk));
    } catch (XtentisException e) {
        throw (new RemoteException(e.getLocalizedMessage(), e));
    } 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 existsRoutingRule(WSExistsRoutingRule wsExistsRoutingRule) throws RemoteException {
    try {/* w w  w .j a v a 2s.co  m*/
        RoutingRule routingRuleCtrlLocal = Util.getRoutingRuleCtrlLocal();
        RoutingRulePOJOPK pk = new RoutingRulePOJOPK(wsExistsRoutingRule.getWsRoutingRulePK().getPk());
        return new WSBoolean(routingRuleCtrlLocal.existsRoutingRule(pk) != null);
    } catch (XtentisException e) {
        throw (new RemoteException(e.getLocalizedMessage(), e));
    } 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 WSRoutingRulePK deleteRoutingRule(WSDeleteRoutingRule wsDeleteRoutingRule) throws RemoteException {
    try {/*from  w  w  w . ja  va2 s .  com*/
        RoutingRule routingRuleCtrlLocal = Util.getRoutingRuleCtrlLocal();
        RoutingRulePOJOPK pk = new RoutingRulePOJOPK(wsDeleteRoutingRule.getWsRoutingRulePK().getPk());
        return new WSRoutingRulePK(routingRuleCtrlLocal.removeRoutingRule(pk).getUniqueId());
    } catch (XtentisException e) {
        throw (new RemoteException(e.getLocalizedMessage(), e));
    } 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 WSRoutingRulePK putRoutingRule(WSPutRoutingRule wsRoutingRule) throws RemoteException {
    try {/*from  ww w.  j ava 2s .c  om*/
        RoutingRule routingRuleCtrlLocal = Util.getRoutingRuleCtrlLocal();
        RoutingRulePOJO routingRule = XConverter.WS2VO(wsRoutingRule.getWsRoutingRule());
        return new WSRoutingRulePK(routingRuleCtrlLocal.putRoutingRule(routingRule).getUniqueId());
    } catch (XtentisException e) {
        throw (new RemoteException(e.getLocalizedMessage(), e));
    } 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 WSRoutingRulePKArray getRoutingRulePKs(WSGetRoutingRulePKs regex) throws RemoteException {
    try {/* ww  w  .j  av  a 2  s . co m*/
        RoutingRule ctrl = Util.getRoutingRuleCtrlLocal();
        Collection<RoutingRulePOJOPK> collection = ctrl.getRoutingRulePKs(regex.getRegex());
        if (collection == null) {
            return null;
        }
        WSRoutingRulePK[] pks = new WSRoutingRulePK[collection.size()];
        int i = 0;
        for (RoutingRulePOJOPK o : collection) {
            pks[i++] = new WSRoutingRulePK(o.getUniqueId());
        }
        return new WSRoutingRulePKArray(pks);
    } catch (Exception e) {
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSTransformerV2PK deleteTransformerV2(WSDeleteTransformerV2 wsTransformerV2Delete)
        throws RemoteException {
    try {/*from  w  ww .j av a2  s  .  c o m*/
        Transformer ctrl = Util.getTransformerV2CtrlLocal();
        return new WSTransformerV2PK(ctrl
                .removeTransformer(
                        new TransformerV2POJOPK(wsTransformerV2Delete.getWsTransformerV2PK().getPk()))
                .getUniqueId());
    } catch (Exception e) {
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSTransformerV2 getTransformerV2(WSGetTransformerV2 wsGetTransformerV2) throws RemoteException {
    try {//from   www.  j  a  v  a 2 s  .c o m
        Transformer ctrl = Util.getTransformerV2CtrlLocal();
        String pk = wsGetTransformerV2.getWsTransformerV2PK().getPk();
        TransformerV2POJO pojo = ctrl.getTransformer(new TransformerV2POJOPK(pk));
        return XConverter.POJO2WS(pojo);
    } catch (Exception e) {
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSBoolean existsTransformerV2(WSExistsTransformerV2 wsExistsTransformerV2) throws RemoteException {
    try {//from   ww  w  . j  a  v a  2  s . c  o  m
        Transformer ctrl = Util.getTransformerV2CtrlLocal();
        String pk = wsExistsTransformerV2.getWsTransformerV2PK().getPk();
        TransformerV2POJO pojo = ctrl.existsTransformer(new TransformerV2POJOPK(pk));
        return new WSBoolean(pojo != null);
    } catch (Exception e) {
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSTransformerV2PKArray getTransformerV2PKs(WSGetTransformerV2PKs regex) throws RemoteException {
    try {//from  w w w.j a v  a  2  s . c  o m
        Transformer ctrl = Util.getTransformerV2CtrlLocal();
        Collection<TransformerV2POJOPK> collection = ctrl.getTransformerPKs(regex.getRegex());
        if (collection == null) {
            return null;
        }
        WSTransformerV2PK[] pks = new WSTransformerV2PK[collection.size()];
        int i = 0;
        for (TransformerV2POJOPK o : collection) {
            pks[i++] = new WSTransformerV2PK(o.getUniqueId());
        }
        return new WSTransformerV2PKArray(pks);
    } catch (Exception e) {
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}