Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
feat: add version attribute to model (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
kayman-mk committed May 12, 2022
1 parent 562174f commit dd4d399
Showing 1 changed file with 22 additions and 10 deletions.
Expand Up @@ -3,53 +3,65 @@
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;

import java.util.Collection;
import java.util.HashSet;

/**
* Base class for the entire communication model, e.g. senders and receivers.
*
* The model is built by various services implementing the {@link com.hlag.tools.commvis.analyzer.service.IScannerService}
* interface.
*/
@Getter
@AllArgsConstructor
@RequiredArgsConstructor
@ToString
public class CommunicationModel {
/**
* Identifier for the current project, e.g. gitlab project id
*/
@SerializedName(value="project_id")

private String projectId;
private final String projectId;

/**
* A name for the project. Just for information.
*/

@SerializedName(value="project_name")
private String projectName;
private final String projectName;

@SerializedName(value="model_version")
private final String modelVersion;

/**
* All HTTP receiver endpoints.
*/
@SerializedName(value="http_consumers")
private Collection<ISenderReceiverCommunication> httpConsumers;
private Collection<ISenderReceiverCommunication> httpConsumers = new HashSet<>();

/**
* All HTTP producers.
*/
@SerializedName(value="http_producers")
private Collection<ISenderReceiverCommunication> httpProducers;
private Collection<ISenderReceiverCommunication> httpProducers = new HashSet<>();

/**
* All JMS receivers.
*/

@SerializedName(value="jms_consumers")
private Collection<ISenderReceiverCommunication> jmsConsumers;
private Collection<ISenderReceiverCommunication> jmsConsumers = new HashSet<>();

public void addHttpConsumer(ISenderReceiverCommunication consumer) {
httpConsumers.add(consumer);
}

public void addHttpProducer(ISenderReceiverCommunication producer) {
httpProducers.add(producer);
}

public void addJmsConsumer(ISenderReceiverCommunication consumer) {
jmsConsumers.add(consumer);
}

public void visit(AbstractCommunicationModelVisitor visitor) {
visitor.visit(this);
Expand Down

0 comments on commit dd4d399

Please sign in to comment.