Skip to content
Merged
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
19 changes: 5 additions & 14 deletions cloud-util/src/main/java/io/ballerina/c2c/util/C2CVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;

/**
* Visitor for validation related to code to cloud.
Expand All @@ -77,6 +78,9 @@
@Data
public class C2CVisitor extends NodeVisitor {

private static final Set<String> C2C_SUPPORTED_LISTENERS = Set.of("http", "grpc", "graphql", "tcp", "udp",
"websocket", "websub", "websubhub", "ai");

private final List<ServiceInfo> services = new ArrayList<>();
private final Map<String, Node> moduleLevelVariables;
private final SemanticModel semanticModel;
Expand Down Expand Up @@ -454,20 +458,7 @@ private boolean isC2CNativelySupportedListener(TypeSymbol typeSymbol) {
return false;
}
String moduleName = module.get().getName().get();
switch (moduleName) {
case "http":
case "grpc":
case "graphql":
case "tcp":
case "udp":
case "websocket":
case "websub":
case "websubhub":
//TODO add other stdlib
return true;
default:
return false;
}
return C2C_SUPPORTED_LISTENERS.contains(moduleName);
}
return false;
}
Expand Down