Commit 86d8ef34 authored by Matt Wise's avatar Matt Wise
Browse files

New Dataset API

commit c958f6eb 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Thu Dec 03 2020 09:52:23 GMT-0600 (Central Standard Time) 

    update regex


commit d17de164 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Wed Dec 02 2020 17:06:12 GMT-0600 (Central Standard Time) 

    Merge remote-tracking branch 'origin/dev' into dataset-api


commit 08e183f6 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Wed Dec 02 2020 13:25:32 GMT-0600 (Central Standard Time) 

    update sample routes


commit f4d5e9a2 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Wed Dec 02 2020 11:03:06 GMT-0600 (Central Standard Time) 

    fix schema name


commit 20bc92ec 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Tue Dec 01 2020 14:13:19 GMT-0600 (Central Standard Time) 

    code cleanup


commit f3e345e6 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Tue Dec 01 2020 10:41:04 GMT-0600 (Central Standard Time) 

    Add copyright notices


commit 5918f954 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Mon Nov 30 2020 11:49:21 GMT-0600 (Central Standard Time) 

    Add DmsClientFactory to support calling Dms Services


commit 67cb2f3e 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Mon Nov 30 2020 10:38:24 GMT-0600 (Central Standard Time) 

    dms service spi + unit tests


commit ad7ab92c 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Tue Nov 24 2020 15:56:25 GMT-0600 (Central Standard Time) 

    move namespace/service from dataset-registry to dataset


commit 486c8029 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Tue Nov 24 2020 15:33:48 GMT-0600 (Central Standard Time) 

    work on DMS routes and services


commit f57a05f2 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Tue Nov 24 2020 09:14:02 GMT-0600 (Central Standard Time) 

    work on new api support for DMS


commit 020f725f 
Author: Matt Wise <wsmatth@amazon.com> 
Date: Mon Nov 23 2020 14:39:34 GMT-0600 (Central Standard Time) 

    refactor to prepare for new dataset api.  Add create/get routes
parent 00105922
......@@ -8,15 +8,15 @@ cli:
project: Dataset Registry
analyze:
modules:
- name: os-dataset-registry
- name: os-dataset
type: mvn
target: pom.xml
path: .
- name: dataset-registry-core
- name: dataset-core
type: mvn
target: dataset-registry-core/pom.xml
target: dataset-core/pom.xml
path: .
- name: dataset-registry-aws
- name: dataset-aws
type: mvn
target: provider/dataset-registry-aws/pom.xml
target: provider/dataset-aws/pom.xml
path: .
variables:
AWS_BUILD_SUBDIR: provider/dataset-registry-aws/build-aws
AWS_TEST_SUBDIR: testing/dataset-registry-test-aws
AWS_SERVICE: dataset-registry
AWS_BUILD_SUBDIR: provider/dataset-aws/build-aws
AWS_TEST_SUBDIR: testing/dataset-test-aws
AWS_SERVICE: dataset
AWS_ENVIRONMENT: dev
AWS_SKIP_TESTS: 'true'
......
......@@ -3,7 +3,7 @@ The Dataset Registry Service is a Maven multi-module project with each cloud imp
### Other platforms
1. Navigate to the module of the cloud of interest, for example, ```dataset-registry-aws```. Configure ```application.properties``` and optionally ```logback-spring.xml```. Intead of changing these files in the source, you can also provide external files at run time.
1. Navigate to the module of the cloud of interest, for example, ```dataset-aws```. Configure ```application.properties``` and optionally ```logback-spring.xml```. Intead of changing these files in the source, you can also provide external files at run time.
2. Navigate to the root of the dataset registry project, build and run unit tests in command line:
```bash
......@@ -34,21 +34,21 @@ variables or user environment variables. User values will take precedence if bot
Note that these values can be found in the IAM stack's export values in the AWS console. To
deploy resources to the AWS console, see the deployment section below.
5. Run dataset-registry service in command line:
1. Run dataset service in command line:
```bash
# Running AWS:
java -jar provider\dataset-registry-aws\target\dataset-registry-aws-0.0.1-SNAPSHOT-spring-boot.jar
java -jar provider\dataset-aws\target\dataset-aws-0.0.1-SNAPSHOT-spring-boot.jar
```
6. Access the service:
2. Access the service:
The port and path for the service endpoint can be configured in ```application.properties``` in the provider folder as following. If not specified, then the web container (ex. Tomcat) default is used:
```bash
server.servlet.contextPath=/api/dataset-registry/v1/
server.servlet.contextPath=/api/dataset/v1/
server.port=8080
```
7. Build and test in IntelliJ:
3. Build and test in IntelliJ:
1. Import the maven project from the root of this project.
2. Create a ```JAR Application``` in ```Run/Debug Configurations``` with the ```Path to JAR``` set to the target jar file.
3. To run unit tests, creat a ```JUnit``` configuration in ```Run/Debug Configurations```, specify, for example:
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2017-2019, Schlumberger
Copyright © 2020 Amazon Web Services
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
......@@ -19,14 +20,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.opengroup.osdu</groupId>
<artifactId>dataset-registry-core</artifactId>
<artifactId>dataset-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<description>Core project for the Dataset Registry service</description>
<packaging>jar</packaging>
<parent>
<groupId>org.opengroup.osdu</groupId>
<artifactId>os-dataset-registry</artifactId>
<artifactId>os-dataset</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
......@@ -194,7 +195,7 @@
<configuration>
<classifier>spring-boot</classifier>
<mainClass>
org.opengroup.osdu.datasetregistry.DatasetRegistryApplication
org.opengroup.osdu.dataset.DatasetApplication
</mainClass>
</configuration>
</execution>
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.datasetregistry;
package org.opengroup.osdu.dataset;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......@@ -23,13 +23,13 @@ import javax.annotation.PostConstruct;
@SpringBootApplication
@ComponentScan({"org.opengroup.osdu"})
public class DatasetRegistryApplication {
public class DatasetApplication {
@PostConstruct
void finalizeConstruction() {
}
public static void main(String[] args) {
SpringApplication.run(DatasetRegistryApplication.class, args);
SpringApplication.run(DatasetApplication.class, args);
}
}
\ No newline at end of file
// Copyright © 2020 Amazon Web Services
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.dataset.api;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.dataset.model.request.DeliveryRole;
import org.opengroup.osdu.dataset.model.request.GetDatasetRegistryRequest;
import org.opengroup.osdu.dataset.model.response.GetDatasetStorageInstructionsResponse;
import org.opengroup.osdu.dataset.service.DatasetDmsService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.annotation.RequestScope;
@RestController
@RequestMapping("/")
@RequestScope
@Validated
public class DatasetDmsApi {
@Inject
private DpsHeaders headers;
@Inject
private DatasetDmsService datasetDmsService;
@GetMapping("/getStorageInstructions")
@PreAuthorize("@authorizationFilter.hasRole('" + DeliveryRole.VIEWER + "')")
public ResponseEntity<GetDatasetStorageInstructionsResponse> getStorageInstructions(
@RequestParam(value = "resourceType") String resourceType) {
GetDatasetStorageInstructionsResponse response = this.datasetDmsService.getStorageInstructions(resourceType);
return new ResponseEntity<GetDatasetStorageInstructionsResponse>(response, HttpStatus.OK);
}
@GetMapping("/getRetrievalInstructions")
@PreAuthorize("@authorizationFilter.hasRole('" + DeliveryRole.VIEWER + "')")
public ResponseEntity<Object> getRetrievalInstructions(
@RequestParam(value = "id") String datasetRegistryId) {
List<String> datasetRegistryIds = new ArrayList<>();
datasetRegistryIds.add(datasetRegistryId);
Object response = this.datasetDmsService.getDatasetRetrievalInstructions(datasetRegistryIds);
return new ResponseEntity<Object>(response, HttpStatus.OK);
}
@PostMapping("/getRetrievalInstructions")
@PreAuthorize("@authorizationFilter.hasRole('" + DeliveryRole.VIEWER + "')")
public ResponseEntity<Object> getRetrievalInstructions(
@RequestBody @Valid @NotNull GetDatasetRegistryRequest request) {
Object response = this.datasetDmsService.getDatasetRetrievalInstructions(request.datasetRegistryIds);
return new ResponseEntity<Object>(response, HttpStatus.OK);
}
}
......@@ -12,7 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.datasetregistry.api;
package org.opengroup.osdu.dataset.api;
import java.util.ArrayList;
import java.util.List;
import javax.inject.Inject;
import javax.validation.Valid;
......@@ -20,22 +23,26 @@ import javax.validation.constraints.NotNull;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.model.storage.StorageRole;
import org.opengroup.osdu.datasetregistry.model.CreateDatasetRegistryRequest;
import org.opengroup.osdu.datasetregistry.response.CreateUpdateDatasetRegistryResponse;
import org.opengroup.osdu.datasetregistry.service.DatasetRegistryService;
import org.opengroup.osdu.dataset.model.request.CreateDatasetRegistryRequest;
import org.opengroup.osdu.dataset.model.request.GetDatasetRegistryRequest;
import org.opengroup.osdu.dataset.model.response.GetCreateUpdateDatasetRegistryResponse;
import org.opengroup.osdu.dataset.service.DatasetRegistryService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.annotation.RequestScope;
@RestController
@RequestMapping("registry")
@RequestMapping("/")
@RequestScope
@Validated
public class DatasetRegistryApi {
......@@ -46,12 +53,32 @@ public class DatasetRegistryApi {
@Inject
private DatasetRegistryService dataRegistryService;
@PutMapping()
@PutMapping("/registerDataset")
@PreAuthorize("@authorizationFilter.hasRole('" + StorageRole.CREATOR + "', '" + StorageRole.ADMIN + "')")
public ResponseEntity<CreateUpdateDatasetRegistryResponse> createOrUpdateDatasetRegistry(
public ResponseEntity<GetCreateUpdateDatasetRegistryResponse> createOrUpdateDatasetRegistry(
@RequestBody @Valid @NotNull CreateDatasetRegistryRequest request) {
CreateUpdateDatasetRegistryResponse response = this.dataRegistryService.createOrUpdateDatasetRegistry(request.datasetRegistries);
return new ResponseEntity<CreateUpdateDatasetRegistryResponse>(response, HttpStatus.CREATED);
GetCreateUpdateDatasetRegistryResponse response = this.dataRegistryService.createOrUpdateDatasetRegistry(request.datasetRegistries);
return new ResponseEntity<GetCreateUpdateDatasetRegistryResponse>(response, HttpStatus.CREATED);
}
@GetMapping("/getDatasetRegistry")
@PreAuthorize("@authorizationFilter.hasRole('" + StorageRole.CREATOR + "', '" + StorageRole.ADMIN + "', '" + StorageRole.VIEWER + "')")
public ResponseEntity<GetCreateUpdateDatasetRegistryResponse> getDatasetRegistry(
@RequestParam(value = "id") String datasetRegistryId) {
List<String> datasetRegistryIds = new ArrayList<>();
datasetRegistryIds.add(datasetRegistryId);
GetCreateUpdateDatasetRegistryResponse response = this.dataRegistryService.getDatasetRegistries(datasetRegistryIds);
return new ResponseEntity<GetCreateUpdateDatasetRegistryResponse>(response, HttpStatus.OK);
}
@PostMapping("/getDatasetRegistry")
@PreAuthorize("@authorizationFilter.hasRole('" + StorageRole.CREATOR + "', '" + StorageRole.ADMIN + "', '" + StorageRole.VIEWER + "')")
public ResponseEntity<GetCreateUpdateDatasetRegistryResponse> getDatasetRegistry(
@RequestBody @Valid @NotNull GetDatasetRegistryRequest request) {
GetCreateUpdateDatasetRegistryResponse response = this.dataRegistryService.getDatasetRegistries(request.datasetRegistryIds);
return new ResponseEntity<GetCreateUpdateDatasetRegistryResponse>(response, HttpStatus.OK);
}
}
\ No newline at end of file
// Copyright © 2020 Amazon Web Services
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.dataset.di;
import org.opengroup.osdu.dataset.dms.DmsAPIConfig;
import org.opengroup.osdu.dataset.dms.DmsFactory;
import org.opengroup.osdu.dataset.dms.IDmsFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.stereotype.Component;
@Component
public class DmsClientFactory extends AbstractFactoryBean<IDmsFactory> {
@Value("${DMS_API_BASE}")
private String DMS_API_BASE;
@Override
public Class<?> getObjectType() {
return IDmsFactory.class;
}
@Override
protected IDmsFactory createInstance() throws Exception {
return new DmsFactory(DmsAPIConfig
.builder()
.rootUrl(DMS_API_BASE)
.build());
}
}
......@@ -13,7 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.datasetregistry.di;
package org.opengroup.osdu.dataset.di;
import org.opengroup.osdu.core.common.entitlements.EntitlementsAPIConfig;
import org.opengroup.osdu.core.common.entitlements.EntitlementsFactory;
......
......@@ -13,14 +13,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.datasetregistry.di;
package org.opengroup.osdu.dataset.di;
import org.opengroup.osdu.core.common.legal.ILegalFactory;
import org.opengroup.osdu.core.common.legal.LegalAPIConfig;
import org.opengroup.osdu.core.common.legal.LegalFactory;
import org.opengroup.osdu.datasetregistry.storage.IStorageFactory;
import org.opengroup.osdu.datasetregistry.storage.StorageAPIConfig;
import org.opengroup.osdu.datasetregistry.storage.StorageFactory;
import org.opengroup.osdu.dataset.storage.IStorageFactory;
import org.opengroup.osdu.dataset.storage.StorageAPIConfig;
import org.opengroup.osdu.dataset.storage.StorageFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.AbstractFactoryBean;
import org.springframework.stereotype.Component;
......
// Copyright © 2020 Amazon Web Services
// Copyright 2017-2019, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//TODO: move to os-core-common
package org.opengroup.osdu.dataset.dms;
import lombok.Builder;
import lombok.Data;
@Builder
@Data
public class DmsAPIConfig {
@Builder.Default
String rootUrl = "https://osdu-api";
String apiKey;
public static DmsAPIConfig Default() {
return DmsAPIConfig.builder().build();
}
}
// Copyright © 2020 Amazon Web Services
// Copyright 2017-2019, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//TODO: Move to os-core-common
package org.opengroup.osdu.dataset.dms;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.opengroup.osdu.core.common.model.http.DpsException;
import org.opengroup.osdu.core.common.http.HttpResponse;
@Data
@EqualsAndHashCode(callSuper = false)
public class DmsException extends DpsException {
private static final long serialVersionUID = 9094949225576291097L;
public DmsException(String message, HttpResponse httpResponse) {
super(message, httpResponse);
}
}
\ No newline at end of file
// Copyright © 2020 Amazon Web Services
// Copyright 2017-2019, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//TODO: move to os-core-common
package org.opengroup.osdu.dataset.dms;
import org.opengroup.osdu.core.common.http.HttpClient;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
public class DmsFactory implements IDmsFactory {
private final DmsAPIConfig config;
public DmsFactory(DmsAPIConfig config) {
if (config == null) {
throw new IllegalArgumentException("DmsAPIConfig cannot be empty");
}
this.config = config;
}
@Override
public IDmsProvider create(DpsHeaders headers, String dmsServiceRoute) {
if (headers == null) {
throw new NullPointerException("headers cannot be null");
}
return new DmsService(this.config, dmsServiceRoute, new HttpClient(), headers);
}
}
// Copyright © 2020 Amazon Web Services
// Copyright 2017-2019, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//TODO: Move to os-core-common
package org.opengroup.osdu.dataset.dms;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.gson.JsonSyntaxException;
import org.apache.commons.lang3.StringUtils;
import org.opengroup.osdu.core.common.http.HttpRequest;
import org.opengroup.osdu.core.common.http.HttpResponse;
import org.opengroup.osdu.core.common.http.IHttpClient;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.core.common.model.storage.MultiRecordIds;
import org.opengroup.osdu.core.common.model.storage.MultiRecordInfo;
import org.opengroup.osdu.core.common.model.storage.Record;
import org.opengroup.osdu.core.common.model.storage.Schema;
import org.opengroup.osdu.dataset.model.request.GetDatasetRegistryRequest;
import org.opengroup.osdu.dataset.model.response.GetDatasetRetrievalInstructionsResponse;
import org.opengroup.osdu.dataset.model.response.GetDatasetStorageInstructionsResponse;
public class DmsService implements IDmsProvider {
private final String rootUrl;
private String dmsServiceRoute;
private final IHttpClient httpClient;
private final DpsHeaders headers;
public DmsService(DmsAPIConfig config, String dmsServiceRoute, IHttpClient httpClient, DpsHeaders headers) {
this.dmsServiceRoute = dmsServiceRoute;
this.rootUrl = config.getRootUrl();
this.httpClient = httpClient;
this.headers = headers;
if (config.apiKey != null) {
headers.put("AppKey", config.apiKey);
}
}
@Override
public GetDatasetStorageInstructionsResponse getStorageInstructions() throws DmsException {
String url = this.createUrl("/getStorageInstructions");
HttpResponse result = this.httpClient
.send(HttpRequest.get().url(url).headers(this.headers.getHeaders()).build());
return this.getResult(result, GetDatasetStorageInstructionsResponse.class);
}
@Override
public GetDatasetRetrievalInstructionsResponse getDatasetRetrievalInstructions(GetDatasetRegistryRequest datasetRegistryRequest) throws DmsException {
String url = this.createUrl("/getRetrievalInstructions");
HttpResponse result = this.httpClient
.send(HttpRequest.post(datasetRegistryRequest).url(url).headers(this.headers.getHeaders()).build());
return this.getResult(result, GetDatasetRetrievalInstructionsResponse.class);
}
private String createUrl(String requestPathAndQuery) {
return StringUtils.join(this.rootUrl, this.dmsServiceRoute, requestPathAndQuery);
}
private <T> T getResult(HttpResponse result, Class<T> type) throws DmsException {
if (result.isSuccessCode()) {
try {
return result.parseBody(type);
} catch (JsonSyntaxException e) {
throw new DmsException("Error parsing response. Check the inner HttpResponse for more info.",
result);
}
} else {
throw this.generateException(result);
}
}
private DmsException generateException(HttpResponse result) {
return new DmsException(
"Error making request to DMS service. Check the inner HttpResponse for more info.", result);
}