Package io.openems.edge.evcs.ocpp.server
Class OcppServerImpl
- java.lang.Object
-
- io.openems.edge.common.component.AbstractOpenemsComponent
-
- io.openems.edge.evcs.ocpp.server.OcppServerImpl
-
- All Implemented Interfaces:
OpenemsComponent
,OcppServer
,org.osgi.service.event.EventHandler
public class OcppServerImpl extends AbstractOpenemsComponent implements OpenemsComponent, OcppServer, org.osgi.service.event.EventHandler
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.openems.edge.common.component.OpenemsComponent
OpenemsComponent.ChannelId
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.util.UUID,java.util.List<AbstractManagedOcppEvcsComponent>>
activeEvcsSessions
Currently connected sessions with their related evcs components.protected ComponentManager
componentManager
protected io.openems.edge.evcs.ocpp.server.Config
config
static java.lang.String
DEFAULT_IP
static int
DEFAULT_PORT
protected java.util.Map<java.lang.String,java.util.List<AbstractManagedOcppEvcsComponent>>
ocppEvcss
Currently configured ocpp evcss.protected java.util.Map<java.lang.String,java.util.UUID>
ocppSessions
Current sessions (Existing connections between server and evcs hardware).
-
Constructor Summary
Constructors Constructor Description OcppServerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addEvcs(Evcs evcs)
Adds each Evcs component to a list and checks whether there is a matching session.protected void
deactivate()
Handles @Deactivate of implementations.void
handleEvent(org.osgi.service.event.Event event)
protected void
logDebug(org.slf4j.Logger log, java.lang.String message)
Log a debug message including the Component ID.void
logInfo(org.slf4j.Logger log, java.lang.String message)
Log an info message including the Component ID.protected void
logWarn(org.slf4j.Logger log, java.lang.String message)
Log a warn message including the Component ID.protected void
removeEvcs(Evcs evcs)
Removes the given Evcs component from the list and checks whether there is a present session that should be removed.java.util.concurrent.CompletionStage<eu.chargetime.ocpp.model.Confirmation>
send(java.util.UUID session, eu.chargetime.ocpp.model.Request request)
Send message to EVCS.-
Methods inherited from class io.openems.edge.common.component.AbstractOpenemsComponent
_channel, activate, activate, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logError, modified, removeChannel
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.openems.edge.common.component.OpenemsComponent
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid
-
-
-
-
Field Detail
-
DEFAULT_IP
public static final java.lang.String DEFAULT_IP
- See Also:
- Constant Field Values
-
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
-
config
protected io.openems.edge.evcs.ocpp.server.Config config
-
activeEvcsSessions
protected final java.util.Map<java.util.UUID,java.util.List<AbstractManagedOcppEvcsComponent>> activeEvcsSessions
Currently connected sessions with their related evcs components.
-
ocppEvcss
protected java.util.Map<java.lang.String,java.util.List<AbstractManagedOcppEvcsComponent>> ocppEvcss
Currently configured ocpp evcss.
-
ocppSessions
protected java.util.Map<java.lang.String,java.util.UUID> ocppSessions
Current sessions (Existing connections between server and evcs hardware).
-
componentManager
protected ComponentManager componentManager
-
-
Method Detail
-
addEvcs
protected void addEvcs(Evcs evcs)
Adds each Evcs component to a list and checks whether there is a matching session.- Parameters:
evcs
- new Evcs
-
removeEvcs
protected void removeEvcs(Evcs evcs)
Removes the given Evcs component from the list and checks whether there is a present session that should be removed.- Parameters:
evcs
- Evcs that should be removed
-
deactivate
protected void deactivate()
Description copied from class:AbstractOpenemsComponent
Handles @Deactivate of implementations. Prints log output.- Overrides:
deactivate
in classAbstractOpenemsComponent
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event)
- Specified by:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
-
send
public java.util.concurrent.CompletionStage<eu.chargetime.ocpp.model.Confirmation> send(java.util.UUID session, eu.chargetime.ocpp.model.Request request) throws eu.chargetime.ocpp.OccurenceConstraintException, eu.chargetime.ocpp.UnsupportedFeatureException, eu.chargetime.ocpp.NotConnectedException
Description copied from interface:OcppServer
Send message to EVCS.Example:
send(session, request).whenComplete((confirmation, throwable) -> { this.logInfo(log, confirmation.toString()); });
- Specified by:
send
in interfaceOcppServer
- Parameters:
session
- Current sessionrequest
- Request that will be sent- Returns:
- When the request has been sent and a confirmation is received
- Throws:
eu.chargetime.ocpp.OccurenceConstraintException
- occurenceConstraintExceptioneu.chargetime.ocpp.UnsupportedFeatureException
- unsupportedFeatureExceptioneu.chargetime.ocpp.NotConnectedException
- notConnectedException
-
logInfo
public void logInfo(org.slf4j.Logger log, java.lang.String message)
Description copied from class:AbstractOpenemsComponent
Log an info message including the Component ID.- Overrides:
logInfo
in classAbstractOpenemsComponent
- Parameters:
log
- the Logger instancemessage
- the message
-
logWarn
protected void logWarn(org.slf4j.Logger log, java.lang.String message)
Description copied from class:AbstractOpenemsComponent
Log a warn message including the Component ID.- Overrides:
logWarn
in classAbstractOpenemsComponent
- Parameters:
log
- the Logger instancemessage
- the message
-
logDebug
protected void logDebug(org.slf4j.Logger log, java.lang.String message)
Description copied from class:AbstractOpenemsComponent
Log a debug message including the Component ID.- Overrides:
logDebug
in classAbstractOpenemsComponent
- Parameters:
log
- the Logger instancemessage
- the message
-
-