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 countItemsByCustomFKFilters(WSCountItemsByCustomFKFilters wsCountItemsByCustomFKFilters)
        throws RemoteException {
    try {/*w w  w  .ja v a  2 s .  c  om*/
        long count = Util.getItemCtrl2Local().countItemsByCustomFKFilters(
                new DataClusterPOJOPK(wsCountItemsByCustomFKFilters.getWsDataClusterPK().getPk()),
                wsCountItemsByCustomFKFilters.getConceptName(),
                wsCountItemsByCustomFKFilters.getInjectedXpath());
        return new WSString(String.valueOf(count));
    } 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 getItemsByCustomFKFilters(WSGetItemsByCustomFKFilters wsGetItemsByCustomFKFilters)
        throws RemoteException {
    try {//from  w w w  . jav  a 2s.  c om
        Map context = Collections.emptyMap();
        ArrayList res = Util.getItemCtrl2Local().getItemsByCustomFKFilters(
                new DataClusterPOJOPK(wsGetItemsByCustomFKFilters.getWsDataClusterPK().getPk()),
                new ArrayList<String>(
                        Arrays.asList(wsGetItemsByCustomFKFilters.getViewablePaths().getStrings())),
                wsGetItemsByCustomFKFilters.getInjectedXpath(),
                XConverter.WS2VO(wsGetItemsByCustomFKFilters.getWhereItem(),
                        new WhereConditionForcePivotFilter(context)),
                wsGetItemsByCustomFKFilters.getSkip(), wsGetItemsByCustomFKFilters.getMaxItems(),
                wsGetItemsByCustomFKFilters.getOrderBy(), wsGetItemsByCustomFKFilters.getDirection(),
                wsGetItemsByCustomFKFilters.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 WSRole getRole(WSGetRole wsGetRole) throws RemoteException {
    try {//w w  w  . java2 s  .c  o m
        Role ctrl = Util.getRoleCtrlLocal();
        RolePOJO role = ctrl.getRole(new RolePOJOPK(wsGetRole.getWsRolePK().getPk()));
        return XConverter.POJO2WS(role);
    } 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 existsRole(WSExistsRole wsExistsRole) throws RemoteException {
    try {/*from w w w .  jav  a  2s  .  c om*/
        Role ctrl = Util.getRoleCtrlLocal();
        RolePOJO pojo = ctrl.existsRole(new RolePOJOPK(wsExistsRole.getWsRolePK().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 WSRolePKArray getRolePKs(WSGetRolePKs regex) throws RemoteException {
    try {/*  w w w  . j a  va  2s.  co m*/
        Role ctrl = Util.getRoleCtrlLocal();
        Collection c = ctrl.getRolePKs(regex.getRegex());
        if (c == null) {
            return null;
        }
        WSRolePK[] pks = new WSRolePK[c.size()];
        int i = 0;
        for (Object currentRolePK : c) {
            pks[i++] = new WSRolePK(((RolePOJOPK) currentRolePK).getUniqueId());
        }
        return new WSRolePKArray(pks);
    } catch (Exception e) {
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSRolePK putRole(WSPutRole wsRole) throws RemoteException {
    try {//from www  .  j a  v a  2 s.  co m
        Role ctrl = Util.getRoleCtrlLocal();
        RolePOJOPK pk = ctrl.putRole(XConverter.WS2POJO(wsRole.getWsRole()));
        LocalUser.resetLocalUsers();
        return new WSRolePK(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 WSRolePK deleteRole(WSDeleteRole wsRoleDelete) throws RemoteException {
    try {//from  w  ww.j  av a2s .  c o  m
        Role ctrl = Util.getRoleCtrlLocal();
        return new WSRolePK(ctrl.removeRole(new RolePOJOPK(wsRoleDelete.getWsRolePK().getPk())).getUniqueId());
    } catch (Exception e) {
        throw new RemoteException(e.getLocalizedMessage(), e);
    }
}

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

@Override
public WSString serviceAction(WSServiceAction wsServiceAction) throws RemoteException {
    try {//from  www.  ja  v a 2s  .c  o m
        Service service = PluginRegistry.getInstance().getService(wsServiceAction.getJndiName());
        String result;
        if (WSServiceActionCode.EXECUTE.equals(wsServiceAction.getWsAction())) {
            Method method = Util.getMethod(service, wsServiceAction.getMethodName());
            result = (String) method.invoke(service, wsServiceAction.getMethodParameters());
        } else {
            if (WSServiceActionCode.START.equals(wsServiceAction.getWsAction())) {
                service.start();
            } else if (WSServiceActionCode.STOP.equals(wsServiceAction.getWsAction())) {
                service.stop();
            }
            result = service.getStatus();
        }
        return new WSString(result);
    } 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 WSString getServiceConfiguration(WSServiceGetConfiguration wsGetConfiguration) throws RemoteException {
    try {//from  ww  w .  ja  va  2  s .  co m
        Service service = PluginRegistry.getInstance().getService(wsGetConfiguration.getJndiName());
        String configuration = service.getConfiguration(wsGetConfiguration.getOptionalParameter());
        return new WSString(configuration);
    } 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 putServiceConfiguration(WSServicePutConfiguration wsPutConfiguration) throws RemoteException {
    try {/*from  www.  j a  va 2  s  .co m*/
        Service service = PluginRegistry.getInstance().getService(wsPutConfiguration.getJndiName());
        service.putConfiguration(wsPutConfiguration.getConfiguration());
        return new WSString(wsPutConfiguration.getConfiguration());
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}