aai-common support for v20
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / serialization / queryformats / FormatFactory.java
index 0ae0c5f..50aa8dd 100644 (file)
@@ -46,6 +46,14 @@ public class FormatFactory {
         this.injector = QueryParamInjector.getInstance();
     }
 
+    public FormatFactory(Loader loader, DBSerializer serializer, SchemaVersions schemaVersions, String basePath, String serverBase)
+        throws AAIException {
+        this.loader = loader;
+        this.serializer = serializer;
+        this.urlBuilder = new UrlBuilder(loader.getVersion(), serializer, serverBase, schemaVersions, basePath);
+        this.injector = QueryParamInjector.getInstance();
+    }
+
     public Formatter get(Format format) throws AAIException {
         return get(format, new MultivaluedHashMap<>());
     }
@@ -110,6 +118,10 @@ public class FormatFactory {
                 formatter =
                     new Formatter(inject(new LifecycleFormat.Builder(loader, serializer, urlBuilder), params).build(format));
                 break;
+            case tree:
+                formatter = new Formatter(
+                    inject(new TreeFormat.Builder(loader, serializer, urlBuilder), params).build());
+                break;
             default:
                 break;