package org.datavaultplatform.broker.services;

import org.datavaultplatform.common.metadata.*;

import java.util.Date;
import java.util.List;
import java.util.ArrayList;

/* Mock interface for an external metadata service such as a CRIS system */

public class ExternalMetadataService {

    List<Dataset> datasets = new ArrayList<>();
    
    public List<Dataset> getDatasets() { return datasets; }
    public Dataset getDataset(String id) { Dataset d = new Dataset(); d.setID(id); return d; }
}

@@ -94,31 +94,8 @@
 *;%0A%0A
-import java.util.Date;%0A
 impo
@@ -312,16 +312,342 @@
 );%0A    %0A
+    public ExternalMetadataService() %7B%0A        generateMockData();%0A    %7D%0A    %0A    private void generateMockData() %7B%0A        for (int i = 0; i %3C 10; i++) %7B%0A            Dataset d = new Dataset();%0A            d.setID(%22DATASET%22 + i);%0A            d.setName(%22Sample dataset %22 + i);%0A            datasets.add(d);%0A        %7D%0A    %7D%0A    %0A
     publ
@@ -698,16 +698,21 @@
 sets; %7D%0A
+    %0A
     publ
@@ -749,58 +749,160 @@
 d) %7B
- Dataset d = new Dataset(); d.s
+%0A        for (Dataset d : datasets) %7B%0A            if (d.g
 etID(
-id); return d;
+).equals(id)) %7B%0A                return d;%0A            %7D%0A        %7D%0A        return null;%0A   
  %7D%0A%7D

Add mock data for metadata API