diff options
Diffstat (limited to 'common/src/main/java/org/onap/so/client/aai/entities')
19 files changed, 1437 insertions, 0 deletions
diff --git a/common/src/main/java/org/onap/so/client/aai/entities/AAIEntity.java b/common/src/main/java/org/onap/so/client/aai/entities/AAIEntity.java new file mode 100644 index 0000000000..c2aceeeeba --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/AAIEntity.java @@ -0,0 +1,25 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities; + +public class AAIEntity{ + +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/AAIEntityObject.java b/common/src/main/java/org/onap/so/client/aai/entities/AAIEntityObject.java new file mode 100644 index 0000000000..dc91c8a034 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/AAIEntityObject.java @@ -0,0 +1,29 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities; + +import org.onap.so.client.aai.entities.uri.AAIResourceUri; + +public interface AAIEntityObject { + + public AAIResourceUri getUri(); + +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/AAIError.java b/common/src/main/java/org/onap/so/client/aai/entities/AAIError.java new file mode 100644 index 0000000000..4261f4f3c0 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/AAIError.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "requestError" +}) +public class AAIError { + + @JsonProperty("requestError") + private RequestError requestError; + + @JsonProperty("requestError") + public RequestError getRequestError() { + return requestError; + } + + @JsonProperty("requestError") + public void setRequestError(RequestError requestError) { + this.requestError = requestError; + } + +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/AAIResultWrapper.java b/common/src/main/java/org/onap/so/client/aai/entities/AAIResultWrapper.java new file mode 100644 index 0000000000..9087995f97 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/AAIResultWrapper.java @@ -0,0 +1,92 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities; + +import java.io.IOException; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +import org.onap.so.client.aai.AAICommonObjectMapperProvider; +import org.onap.so.jsonpath.JsonPathUtil; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class AAIResultWrapper implements Serializable { + + private static final long serialVersionUID = 5895841925807816737L; + private final Optional<String> jsonBody; + private final ObjectMapper mapper; + public AAIResultWrapper(String json) { + this.jsonBody = Optional.ofNullable(json); + this.mapper = new AAICommonObjectMapperProvider().getMapper(); + } + + public Optional<Relationships> getRelationships() { + final String path = "$.relationship-list"; + if (!jsonBody.isPresent()) { + return Optional.empty(); + } + Optional<String> result = JsonPathUtil.getInstance().locateResult(jsonBody.get(), path); + if (result.isPresent()) { + return Optional.of(new Relationships(result.get())); + } else { + return Optional.empty(); + } + } + + public String getJson() { + return jsonBody.orElse("{}"); + } + + public Map<String, Object> asMap() { + if (!this.jsonBody.isPresent()) { + return new HashMap<>(); + } + try { + return mapper.readValue(this.jsonBody.get(), new TypeReference<Map<String, Object>>(){}); + } catch (IOException e) { + return new HashMap<>(); + } + } + + public <T> Optional<T> asBean(Class<T> clazz) { + if (!this.jsonBody.isPresent()) { + return Optional.empty(); + } + try { + return Optional.of(mapper.readValue(this.jsonBody.get(), clazz)); + } catch (IOException e) { + return Optional.empty(); + } + } + + public boolean isEmpty() { + return !this.jsonBody.isPresent(); + } + @Override + public String toString() { + return this.getJson(); + } + +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/Configuration.java b/common/src/main/java/org/onap/so/client/aai/entities/Configuration.java new file mode 100644 index 0000000000..e1ce3a8adc --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/Configuration.java @@ -0,0 +1,161 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "configuration-id", + "configuration-type", + "configuration-sub-type", + "model-invariant-id", + "model-version-id", + "orchestration-status", + "operational-status", + "configuration-selflink", + "model-customization-id" +}) +public class Configuration { + + @JsonProperty("configuration-id") + private String configurationId; + @JsonProperty("configuration-name") + private String configurationName; + @JsonProperty("configuration-type") + private String configurationType; + @JsonProperty("configuration-sub-type") + private String configurationSubType; + @JsonProperty("model-invariant-id") + private String modelInvariantId; + @JsonProperty("model-version-id") + private String modelVersionId; + @JsonProperty("orchestration-status") + private String orchestrationStatus; + @JsonProperty("operational-status") + private String operationalStatus; + @JsonProperty("configuration-selflink") + private String configurationSelflink; + @JsonProperty("model-customization-id") + private String modelCustomizationId; + + @JsonProperty("configuration-id") + public String getConfigurationId() { + return configurationId; + } + + @JsonProperty("configuration-id") + public void setConfigurationId(String configurationId) { + this.configurationId = configurationId; + } + + @JsonProperty("configuration-name") + public String getConfigurationName() { + return configurationName; + } + + @JsonProperty("configuration-name") + public void setConfigurationName(String configurationName) { + this.configurationName = configurationName; + } + + @JsonProperty("configuration-type") + public String getConfigurationType() { + return configurationType; + } + + @JsonProperty("configuration-type") + public void setConfigurationType(String configurationType) { + this.configurationType = configurationType; + } + + @JsonProperty("configuration-sub-type") + public String getConfigurationSubType() { + return configurationSubType; + } + + @JsonProperty("configuration-sub-type") + public void setConfigurationSubType(String configurationSubType) { + this.configurationSubType = configurationSubType; + } + + @JsonProperty("model-invariant-id") + public String getModelInvariantId() { + return modelInvariantId; + } + + @JsonProperty("model-invariant-id") + public void setModelInvariantId(String modelInvariantId) { + this.modelInvariantId = modelInvariantId; + } + + @JsonProperty("model-version-id") + public String getModelVersionId() { + return modelVersionId; + } + + @JsonProperty("model-version-id") + public void setModelVersionId(String modelVersionId) { + this.modelVersionId = modelVersionId; + } + + @JsonProperty("orchestration-status") + public String getOrchestrationStatus() { + return orchestrationStatus; + } + + @JsonProperty("orchestration-status") + public void setOrchestrationStatus(String orchestrationStatus) { + this.orchestrationStatus = orchestrationStatus; + } + + @JsonProperty("operational-status") + public String getOperationalStatus() { + return operationalStatus; + } + + @JsonProperty("operational-status") + public void setOperationalStatus(String operationalStatus) { + this.operationalStatus = operationalStatus; + } + + @JsonProperty("model-customization-id") + public String getModelCustomizationId() { + return modelCustomizationId; + } + + @JsonProperty("model-customization-id") + public void setModelCustomizationId(String modelCustomizationId) { + this.modelCustomizationId = modelCustomizationId; + } + + @JsonProperty("configuration-selflink") + public String getConfigurationSelflink() { + return configurationSelflink; + } + + @JsonProperty("configuration-selflink") + public void setConfigurationSelflink(String configurationSelflink) { + this.configurationSelflink = configurationSelflink; + } +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/CustomQuery.java b/common/src/main/java/org/onap/so/client/aai/entities/CustomQuery.java new file mode 100644 index 0000000000..8203476c82 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/CustomQuery.java @@ -0,0 +1,82 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities; + +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.List; + +import org.onap.so.client.aai.entities.uri.AAIResourceUri; + +import com.fasterxml.jackson.annotation.JsonInclude; + + +@JsonInclude(JsonInclude.Include.NON_NULL) +public class CustomQuery { + + private List<String> start; + private String query; + private String gremlin; + + public String getGremlin() { + return gremlin; + } + + public void setGremlin(String gremlin) { + this.gremlin = gremlin; + } + + + public CustomQuery(List<AAIResourceUri> start){ + this.setStart(start); + } + + public CustomQuery(List<AAIResourceUri> start, String query){ + this.setStart(start); + this.query= "query/" + query; + } + + public CustomQuery(String gremlin) throws UnsupportedEncodingException{ + this.gremlin=gremlin; + } + + public List<String> getStart() { + return start; + } + + public void setStart(List<AAIResourceUri> start) { + this.start = this.mapUris(start); + } + + public String getQuery() { + return query; + } + + public void setQuery(String query) { + this.query = query; + } + + private List<String> mapUris(List<AAIResourceUri> uris) { + final List<String> result = new ArrayList<>(); + uris.stream().map(item -> item.build().toString()).forEach(result::add); + return result; + } +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/Relationships.java b/common/src/main/java/org/onap/so/client/aai/entities/Relationships.java new file mode 100644 index 0000000000..bab145b3fd --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/Relationships.java @@ -0,0 +1,140 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Predicate; + +import javax.ws.rs.core.UriBuilder; + +import org.onap.so.client.aai.AAICommonObjectMapperProvider; +import org.onap.so.client.aai.AAIObjectType; +import org.onap.so.client.aai.AAIResourcesClient; +import org.onap.so.client.aai.entities.uri.AAIResourceUri; +import org.onap.so.client.aai.entities.uri.AAIUriFactory; +import org.onap.so.client.graphinventory.GraphInventoryObjectName; +import org.onap.so.jsonpath.JsonPathUtil; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.base.CaseFormat; + +public class Relationships { + + private final ObjectMapper mapper; + private Map<String, Object> map; + private final String jsonBody; + public Relationships(String json) { + this.jsonBody = json; + this.mapper = new AAICommonObjectMapperProvider().getMapper(); + try { + this.map = mapper.readValue(json, new TypeReference<Map<String, Object>>() {}); + } catch (IOException e) { + this.map = new HashMap<>(); + } + } + + public List<AAIResultWrapper> getByType(GraphInventoryObjectName type) { + + return this.getAll(Optional.of(type)); + } + + public List<AAIResultWrapper> getAll() { + + return this.getAll(Optional.empty()); + } + + + public List<String> getRelatedLinks() { + return this.getRelatedLinks(Optional.empty()); + } + + public List<String> getRelatedLinks(GraphInventoryObjectName type) { + return this.getRelatedLinks(Optional.of(type)); + } + + public List<AAIResourceUri> getRelatedAAIUris() { + return this.getRelatedAAIUris(x -> true); + } + + public List<AAIResourceUri> getRelatedAAIUris(GraphInventoryObjectName type) { + return this.getRelatedAAIUris(x -> type.typeName().equals(x)); + } + protected List<AAIResourceUri> getRelatedAAIUris(Predicate<String> p) { + List<AAIResourceUri> result = new ArrayList<>(); + if (map.containsKey("relationship")) { + List<Map<String, Object>> relationships = (List<Map<String, Object>>)map.get("relationship"); + for (Map<String, Object> relationship : relationships) { + final String relatedTo = (String)relationship.get("related-to"); + if (p.test(relatedTo)) { + AAIObjectType type; + try { + type = AAIObjectType.valueOf(CaseFormat.LOWER_HYPHEN.to(CaseFormat.UPPER_UNDERSCORE, relatedTo)); + } catch (IllegalArgumentException e) { + type = AAIObjectType.UNKNOWN; + } + final String relatedLink = (String)relationship.get("related-link"); + + result.add(AAIUriFactory.createResourceFromExistingURI(type, UriBuilder.fromPath(relatedLink).build())); + } + } + } + return result; + } + + + + protected List<AAIResultWrapper> getAll(final Optional<GraphInventoryObjectName> type) { + List<AAIResourceUri> relatedLinks; + if (type.isPresent()) { + relatedLinks = this.getRelatedAAIUris(type.get()); + } else { + relatedLinks = this.getRelatedAAIUris(); + } + ArrayList<AAIResultWrapper> result = new ArrayList<>(); + for (AAIResourceUri link : relatedLinks) { + result.add(this.get(link)); + } + return result; + } + + protected AAIResultWrapper get(AAIResourceUri uri) { + return new AAIResourcesClient().get(uri); + + } + + protected List<String> getRelatedLinks(Optional<GraphInventoryObjectName> type) { + String matcher = ""; + if (type.isPresent()) { + matcher = "[?(@.related-to=='" + type.get() + "')]"; + } + return JsonPathUtil.getInstance().locateResultList(this.jsonBody, String.format("$.relationship%s.related-link", matcher)); + } + + public String getJson() { + return this.jsonBody; + } +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/RequestError.java b/common/src/main/java/org/onap/so/client/aai/entities/RequestError.java new file mode 100644 index 0000000000..bc8c283e34 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/RequestError.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "serviceException" +}) +public class RequestError { + + @JsonProperty("serviceException") + private ServiceException serviceException; + + @JsonProperty("serviceException") + public ServiceException getServiceException() { + return serviceException; + } + + @JsonProperty("serviceException") + public void setServiceException(ServiceException serviceException) { + this.serviceException = serviceException; + } + +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/Results.java b/common/src/main/java/org/onap/so/client/aai/entities/Results.java new file mode 100644 index 0000000000..c3f0ad1fa1 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/Results.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + + + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ +"results" +}) +public class Results<T> { + @JsonProperty("results") + protected List<T> results; + + @JsonProperty("results") + public List<T> getResult() { + if (results == null) { + results = new ArrayList<>(); + } + return this.results; + } + @JsonProperty("results") + public void setResult(List<T> results) { + this.results=results; + } +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/ServiceException.java b/common/src/main/java/org/onap/so/client/aai/entities/ServiceException.java new file mode 100644 index 0000000000..9d9723c514 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/ServiceException.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ + "messageId", + "text", + "variables" +}) +public class ServiceException { + + @JsonProperty("messageId") + private String messageId; + @JsonProperty("text") + private String text; + @JsonProperty("variables") + private List<String> variables = new ArrayList<>(); + + @JsonProperty("messageId") + public String getMessageId() { + return messageId; + } + + @JsonProperty("messageId") + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + @JsonProperty("text") + public String getText() { + return text; + } + + @JsonProperty("text") + public void setText(String text) { + this.text = text; + } + + @JsonProperty("variables") + public List<String> getVariables() { + return variables; + } + + @JsonProperty("variables") + public void setVariables(List<String> variables) { + this.variables = variables; + } + +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/bulkprocess/OperationBody.java b/common/src/main/java/org/onap/so/client/aai/entities/bulkprocess/OperationBody.java new file mode 100644 index 0000000000..1803440edd --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/bulkprocess/OperationBody.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities.bulkprocess; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ +"uri", +"body" +}) +public class OperationBody { + +@JsonProperty("uri") +private String uri; +@JsonProperty("body") +private Object body; + +@JsonProperty("uri") +public String getUri() { +return uri; +} + +@JsonProperty("uri") +public void setUri(String uri) { +this.uri = uri; +} + +public OperationBody withUri(String uri) { +this.uri = uri; +return this; +} + +@JsonProperty("body") +public Object getBody() { +return body; +} + +@JsonProperty("body") +public void setBody(Object body) { +this.body = body; +} + +public OperationBody withBody(Object body) { +this.body = body; +return this; +} + +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/bulkprocess/Transaction.java b/common/src/main/java/org/onap/so/client/aai/entities/bulkprocess/Transaction.java new file mode 100644 index 0000000000..1c405753c3 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/bulkprocess/Transaction.java @@ -0,0 +1,95 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities.bulkprocess; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ +"patch", +"patch", +"delete" +}) +public class Transaction { + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonProperty("put") +private List<OperationBody> put = new ArrayList<>(); + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonProperty("patch") +private List<OperationBody> patch = new ArrayList<>(); + +@JsonInclude(JsonInclude.Include.NON_EMPTY) +@JsonProperty("delete") +private List<OperationBody> delete = new ArrayList<>(); + +@JsonProperty("put") +public List<OperationBody> getPut() { +return put; +} + +@JsonProperty("put") +public void setPut(List<OperationBody> put) { +this.put = put; +} + +public Transaction withPut(List<OperationBody> put) { +this.put = put; +return this; +} + +@JsonProperty("patch") +public List<OperationBody> getPatch() { +return patch; +} + +@JsonProperty("patch") +public void setPatch(List<OperationBody> patch) { +this.patch = patch; +} + +public Transaction withPatch(List<OperationBody> patch) { +this.patch = patch; +return this; +} + +@JsonProperty("delete") +public List<OperationBody> getDelete() { +return delete; +} + +@JsonProperty("delete") +public void setDelete(List<OperationBody> delete) { +this.delete = delete; +} + +public Transaction withDelete(List<OperationBody> delete) { +this.delete = delete; +return this; +} + +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/bulkprocess/Transactions.java b/common/src/main/java/org/onap/so/client/aai/entities/bulkprocess/Transactions.java new file mode 100644 index 0000000000..51d56d371a --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/bulkprocess/Transactions.java @@ -0,0 +1,54 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities.bulkprocess; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({ +"transactions" +}) +public class Transactions { + +@JsonProperty("transactions") +private List<Transaction> transactions = new ArrayList<>(); + +@JsonProperty("transactions") +public List<Transaction> getTransactions() { +return transactions; +} + +@JsonProperty("transactions") +public void setTransactions(List<Transaction> transactions) { +this.transactions = transactions; +} + +public Transactions withTransactions(List<Transaction> transactions) { +this.transactions = transactions; +return this; +} + +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIResourceUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIResourceUri.java new file mode 100644 index 0000000000..42fa1ad02a --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIResourceUri.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities.uri; + +import org.onap.so.client.aai.AAIObjectPlurals; +import org.onap.so.client.aai.AAIObjectType; +import org.onap.so.client.graphinventory.Format; +import org.onap.so.client.graphinventory.entities.uri.Depth; +import org.onap.so.client.graphinventory.entities.uri.GraphInventoryResourceUri; + +public interface AAIResourceUri extends AAIUri, GraphInventoryResourceUri { + + public AAIResourceUri relationshipAPI(); + public AAIResourceUri relatedTo(AAIObjectPlurals plural); + public AAIResourceUri relatedTo(AAIObjectType type, String... values); + public AAIResourceUri resourceVersion(String version); + public AAIResourceUri format(Format format); + @Override + public AAIResourceUri depth(Depth depth); + @Override + public AAIResourceUri nodesOnly(boolean nodesOnly); + @Override + public AAIResourceUri queryParam(String name, String... values); + @Override + public AAIResourceUri replaceQueryParam(String name, String... values); + @Override + public AAIResourceUri clone(); +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java new file mode 100644 index 0000000000..14671b2f85 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java @@ -0,0 +1,111 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities.uri; + +import java.net.URI; + +import javax.ws.rs.core.UriBuilder; + +import org.onap.so.client.aai.AAIObjectPlurals; +import org.onap.so.client.aai.AAIObjectType; +import org.onap.so.client.graphinventory.Format; +import org.onap.so.client.graphinventory.entities.uri.Depth; +import org.onap.so.client.graphinventory.entities.uri.SimpleUri; + +public class AAISimpleUri extends SimpleUri implements AAIResourceUri { + + protected AAISimpleUri(AAIObjectType type, Object... values) { + super(type, values); + + } + protected AAISimpleUri(AAIObjectType type, URI uri) { + super(type, uri); + } + protected AAISimpleUri(AAIObjectType type, UriBuilder builder, Object... values) { + super(type, builder, values); + } + protected AAISimpleUri(AAIObjectPlurals type, UriBuilder builder, Object... values) { + super(type, builder, values); + } + protected AAISimpleUri(AAIObjectPlurals type) { + super(type); + } + protected AAISimpleUri(AAIObjectPlurals type, Object... values) { + super(type, values); + } + + @Override + public AAISimpleUri relationshipAPI() { + return (AAISimpleUri) super.relationshipAPI(); + } + + @Override + public AAISimpleUri relatedTo(AAIObjectPlurals plural) { + return (AAISimpleUri) super.relatedTo(plural); + } + @Override + public AAISimpleUri relatedTo(AAIObjectType type, String... values) { + return (AAISimpleUri) super.relatedTo(type, values); + } + + @Override + public AAISimpleUri resourceVersion(String version) { + return (AAISimpleUri) super.resourceVersion(version); + } + + @Override + public AAISimpleUri queryParam(String name, String... values) { + return (AAISimpleUri) super.queryParam(name, values); + } + + @Override + public AAISimpleUri replaceQueryParam(String name, String... values) { + return (AAISimpleUri) super.replaceQueryParam(name, values); + } + + @Override + public AAISimpleUri clone() { + if (this.type != null) { + return new AAISimpleUri((AAIObjectType)this.type, this.internalURI.clone(), values); + } else { + return new AAISimpleUri((AAIObjectPlurals)this.pluralType, this.internalURI.clone(), values); + } + } + + @Override + public AAIObjectType getObjectType() { + return (AAIObjectType)this.type; + } + + @Override + public AAISimpleUri depth(Depth depth) { + return (AAISimpleUri) super.depth(depth); + } + @Override + public AAISimpleUri nodesOnly(boolean nodesOnly) { + return (AAISimpleUri)super.nodesOnly(nodesOnly); + } + + @Override + public AAISimpleUri format(Format format) { + return (AAISimpleUri)super.format(format); + } +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUri.java new file mode 100644 index 0000000000..eb336d9219 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUri.java @@ -0,0 +1,60 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities.uri; + +import java.net.URI; +import java.util.Map; + +import org.onap.so.client.aai.AAIObjectType; +import org.onap.so.client.graphinventory.GraphInventoryObjectType; +import org.onap.so.client.graphinventory.entities.uri.Depth; +import org.onap.so.client.graphinventory.entities.uri.GraphInventoryUri; + +public interface AAIUri extends GraphInventoryUri { + + /** + * By default A&AI enforces a depth of 1. Some objects can be told to retrieve objects + * nested beneath them by increasing this number. + * + * You can use 0 to restrict the returned information to only the object you requested + * You can use all to retrieve all nested objects (this should only be used if you really need a massive amount of information and are caching the retrieval) + * @param depth + * @return + */ + @Override + public AAIUri depth(Depth depth); + /** + * Makes client only return object fields, no relationships + * + * @return + */ + @Override + public AAIUri nodesOnly(boolean nodesOnly); + @Override + public AAIUri queryParam(String name, String... values); + @Override + public AAIUri replaceQueryParam(String name, String... values); + @Override + public AAIUri clone(); + + @Override + public AAIObjectType getObjectType(); +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUriFactory.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUriFactory.java new file mode 100644 index 0000000000..2a7c8ee78c --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAIUriFactory.java @@ -0,0 +1,86 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities.uri; + +import java.net.URI; + +import org.onap.so.client.aai.AAIObjectPlurals; +import org.onap.so.client.aai.AAIObjectType; +import org.onap.so.client.graphinventory.entities.uri.SimpleUri; + + +public class AAIUriFactory { + + /** + * values are filled into the URI template specified in {@link AAIObjectType} in order + * + * @param type + * @param values + * @return + */ + public static AAIResourceUri createResourceUri(AAIObjectType type, Object... values) { + if (AAIObjectType.SERVICE_INSTANCE.equals(type)) { + return new ServiceInstanceUri(values); + } else { + return new AAISimpleUri(type, values); + } + } + + public static AAIResourceUri createNodesUri(AAIObjectType type, Object... values) { + return new NodesUri(type, values); + + } + + /** + * This method should only be used to wrap a URI retrieved from A&AI contained within an object response + * + * @param type + * @param uri + * @return + */ + public static AAIResourceUri createResourceFromExistingURI(AAIObjectType type, URI uri) { + return new AAISimpleUri(type, uri); + } + + /** + * Creates a uri for a plural type e.g. /cloud-infrastructure/pservers + * + * @param type + * @return + */ + public static AAIResourceUri createResourceUri(AAIObjectPlurals type) { + + return new AAISimpleUri(type); + + } + + /** + * Creates a uri for a plural type with values e.g. /cloud-infrastructure/pservers + * + * @param type + * @return + */ + public static AAIResourceUri createResourceUri(AAIObjectPlurals type, Object... values) { + + return new AAISimpleUri(type, values); + + } +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/NodesUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/NodesUri.java new file mode 100644 index 0000000000..ccae0b44b7 --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/NodesUri.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities.uri; + +import org.onap.so.client.aai.AAIObjectType; +import org.onap.so.client.graphinventory.GraphInventoryObjectPlurals; +import org.onap.so.client.graphinventory.GraphInventoryObjectType; + +public class NodesUri extends AAISimpleUri { + + protected NodesUri(AAIObjectType type, Object... values) { + super(type, values); + } + + + @Override + protected String getTemplate(GraphInventoryObjectType type) { + return "/nodes" + type.partialUri(); + } + + @Override + protected String getTemplate(GraphInventoryObjectPlurals type) { + return "/nodes" + type.partialUri(); + } +} diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUri.java new file mode 100644 index 0000000000..093918d49b --- /dev/null +++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/ServiceInstanceUri.java @@ -0,0 +1,126 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * 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. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.aai.entities.uri; + +import java.io.IOException; +import java.net.URI; +import java.util.Collections; +import java.util.Map; +import java.util.Optional; + +import javax.ws.rs.BadRequestException; +import javax.ws.rs.core.UriBuilder; + +import org.onap.so.client.aai.AAIObjectType; +import org.onap.so.client.aai.AAIQueryClient; +import org.onap.so.client.graphinventory.Format; +import org.onap.so.client.aai.entities.CustomQuery; +import org.onap.so.client.aai.entities.Results; +import org.onap.so.client.graphinventory.entities.uri.SimpleUri; +import org.onap.so.client.graphinventory.exceptions.GraphInventoryPayloadException; +import org.onap.so.client.graphinventory.exceptions.GraphInventoryUriComputationException; +import org.onap.so.client.graphinventory.exceptions.GraphInventoryUriNotFoundException; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class ServiceInstanceUri extends AAISimpleUri { + + private Optional<String> cachedValue = Optional.empty(); + + protected ServiceInstanceUri(Object... values) { + super(AAIObjectType.SERVICE_INSTANCE, values); + } + protected ServiceInstanceUri(UriBuilder builder, Optional<String> cachedValue, Object... values) { + super(AAIObjectType.SERVICE_INSTANCE, builder, values); + this.cachedValue = cachedValue; + } + protected String getSerivceInstance(Object id) throws GraphInventoryUriNotFoundException, GraphInventoryPayloadException { + if (!this.getCachedValue().isPresent()) { + AAIResourceUri serviceInstanceUri = AAIUriFactory.createNodesUri(AAIObjectType.SERVICE_INSTANCE, id); + CustomQuery query = new CustomQuery(Collections.singletonList(serviceInstanceUri)); + String resultJson; + try { + resultJson = this.getQueryClient().query(Format.PATHED, query); + } catch (BadRequestException e) { + throw new GraphInventoryUriNotFoundException("Service instance " + id + " not found at: " + serviceInstanceUri.build()); + + } + try { + cachedValue = extractRelatedLink(resultJson); + if (!cachedValue.isPresent()) { + throw new GraphInventoryUriNotFoundException("Service instance " + id + " not found at: " + serviceInstanceUri.build()); + } + } catch (IOException e) { + throw new GraphInventoryPayloadException("could not map payload: " + resultJson, e); + } + } + Optional<String> cachedValueOpt = this.getCachedValue(); + return cachedValueOpt.isPresent() ? cachedValueOpt.get() : ""; + } + + protected Optional<String> extractRelatedLink(String jsonString) throws IOException { + Optional<String> result; + ObjectMapper mapper = new ObjectMapper(); + + Results<Map<String, String>> results = mapper.readValue(jsonString, new TypeReference<Results<Map<String, String>>>(){}); + if (results.getResult().size() == 1) { + String uriString = results.getResult().get(0).get("resource-link"); + URI uri = UriBuilder.fromUri(uriString).build(); + String rawPath = uri.getRawPath(); + result = Optional.of(rawPath.replaceAll("/aai/v\\d+", "")); + } else if (results.getResult().isEmpty()) { + result = Optional.empty(); + } else { + throw new IllegalStateException("more than one result returned"); + } + + return result; + } + + protected Optional<String> getCachedValue() { + return this.cachedValue; + } + + @Override + public URI build() { + try { + if (this.values.length == 1) { + String uri = getSerivceInstance(this.values[0]); + Map<String, String> map = getURIKeys(uri); + return super.build(map.values().toArray(values)); + } + } catch (GraphInventoryUriNotFoundException | GraphInventoryPayloadException e) { + throw new GraphInventoryUriComputationException(e); + } + return super.build(); + } + + @Override + public ServiceInstanceUri clone() { + return new ServiceInstanceUri(this.internalURI.clone(), this.getCachedValue(), values); + } + + protected AAIQueryClient getQueryClient() { + AAIResourceUri uri = AAIUriFactory.createNodesUri(AAIObjectType.ALLOTTED_RESOURCE, "").clone(); + return new AAIQueryClient(); + } +} |