Skip to content

Commit

Permalink
Merge pull request #1687 from GRIDAPPSD/releases/2022.12.0
Browse files Browse the repository at this point in the history
Release of version 2022.12.0
  • Loading branch information
tonya1 authored Jan 14, 2023
2 parents 239e304 + 6388b26 commit 2162c91
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
public interface FieldBusManager {

public Serializable handleRequest(String requestQueue, Serializable request);

public String getFieldModelMrid();

}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public class FieldBusManagerImpl implements FieldBusManager {

Client client;

List<Feeder> feederList = null;
Map<String, List<String>> messageBus_measIds_map = new HashMap<String, List<String>>();
Map<String, String> measId_messageBus_map = new HashMap<String, String>();

Expand Down Expand Up @@ -132,14 +131,6 @@ public Serializable handleRequest(String request_queue, Serializable request) {
if (request_queue.endsWith("context")) {

RequestFieldContext requestFieldContext = RequestFieldContext.parse(request.toString());
// TODO: This block will be used if FieldBusManager is initialized
// with multiple feeders
/*
* for(Feeder feeder : feederList){
* if(feeder.feeder_id.equals(requestFieldContext.modelId))
* responseFeeder = feeder; }
*/

if (requestFieldContext.areaId == null)
return topology.root.feeders;
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class PlatformStatus implements Serializable{
List<ServiceInfo> services;
List<AppInstance> appInstances;
List<ServiceInstance> serviceInstances;
String fieldModelMrid;


public PlatformStatus() {}
Expand Down Expand Up @@ -50,5 +51,9 @@ public List<ServiceInstance> getServiceInstances() {
public void setServiceInstances(List<ServiceInstance> serviceInstances) {
this.serviceInstances = serviceInstances;
}
public void setField(String fieldModelMrid) {
this.fieldModelMrid = fieldModelMrid;

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class RequestPlatformStatus implements Serializable {
boolean services = false;
boolean appInstances = false;
boolean serviceInstances = false;
boolean field = false;

public boolean isApplications() {
return applications;
Expand All @@ -37,15 +38,22 @@ public boolean isServiceInstances() {
public void setServiceInstances(boolean serviceInstances) {
this.serviceInstances = serviceInstances;
}
public boolean isField() {
return field;
}
public void setField(boolean field) {
this.field = field;
}

public static RequestPlatformStatus parse(String jsonString){
Gson gson = new Gson();
RequestPlatformStatus obj = gson.fromJson(jsonString, RequestPlatformStatus.class);
if(!obj.appInstances & !obj.services & !obj.applications & !obj.serviceInstances){
if(!obj.appInstances & !obj.services & !obj.applications & !obj.serviceInstances & !obj.field){
obj.applications = true;
obj.services = true;
obj.appInstances = true;
obj.serviceInstances = true;
obj.field = true;
}
return obj;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class ServiceInstance implements Serializable{
ServiceInfo servcie_info;
HashMap<String, Object> runtime_options;
String simulation_id;
Process process;
transient Process process;


public ServiceInstance(String instance_id, ServiceInfo servcie_info, HashMap<String, Object> runtime_options, String simulation_id, Process process){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import java.io.Serializable;
import java.util.ArrayList;

import com.google.gson.Gson;

public class SecondaryArea implements Serializable{

private static final long serialVersionUID = 1L;
Expand All @@ -13,4 +15,10 @@ public class SecondaryArea implements Serializable{
public ArrayList<String> connectivity_node;
public String message_bus_id;

@Override
public String toString() {
Gson gson = new Gson();
return gson.toJson(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import java.io.Serializable;
import java.util.ArrayList;

import com.google.gson.Gson;

public class SwitchArea implements Serializable {

private static final long serialVersionUID = 1L;
Expand All @@ -13,5 +15,11 @@ public class SwitchArea implements Serializable {
public ArrayList<SecondaryArea> secondary_areas;
public ArrayList<String> connectivity_node;
public String message_bus_id;

@Override
public String toString() {
Gson gson = new Gson();
return gson.toJson(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ else if(event.getDestination().contains(GridAppsDConstants.topic_requestPlatform
platformStatus.setAppInstances(appManager.listRunningApps());
if(request.isServiceInstances())
platformStatus.setServiceInstances(serviceManager.listRunningServices());
if(request.isField())
platformStatus.setField(fieldBusManager.getFieldModelMrid());
client.publish(event.getReplyDestination(), platformStatus);

} else if (event.getDestination().contains(GridAppsDConstants.topic_requestMyRoles)){
Expand Down

0 comments on commit 2162c91

Please sign in to comment.