Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import io.netty.buffer.ByteBufAllocator;
import lombok.AllArgsConstructor;
import org.jetlinks.collector.command.GetEditorResourceCommand;
import org.jetlinks.collector.command.*;
import org.jetlinks.collector.metadata.MetadataResolver;
import org.jetlinks.core.annotation.command.CommandHandler;
import org.jetlinks.collector.command.GetChannelConfigMetadataCommand;
import org.jetlinks.collector.command.GetCollectorConfigMetadataCommand;
import org.jetlinks.collector.command.GetPointConfigMetadataCommand;
import org.jetlinks.core.command.CommandMetadataResolver;
import org.jetlinks.core.metadata.PropertyMetadata;
import org.jetlinks.supports.command.AnnotationCommandSupport;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ interface Headers {

HeaderKey<String> pointId = HeaderKey.of("pointId", null, String.class);
HeaderKey<String> reason = HeaderKey.of("reason", null, String.class);
HeaderKey<String> channelId = HeaderKey.of("channelId", null, String.class);
HeaderKey<String> collectorId = HeaderKey.of("collectorId", null, String.class);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import lombok.Getter;
import lombok.Setter;
import org.jetlinks.collector.address.PointAddress;
import org.jetlinks.core.codec.Codec;
import org.jetlinks.core.codec.layout.ByteLayout;
import org.jetlinks.core.metadata.DataType;

import java.util.List;
import java.util.Map;

@Getter
Expand All @@ -18,6 +18,11 @@ public class PointMetadata {
@Schema(title = "点位地址标识")
private PointAddress address;

@Schema(title = "访问方式")
private AccessMode[] accessModes = new AccessMode[]{
AccessMode.read, AccessMode.write, AccessMode.subscribe
};

/**
* 点位是否自动编解码,为true时,表示点位直接处理java类型,平台无需进行{@link Codec#encode(Object, ByteBuf)}.
*
Expand All @@ -26,6 +31,13 @@ public class PointMetadata {
@Schema(title = "是否自动编解码")
private boolean autoCodec;


/**
* 点位使用平台的解码时
*/
@Schema(title = "当前支持的平台解码")
private List<String> supportCodecs;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不用设置这个吧? 采集器应该不关心平台支持哪些编解码. 根据字节长度来由平台决定更合适? 看最新的org.jetlinks.core.codec.Codec.isByteLengthSupported


/**
* 当{@link PointMetadata#isAutoCodec()}为false时,此字段表示点位数据的字节长度,-1表示长度不确定.
*
Expand All @@ -46,4 +58,6 @@ public class PointMetadata {

@Schema(title = "自定义元数据信息")
private Map<String, Object> metadata;


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.jetlinks.collector.command;

import org.jetlinks.collector.AccessMode;
import org.jetlinks.core.command.AbstractCommand;
import reactor.core.publisher.Mono;

import java.util.List;

/**
* 获取支持的访问方式
*/
public class GetSupportAccessModesCommand extends AbstractCommand<Mono<List<AccessMode>>, GetSupportAccessModesCommand> {
}