com.jamonapi.MonitorFactory.start()

Here are the examples of the java api com.jamonapi.MonitorFactory.start() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

109 Examples 7

18 Source : SOMapProviderConfigurator.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Configure.
 *
 * @param soMapProvider
 *            the so map provider
 * @param conf
 *            the conf
 *
 * @throws GeoEngineException
 *             the geo engine exception
 */
public static void configure(SOMapProvider soMapProvider, Object conf) throws SvgViewerEngineException {
    Monitor mapCatalogueServiceProxyMonitor = MonitorFactory.start("GeoEngine.SOMapProviderConfigurator.configure.mapCatalogueServiceProxy");
    MapCatalogueAccessUtils mapCatalogueServiceProxy = (MapCatalogueAccessUtils) soMapProvider.getEnv().get(SvgViewerEngineConstants.ENV_MAPCATALOGUE_SERVICE_PROXY);
    soMapProvider.setMapCatalogueServiceProxy(mapCatalogueServiceProxy);
    if (conf instanceof HierarchyMember)
        soMapProvider.setSelectedHierarchyMember((HierarchyMember) conf);
    mapCatalogueServiceProxyMonitor.stop();
}

17 Source : SpagoBIPivotModel.java
with GNU Affero General Public License v3.0
from KnowageLabs

public void applyCal() {
    Monitor totalTime = MonitorFactory.start("WhatIfEngine/it.eng.spagobi.engines.whatif.model.SpagoBIPivotModel.total");
    Monitor getQuery = MonitorFactory.start("WhatIfEngine/it.eng.spagobi.engines.whatif.model.SpagoBIPivotModel.getQuery");
    queryWithOutCC = getCurrentMdx();
    getQuery.stop();
    try {
        Monitor injectCalculatedFieldsIntoMdxQueryTime = MonitorFactory.start("WhatIfEngine/it.eng.spagobi.engines.whatif.model.SpagoBIPivotModel.injectCalculatedFieldsIntoMdxQueryTime");
        String queryString = CalculatedMemberManager.injectCalculatedFieldsIntoMdxQuery(this);
        injectCalculatedFieldsIntoMdxQueryTime.stop();
        Monitor setMdxTime = MonitorFactory.start("WhatIfEngine/it.eng.spagobi.engines.whatif.model.SpagoBIPivotModel.setMdxTime");
        setMdx(queryString);
        setMdxTime.stop();
        Monitor getCellSetTime = MonitorFactory.start("WhatIfEngine/it.eng.spagobi.engines.whatif.model.SpagoBIPivotModel.getCellSetTime");
        this.getCellSet();
        getCellSetTime.stop();
    // System.out.println("rows "+ cs.getAxes().get(0).getPositions().size());
    // System.out.println("columns "+cs.getAxes().get(1).getPositions().size());
    } catch (Exception e) {
        this.getCalculatedFields().remove(this.getCalculatedFields().size() - 1);
        restoreQuery();
        throw new SpagoBIEngineRuntimeException("Error calculating the field", e);
    }
    totalTime.stop();
}

17 Source : ModelResource.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Service to increase Version
 *
 * @return
 */
@POST
@Path("/saveAs")
@Produces("text/html; charset=UTF-8")
public String increaseVersion() {
    logger.debug("IN");
    logOperation("Save As");
    String name;
    String descr;
    JSONObject json;
    try {
        json = RestUtilities.readBodyAsJSONObject(getServletRequest());
        name = json.getString("name");
        descr = json.getString("descr");
    } catch (IOException e1) {
        logger.error("Error loading the parameters from the request", e1);
        throw new SpagoBIEngineRestServiceRuntimeException(getLocale(), e1);
    } catch (JSONException e1) {
        logger.error("Error loading the parameters from the request", e1);
        throw new SpagoBIEngineRestServiceRuntimeException(getLocale(), e1);
    }
    Monitor totalTime = MonitorFactory.start("WhatIfEngine/it.eng.spagobi.engines.whatif.api.ModelResource.increaseVersion.totalTime");
    if (name.equals(VERSION_FAKE_DESCR)) {
        name = null;
    }
    if (descr.equals(VERSION_FAKE_DESCR)) {
        descr = null;
    }
    PivotModel model;
    try {
        model = getVersionBusiness().persistNewVersionProcedure(name, descr);
    } catch (WhatIfPersistingTransformationException e) {
        logErrorTransformations(e.getTransformations());
        logger.error("Error persisting the trasformations in the new version a new version", e);
        throw new SpagoBIEngineRestServiceRuntimeException("versionresource.generic.error", getLocale(), e);
    }
    logTransormations();
    logger.debug("OUT");
    String toReturn = renderModel(model);
    totalTime.stop();
    return toReturn;
}

17 Source : JDBCDataProxy.java
with GNU Affero General Public License v3.0
from KnowageLabs

@Override
public ResultSet getData(IDataReader dataReader, Object... resources) {
    logger.debug("IN");
    Statement stmt = (Statement) resources[0];
    ResultSet resultSet = null;
    try {
        if (getMaxResults() > 0) {
            stmt.setMaxRows(getMaxResults());
        }
        String sqlQuery = getStatement();
        LogMF.info(logger, "Executing query:\n{0}", sqlQuery);
        Monitor timeToExecuteStatement = MonitorFactory.start("Knowage.JDBCDataProxy.executeStatement:" + sqlQuery);
        try {
            resultSet = stmt.executeQuery(sqlQuery);
        } finally {
            timeToExecuteStatement.stop();
        }
        LogMF.debug(logger, "Executed query:\n{0}", sqlQuery);
        return resultSet;
    } catch (SQLException e) {
        throw new SpagoBIRuntimeException(e);
    } finally {
        logger.debug("OUT");
    }
}

17 Source : AbstractSvgViewerEngineResource.java
with GNU Affero General Public License v3.0
from KnowageLabs

public EngineStartServletIOManager getIOManager() {
    Monitor getIOManagerMonitor = MonitorFactory.start("GeoEngine.AbstractSvgViewerEngineResource.getIOManager");
    EngineStartServletIOManager ioManager = null;
    try {
        ioManager = new EngineStartServletIOManager(request, response);
        UserProfile userProfile = (UserProfile) ioManager.getParameterFromSession(IEngUserProfile.ENG_USER_PROFILE);
        if (userProfile == null) {
            String userId = request.getHeader("user");
            userProfile = (UserProfile) UserUtilities.getUserProfile(userId);
            ioManager.setUserProfile(userProfile);
        }
    } catch (Exception e) {
        throw new RuntimeException("An unexpected error occured while inizializing ioManager", e);
    }
    getIOManagerMonitor.stop();
    return ioManager;
}

17 Source : DatasetManagementAPI.java
with GNU Affero General Public License v3.0
from KnowageLabs

public IDataStore getDataStore(IDataSet dataSet, boolean isNearRealtime, Map<String, String> parametersValues, List<AbstractSelectionField> projections, Filter filter, List<AbstractSelectionField> list, List<Sorting> sortings, List<List<AbstractSelectionField>> summaryRowProjections, int offset, int fetchSize, int maxRowCount, Set<String> indexes) throws JSONException {
    Monitor totalTiming = MonitorFactory.start("Knowage.DatasetManagementAPI.getDataStore");
    try {
        dataSet.setParametersMap(parametersValues);
        dataSet.resolveParameters();
        IDatasetEvaluationStrategy strategy = DatasetEvaluationStrategyFactory.get(dataSet.getEvaluationStrategy(isNearRealtime), dataSet, userProfile);
        return strategy.executeQuery(projections, filter, list, sortings, summaryRowProjections, offset, fetchSize, maxRowCount, indexes);
    } finally {
        totalTiming.stop();
        logger.debug("OUT");
    }
}

17 Source : SecurityServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * User profile creation.
 *
 * @param token
 *            the token
 * @param userId
 *            the user id
 *
 * @return the user profile
 */
public SpagoBIUserProfile getUserProfile(String token, String userId) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.security.getUserProfile");
    try {
        validateTicket(token, userId);
        UserProfile userProfile = (UserProfile) UserUtilities.getUserProfile(userId);
        return userProfile.getSpagoBIUserProfile();
    } catch (Exception e) {
        logger.error("An exception occurred while creating user profile for user " + userId, e);
        return null;
    } finally {
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SecurityServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * check if the user can execute the function.
 *
 * @param token
 *            the token
 * @param userId
 *            the user id
 * @param function
 *            the function
 *
 * @return true, if check authorization
 */
public boolean checkAuthorization(String token, String userId, String function) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.security.checkAuthorization");
    try {
        validateTicket(token, userId);
        ISecurityServiceSupplier supplier = SecurityServiceSupplierFactory.createISecurityServiceSupplier();
        return supplier.checkAuthorization(userId, function);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return false;
    } finally {
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SchedulerServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Gets the job schedulation definition.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 * @param triggerName
 *            the trigger name
 * @param triggerGroup
 *            the trigger group
 *
 * @return the job schedulation definition
 */
public String getJobSchedulationDefinition(String token, String user, String triggerName, String triggerGroup) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.scheduler.getJobSchedulationDefinition");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.getJobSchedulationDefinition(triggerName, triggerGroup);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SchedulerServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Schedule job.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 * @param xmlRequest
 *            the xml request
 *
 * @return the string
 */
public String scheduleJob(String token, String user, String xmlRequest) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.scheduler.scheduleJob");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.scheduleJob(xmlRequest);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SchedulerServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Define job.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 * @param xmlRequest
 *            the xml request
 *
 * @return the string
 */
public String defineJob(String token, String user, String xmlRequest) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.scheduler.defineJob");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.defineJob(xmlRequest);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SchedulerServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Gets the job list.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 *
 * @return the job list
 */
public String getJobList(String token, String user) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.scheduler.getJobList");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.getJobList();
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SchedulerServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Gets the job schedulation list.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 * @param jobName
 *            the job name
 * @param jobGroup
 *            the job group
 *
 * @return the job schedulation list
 */
public String getJobSchedulationList(String token, String user, String jobName, String jobGroup) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.scheduler.getJobSchedulationList");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.getJobSchedulationList(jobName, jobGroup);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SchedulerServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Delete schedulation.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 * @param triggerName
 *            the trigger name
 * @param triggerGroup
 *            the trigger group
 *
 * @return the string
 */
public String deleteSchedulation(String token, String user, String triggerName, String triggerGroup) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.scheduler.deleteSchedulation");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.deleteSchedulation(triggerName, triggerGroup);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SchedulerServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Gets the job definition.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 * @param jobName
 *            the job name
 * @param jobGroup
 *            the job group
 *
 * @return the job definition
 */
public String getJobDefinition(String token, String user, String jobName, String jobGroup) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.scheduler.getJobDefinition");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.getJobDefinition(jobName, jobGroup);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SchedulerServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Exist job definition.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 * @param jobName
 *            the job name
 * @param jobGroup
 *            the job group
 *
 * @return the string
 */
public String existJobDefinition(String token, String user, String jobName, String jobGroup) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.scheduler.existJobDefinition");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.existJobDefinition(jobName, jobGroup);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SchedulerServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Delete job.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 * @param jobName
 *            the job name
 * @param jobGroupName
 *            the job group name
 *
 * @return the string
 */
public String deleteJob(String token, String user, String jobName, String jobGroupName) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.scheduler.deleteJob");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.deleteJob(jobName, jobGroupName);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SbiDocumentServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

public SpagobireplacedyticalDriver[] getDoreplacedentreplacedyticalDrivers(String token, String user, Integer id, String language, String country) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.sbidoreplacedent.getDoreplacedentParameters");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.getDoreplacedentreplacedyticalDrivers(id, language, country);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : SbiDocumentServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

public String getDoreplacedentreplacedyticalDriversJSON(String token, String user, Integer id, String language, String country) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.sbidoreplacedent.getDoreplacedentParametersJSON");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.getDoreplacedentreplacedyticalDriversJSON(id, language, country);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : MetamodelServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Returns the last modification date of the metamodel specified
 *
 * @param token The token.
 * @param user The user.
 * @param name  The metamodel's name.
 *
 * @return the last modification date of the metamodel specified
 */
public long getMetamodelContentLastModified(String token, String user, String name) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.metamodel.getMetamodelContentByName");
    try {
        long lastModified = -1;
        validateTicket(token, user);
        this.setTenantByUserId(user);
        MetamodelServiceImplSupplier supplier = new MetamodelServiceImplSupplier();
        lastModified = supplier.getMetamodelContentLastModified(name);
        return lastModified;
    } catch (Exception e) {
        logger.error("Exception", e);
        return -1;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : MetamodelServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * return the metamodel by the id
 * @param token. The token.
 * @param user. The user.
 * @param id. The metamodel's name.
 * @return the content of the metamodel.
 */
public DataHandler getMetamodelContentByName(String token, String user, String name) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.metamodel.getMetamodelContentByName");
    try {
        DataHandler dataHandler = null;
        validateTicket(token, user);
        this.setTenantByUserId(user);
        MetamodelServiceImplSupplier supplier = new MetamodelServiceImplSupplier();
        dataHandler = supplier.getMetamodelContentByName(name);
        return dataHandler;
    } catch (Exception e) {
        logger.error("Exception", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : EventServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Fire event.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 * @param description
 *            the description
 * @param parameters
 *            the parameters
 * @param rolesHandler
 *            the roles handler
 * @param type
 *            the type
 *
 * @return the string
 */
public String fireEvent(String token, String user, String description, String parameters, String rolesHandler, String type) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.event.fireEvent");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        UserProfile profile = (UserProfile) UserUtilities.getUserProfile(user);
        return fireEvent(profile, description, parameters, rolesHandler, type);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } catch (Exception e) {
        logger.error("Error while firing event", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : AuditServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Log.
 *
 * @param token String
 * @param user String
 * @param id String
 * @param start String
 * @param end String
 * @param state String
 * @param message String
 * @param errorCode String
 *
 * @return String
 */
public String log(String token, String user, String id, String start, String end, String state, String message, String errorCode) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.audit.log");
    try {
        validateTicket(token, user);
        return log(user, id, start, end, state, message, errorCode);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : ArtifactServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * return the artifact by the id
 * @param token. The token.
 * @param user. The user.
 * @param id. The artifact's id.
 * @return the content of the artifact.
 */
public DataHandler getArtifactContentById(String token, String user, Integer id) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.artifact.getArtifactContentById");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        ArtifactServiceImplSupplier supplier = new ArtifactServiceImplSupplier();
        return supplier.getArtifactContentById(id);
    } catch (Exception e) {
        logger.error("Exception", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : ArtifactServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * return the artifacts list of the given type
 * @param token. The token.
 * @param user. The user.
 * @param type. The artifact's type.
 * @return the list of the artifacts of the given type.
 */
public SpagoBIArtifact[] getArtifactsByType(String token, String user, String type) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.artifact.getArtifactsByType");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        ArtifactServiceImplSupplier supplier = new ArtifactServiceImplSupplier();
        return supplier.getArtifactsByType(type);
    } catch (Exception e) {
        logger.error("An error occurred while getting artifacts of type [" + type + "]", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

17 Source : ArtifactServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * return the artifact by name and type
 * @param token. The token.
 * @param user. The user.
 * @param name. The artifact's name.
 * @param type. The artifact's type.
 * @return the content of the artifact.
 */
public DataHandler getArtifactContentByNameAndType(String token, String user, String name, String type) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.artifact.getArtifactContentByNameAndType");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        ArtifactServiceImplSupplier supplier = new ArtifactServiceImplSupplier();
        return supplier.getArtifactContentByNameAndType(name, type);
    } catch (Exception e) {
        logger.error("Exception", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

16 Source : SPARQLDataProxy.java
with GNU Affero General Public License v3.0
from KnowageLabs

private ResultSet executeSPARQLQuery(QueryExecution queryExecution) {
    queryExecution.setTimeout(executionTimeout * 1000);
    Monitor monitor = MonitorFactory.start("Knowage.SPARQLDataProxy.executeSPARQLQuery");
    ResultSet resultSet = null;
    try {
        resultSet = queryExecution.execSelect();
    } finally {
        monitor.stop();
    }
    return resultSet;
}

16 Source : SPARQLDataProxy.java
with GNU Affero General Public License v3.0
from KnowageLabs

private IDataStore readResultSet(IDataReader dataReader, IDataStore dataStore, ResultSet resultSet) {
    Monitor monitor = MonitorFactory.start("Knowage.SPARQLDataProxy.readResultSet");
    try {
        dataStore = dataReader.read(resultSet);
    } catch (Exception t) {
        throw new SpagoBIRuntimeException("An error occurred while parsing resultset", t);
    } finally {
        monitor.stop();
    }
    return dataStore;
}

16 Source : JDBCDataProxy.java
with GNU Affero General Public License v3.0
from KnowageLabs

protected int getResultNumber(Connection connection) {
    logger.debug("IN");
    int resultNumber = 0;
    Statement stmt = null;
    ResultSet rs = null;
    String statement = this.getStatement();
    // if db is SQL server the query nees to be modified in case it contains ORDER BY clause
    String dialect = dataSource.getHibDialectClreplaced();
    logger.debug("Dialect is " + dialect);
    if (dialect.toUpperCase().contains("SQLSERVER") && statement.toUpperCase().contains("ORDER BY")) {
        logger.debug("we are in SQL SERVER and ORDER BY case");
        statement = modifySQLServerQuery(statement);
    }
    try {
        String tableAlias = "";
        if (!dialect.toLowerCase().contains("orient")) {
            tableAlias = "temptable";
        }
        String sqlQuery = "SELECT COUNT(*) FROM (" + statement + ") " + tableAlias;
        stmt = connection.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
        LogMF.info(logger, "Executing count statement, SQL query:\n{0}", sqlQuery);
        Monitor timeToExecuteStatement = MonitorFactory.start("Knowage.JDBCDataProxy.executeCountStatement:" + sqlQuery);
        try {
            rs = stmt.executeQuery(sqlQuery);
        } finally {
            timeToExecuteStatement.stop();
        }
        LogMF.debug(logger, "Executed count statement, SQL query:\n{0}", sqlQuery);
        rs.next();
        resultNumber = rs.getInt(1);
    } catch (Throwable t) {
        throw new SpagoBIRuntimeException("An error occurred while creating connection steatment", t);
    } finally {
        releaseResources(null, stmt, rs);
    }
    logger.debug("OUT : returning " + resultNumber);
    return resultNumber;
}

16 Source : SvgViewerEngineComponentFactory.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Builds the.
 *
 * @param geoEngineComponentClreplacedName
 *            the geo engine component clreplaced name
 * @param conf
 *            the conf
 * @param env
 *            the env
 *
 * @return the i geo engine component
 *
 * @throws GeoEngineException
 *             the geo engine exception
 */
public static ISvgViewerEngineComponent build(String geoEngineComponentClreplacedName, Object conf, Map env) throws SvgViewerEngineException {
    ISvgViewerEngineComponent geoEngineComponent = null;
    logger.debug("IN");
    try {
        geoEngineComponent = (ISvgViewerEngineComponent) Clreplaced.forName(geoEngineComponentClreplacedName).newInstance();
    } catch (InstantiationException e) {
        logger.error("Impossible to instatiate component of type: " + geoEngineComponentClreplacedName);
        throw new SvgViewerEngineException("Impossible to instatiate component of type: " + geoEngineComponentClreplacedName, e);
    } catch (IllegalAccessException e) {
        logger.error("Impossible to instatiate component of type: " + geoEngineComponentClreplacedName);
        throw new SvgViewerEngineException("Impossible to instatiate component of type: " + geoEngineComponentClreplacedName, e);
    } catch (ClreplacedNotFoundException e) {
        SvgViewerEngineException geoException;
        logger.error("Impossible to instatiate component of type: " + geoEngineComponentClreplacedName);
        String description = "Impossible to instatiate component of type: " + geoEngineComponentClreplacedName;
        List hints = new ArrayList();
        hints.add("Check if the clreplaced name is wrong or mispelled");
        hints.add("Check if the clreplaced is on the clreplaced path");
        geoException = new SvgViewerEngineException("Impossible to instatiate component", e);
        geoException.setDescription(description);
        // geoException.setHints(hints);
        throw geoException;
    }
    logger.debug("Component " + geoEngineComponentClreplacedName + " created succesfully");
    Monitor setEnvMonitor = MonitorFactory.start("GeoEngine.SvgViewerEngineComponentFactory.setEnv");
    geoEngineComponent.setEnv(env);
    setEnvMonitor.stop();
    Monitor initMonitor = MonitorFactory.start("GeoEngine.SvgViewerEngineComponentFactory.init." + geoEngineComponentClreplacedName);
    geoEngineComponent.init(conf);
    initMonitor.stop();
    logger.debug("Component " + geoEngineComponentClreplacedName + " configurated succesfully");
    logger.debug("OUT");
    return geoEngineComponent;
}

16 Source : ObjectsAccessVerifier.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Controls if the user can see the LowFunctionality. The root LowFunctionality is visible by everybody. The administrator can see all LowFunctionalities.
 * Other users can see the LowFunctionality only if they have at least one of the following permission: - they can develop on that folder; - they can test
 * on that folder; - they can execute on that folder.
 *
 * @param lowFunctionality The LowFunctionality
 * @param profile          user profile
 * @return true if the user can see the specified lowFunctionality, false otherwise
 * @throws EMFInternalError the EMF internal error
 */
public static boolean canSee(LowFunctionality lowFunctionality, IEngUserProfile profile) throws EMFInternalError {
    boolean canSee = false;
    Monitor monitor = MonitorFactory.start("spagobi.core.ObjectAccessVerifier.canSee(LowFunctionality lowFunctionality, IEngUserProfile profile)");
    logger.debug("IN: lowFunctionality path = [" + lowFunctionality.getPath() + "]; userId = [" + ((UserProfile) profile).getUserId() + "]");
    // if it is root folder, anybody can see it
    if (lowFunctionality.getParentId() == null) {
        canSee = true;
    } else {
        // if user is administrator, he can see all functionalities
        if (profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_ADMIN)) {
            canSee = true;
        } else {
            // if user can exec or dev or test on functionality, he can see it, otherwise he cannot see it
            if (ObjectsAccessVerifier.canExec(lowFunctionality, profile) || ObjectsAccessVerifier.canTest(lowFunctionality, profile) || ObjectsAccessVerifier.canDev(lowFunctionality, profile)) {
                canSee = true;
            } else {
                canSee = false;
            }
        }
    }
    logger.debug("OUT.canSee=" + canSee);
    monitor.stop();
    return canSee;
}

16 Source : SecurityServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * check if user can access to the folder "idFolder".
 *
 * @param token
 *            the token
 * @param userId
 *            the user id
 * @param idFolder
 *            the id folder
 * @param state
 *            the state
 *
 * @return true, if checks if is authorized
 */
public boolean isAuthorized(String token, String userId, String idFolder, String state) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.security.isAuthorized");
    try {
        validateTicket(token, userId);
        UserProfile userProfile = (UserProfile) UserUtilities.getUserProfile(userId);
        this.setTenantByUserProfile(userProfile);
        return ObjectsAccessVerifier.canExec(new Integer(idFolder), userProfile);
    } catch (Exception e) {
        logger.error("An exception occurred while checking authorization for user " + userId + " to folder " + idFolder + " with state " + state, e);
        return false;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

16 Source : DataSourceServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Gets the data source by label.
 *
 * @param token
 *            String
 * @param user
 *            String
 * @param id
 *            int
 *
 * @return SpagoBiDataSource
 */
@Override
public SpagoBiDataSource getDataSourceById(String token, String user, Integer id) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.datasource.getDataSourceById");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.getDataSourceById(id);
    } catch (Exception e) {
        logger.error("Error while getting datasource with id  " + id, e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

16 Source : DataSourceServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Gets the all data source.
 *
 * @param token
 *            String
 * @param user
 *            String
 *
 * @return SpagoBiDataSource[]
 */
@Override
public SpagoBiDataSource[] getAllDataSource(String token, String user) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.datasource.getAllDataSource");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.getAllDataSource();
    } catch (Exception e) {
        logger.error("Error while getting all datasources", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

16 Source : DataSourceServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Gets the data source by label.
 *
 * @param token
 *            String
 * @param user
 *            String
 * @param label
 *            String
 *
 * @return SpagoBiDataSource
 */
@Override
public SpagoBiDataSource getDataSourceByLabel(String token, String user, String label) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.datasource.getDataSourceByLabel");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.getDataSourceByLabel(label);
    } catch (Exception e) {
        logger.error("Error while getting datasource with label  " + label, e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

16 Source : DataSetServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * @param token
 *            String
 * @param user
 *            String
 * @return SpagoBiDataSet[]
 */
@Override
public SpagoBiDataSet[] getAllDataSet(String token, String user) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.dataset.getAllDataSet");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return supplier.getAllDataSet();
    } catch (Exception e) {
        logger.error("Error while getting all datasets", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

16 Source : MapCatalogueImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Map catalogue.
 *
 * @param token the token
 * @param user the user
 * @param operation the operation
 * @param path the path
 * @param featureName the feature name
 * @param mapName the map name
 *
 * @return the string
 */
public String mapCatalogue(String token, String user, String operation, String path, String featureName, String mapName) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.content.mapCatalogue");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return mapCatalogue(user, operation, path, featureName, mapName);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

16 Source : ContentServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Read sub object content.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 * @param subObjectId
 *            the sub object id
 *
 * @return the content
 */
public Content readSubObjectContent(String token, String user, String subObjectId) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.content.readSubObjectContent");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return readSubObjectContent(user, subObjectId);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

16 Source : ContentServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Read sub object content.
 *
 * @param token
 *            the token
 * @param user
 *            the user
 * @param subObjectName
 *            the sub object name
 * @param objId
 *            the object id
 *
 * @return the content
 */
public Content readSubObjectContent(String token, String user, String subObjectName, Integer objId) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.content.readSubObjectContent");
    try {
        validateTicket(token, user);
        this.setTenantByUserId(user);
        return readSubObjectContent(user, subObjectName, objId);
    } catch (SecurityException e) {
        logger.error("SecurityException", e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

16 Source : DefaultScrollableDataResult.java
with GNU Affero General Public License v3.0
from KnowageLabs

// public SourceBean getSourceBean() throws EMFInternalError
/**
 * Questo metodo permette di forzare l'aggiornamento dei dati sull'oggetto ScrollableDataResult
 *
 * @throws <B>EMFInternalError</B> - Se qualche errore si verifica
 */
public void refresh() throws EMFInternalError {
    TracerSingleton.log(Constants.NOME_MODULO, TracerSingleton.DEBUG, "DefaultScrollableDataResult::refresh: invocato");
    Monitor monitor = MonitorFactory.start("model.data-access.default-scrollable-data-result.refresh");
    try {
        _rs.close();
        DataResult dr = null;
        DefaultScrollableDataResult sdr = null;
        if ((_inputParameters == null) || (_inputParameters.size() == 0))
            dr = _sqlCommand.execute();
        else
            dr = _sqlCommand.execute(_inputParameters);
        sdr = (DefaultScrollableDataResult) dr.getDataObject();
        _rs = sdr._rs;
        _rsmd = _rs.getMetaData();
        _columnCount = _rsmd.getColumnCount();
        _resultSetColumnsNames = new String[_columnCount];
        _resultSetColumnsTypes = new int[_columnCount];
        String columnName = null;
        int columnType = -1;
        for (int i = 0; i < _columnCount; i++) {
            // workaround for mariadb
            // columnName = _rsmd.getColumnName(i + 1);
            columnName = _rsmd.getColumnLabel(i + 1);
            columnType = _rsmd.getColumnType(i + 1);
            _resultSetColumnsNames[i] = columnName;
            _resultSetColumnsTypes[i] = columnType;
        }
        // for (int i = 0; i < _columnCount; i++)
        setRowsNumber();
    }// try
     catch (SQLException sqle) {
        throw Utils.generateInternalError(sqle, "DefaultScrollableDataResult::refresh: ");
    } finally // catch (SQLException sqle)
    {
        monitor.stop();
    }
// finally
}

15 Source : VersionResource.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Delete the versions
 *
 * @param versionsToDelete
 *            its the serialization of a list with the ids of the version to
 *            remove. Example. "1 , 2, 4"
 * @return
 */
@POST
@Path("/delete/{versionsToDelete}")
public String deleteVersion(@PathParam("versionsToDelete") String versionsToDelete) {
    logger.debug("IN");
    Monitor totalTimeMonitor = MonitorFactory.start("WhatIfEngine/it.eng.spagobi.engines.whatif.api.VersionResource.deleteVersion.totalTime");
    getVersionBusiness().deleteVersions(versionsToDelete);
    logger.debug("OUT");
    WhatIfEngineInstance ei = getWhatIfEngineInstance();
    PivotModel model = ei.getPivotModel();
    String table = renderModel(model);
    logger.debug("OUT");
    totalTimeMonitor.stop();
    return table;
}

15 Source : PageResource.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * @param pageName
 */
private void openPage(String pageName) {
    SvgViewerEngineInstance engineInstance;
    String dispatchUrl = urls.get(pageName);
    try {
        Monitor getTemplatereplacedourceBeanMonitor = MonitorFactory.start("GeoEngine.openPage.getTemplatereplacedourceBean");
        // SourceBean savedTemplate = getIOManager().getTemplatereplacedourceBean();
        SourceBean savedTemplate = getTemplate();
        getTemplatereplacedourceBeanMonitor.stop();
        switch(pageName) {
            case "execute":
                Monitor getEngineEnvMonitor = MonitorFactory.start("GeoEngine.openPage.getEngineEnv");
                Map env = getEngineEnv();
                getEngineEnvMonitor.stop();
                engineInstance = SvgViewerEngine.createInstance(savedTemplate, env);
                // TODO put this not in session but in context
                Monitor setAttributeMonitor = MonitorFactory.start("GeoEngine.openPage.setAttribute");
                getIOManager().getHttpSession().setAttribute(EngineConstants.ENGINE_INSTANCE, engineInstance);
                setAttributeMonitor.stop();
                break;
            default:
                dispatchUrl = "/WEB-INF/jsp/error.jsp";
                break;
        }
        // To deploy into JBOSSEAP64 is needed a StandardWrapper, instead of RestEasy Wrapper
        /*
			 * HttpServletRequest request = ResteasyProviderFactory.getContextData(HttpServletRequest.clreplaced); HttpServletResponse response =
			 * ResteasyProviderFactory.getContextData(HttpServletResponse.clreplaced);
			 */
        request.getRequestDispatcher(dispatchUrl).forward(request, response);
    } catch (Exception e) {
        throw SpagoBIEngineServiceExceptionHandler.getInstance().getWrappedException("", getEngineInstance(), e);
    } finally {
        logger.debug("OUT");
    }
}

15 Source : ObjectsAccessVerifier.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Control if the current user can test new object into the functionality identified by its id.
 *
 * @param folderId The id of the lowFunctionality
 * @param profile  user profile
 * @return A boolean control value
 */
public static boolean canTest(Integer folderId, IEngUserProfile profile) {
    Monitor monitor = MonitorFactory.start("spagobi.core.ObjectAccessVerifier.canTest");
    logger.debug("IN");
    LowFunctionality folder = null;
    try {
        folder = DAOFactory.getLowFunctionalityDAO().loadLowFunctionalityByID(folderId, false);
    } catch (Exception e) {
        logger.error("Exception in loadLowFunctionalityByID", e);
        return false;
    } finally {
        monitor.stop();
        logger.debug("OUT");
    }
    return canTestInternal(folder, profile);
}

15 Source : ObjectsAccessVerifier.java
with GNU Affero General Public License v3.0
from KnowageLabs

public static boolean isAbleToExec(String state, IEngUserProfile profile) {
    Monitor monitor = MonitorFactory.start("spagobi.core.ObjectAccessVerifier.isAbleToExec");
    logger.debug("IN.state=" + state);
    if (state.equals("REL")) {
        logger.debug("OUT.return true");
        monitor.stop();
        return true;
    } else if (state.equals("DEV")) {
        try {
            if (profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_ADMIN) || profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_DEV)) {
                logger.debug("OUT.return true");
                return true;
            } else if (profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_USER) || profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_TEST)) {
                logger.debug("OUT.return false");
                return false;
            }
        } catch (EMFInternalError e) {
            logger.error(e);
        }
    } else if (state.equals("TEST")) {
        try {
            if (profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_ADMIN) || profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_TEST)) {
                logger.debug("OUT.return true");
                return true;
            } else if (profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_USER) || profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_DEV)) {
                logger.debug("OUT.return false");
                return false;
            }
        } catch (EMFInternalError e) {
            logger.error(e);
        }
    }
    logger.debug("OUT");
    monitor.stop();
    return false;
}

15 Source : ObjectsAccessVerifier.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Control if the current user can execute new object into the functionality identified by its id.
 *
 * @param folderId The id of the lowFunctionality
 * @param profile  user profile
 * @return A boolean control value
 */
public static boolean canExec(Integer folderId, IEngUserProfile profile) {
    Monitor monitor = MonitorFactory.start("spagobi.core.ObjectAccessVerifier.canExec");
    logger.debug("IN");
    LowFunctionality folder = null;
    try {
        folder = DAOFactory.getLowFunctionalityDAO().loadLowFunctionalityByID(folderId, false);
    } catch (Exception e) {
        logger.error("Exception in loadLowFunctionalityByID", e);
        return false;
    } finally {
        monitor.stop();
        logger.debug("OUT");
    }
    return canExecInternal(folder, profile);
}

15 Source : ObjectsAccessVerifier.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * returns the list of correct roles of the input profile for the execution of the doreplacedent with the specified input
 *
 * @param objectId the doreplacedent id
 * @param profile  the user profile
 * @return the list of correct roles of the input profile for the execution of the doreplacedent with the specified input
 * @throws EMFUserError
 * @throws EMFInternalError
 */
public static List getCorrectRolesForExecution(Integer objectId, IEngUserProfile profile) throws EMFInternalError, EMFUserError {
    Monitor monitor = MonitorFactory.start("spagobi.core.ObjectAccessVerifier.getCorrectRolesForExecution");
    logger.debug("IN");
    List correctRoles = null;
    if (profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_DEV) || profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_USER) || profile.isAbleToExecuteAction(SpagoBIConstants.DOreplacedENT_MANAGEMENT_ADMIN)) {
        logger.debug("User is able to execute action");
        correctRoles = DAOFactory.getBIObjectDAO().getCorrectRolesForExecution(objectId, profile);
    } else {
        logger.debug("User is NOT able to execute action");
        correctRoles = DAOFactory.getBIObjectDAO().getCorrectRolesForExecution(objectId);
    }
    logger.debug("OUT");
    monitor.stop();
    return correctRoles;
}

15 Source : CachedEvaluationStrategy.java
with GNU Affero General Public License v3.0
from KnowageLabs

@Override
protected IDataStore execute(List<AbstractSelectionField> projections, Filter filter, List<AbstractSelectionField> groups, List<Sorting> sortings, List<List<AbstractSelectionField>> summaryRowProjections, int offset, int fetchSize, int maxRowCount, Set<String> indexes) {
    Monitor totalCacheTiming = MonitorFactory.start("Knowage.DatasetManagementAPI.getDataStore:totalCache");
    IDataStore dataStore;
    try {
        dataStore = cache.get(profile, dataSet, projections, filter, groups, sortings, summaryRowProjections, offset, fetchSize, maxRowCount, indexes);
        if (dataSet.isRealtime())
            unsetNgsiConsumer();
        if (dataStore == null) {
            dataStore = manageDatasetNotInCache(projections, filter, groups, sortings, summaryRowProjections, offset, fetchSize, maxRowCount, indexes);
        } else {
            if (dataSet.isRealtime())
                subscribeNGSI();
        }
        dataStore.adjustMetadata(dataSet.getMetadata());
        dataSet.decode(dataStore);
    } catch (DataBaseException e) {
        throw new RuntimeException(e);
    } finally {
        totalCacheTiming.stop();
    }
    return dataStore;
}

15 Source : DataSourceServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

/**
 * Gets the data source.
 *
 * @param token
 *            String
 * @param user
 *            String
 * @param doreplacedentId
 *            String
 *
 * @return SpagoBiDataSource
 */
@Override
public SpagoBiDataSource getDataSource(String token, String user, String doreplacedentId) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.datasource.getDataSource");
    try {
        validateTicket(token, user);
        IEngUserProfile profile = this.setTenantByUserId(user);
        return supplier.getDataSource(doreplacedentId, (UserProfile) profile);
    } catch (Exception e) {
        logger.error("Error while getting datasource for doreplacedent with id " + doreplacedentId, e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

15 Source : DataSetServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

@Override
public SpagoBiDataSet getDataSet(String token, String user, String doreplacedentId) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.dataset.getDataSet");
    try {
        validateTicket(token, user);
        IEngUserProfile profile = this.setTenantByUserId(user);
        return supplier.getDataSet(doreplacedentId, (UserProfile) profile);
    } catch (Exception e) {
        logger.error("Error while getting dataset for doreplacedent with id " + doreplacedentId, e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

15 Source : DataSetServiceImpl.java
with GNU Affero General Public License v3.0
from KnowageLabs

@Override
public SpagoBiDataSet getDataSetByLabel(String token, String user, String label) {
    logger.debug("IN");
    Monitor monitor = MonitorFactory.start("spagobi.service.dataset.getDataSetByLabel");
    try {
        validateTicket(token, user);
        IEngUserProfile profile = this.setTenantByUserId(user);
        return supplier.getDataSetByLabel(label, profile);
    } catch (Exception e) {
        logger.error("Error while getting dataset with label " + label, e);
        return null;
    } finally {
        this.unsetTenant();
        monitor.stop();
        logger.debug("OUT");
    }
}

See More Examples