Package org.openremote.manager.dashboard
Class DashboardStorageService
java.lang.Object
org.apache.camel.builder.BuilderSupport
org.apache.camel.builder.RouteBuilder
org.openremote.manager.dashboard.DashboardStorageService
- All Implemented Interfaces:
org.apache.camel.builder.ModelRoutesBuilder,org.apache.camel.CamelContextAware,org.apache.camel.Ordered,org.apache.camel.RoutesBuilder,org.apache.camel.spi.HasCamelContext,org.apache.camel.spi.ResourceAware,org.openremote.model.ContainerService
public class DashboardStorageService
extends org.apache.camel.builder.RouteBuilder
implements org.openremote.model.ContainerService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AssetStorageServiceprotected ManagerIdentityServiceprotected static final Loggerprotected org.openremote.container.persistence.PersistenceServiceprotected org.openremote.container.timer.TimerServiceFields inherited from class org.apache.camel.builder.RouteBuilder
logFields inherited from interface org.openremote.model.ContainerService
DEFAULT_PRIORITY, HIGH_PRIORITY, LOW_PRIORITY, MED_PRIORITYFields inherited from interface org.apache.camel.Ordered
HIGHEST, LOWEST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringBuilderappendSqlAssetConditionsFilter(StringBuilder sqlBuilder, org.openremote.model.query.DashboardQuery query, Map<String, Object> sqlParams, String userId) Builds SQL section for filtering dashboards by assets present in the widgets.protected StringBuilderappendSqlDashboardConditionsFilter(StringBuilder sqlBuilder, org.openremote.model.query.DashboardQuery query, Map<String, Object> sqlParams, String userId) Builds SQL section for filtering dashboards by dashboard conditions, such asDashboardAccess(PRIVATE, SHARED, PUBLIC), and applies the necessary data to the sqlBuilder and sqlParams parameters.protected StringBuilderappendSqlIdFilter(StringBuilder sqlBuilder, org.openremote.model.query.DashboardQuery query, Map<String, Object> sqlParams) Builds SQL section for filtering dashboards by ID, and applies the necessary data to the sqlBuilder and sqlParams parameters.protected StringBuilderappendSqlNamesFilter(StringBuilder sqlBuilder, org.openremote.model.query.DashboardQuery query, Map<String, Object> sqlParams) Builds SQL section for filtering dashboards by display name usingStringPredicate, and applies the necessary data to the sqlBuilder and sqlParams parameters.protected StringBuilderappendSqlUserIdsFilter(StringBuilder sqlBuilder, org.openremote.model.query.DashboardQuery query, Map<String, Object> sqlParams) voidorg.openremote.model.dashboard.DashboardcreateNew(org.openremote.model.dashboard.Dashboard dashboard) booleanvoidinit(org.openremote.model.Container container) protected org.openremote.model.dashboard.Dashboard[]Pulls dashboards from the database based on the query object.voidstart(org.openremote.model.Container container) voidstop(org.openremote.model.Container container) org.openremote.model.dashboard.DashboardMethods inherited from class org.apache.camel.builder.RouteBuilder
addLifecycleInterceptor, addRoutes, addRoutesToCamelContext, addTemplatedRoutesToCamelContext, bindToRegistry, bindToRegistry, checkInitialized, configuration, configureRest, configureRests, configureRoute, configureRouteConfiguration, configureRoutes, configureRouteTemplate, configureTemplatedRoute, customize, customize, dataFormat, errorHandler, errorHandler, expression, from, from, from, fromF, fromV, fromV, getBeans, getOrder, getResource, getRestCollection, getRestConfiguration, getRests, getRouteCollection, getRoutes, getRouteTemplateCollection, getTemplatedRouteCollection, initializeCamelContext, intercept, interceptFrom, interceptFrom, interceptSendToEndpoint, loadRoutesBuilder, loadRoutesBuilder, onCompletion, onException, onException, populateBeans, populateOrUpdateRoutes, populateRests, populateRoutes, populateRouteTemplates, populateTemplatedRoutes, populateTransformers, populateValidators, prepareModel, property, propertyInject, removeLifecycleInterceptor, rest, rest, restConfiguration, routeTemplate, setErrorHandlerFactory, setResource, setRestCollection, setRouteTemplateCollection, setTemplatedRouteCollection, templatedRoute, tokenizer, toString, transformer, updateRoutesToCamelContext, validatorMethods inherited from class org.apache.camel.builder.BuilderSupport
body, bodyAs, constant, constant, constant, createErrorHandlerBuilder, csimple, csimple, datasonnet, datasonnet, datasonnet, deadLetterChannel, deadLetterChannel, defaultErrorHandler, endpoint, endpoint, exceptionMessage, exchangeProperty, expression, getCamelContext, getContext, getErrorHandlerFactory, hasErrorHandlerFactory, header, java, java, joor, joor, jq, jq, jsonpath, jsonpath, jtaTransactionErrorHandler, jtaTransactionErrorHandler, jtaTransactionErrorHandler, method, method, method, method, noErrorHandler, regexReplaceAll, regexReplaceAll, setCamelContext, simple, simple, simpleF, simpleF, springTransactionErrorHandler, springTransactionErrorHandler, springTransactionErrorHandler, systemProperty, systemProperty, variable, xpath, xpath, xpath, xpathMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.openremote.model.ContainerService
getPriority
-
Field Details
-
LOG
-
identityService
-
persistenceService
protected org.openremote.container.persistence.PersistenceService persistenceService -
assetStorageService
-
timerService
protected org.openremote.container.timer.TimerService timerService
-
-
Constructor Details
-
DashboardStorageService
public DashboardStorageService()
-
-
Method Details
-
configure
- Specified by:
configurein classorg.apache.camel.builder.RouteBuilder- Throws:
Exception
-
init
- Specified by:
initin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
start
- Specified by:
startin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
stop
- Specified by:
stopin interfaceorg.openremote.model.ContainerService- Throws:
Exception
-
query
protected org.openremote.model.dashboard.Dashboard[] query(org.openremote.model.query.DashboardQuery dashboardQuery, String userId) Pulls dashboards from the database based on the query object. Useful to specifically filter and request dashboards.- Parameters:
dashboardQuery- seeDashboardQueryfor specification- Returns:
- List of dashboards present in the database
-
appendSqlIdFilter
protected StringBuilder appendSqlIdFilter(StringBuilder sqlBuilder, org.openremote.model.query.DashboardQuery query, Map<String, Object> sqlParams) Builds SQL section for filtering dashboards by ID, and applies the necessary data to the sqlBuilder and sqlParams parameters.- Returns:
StringBuilderused for building
-
appendSqlNamesFilter
protected StringBuilder appendSqlNamesFilter(StringBuilder sqlBuilder, org.openremote.model.query.DashboardQuery query, Map<String, Object> sqlParams) Builds SQL section for filtering dashboards by display name usingStringPredicate, and applies the necessary data to the sqlBuilder and sqlParams parameters.- Returns:
StringBuilderused for building
-
appendSqlUserIdsFilter
protected StringBuilder appendSqlUserIdsFilter(StringBuilder sqlBuilder, org.openremote.model.query.DashboardQuery query, Map<String, Object> sqlParams) -
appendSqlDashboardConditionsFilter
protected StringBuilder appendSqlDashboardConditionsFilter(StringBuilder sqlBuilder, org.openremote.model.query.DashboardQuery query, Map<String, Object> sqlParams, String userId) Builds SQL section for filtering dashboards by dashboard conditions, such asDashboardAccess(PRIVATE, SHARED, PUBLIC), and applies the necessary data to the sqlBuilder and sqlParams parameters.- Returns:
StringBuilderused for building
-
appendSqlAssetConditionsFilter
protected StringBuilder appendSqlAssetConditionsFilter(StringBuilder sqlBuilder, org.openremote.model.query.DashboardQuery query, Map<String, Object> sqlParams, String userId) Builds SQL section for filtering dashboards by assets present in the widgets. For example, to only query dashboards when the user has access to the assets used. UsingDashboardQuery.AssetAccess, it applies the necessary data to the sqlBuilder and sqlParams parameters.- Returns:
StringBuilderused for building
-
createNew
public org.openremote.model.dashboard.Dashboard createNew(org.openremote.model.dashboard.Dashboard dashboard) -
update
public org.openremote.model.dashboard.Dashboard update(org.openremote.model.dashboard.Dashboard dashboard, String realm, String userId) throws IllegalArgumentException - Throws:
IllegalArgumentException
-
delete
public boolean delete(String dashboardId, String realm, String userId) throws IllegalArgumentException - Throws:
IllegalArgumentException
-