Search in sources :

Example 1 with Container

use of org.openremote.model.Container in project openremote by openremote.

the class SNMPProtocol method doStart.

@Override
protected void doStart(Container container) throws Exception {
    String snmpBindHost = agent.getBindHost().orElseThrow(() -> {
        String msg = "No SNMP bind host provided for protocol: " + this;
        LOG.info(msg);
        return new IllegalArgumentException(msg);
    });
    Integer snmpBindPort = agent.getBindPort().orElse(162);
    SNMPAgent.SNMPVersion snmpVersion = agent.getSNMPVersion().orElse(SNMPAgent.SNMPVersion.V2c);
    String snmpUri = String.format("snmp:%s:%d?protocol=udp&type=TRAP&snmpVersion=%d", snmpBindHost, snmpBindPort, snmpVersion.getVersion());
    messageBrokerContext.addRoutes(new RouteBuilder() {

        @Override
        public void configure() {
            from(snmpUri).routeId(getProtocolName() + getAgent().getId()).process(exchange -> {
                SnmpMessage msg = exchange.getIn(SnmpMessage.class);
                LOG.fine(String.format("Message received: %s", msg));
                PDU pdu = msg.getSnmpMessage();
                AttributeRef wildCardAttributeRef;
                if ((wildCardAttributeRef = oidMap.get("*")) != null) {
                    ObjectNode wildCardValue = ValueUtil.createJsonObject();
                    pdu.getVariableBindings().forEach(variableBinding -> {
                        wildCardValue.put(variableBinding.getOid().format(), variableBinding.toValueString());
                    });
                    updateLinkedAttribute(new AttributeState(wildCardAttributeRef, wildCardValue));
                }
                pdu.getVariableBindings().forEach(variableBinding -> {
                    AttributeRef attributeRef = oidMap.get(variableBinding.getOid().format());
                    if (attributeRef != null) {
                        updateLinkedAttribute(new AttributeState(attributeRef, variableBinding.toValueString()));
                    }
                });
            });
        }
    });
    setConnectionStatus(ConnectionStatus.CONNECTED);
}
Also used : AttributeState(org.openremote.model.attribute.AttributeState) ConnectionStatus(org.openremote.model.asset.agent.ConnectionStatus) AttributeRef(org.openremote.model.attribute.AttributeRef) HashMap(java.util.HashMap) ValueUtil(org.openremote.model.util.ValueUtil) Logger(java.util.logging.Logger) PDU(org.snmp4j.PDU) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) AbstractProtocol(org.openremote.agent.protocol.AbstractProtocol) Container(org.openremote.model.Container) PROTOCOL(org.openremote.model.syslog.SyslogCategory.PROTOCOL) SnmpMessage(org.apache.camel.component.snmp.SnmpMessage) RouteBuilder(org.apache.camel.builder.RouteBuilder) Attribute(org.openremote.model.attribute.Attribute) AttributeEvent(org.openremote.model.attribute.AttributeEvent) Map(java.util.Map) SyslogCategory(org.openremote.model.syslog.SyslogCategory) PDU(org.snmp4j.PDU) AttributeState(org.openremote.model.attribute.AttributeState) RouteBuilder(org.apache.camel.builder.RouteBuilder) AttributeRef(org.openremote.model.attribute.AttributeRef) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) SnmpMessage(org.apache.camel.component.snmp.SnmpMessage)

Example 2 with Container

use of org.openremote.model.Container in project openremote by openremote.

the class AbstractProtocol method start.

@Override
public void start(Container container) throws Exception {
    timerService = container.getService(TimerService.class);
    executorService = container.getExecutorService();
    assetService = container.getService(ProtocolAssetService.class);
    predictedAssetService = container.getService(ProtocolPredictedAssetService.class);
    messageBrokerContext = container.getService(MessageBrokerService.class).getContext();
    withLock(getProtocolName() + "::start", () -> {
        try {
            messageBrokerContext.addRoutes(new RouteBuilder() {

                @Override
                public void configure() throws Exception {
                    from(ACTUATOR_TOPIC).routeId("Actuator-" + getProtocolName() + getAgent().getId()).process(exchange -> {
                        Protocol<?> protocolInstance = exchange.getIn().getHeader(ACTUATOR_TOPIC_TARGET_PROTOCOL, Protocol.class);
                        if (protocolInstance != AbstractProtocol.this) {
                            return;
                        }
                        AttributeEvent event = exchange.getIn().getBody(AttributeEvent.class);
                        Attribute<?> linkedAttribute = getLinkedAttributes().get(event.getAttributeRef());
                        if (linkedAttribute == null) {
                            LOG.info("Attempt to write to attribute that is not actually linked to this protocol '" + AbstractProtocol.this + "': " + linkedAttribute);
                            return;
                        }
                        processLinkedAttributeWrite(event);
                    });
                }
            });
            doStart(container);
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    });
    this.producerTemplate = container.getService(MessageBrokerService.class).getProducerTemplate();
}
Also used : Protocol(org.openremote.model.asset.agent.Protocol) ConnectionStatus(org.openremote.model.asset.agent.ConnectionStatus) AttributeRef(org.openremote.model.attribute.AttributeRef) HashMap(java.util.HashMap) AgentLink(org.openremote.model.asset.agent.AgentLink) HashSet(java.util.HashSet) Attribute(org.openremote.model.attribute.Attribute) AttributeEvent(org.openremote.model.attribute.AttributeEvent) Map(java.util.Map) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ProducerTemplate(org.apache.camel.ProducerTemplate) SyslogCategory(org.openremote.model.syslog.SyslogCategory) MessageBrokerService(org.openremote.container.message.MessageBrokerService) AttributeState(org.openremote.model.attribute.AttributeState) MetaItemType(org.openremote.model.value.MetaItemType) Pair(org.openremote.model.util.Pair) Set(java.util.Set) Logger(java.util.logging.Logger) Container(org.openremote.model.Container) PROTOCOL(org.openremote.model.syslog.SyslogCategory.PROTOCOL) TimeUnit(java.util.concurrent.TimeUnit) RouteBuilder(org.apache.camel.builder.RouteBuilder) TimerService(org.openremote.container.timer.TimerService) MessageBrokerContext(org.openremote.container.message.MessageBrokerContext) Agent(org.openremote.model.asset.agent.Agent) GlobalLock(org.openremote.container.concurrent.GlobalLock) ProtocolUtil.hasDynamicWriteValue(org.openremote.model.protocol.ProtocolUtil.hasDynamicWriteValue) ProtocolUtil(org.openremote.model.protocol.ProtocolUtil) GlobalLock.withLock(org.openremote.container.concurrent.GlobalLock.withLock) RouteBuilder(org.apache.camel.builder.RouteBuilder) Attribute(org.openremote.model.attribute.Attribute) Protocol(org.openremote.model.asset.agent.Protocol) TimerService(org.openremote.container.timer.TimerService) AttributeEvent(org.openremote.model.attribute.AttributeEvent)

Example 3 with Container

use of org.openremote.model.Container in project openremote by openremote.

the class ClientEventService method init.

@Override
public void init(Container container) throws Exception {
    timerService = container.getService(TimerService.class);
    messageBrokerService = container.getService(MessageBrokerService.class);
    identityService = container.getService(ManagerIdentityService.class);
    gatewayService = container.getService(GatewayService.class);
    eventSubscriptions = new EventSubscriptions(container.getService(TimerService.class));
    messageBrokerService.getContext().getTypeConverterRegistry().addTypeConverters(new EventTypeConverters());
    // TODO: Remove prefix and just use event type then use a subscription wrapper to pass subscription ID around
    messageBrokerService.getContext().addRoutes(new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            from("websocket://" + WEBSOCKET_EVENTS).routeId("FromClientWebsocketEvents").process(exchange -> exchange.getIn().setHeader(HEADER_CONNECTION_TYPE, HEADER_CONNECTION_TYPE_WEBSOCKET)).to(ClientEventService.CLIENT_EVENT_QUEUE).end();
            from(ClientEventService.CLIENT_EVENT_QUEUE).routeId("ClientEvents").choice().when(header(ConnectionConstants.SESSION_OPEN)).process(exchange -> {
                String sessionKey = getSessionKey(exchange);
                sessionKeyInfoMap.put(sessionKey, createSessionInfo(sessionKey, exchange));
                passToInterceptors(exchange);
            }).stop().when(or(header(ConnectionConstants.SESSION_CLOSE), header(ConnectionConstants.SESSION_CLOSE_ERROR))).process(exchange -> {
                String sessionKey = getSessionKey(exchange);
                sessionKeyInfoMap.remove(sessionKey);
                eventSubscriptions.cancelAll(sessionKey);
                passToInterceptors(exchange);
            }).stop().end().process(exchange -> {
                // Do basic formatting of exchange
                EventRequestResponseWrapper<?> requestResponse = null;
                if (exchange.getIn().getBody() instanceof EventRequestResponseWrapper) {
                    requestResponse = exchange.getIn().getBody(EventRequestResponseWrapper.class);
                } else if (exchange.getIn().getBody() instanceof String && exchange.getIn().getBody(String.class).startsWith(EventRequestResponseWrapper.MESSAGE_PREFIX)) {
                    requestResponse = exchange.getIn().getBody(EventRequestResponseWrapper.class);
                }
                if (requestResponse != null) {
                    SharedEvent event = requestResponse.getEvent();
                    exchange.getIn().setHeader(HEADER_REQUEST_RESPONSE_MESSAGE_ID, requestResponse.getMessageId());
                    exchange.getIn().setBody(event);
                }
                if (exchange.getIn().getBody() instanceof String) {
                    String bodyStr = exchange.getIn().getBody(String.class);
                    if (bodyStr.startsWith(EventSubscription.SUBSCRIBE_MESSAGE_PREFIX)) {
                        exchange.getIn().setBody(exchange.getIn().getBody(EventSubscription.class));
                    } else if (bodyStr.startsWith(CancelEventSubscription.MESSAGE_PREFIX)) {
                        exchange.getIn().setBody(exchange.getIn().getBody(CancelEventSubscription.class));
                    } else if (bodyStr.startsWith(SharedEvent.MESSAGE_PREFIX)) {
                        exchange.getIn().setBody(exchange.getIn().getBody(SharedEvent.class));
                    }
                }
                if (exchange.getIn().getBody() instanceof SharedEvent) {
                    SharedEvent event = exchange.getIn().getBody(SharedEvent.class);
                    // If there is no timestamp in event, set to system time
                    if (event.getTimestamp() <= 0) {
                        event.setTimestamp(timerService.getCurrentTimeMillis());
                    }
                }
            }).process(exchange -> passToInterceptors(exchange)).choice().when(body().isInstanceOf(EventSubscription.class)).process(exchange -> {
                String sessionKey = getSessionKey(exchange);
                EventSubscription<?> subscription = exchange.getIn().getBody(EventSubscription.class);
                AuthContext authContext = exchange.getIn().getHeader(Constants.AUTH_CONTEXT, AuthContext.class);
                boolean restrictedUser = identityService.getIdentityProvider().isRestrictedUser(authContext);
                boolean anonymousUser = authContext == null;
                String username = authContext == null ? "anonymous" : authContext.getUsername();
                String realm = exchange.getIn().getHeader(Constants.REALM_PARAM_NAME, String.class);
                if (authorizeEventSubscription(realm, authContext, subscription)) {
                    eventSubscriptions.createOrUpdate(sessionKey, restrictedUser, anonymousUser, subscription);
                    subscription.setSubscribed(true);
                    sendToSession(sessionKey, subscription);
                } else {
                    LOG.warning("Unauthorized subscription from '" + username + "' in realm '" + realm + "': " + subscription);
                    sendToSession(sessionKey, new UnauthorizedEventSubscription<>(subscription));
                }
            }).stop().when(body().isInstanceOf(CancelEventSubscription.class)).process(exchange -> {
                String sessionKey = getSessionKey(exchange);
                eventSubscriptions.cancel(sessionKey, exchange.getIn().getBody(CancelEventSubscription.class));
            }).stop().when(body().isInstanceOf(SharedEvent.class)).choice().when(// Inbound messages from clients
            header(HEADER_CONNECTION_TYPE).isNotNull()).to(ClientEventService.CLIENT_EVENT_TOPIC).stop().when(// Outbound message to clients
            header(HEADER_CONNECTION_TYPE).isNull()).split(method(eventSubscriptions, "splitForSubscribers")).process(exchange -> {
                String sessionKey = getSessionKey(exchange);
                sendToSession(sessionKey, exchange.getIn().getBody());
            }).stop().endChoice().otherwise().process(exchange -> LOG.info("Unsupported message body: " + exchange.getIn().getBody())).end();
        }
    });
    // Add pending internal subscriptions
    if (!pendingInternalSubscriptions.isEmpty()) {
        pendingInternalSubscriptions.forEach(subscription -> eventSubscriptions.createOrUpdate(INTERNAL_SESSION_KEY, false, false, subscription));
    }
    pendingInternalSubscriptions = null;
}
Also used : java.util(java.util) AuthContext(org.openremote.container.security.AuthContext) CloseReason(javax.websocket.CloseReason) Exchange(org.apache.camel.Exchange) Level(java.util.logging.Level) Builder.header(org.apache.camel.builder.Builder.header) ManagerWebService(org.openremote.manager.web.ManagerWebService) MessageBrokerService(org.openremote.container.message.MessageBrokerService) Session(javax.websocket.Session) ManagerIdentityService(org.openremote.manager.security.ManagerIdentityService) ContainerService(org.openremote.model.ContainerService) SESSION_TERMINATOR(org.openremote.container.web.ConnectionConstants.SESSION_TERMINATOR) Constants(org.openremote.model.Constants) CopyOnWriteArraySet(java.util.concurrent.CopyOnWriteArraySet) Logger(java.util.logging.Logger) Container(org.openremote.model.Container) Consumer(java.util.function.Consumer) SyslogEvent(org.openremote.model.syslog.SyslogEvent) MqttBrokerService(org.openremote.manager.mqtt.MqttBrokerService) RouteBuilder(org.apache.camel.builder.RouteBuilder) TimerService(org.openremote.container.timer.TimerService) org.openremote.model.event.shared(org.openremote.model.event.shared) PredicateBuilder.or(org.apache.camel.builder.PredicateBuilder.or) ConnectionConstants(org.openremote.container.web.ConnectionConstants) GatewayService(org.openremote.manager.gateway.GatewayService) RouteBuilder(org.apache.camel.builder.RouteBuilder) AuthContext(org.openremote.container.security.AuthContext) TimerService(org.openremote.container.timer.TimerService) GatewayService(org.openremote.manager.gateway.GatewayService) ManagerIdentityService(org.openremote.manager.security.ManagerIdentityService) MessageBrokerService(org.openremote.container.message.MessageBrokerService)

Example 4 with Container

use of org.openremote.model.Container in project openremote by openremote.

the class GatewayService method start.

@Override
public void start(Container container) throws Exception {
    if (!active) {
        return;
    }
    List<GatewayAsset> gateways = assetStorageService.findAll(new AssetQuery().types(GatewayAsset.class)).stream().map(asset -> (GatewayAsset) asset).collect(Collectors.toList());
    List<String> gatewayIds = gateways.stream().map(Asset::getId).collect(Collectors.toList());
    gateways = gateways.stream().filter(gateway -> Arrays.stream(gateway.getPath()).noneMatch(p -> !p.equals(gateway.getId()) && gatewayIds.contains(p))).collect(Collectors.toList());
    if (!gateways.isEmpty()) {
        LOG.info("Directly registered gateways found = " + gateways.size());
        gateways.forEach(gateway -> {
            // Check if client has been created
            boolean hasClientId = gateway.getClientId().isPresent();
            boolean hasClientSecret = gateway.getClientSecret().isPresent();
            if (!hasClientId || !hasClientSecret) {
                createUpdateGatewayServiceUser(gateway);
            }
            // Create connector
            GatewayConnector connector = new GatewayConnector(assetStorageService, assetProcessingService, executorService, gateway);
            gatewayConnectorMap.put(gateway.getId().toLowerCase(Locale.ROOT), connector);
            // Get IDs of all assets under this gateway
            List<Asset<?>> gatewayAssets = assetStorageService.findAll(new AssetQuery().parents(gateway.getId()).select(new AssetQuery.Select().excludeAttributes()).recursive(true));
            gatewayAssets.forEach(asset -> assetIdGatewayIdMap.put(asset.getId(), gateway.getId()));
        });
    }
}
Also used : AssetStorageService(org.openremote.manager.asset.AssetStorageService) Tenant(org.openremote.model.security.Tenant) IntStream(java.util.stream.IntStream) ManagerKeycloakIdentityProvider(org.openremote.manager.security.ManagerKeycloakIdentityProvider) java.util(java.util) GATEWAY(org.openremote.model.syslog.SyslogCategory.GATEWAY) AssetProcessingException(org.openremote.manager.asset.AssetProcessingException) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Exchange(org.apache.camel.Exchange) AssetProcessingService(org.openremote.manager.asset.AssetProcessingService) Level(java.util.logging.Level) Predicate(org.apache.camel.Predicate) RulesetStorageService(org.openremote.manager.rules.RulesetStorageService) RulesService(org.openremote.manager.rules.RulesService) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) SyslogCategory(org.openremote.model.syslog.SyslogCategory) TextUtil(org.openremote.model.util.TextUtil) PersistenceEvent(org.openremote.model.PersistenceEvent) MessageBrokerService(org.openremote.container.message.MessageBrokerService) User(org.openremote.model.security.User) Ruleset(org.openremote.model.rules.Ruleset) ManagerIdentityService(org.openremote.manager.security.ManagerIdentityService) Asset(org.openremote.model.asset.Asset) GatewayDisconnectEvent(org.openremote.model.gateway.GatewayDisconnectEvent) AssetQuery(org.openremote.model.query.AssetQuery) GatewayAsset(org.openremote.model.asset.impl.GatewayAsset) ContainerService(org.openremote.model.ContainerService) EntityManager(javax.persistence.EntityManager) Logger(java.util.logging.Logger) Collectors(java.util.stream.Collectors) Container(org.openremote.model.Container) Consumer(java.util.function.Consumer) ClientEventService(org.openremote.manager.event.ClientEventService) RouteBuilder(org.apache.camel.builder.RouteBuilder) PERSISTENCE_TOPIC(org.openremote.container.persistence.PersistenceService.PERSISTENCE_TOPIC) GatewayConnector.mapAssetId(org.openremote.manager.gateway.GatewayConnector.mapAssetId) org.openremote.model.attribute(org.openremote.model.attribute) AssetUpdateProcessor(org.openremote.manager.asset.AssetUpdateProcessor) PredicateBuilder.and(org.apache.camel.builder.PredicateBuilder.and) PredicateBuilder.or(org.apache.camel.builder.PredicateBuilder.or) PersistenceService.isPersistenceEventForEntityType(org.openremote.container.persistence.PersistenceService.isPersistenceEventForEntityType) ConnectionConstants(org.openremote.container.web.ConnectionConstants) SharedEvent(org.openremote.model.event.shared.SharedEvent) AssetQuery(org.openremote.model.query.AssetQuery) Asset(org.openremote.model.asset.Asset) GatewayAsset(org.openremote.model.asset.impl.GatewayAsset) GatewayAsset(org.openremote.model.asset.impl.GatewayAsset)

Example 5 with Container

use of org.openremote.model.Container in project openremote by openremote.

the class AgentService method startAgent.

protected void startAgent(Agent<?, ?, ?> agent) {
    withLock(getClass().getSimpleName() + "::startAgent", () -> {
        Protocol<?> protocol = null;
        try {
            protocol = agent.getProtocolInstance();
            protocolInstanceMap.put(agent.getId(), protocol);
            LOG.fine("Starting protocol instance: " + protocol);
            protocol.start(container);
            LOG.fine("Started protocol instance:" + protocol);
            LOG.finer("Linking attributes to protocol instance: " + protocol);
            // Get all assets that have attributes with agent link meta for this agent
            List<Asset<?>> assets = assetStorageService.findAll(new AssetQuery().attributes(new AttributePredicate().meta(new NameValuePredicate(AGENT_LINK, new StringPredicate(agent.getId()), false, new NameValuePredicate.Path("id")))));
            LOG.finer("Found '" + assets.size() + "' asset(s) with attributes linked to this protocol instance: " + protocol);
            assets.forEach(asset -> getGroupedAgentLinkAttributes(asset.getAttributes().stream(), assetAttribute -> assetAttribute.getMetaValue(AGENT_LINK).map(agentLink -> agentLink.getId().equals(agent.getId())).orElse(false)).forEach((agnt, attributes) -> linkAttributes(agnt, asset.getId(), attributes)));
        } catch (Exception e) {
            if (protocol != null) {
                try {
                    protocol.stop(container);
                } catch (Exception ignored) {
                }
            }
            protocolInstanceMap.remove(agent.getId());
            LOG.log(Level.SEVERE, "Failed to start protocol instance for agent: " + agent, e);
            sendAttributeEvent(new AttributeEvent(agent.getId(), Agent.STATUS.getName(), ConnectionStatus.ERROR));
        }
    });
}
Also used : Protocol(org.openremote.model.asset.agent.Protocol) AssetProcessingException(org.openremote.manager.asset.AssetProcessingException) AssetProcessingService(org.openremote.manager.asset.AssetProcessingService) ASSET_QUEUE(org.openremote.manager.asset.AssetProcessingService.ASSET_QUEUE) ProtocolInstanceDiscovery(org.openremote.model.protocol.ProtocolInstanceDiscovery) ACTUATOR_TOPIC(org.openremote.model.asset.agent.Protocol.ACTUATOR_TOPIC) AgentLink(org.openremote.model.asset.agent.AgentLink) Future(java.util.concurrent.Future) TextUtil(org.openremote.model.util.TextUtil) Attribute.getAddedOrModifiedAttributes(org.openremote.model.attribute.Attribute.getAddedOrModifiedAttributes) AssetTreeNode(org.openremote.model.asset.AssetTreeNode) Predicate(java.util.function.Predicate) ProtocolAssetDiscovery(org.openremote.model.protocol.ProtocolAssetDiscovery) ContainerService(org.openremote.model.ContainerService) AttributePredicate(org.openremote.model.query.filter.AttributePredicate) Logger(java.util.logging.Logger) Collectors(java.util.stream.Collectors) Container(org.openremote.model.Container) Stream(java.util.stream.Stream) StringPredicate(org.openremote.model.query.filter.StringPredicate) RouteBuilder(org.apache.camel.builder.RouteBuilder) PERSISTENCE_TOPIC(org.openremote.container.persistence.PersistenceService.PERSISTENCE_TOPIC) org.openremote.model.attribute(org.openremote.model.attribute) Agent(org.openremote.model.asset.agent.Agent) PathPredicate(org.openremote.model.query.filter.PathPredicate) GatewayService(org.openremote.manager.gateway.GatewayService) GlobalLock.withLock(org.openremote.container.concurrent.GlobalLock.withLock) AssetStorageService(org.openremote.manager.asset.AssetStorageService) GatewayService.isNotForGateway(org.openremote.manager.gateway.GatewayService.isNotForGateway) java.util(java.util) ConnectionStatus(org.openremote.model.asset.agent.ConnectionStatus) Level(java.util.logging.Level) GlobalLock.withLockReturning(org.openremote.container.concurrent.GlobalLock.withLockReturning) AGENT_LINK(org.openremote.model.value.MetaItemType.AGENT_LINK) Collectors.mapping(java.util.stream.Collectors.mapping) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) NameValuePredicate(org.openremote.model.query.filter.NameValuePredicate) ManagerWebService(org.openremote.manager.web.ManagerWebService) PersistenceEvent(org.openremote.model.PersistenceEvent) MessageBrokerService(org.openremote.container.message.MessageBrokerService) ManagerIdentityService(org.openremote.manager.security.ManagerIdentityService) Asset(org.openremote.model.asset.Asset) AssetQuery(org.openremote.model.query.AssetQuery) Pair(org.openremote.model.util.Pair) ProtocolAssetService(org.openremote.agent.protocol.ProtocolAssetService) EntityManager(javax.persistence.EntityManager) HEADER_SOURCE(org.openremote.model.attribute.AttributeEvent.HEADER_SOURCE) Consumer(java.util.function.Consumer) SENSOR_QUEUE(org.openremote.model.asset.agent.Protocol.SENSOR_QUEUE) ClientEventService(org.openremote.manager.event.ClientEventService) ProtocolAssetImport(org.openremote.model.protocol.ProtocolAssetImport) Collectors.toList(java.util.stream.Collectors.toList) TimerService(org.openremote.container.timer.TimerService) AssetUpdateProcessor(org.openremote.manager.asset.AssetUpdateProcessor) PersistenceService.isPersistenceEventForEntityType(org.openremote.container.persistence.PersistenceService.isPersistenceEventForEntityType) Source(org.openremote.model.attribute.AttributeEvent.Source) StringPredicate(org.openremote.model.query.filter.StringPredicate) AssetQuery(org.openremote.model.query.AssetQuery) Asset(org.openremote.model.asset.Asset) NameValuePredicate(org.openremote.model.query.filter.NameValuePredicate) AttributePredicate(org.openremote.model.query.filter.AttributePredicate) AssetProcessingException(org.openremote.manager.asset.AssetProcessingException)

Aggregations

Container (org.openremote.model.Container)11 Logger (java.util.logging.Logger)9 RouteBuilder (org.apache.camel.builder.RouteBuilder)6 MessageBrokerService (org.openremote.container.message.MessageBrokerService)5 ContainerService (org.openremote.model.ContainerService)5 java.util (java.util)4 ScheduledExecutorService (java.util.concurrent.ScheduledExecutorService)4 Collectors (java.util.stream.Collectors)4 TimerService (org.openremote.container.timer.TimerService)4 ManagerIdentityService (org.openremote.manager.security.ManagerIdentityService)4 Consumer (java.util.function.Consumer)3 Level (java.util.logging.Level)3 EntityManager (javax.persistence.EntityManager)3 GlobalLock.withLock (org.openremote.container.concurrent.GlobalLock.withLock)3 PERSISTENCE_TOPIC (org.openremote.container.persistence.PersistenceService.PERSISTENCE_TOPIC)3 PersistenceService.isPersistenceEventForEntityType (org.openremote.container.persistence.PersistenceService.isPersistenceEventForEntityType)3 MapAccess.getString (org.openremote.container.util.MapAccess.getString)3 AssetProcessingException (org.openremote.manager.asset.AssetProcessingException)3 AssetProcessingService (org.openremote.manager.asset.AssetProcessingService)3 AssetStorageService (org.openremote.manager.asset.AssetStorageService)3