public class OcppServerImpl extends AbstractOpenemsComponent implements OpenemsComponent, OcppServer, org.osgi.service.event.EventHandler
OpenemsComponent.ChannelId
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.util.UUID,java.util.List<AbstractOcppEvcsComponent>> |
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<AbstractOcppEvcsComponent>> |
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 and Description |
---|
OcppServerImpl() |
Modifier and Type | Method and 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.
|
_channel, activate, addChannel, addChannels, addChannels, alias, channels, getComponentContext, id, isEnabled, logError, modified, removeChannel
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
_channel, _getChannelAs, alias, channel, channel, channels, debugLog, getComponentContext, getModbusSlaveNatureTable, getState, getStateChannel, hasFaults, id, isEnabled, serviceFactoryPid, servicePid, updateConfigurationProperty, updateReferenceFilter
public static final java.lang.String DEFAULT_IP
public static final int DEFAULT_PORT
protected io.openems.edge.evcs.ocpp.server.Config config
protected final java.util.Map<java.util.UUID,java.util.List<AbstractOcppEvcsComponent>> activeEvcsSessions
protected java.util.Map<java.lang.String,java.util.List<AbstractOcppEvcsComponent>> ocppEvcss
protected java.util.Map<java.lang.String,java.util.UUID> ocppSessions
protected ComponentManager componentManager
protected void addEvcs(Evcs evcs)
evcs
- new Evcsprotected void removeEvcs(Evcs evcs)
evcs
- Evcs that should be removedprotected void deactivate()
AbstractOpenemsComponent
deactivate
in class AbstractOpenemsComponent
public void handleEvent(org.osgi.service.event.Event event)
handleEvent
in interface org.osgi.service.event.EventHandler
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
OcppServer
Example:
send(session, request).whenComplete((confirmation, throwable) -> { this.logInfo(log, confirmation.toString()); });
send
in interface OcppServer
session
- Current sessionrequest
- Request that will be senteu.chargetime.ocpp.OccurenceConstraintException
- occurenceConstraintExceptioneu.chargetime.ocpp.UnsupportedFeatureException
- unsupportedFeatureExceptioneu.chargetime.ocpp.NotConnectedException
- notConnectedExceptionpublic void logInfo(org.slf4j.Logger log, java.lang.String message)
AbstractOpenemsComponent
logInfo
in class AbstractOpenemsComponent
log
- the Logger instancemessage
- the messageprotected void logWarn(org.slf4j.Logger log, java.lang.String message)
AbstractOpenemsComponent
logWarn
in class AbstractOpenemsComponent
log
- the Logger instancemessage
- the messageprotected void logDebug(org.slf4j.Logger log, java.lang.String message)
AbstractOpenemsComponent
logDebug
in class AbstractOpenemsComponent
log
- the Logger instancemessage
- the message