// Path: ocpp-common/src/main/java/eu/chargetime/ocpp/model/SessionInformation.java
// public class SessionInformation {
// 
//   private String identifier;
//   private InetSocketAddress address;
//   private String SOAPtoURL;
//   private String proxiedAddress;
// 
//   public String getIdentifier() {
//     return identifier;
//   }
// 
//   public InetSocketAddress getAddress() {
//     return address;
//   }
// 
//   public String getSOAPtoURL() {
//     return SOAPtoURL;
//   }
// 
//   public String getProxiedAddress() {
//     return proxiedAddress;
//   }
// 
//   public static class Builder {
// 
//     private String identifier;
//     private InetSocketAddress address;
//     private String SOAPtoURL;
//     private String proxiedAddress;
// 
//     public Builder Identifier(String identifier) {
//       this.identifier = identifier;
//       return this;
//     }
// 
//     public Builder InternetAddress(InetSocketAddress address) {
//       this.address = address;
//       return this;
//     }
// 
//     public Builder ProxiedAddress(String proxiedAddress) {
//       this.proxiedAddress = proxiedAddress;
//       return this;
//     }
// 
//     public SessionInformation build() {
//       SessionInformation sessionInformation = new SessionInformation();
//       sessionInformation.identifier = this.identifier;
//       sessionInformation.address = this.address;
//       sessionInformation.SOAPtoURL = this.SOAPtoURL;
//       sessionInformation.proxiedAddress = this.proxiedAddress;
//       return sessionInformation;
//     }
// 
//     public Builder SOAPtoURL(String toUrl) {
//       this.SOAPtoURL = toUrl;
//       return this;
//     }
//   }
// }


import eu.chargetime.ocpp.model.SessionInformation;
import eu.chargetime.ocpp.wss.WssFactoryBuilder;
import java.io.IOException;
import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.java_websocket.WebSocket;
import org.java_websocket.drafts.Draft;
import org.java_websocket.exceptions.InvalidDataException;
import org.java_websocket.handshake.ClientHandshake;
import org.java_websocket.handshake.ServerHandshakeBuilder;
import org.java_websocket.server.WebSocketServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
                      }
                    });

            sockets.put(webSocket, receiver);

            String proxiedAddress = clientHandshake.getFieldValue(HTTP_HEADER_PROXIED_ADDRESS);

            logger.debug(
                "New web-socket connection opened from address: {} proxied for: {}",
                webSocket.getRemoteSocketAddress(),
                proxiedAddress);

            SessionInformation information =
                new SessionInformation.Builder()
                    .Identifier(clientHandshake.getResourceDescriptor())
                    .InternetAddress(webSocket.getRemoteSocketAddress())
                    .ProxiedAddress(proxiedAddress)
                    .build();

            handler.newSession(
                sessionFactory.createSession(new JSONCommunicator(receiver)), information);
          }

          @Override
          public ServerHandshakeBuilder onWebsocketHandshakeReceivedAsServer(
              WebSocket webSocket, Draft draft, ClientHandshake clientHandshake)
              throws InvalidDataException {
            SessionInformation information =
                new SessionInformation.Builder()
                    .Identifier(clientHandshake.getResourceDescriptor())
// Path: ocpp-common/src/main/java/eu/chargetime/ocpp/model/SessionInformation.java
// public class SessionInformation {
// 
//   private String identifier;
//   private InetSocketAddress address;
//   private String SOAPtoURL;
//   private String proxiedAddress;
// 
//   public String getIdentifier() {
//     return identifier;
//   }
// 
//   public InetSocketAddress getAddress() {
//     return address;
//   }
// 
//   public String getSOAPtoURL() {
//     return SOAPtoURL;
//   }
// 
//   public String getProxiedAddress() {
//     return proxiedAddress;
//   }
// 
//   public static class Builder {
// 
//     private String identifier;
//     private InetSocketAddress address;
//     private String SOAPtoURL;
//     private String proxiedAddress;
// 
//     public Builder Identifier(String identifier) {
//       this.identifier = identifier;
//       return this;
//     }
// 
//     public Builder InternetAddress(InetSocketAddress address) {
//       this.address = address;
//       return this;
//     }
// 
//     public Builder ProxiedAddress(String proxiedAddress) {
//       this.proxiedAddress = proxiedAddress;
//       return this;
//     }
// 
//     public SessionInformation build() {
//       SessionInformation sessionInformation = new SessionInformation();
//       sessionInformation.identifier = this.identifier;
//       sessionInformation.address = this.address;
//       sessionInformation.SOAPtoURL = this.SOAPtoURL;
//       sessionInformation.proxiedAddress = this.proxiedAddress;
//       return sessionInformation;
//     }
// 
//     public Builder SOAPtoURL(String toUrl) {
//       this.SOAPtoURL = toUrl;
//       return this;
//     }
//   }
// }


// Path: OCPP-J/src/main/java/eu/chargetime/ocpp/WebSocketListener.java
import eu.chargetime.ocpp.model.SessionInformation;
import eu.chargetime.ocpp.wss.WssFactoryBuilder;
import java.io.IOException;
import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.java_websocket.WebSocket;
import org.java_websocket.drafts.Draft;
import org.java_websocket.exceptions.InvalidDataException;
import org.java_websocket.handshake.ClientHandshake;
import org.java_websocket.handshake.ServerHandshakeBuilder;
import org.java_websocket.server.WebSocketServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

                      }
                    });

            sockets.put(webSocket, receiver);

            String proxiedAddress = clientHandshake.getFieldValue(HTTP_HEADER_PROXIED_ADDRESS);

            logger.debug(
                "New web-socket connection opened from address: {} proxied for: {}",
                webSocket.getRemoteSocketAddress(),
                proxiedAddress);

            SessionInformation information =
                new SessionInformation.Builder()
                    .Identifier(clientHandshake.getResourceDescriptor())
                    .InternetAddress(webSocket.getRemoteSocketAddress())
                    .ProxiedAddress(proxiedAddress)
                    .build();

            handler.newSession(
                sessionFactory.createSession(new JSONCommunicator(receiver)), information);
          }

          @Override
          public ServerHandshakeBuilder onWebsocketHandshakeReceivedAsServer(
              WebSocket webSocket, Draft draft, ClientHandshake clientHandshake)
              throws InvalidDataException {
            SessionInformation information =
                new SessionInformation.Builder()
                    .Identifier(clientHandshake.getResourceDescriptor())
                    .InternetAddress(webSocket.getRemoteSocketAddress())