Example usage for java.rmi RemoteException getMessage

List of usage examples for java.rmi RemoteException getMessage

Introduction

In this page you can find the example usage for java.rmi RemoteException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message, including the message from the cause, if any, of this exception.

Usage

From source file:org.wso2.carbon.analytics.jsservice.AnalyticsWebServiceConnector.java

public ResponseBean waitForIndexingForTable(String tableName, long seconds) {
    if (logger.isDebugEnabled()) {
        logger.debug(/*from   w  w w .  jav a  2s.  com*/
                "Invoking waiting for indexing - timeout : " + seconds + " seconds for table: " + tableName);
    }
    try {
        analyticsWebServiceStub.waitForIndexingForTable(tableName, seconds * Constants.MILLISECONDSPERSECOND);
        return handleResponse(ResponseStatus.SUCCESS, "Indexing Completed successfully");
    } catch (RemoteException e) {
        logger.error("Failed to wait till indexing finishes: " + e.getMessage(), e);
        return handleResponse(ResponseStatus.FAILED,
                "Failed to wait till indexing finishes: " + e.getMessage());
    } catch (AnalyticsWebServiceAnalyticsWebServiceExceptionException e) {
        logger.error("Failed to wait till indexing finishes: " + e.getFaultMessage(), e);
        return handleResponse(ResponseStatus.FAILED,
                "Failed to wait till indexing finishes: " + e.getFaultMessage());
    }
}

From source file:org.wso2.carbon.analytics.jsservice.AnalyticsWebServiceConnector.java

public String setTableSchema(String tableName, String schemaAsString) {
    if (logger.isDebugEnabled()) {
        logger.debug("Invoking setTableSchema for tableName : " + tableName);
    }// w  w w .  jav  a 2s  .c  om
    if (schemaAsString != null) {
        try {
            AnalyticsSchemaBean analyticsSchemaBean = gson.fromJson(schemaAsString, AnalyticsSchemaBean.class);
            org.wso2.carbon.analytics.webservice.stub.beans.AnalyticsSchemaBean analyticsSchema = Utils
                    .createAnalyticsSchema(analyticsSchemaBean);
            analyticsWebServiceStub.setTableSchema(tableName, analyticsSchema);
            return gson.toJson(handleResponse(ResponseStatus.SUCCESS,
                    "Successfully set table schema for table: " + tableName));
        } catch (RemoteException e) {
            logger.error("Failed to set the table schema for table: " + tableName + " : " + e.getMessage(), e);
            return gson.toJson(handleResponse(ResponseStatus.FAILED,
                    " Failed to set table schema for table: " + tableName + ": " + e.getMessage()));
        } catch (AnalyticsWebServiceAnalyticsWebServiceExceptionException e) {
            logger.error("Failed to set the table schema for table: " + tableName + " : " + e.getFaultMessage(),
                    e);
            return gson.toJson(handleResponse(ResponseStatus.FAILED,
                    " Failed to set table schema for table: " + tableName + ": " + e.getFaultMessage()));
        }
    } else {
        return gson.toJson(handleResponse(ResponseStatus.FAILED, "Table schema is not provided"));
    }
}

From source file:org.wso2.carbon.analytics.jsservice.AnalyticsWebServiceConnector.java

public ResponseBean getTableSchema(String tableName) {
    if (logger.isDebugEnabled()) {
        logger.debug("Invoking getTableSchema for table : " + tableName);
    }/*from  w  w w . ja  va2s .  c om*/
    try {
        org.wso2.carbon.analytics.webservice.stub.beans.AnalyticsSchemaBean analyticsSchema = analyticsWebServiceStub
                .getTableSchema(tableName);
        AnalyticsSchemaBean analyticsSchemaBean = Utils.createTableSchemaBean(analyticsSchema);
        return handleResponse(ResponseStatus.SUCCESS, gson.toJson(analyticsSchemaBean));
    } catch (RemoteException e) {
        logger.error("Failed to get the table schema for table: " + tableName + " : " + e.getMessage(), e);
        return handleResponse(ResponseStatus.FAILED,
                "Failed to get the table schema for table: " + tableName + ": " + e.getMessage());
    } catch (AnalyticsWebServiceAnalyticsWebServiceExceptionException e) {
        logger.error("Failed to get the table schema for table: " + tableName + " : " + e.getFaultMessage(), e);
        return handleResponse(ResponseStatus.FAILED,
                "Failed to get the table schema for table: " + tableName + ": " + e.getFaultMessage());
    }
}

From source file:org.wso2.carbon.analytics.jsservice.AnalyticsWebServiceConnector.java

public ResponseBean isPaginationSupported(String recordStoreName) {
    if (logger.isDebugEnabled()) {
        logger.debug("Invoking isPaginationSupported for recordStore: " + recordStoreName);
    }//  ww w  . j a  v a2 s .c o m
    try {
        if (recordStoreName == null) {
            throw new JSServiceException("RecordStoreName is not mentioned");
        }
        return handleResponse(ResponseStatus.SUCCESS,
                gson.toJson(analyticsWebServiceStub.isPaginationSupported(recordStoreName)));
    } catch (RemoteException e) {
        logger.error("Failed to check pagination support: " + e.getMessage(), e);
        return handleResponse(ResponseStatus.FAILED, "Failed to check pagination support: " + e.getMessage());
    } catch (AnalyticsWebServiceAnalyticsWebServiceExceptionException e) {
        logger.error("Failed to check pagination support: " + e.getFaultMessage(), e);
        return handleResponse(ResponseStatus.FAILED,
                "Failed to check pagination support: " + e.getFaultMessage());
    } catch (JSServiceException e) {
        logger.error("Failed to check pagination support: " + e.getMessage(), e);
        return handleResponse(ResponseStatus.FAILED, "Failed to check pagination support: " + e.getMessage());
    }
}

From source file:org.wso2.carbon.analytics.jsservice.AnalyticsWebServiceConnector.java

public ResponseBean drillDownCategories(String tableName, String queryAsString) {
    if (logger.isDebugEnabled()) {
        logger.debug("Invoking drillDownCategories for tableName : " + tableName);
    }//from  ww w .  j  a v a  2 s  .com
    if (queryAsString != null && !queryAsString.isEmpty()) {
        try {
            CategoryDrillDownRequestBean queryBean = gson.fromJson(queryAsString,
                    CategoryDrillDownRequestBean.class);
            org.wso2.carbon.analytics.webservice.stub.beans.CategoryDrillDownRequestBean requestBean = Utils
                    .createCategoryDrillDownRequest(tableName, queryBean);
            org.wso2.carbon.analytics.webservice.stub.beans.SubCategoriesBean searchResults = analyticsWebServiceStub
                    .drillDownCategories(requestBean);
            SubCategoriesBean subCategories = Utils.getSubCategories(searchResults);
            if (logger.isDebugEnabled()) {
                logger.debug(
                        "DrilldownCategory Result -- path: " + Arrays.toString(subCategories.getCategoryPath())
                                + " values :" + subCategories.getCategories());

            }
            return handleResponse(ResponseStatus.SUCCESS, gson.toJson(subCategories));
        } catch (RemoteException e) {
            logger.error("Failed to perform categoryDrilldown on table: " + tableName + " : " + e.getMessage(),
                    e);
            return handleResponse(ResponseStatus.FAILED,
                    "Failed to perform Category Drilldown on table: " + tableName + ": " + e.getMessage());
        } catch (AnalyticsWebServiceAnalyticsWebServiceExceptionException e) {
            logger.error(
                    "Failed to perform categoryDrilldown on table: " + tableName + " : " + e.getFaultMessage(),
                    e);
            return handleResponse(ResponseStatus.FAILED,
                    "Failed to perform Category Drilldown on table: " + tableName + ": " + e.getFaultMessage());
        }
    } else {
        return handleResponse(ResponseStatus.FAILED, "Category drilldown parameters " + "are not provided");
    }
}

From source file:org.wso2.carbon.analytics.jsservice.AnalyticsWebServiceConnector.java

public ResponseBean drillDownSearch(String tableName, String queryAsString) {
    if (logger.isDebugEnabled()) {
        logger.debug("Invoking drillDownCategories for tableName : " + tableName);
    }//from ww  w.ja v  a  2 s . c o  m
    if (queryAsString != null && !queryAsString.isEmpty()) {
        try {
            DrillDownRequestBean queryBean = gson.fromJson(queryAsString, DrillDownRequestBean.class);
            org.wso2.carbon.analytics.webservice.stub.beans.AnalyticsDrillDownRequestBean requestBean = Utils
                    .createDrillDownSearchRequest(tableName, queryBean);
            RecordBean[] records = analyticsWebServiceStub.drillDownSearch(requestBean);
            List<Record> recordBeans = Utils.getRecordBeans(records);
            if (logger.isDebugEnabled()) {
                for (Record record : recordBeans) {
                    logger.debug("Drilldown Search Result -- Record Id: " + record.getId() + " values :"
                            + record.toString());
                }
            }
            return handleResponse(ResponseStatus.SUCCESS, gson.toJson(recordBeans));
        } catch (RemoteException e) {
            logger.error("Failed to perform DrilldownSearch on table: " + tableName + " : " + e.getMessage(),
                    e);
            return handleResponse(ResponseStatus.FAILED,
                    "Failed to perform DrilldownSearch on table: " + tableName + ": " + e.getMessage());
        } catch (AnalyticsWebServiceAnalyticsWebServiceExceptionException e) {
            logger.error(
                    "Failed to perform DrilldownSearch on table: " + tableName + " : " + e.getFaultMessage(),
                    e);
            return handleResponse(ResponseStatus.FAILED,
                    "Failed to perform DrilldownSearch on table: " + tableName + ": " + e.getFaultMessage());
        }
    } else {
        return handleResponse(ResponseStatus.FAILED, "drilldownSearch parameters " + "are not provided");
    }
}

From source file:org.wso2.carbon.analytics.jsservice.AnalyticsWebServiceConnector.java

public ResponseBean drillDownSearchCount(String tableName, String queryAsString) {
    if (logger.isDebugEnabled()) {
        logger.debug("Invoking drillDownCategories for tableName : " + tableName);
    }/*from  w w w. j  ava  2 s . co m*/
    if (queryAsString != null && !queryAsString.isEmpty()) {
        try {
            DrillDownRequestBean queryBean = gson.fromJson(queryAsString, DrillDownRequestBean.class);
            org.wso2.carbon.analytics.webservice.stub.beans.AnalyticsDrillDownRequestBean requestBean = Utils
                    .createDrillDownSearchRequest(tableName, queryBean);
            double count = analyticsWebServiceStub.drillDownSearchCount(requestBean);
            if (logger.isDebugEnabled()) {
                logger.debug("Search count Result -- Record Count: " + count);
            }
            return handleResponse(ResponseStatus.SUCCESS, gson.toJson(count));
        } catch (RemoteException e) {
            logger.error(
                    "Failed to perform DrilldownSearch Count on table: " + tableName + " : " + e.getMessage(),
                    e);
            return handleResponse(ResponseStatus.FAILED,
                    "Failed to perform DrilldownSearch Count on table: " + tableName + ": " + e.getMessage());
        } catch (AnalyticsWebServiceAnalyticsWebServiceExceptionException e) {
            logger.error("Failed to perform DrilldownSearch Count on table: " + tableName + " : "
                    + e.getFaultMessage(), e);
            return handleResponse(ResponseStatus.FAILED, "Failed to perform DrilldownSearch Count on table: "
                    + tableName + ": " + e.getFaultMessage());
        }
    } else {
        return handleResponse(ResponseStatus.FAILED, "drilldownSearch parameters " + "are not provided");
    }
}

From source file:org.wso2.carbon.api.analytics.alerts.core.internal.clients.EventBuilderAdminServiceClient.java

public void removeEventBuilderConfiguration(String builderName) throws RemoteException {
    try {/*from  w  w w.  ja  v a 2  s . c om*/
        removeActiveEventBuilderConfiguration(builderName);
    } catch (RemoteException e) {
        log.error(e.getMessage());
        removeInactiveEventBuilderConfiguration(builderName + ".xml");
    }
}

From source file:org.wso2.carbon.api.analytics.alerts.core.internal.clients.EventFormatterAdminServiceClient.java

public void removeEventFormatterConfiguration(String formatterName) throws RemoteException {
    try {//ww  w . j a v  a  2 s. c o  m
        removeActiveEventFormatterConfiguration(formatterName);
    } catch (RemoteException e) {
        log.error(e.getMessage());
        removeInactiveEventFormatterConfiguration(formatterName + ".xml");
    }
}

From source file:org.wso2.carbon.api.analytics.alerts.core.internal.clients.EventProcessorAdminServiceClient.java

public void removeExecutionPlan(String planName) throws RemoteException {
    try {/*from www.  j  a va2  s .c  o  m*/
        removeActiveExecutionPlan(planName);
    } catch (RemoteException e) {
        log.error(e.getMessage());
        removeInactiveExecutionPlan(planName + ".xml");
    }
}