Package io.openems.edge.evcs.ocpp.server
Class EvcsOcppServer
java.lang.Object
io.openems.edge.common.component.AbstractOpenemsComponent
io.openems.edge.evcs.ocpp.server.EvcsOcppServer
- All Implemented Interfaces:
OpenemsComponent
,OcppServer
,org.osgi.service.event.EventHandler
public class EvcsOcppServer
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
Modifier and TypeFieldDescriptionprotected final Map
<UUID, List<AbstractManagedOcppEvcsComponent>> Currently connected sessions with their related evcs components.protected ComponentManager
protected io.openems.edge.evcs.ocpp.server.Config
static final String
static final int
protected Map
<String, List<AbstractManagedOcppEvcsComponent>> Currently configured ocpp evcss.Current sessions (Existing connections between server and evcs hardware). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Adds each Evcs component to a list and checks whether there is a matching session.protected void
Handles @Deactivate of implementations.void
handleEvent
(org.osgi.service.event.Event event) protected void
Log a debug message including the Component ID.void
Log an info message including the Component ID.protected void
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.CompletionStage
<eu.chargetime.ocpp.model.Confirmation> 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 Details
-
DEFAULT_IP
- See Also:
-
DEFAULT_PORT
public static final int DEFAULT_PORT- See Also:
-
activeEvcsSessions
Currently connected sessions with their related evcs components. -
componentManager
-
config
protected io.openems.edge.evcs.ocpp.server.Config config -
ocppEvcss
Currently configured ocpp evcss. -
ocppSessions
Current sessions (Existing connections between server and evcs hardware).
-
-
Constructor Details
-
EvcsOcppServer
public EvcsOcppServer()
-
-
Method Details
-
addEvcs
Adds each Evcs component to a list and checks whether there is a matching session.- Parameters:
evcs
- new Evcs
-
removeEvcs
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 CompletionStage<eu.chargetime.ocpp.model.Confirmation> send(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
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
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
Description copied from class:AbstractOpenemsComponent
Log a debug message including the Component ID.- Overrides:
logDebug
in classAbstractOpenemsComponent
- Parameters:
log
- the Logger instancemessage
- the message
-