Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/java/io/mapsmessaging/logging/ServerLogMessages.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,17 @@ public enum ServerLogMessages implements LogMessage {

// </editor-fold>

// <editor-fold desc="TAK protocol log messages">
TAK_EXTENSION_INITIALISED(LEVEL.INFO, SERVER_CATEGORY.PROTOCOL, "TAK extension initialised for {}"),
TAK_EXTENSION_CLOSED(LEVEL.INFO, SERVER_CATEGORY.PROTOCOL, "TAK extension closed for {}"),
TAK_EXTENSION_OUTBOUND_FAILED(LEVEL.WARN, SERVER_CATEGORY.PROTOCOL, "TAK outbound failed for destination {}"),
TAK_EXTENSION_DECODE_FAILED(LEVEL.WARN, SERVER_CATEGORY.PROTOCOL, "TAK decode failed for transport {}"),
TAK_EXTENSION_RECONNECT_ATTEMPT(LEVEL.INFO, SERVER_CATEGORY.NETWORK, "TAK reconnect attempt in {}ms for {}"),
TAK_EXTENSION_RECONNECT_SUCCESS(LEVEL.INFO, SERVER_CATEGORY.NETWORK, "TAK reconnect succeeded for {}"),
TAK_EXTENSION_RECONNECT_FAILED(LEVEL.WARN, SERVER_CATEGORY.NETWORK, "TAK reconnect failed for {}"),
TAK_MULTICAST_IO_FAILED(LEVEL.WARN, SERVER_CATEGORY.NETWORK, "TAK multicast IO failed for {}:{}"),
// </editor-fold>

// <editor-fold desc="Packet Security">
PACKET_SECURITY_VERIFICATION_FAILED(LEVEL.WARN, SERVER_CATEGORY.NETWORK, "Packet integrity verification failed: ip={}, algorithm={}, reason={}, packetLength={}, signatureSize={}"),
PACKET_SECURITY_NOT_INITIALISED(LEVEL.ERROR, SERVER_CATEGORY.NETWORK, "Packet integrity not initialised: algorithm={}"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package io.mapsmessaging.network.protocol.impl.extension;

import io.mapsmessaging.api.message.Message;
import io.mapsmessaging.network.io.Packet;
import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NonNull;
Expand Down Expand Up @@ -74,6 +75,10 @@ public String getSessionId() {

public abstract void registerLocalLink(@NonNull @NotNull String destination) throws IOException;

public boolean processPacket(@NonNull @NotNull Packet packet) throws IOException {
return false;
}


protected void inbound(@NonNull @NotNull String destinationName, @NonNull @NotNull Message message) throws IOException {
if (extensionProtocol == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public ProtocolInformationDTO getInformation() {

@Override
public boolean processPacket(@NonNull @NotNull Packet packet) throws IOException {
return false;
return extension.processPacket(packet);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
*
* Copyright [ 2020 - 2024 ] Matthew Buckton
* Copyright [ 2024 - 2026 ] MapsMessaging B.V.
*
* Licensed under the Apache License, Version 2.0 with the Commons Clause
* (the "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://commonsclause.com/
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package io.mapsmessaging.network.protocol.impl.tak;

import io.mapsmessaging.network.EndPointURL;
import io.mapsmessaging.network.io.EndPoint;
import io.mapsmessaging.network.io.EndPointConnectedCallback;
import io.mapsmessaging.network.io.EndPointConnectionFactory;
import io.mapsmessaging.network.io.EndPointServerStatus;
import io.mapsmessaging.network.io.impl.SelectorLoadManager;
import io.mapsmessaging.network.protocol.impl.extension.ExtensionEndPointConnectionFactory;

import java.io.IOException;
import java.util.List;

public class TakEndPointConnectionFactory implements EndPointConnectionFactory {

private final ExtensionEndPointConnectionFactory delegate = new ExtensionEndPointConnectionFactory();

@Override
public EndPoint connect(EndPointURL url, SelectorLoadManager selector, EndPointConnectedCallback connectedCallback,
EndPointServerStatus endPointServerStatus, List<String> jmxPath) throws IOException {
return delegate.connect(url, selector, connectedCallback, endPointServerStatus, jmxPath);
}

@Override
public String getName() {
return "tak";
}

@Override
public String getDescription() {
return "TAK extension endpoint factory";
}
}
Loading