diff options
Diffstat (limited to 'graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction')
5 files changed, 301 insertions, 0 deletions
diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/OperationBodyRequest.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/OperationBodyRequest.java new file mode 100644 index 0000000000..25aff9fb4a --- /dev/null +++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/OperationBodyRequest.java @@ -0,0 +1,84 @@ +/*- + * ============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.aaiclient.client.aai.entities.singletransaction; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"action", "uri", "body"}) +public class OperationBodyRequest { + + @JsonProperty("action") + private String action; + @JsonProperty("uri") + private String uri; + @JsonProperty("body") + @JsonSerialize(using = OperationBodyRequestSerializer.class) + private Object body; + + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public OperationBodyRequest withAction(String action) { + this.action = action; + return this; + } + + @JsonProperty("uri") + public String getUri() { + return uri; + } + + @JsonProperty("uri") + public void setUri(String uri) { + this.uri = uri; + } + + public OperationBodyRequest 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 OperationBodyRequest withBody(Object body) { + this.body = body; + return this; + } + +} diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/OperationBodyRequestSerializer.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/OperationBodyRequestSerializer.java new file mode 100644 index 0000000000..5a8a2b6f73 --- /dev/null +++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/OperationBodyRequestSerializer.java @@ -0,0 +1,54 @@ +/*- + * ============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.aaiclient.client.aai.entities.singletransaction; + +import java.io.IOException; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; + +public class OperationBodyRequestSerializer extends StdSerializer<Object> { + + private static final long serialVersionUID = 5367385969270400106L; + + public OperationBodyRequestSerializer() { + this(null); + } + + public OperationBodyRequestSerializer(Class<Object> t) { + super(t); + } + + @Override + public void serialize(Object value, JsonGenerator gen, SerializerProvider serializers) + throws IOException, JsonProcessingException { + + if (value instanceof String) { + gen.writeRawValue((String) value); + } else { + gen.writeObject(value); + } + + } + +} + diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/OperationBodyResponse.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/OperationBodyResponse.java new file mode 100644 index 0000000000..165806fdfa --- /dev/null +++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/OperationBodyResponse.java @@ -0,0 +1,73 @@ +/*- + * ============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.aaiclient.client.aai.entities.singletransaction; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonPropertyOrder({"action", "uri", "response-status-code", "response-body"}) +public class OperationBodyResponse { + + @JsonProperty("action") + public String action; + @JsonProperty("uri") + public String uri; + @JsonProperty("response-status-code") + public Integer responseStatusCode; + @JsonProperty("response-body") + public Object responseBody; + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getUri() { + return uri; + } + + public void setUri(String uri) { + this.uri = uri; + } + + @JsonProperty("response-status-code") + public Integer getResponseStatusCode() { + return responseStatusCode; + } + + @JsonProperty("response-status-code") + public void setResponseStatusCode(Integer responseStatusCode) { + this.responseStatusCode = responseStatusCode; + } + + @JsonProperty("response-body") + public Object getResponseBody() { + return responseBody; + } + + @JsonProperty("response-body") + public void getResponseBody(Object responseBody) { + this.responseBody = responseBody; + } +} diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/SingleTransactionRequest.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/SingleTransactionRequest.java new file mode 100644 index 0000000000..c279c18dd7 --- /dev/null +++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/SingleTransactionRequest.java @@ -0,0 +1,44 @@ +/*- + * ============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.aaiclient.client.aai.entities.singletransaction; + +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class SingleTransactionRequest { + + @JsonProperty("operations") + public List<OperationBodyRequest> operations; + + public List<OperationBodyRequest> getOperations() { + + if (operations == null) { + operations = new ArrayList<>(); + } + + return operations; + } + + public void setOperations(List<OperationBodyRequest> operations) { + this.operations = operations; + } +} diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/SingleTransactionResponse.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/SingleTransactionResponse.java new file mode 100644 index 0000000000..ac4eb2c82f --- /dev/null +++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/entities/singletransaction/SingleTransactionResponse.java @@ -0,0 +1,46 @@ +/*- + * ============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.aaiclient.client.aai.entities.singletransaction; + +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class SingleTransactionResponse { + + @JsonProperty("operation-responses") + public List<OperationBodyResponse> operationResponses; + + @JsonProperty("operation-responses") + public List<OperationBodyResponse> getOperationResponses() { + if (operationResponses == null) { + operationResponses = new ArrayList<>(); + } + return operationResponses; + } + + @JsonProperty("operation-responses") + public void setOperationResponses(List<OperationBodyResponse> operationResponses) { + this.operationResponses = operationResponses; + } + + +} |