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 WSMenuPK deleteMenu(WSDeleteMenu wsMenuDelete) throws RemoteException {
    try {/*from  w  ww  .  java  2s .  c o m*/
        Menu ctrl = Util.getMenuCtrlLocal();
        return new WSMenuPK(ctrl.removeMenu(new MenuPOJOPK(wsMenuDelete.getWsMenuPK().getPk())).getUniqueId());
    } catch (Exception e) {
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSMenu getMenu(WSGetMenu wsGetMenu) throws RemoteException {
    try {//from  w  w w  . j av  a2  s . c om
        Menu ctrl = Util.getMenuCtrlLocal();
        MenuPOJO pojo = ctrl.getMenu(new MenuPOJOPK(wsGetMenu.getWsMenuPK().getPk()));
        return XConverter.POJO2WS(pojo);
    } 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 existsMenu(WSExistsMenu wsExistsMenu) throws RemoteException {
    try {//  w  w  w . ja  v  a  2s .  c om
        Menu ctrl = Util.getMenuCtrlLocal();
        MenuPOJO pojo = ctrl.existsMenu(new MenuPOJOPK(wsExistsMenu.getWsMenuPK().getPk()));
        return new WSBoolean(pojo != null);
    } 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 WSMenuPKArray getMenuPKs(WSGetMenuPKs regex) throws RemoteException {
    try {/*from   w w w  . ja  va2  s.co m*/
        Menu ctrl = Util.getMenuCtrlLocal();
        Collection<MenuPOJOPK> collection = ctrl.getMenuPKs(regex.getRegex());
        if (collection == null) {
            return null;
        }
        WSMenuPK[] pks = new WSMenuPK[collection.size()];
        int i = 0;
        for (MenuPOJOPK o : collection) {
            pks[i++] = new WSMenuPK(o.getUniqueId());
        }
        return new WSMenuPKArray(pks);
    } catch (Exception e) {
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSMenuPK putMenu(WSPutMenu wsMenu) throws RemoteException {
    try {/*from  www .  ja va 2 s. c o m*/
        Menu ctrl = Util.getMenuCtrlLocal();
        MenuPOJOPK pk = ctrl.putMenu(XConverter.WS2POJO(wsMenu.getWsMenu()));
        return new WSMenuPK(pk.getUniqueId());
    } 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 WSBackgroundJob getBackgroundJob(WSGetBackgroundJob wsBackgroundJobGet) throws RemoteException {
    try {/*from  w w w  .  j  a v  a  2  s.co m*/
        return XConverter.POJO2WS(Util.getBackgroundJobCtrlLocal()
                .getBackgroundJob(new BackgroundJobPOJOPK(wsBackgroundJobGet.getPk())));
    } 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 WSBackgroundJobPKArray findBackgroundJobPKs(WSFindBackgroundJobPKs wsFindBackgroundJobPKs)
        throws RemoteException {
    try {//from  ww  w.  j  a v a  2 s  . co m
        BackgroundJob backgroundJob = Util.getBackgroundJobCtrlLocal();
        Collection<BackgroundJobPOJOPK> jobs = backgroundJob.getBackgroundJobPKs(".*"); //$NON-NLS-1$
        List<WSBackgroundJobPK> match = new LinkedList<>();
        for (BackgroundJobPOJOPK job : jobs) {
            if (backgroundJob.getBackgroundJob(job).getStatus() == wsFindBackgroundJobPKs.getStatus()
                    .ordinal()) {
                match.add(XConverter.POJO2WS(job));
            }
        }
        return new WSBackgroundJobPKArray(match.toArray(new WSBackgroundJobPK[match.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 WSDroppedItemPKArray findAllDroppedItemsPKs(WSFindAllDroppedItemsPKs regex) throws RemoteException {
    try {//from  w w w  .  ja v a  2  s  .c o m
        List droppedItemPOJOPKs = Util.getDroppedItemCtrlLocal().findAllDroppedItemsPKs(regex.getRegex());
        WSDroppedItemPK[] wsDroppedItemPKs = new WSDroppedItemPK[droppedItemPOJOPKs.size()];
        for (int i = 0; i < droppedItemPOJOPKs.size(); i++) {
            DroppedItemPOJOPK droppedItemPOJOPK = (DroppedItemPOJOPK) droppedItemPOJOPKs.get(i);
            wsDroppedItemPKs[i] = XConverter.POJO2WS(droppedItemPOJOPK);
        }
        return new WSDroppedItemPKArray(wsDroppedItemPKs);
    } 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 WSDroppedItem loadDroppedItem(WSLoadDroppedItem wsLoadDroppedItem) throws RemoteException {
    try {/*from w  w  w  .  j  a  va  2s. c o m*/
        DroppedItemPOJO droppedItemPOJO = Util.getDroppedItemCtrlLocal()
                .loadDroppedItem(XConverter.WS2POJO(wsLoadDroppedItem.getWsDroppedItemPK()));
        return XConverter.POJO2WS(droppedItemPOJO);
    } 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 WSItemPK recoverDroppedItem(WSRecoverDroppedItem wsRecoverDroppedItem) throws RemoteException {
    try {/*from  ww w. ja  v a  2  s.  com*/
        // Restore record
        DroppedItemPOJOPK droppedItemPOJOPK = XConverter.WS2POJO(wsRecoverDroppedItem.getWsDroppedItemPK());
        ItemPOJOPK itemPOJOPK = Util.getDroppedItemCtrlLocal().recoverDroppedItem(droppedItemPOJOPK);
        // Generate journal event (after restore operation's completed).
        WSItemPK itemPK = wsRecoverDroppedItem.getWsDroppedItemPK().getWsItemPK();
        String operationType = UpdateReportPOJO.OPERATION_TYPE_RESTORED;
        String clusterName = itemPK.getWsDataClusterPK().getPk();
        String dataModelName = clusterName;
        String conceptName = itemPK.getConceptName();
        String[] ids = itemPK.getIds();
        pushToUpdateReport(clusterName, dataModelName, conceptName, ids, true,
                UpdateReportPOJO.GENERIC_UI_SOURCE, operationType, null);
        return XConverter.POJO2WS(itemPOJOPK);
    } catch (XtentisException e) {
        throw (new RemoteException(e.getLocalizedMessage(), e));
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}