-
Notifications
You must be signed in to change notification settings - Fork 413
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plc4j/opcua): Chunking and encryption of request/response calls.
Update of protocol logic to reflect chunked payloads. Threading updates within driver itself should allow us to have better control over how results are being processed.. and make error handling more consistent. Signed-off-by: Łukasz Dywicki <[email protected]>
- Loading branch information
Showing
41 changed files
with
3,755 additions
and
2,629 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
plc4j/drivers/opcua/src/main/java/org/apache/plc4x/java/opcua/config/Limits.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (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 | ||
* | ||
* 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 org.apache.plc4x.java.opcua.config; | ||
|
||
import org.apache.plc4x.java.spi.configuration.Configuration; | ||
import org.apache.plc4x.java.spi.configuration.annotations.ConfigurationParameter; | ||
|
||
public class Limits implements Configuration { | ||
|
||
private static final int DEFAULT_RECEIVE_BUFFER_SIZE = 65535; | ||
private static final int DEFAULT_SEND_BUFFER_SIZE = 65535; | ||
private static final int DEFAULT_MAX_MESSAGE_SIZE = 2097152; | ||
private static final int DEFAULT_MAX_CHUNK_COUNT = 64; | ||
|
||
@ConfigurationParameter("receiveBufferSize") | ||
private int receiveBufferSize; | ||
@ConfigurationParameter("sendBufferSize") | ||
private int sendBufferSize; | ||
@ConfigurationParameter("maxMessageSize") | ||
private int maxMessageSize; | ||
@ConfigurationParameter("maxChunkCount") | ||
private int maxChunkCount; | ||
|
||
public Limits() { | ||
this(DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_MAX_MESSAGE_SIZE, DEFAULT_MAX_CHUNK_COUNT); | ||
} | ||
|
||
public Limits(int receiveBufferSize, int sendBufferSize, int maxMessageSize, int maxChunkCount) { | ||
this.receiveBufferSize = receiveBufferSize; | ||
this.sendBufferSize = sendBufferSize; | ||
this.maxMessageSize = maxMessageSize; | ||
this.maxChunkCount = maxChunkCount; | ||
} | ||
|
||
public int getReceiveBufferSize() { | ||
return receiveBufferSize; | ||
} | ||
|
||
public int getSendBufferSize() { | ||
return sendBufferSize; | ||
} | ||
|
||
public int getMaxMessageSize() { | ||
return maxMessageSize; | ||
} | ||
|
||
public int getMaxChunkCount() { | ||
return maxChunkCount; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Limits{" + | ||
" receiveBufferSize=" + receiveBufferSize + | ||
", sendBufferSize=" + sendBufferSize + | ||
", maxMessageSize=" + maxMessageSize + | ||
", maxChunkCount=" + maxChunkCount + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.