diff options
author | Shankaranarayanan Puzhavakath Narayanan <snarayanan@research.att.com> | 2019-03-19 15:36:00 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-03-19 15:36:00 +0000 |
commit | dc9c2f741f3e47abb646a2a4291bf9323fee69d7 (patch) | |
tree | 2fca65e210ad429a054d291a6eab5c2981f5af13 /cmso-service/src/main/java/org | |
parent | c0f2c43b2074a3ef76b40c45803ce788ec79dce6 (diff) | |
parent | c8b7020a4a181e3a491d4b8b50382df8045a6552 (diff) |
Merge "Commit 2: Define Create Optimized API"
Diffstat (limited to 'cmso-service/src/main/java/org')
3 files changed, 278 insertions, 0 deletions
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/v2/ChangeWindow.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/v2/ChangeWindow.java new file mode 100644 index 0000000..7553c87 --- /dev/null +++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/v2/ChangeWindow.java @@ -0,0 +1,87 @@ +/* + * Copyright © 2017-2018 AT&T Intellectual Property. + * Modifications Copyright © 2018 IBM. + * + * 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. + * + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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.onap.optf.cmso.service.rs.models.v2; + +import java.io.Serializable; +import java.util.Date; + +import org.springframework.format.annotation.DateTimeFormat; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@ApiModel(value = "Change Window", + description = "Time window for which tickets are to returned") +public class ChangeWindow implements Serializable { + private static final long serialVersionUID = 1L; + private static EELFLogger log = EELFManager.getInstance().getLogger(ChangeWindow.class); + + @ApiModelProperty(value = "Earliest time for which changes may begin.") + @DateTimeFormat(pattern="yyyy-MM-dd'T'hh:mm:ss'Z'") + private Date startTime; + + @ApiModelProperty(value = "Latest time by which all changes must be completed.") + @DateTimeFormat(pattern="yyyy-MM-dd'T'hh:mm:ss'Z'") + private Date endTime; + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Date getEndTime() { + return endTime; + } + + public void setEndTime(Date endTime) { + this.endTime = endTime; + } + + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.writeValueAsString(this); + } catch (JsonProcessingException e) { + log.debug("Error in toString()", e); + } + return ""; + } + +} diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/v2/ElementInfo.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/v2/ElementInfo.java new file mode 100644 index 0000000..35649ea --- /dev/null +++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/v2/ElementInfo.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * + * Copyright © 2019 AT&T Intellectual Property. + * + * 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. + * + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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.onap.optf.cmso.service.rs.models.v2; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@ApiModel(value = "Optimizer Element", description = "Element to be scheduled.") +public class ElementInfo implements Serializable { + private static final long serialVersionUID = 1L; + private static EELFLogger log = EELFManager.getInstance().getLogger(ElementInfo.class); + + @ApiModelProperty(value = "Element identifier") + private String elementId; + + @ApiModelProperty(value = "Implementation specific element data.") + public List<NameValue> elementData = new ArrayList<>(); + + @ApiModelProperty(value = "Request for be scheduled.") + public Object request; + + public String getElementId() { + return elementId; + } + + public void setElementId(String elementId) { + this.elementId = elementId; + } + + + public List<NameValue> getElementData() { + return elementData; + } + + public void setElementData(List<NameValue> elementData) { + this.elementData = elementData; + } + + public Object getRequest() { + return request; + } + + public void setRequest(Object request) { + this.request = request; + } + + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.writeValueAsString(this); + } catch (JsonProcessingException e) { + log.debug("Error in toString()", e); + } + return ""; + } +} diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/v2/NameValue.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/v2/NameValue.java new file mode 100644 index 0000000..9b71f76 --- /dev/null +++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/models/v2/NameValue.java @@ -0,0 +1,98 @@ +/* + * Copyright © 2017-2019 AT&T Intellectual Property. + * Modifications Copyright © 2018 IBM. + * + * 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. + * + * + * Unless otherwise specified, all documentation contained herein is licensed + * under the Creative Commons License, Attribution 4.0 Intl. (the "License"); + * you may not use this documentation except in compliance with the License. + * You may obtain a copy of the License at + * + * https://creativecommons.org/licenses/by/4.0/ + * + * Unless required by applicable law or agreed to in writing, documentation + * 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.onap.optf.cmso.service.rs.models.v2; + +import java.io.Serializable; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +@ApiModel(value = "Name Value Data", + description = "Instance of a name/value") +public class NameValue implements Serializable { + private static final long serialVersionUID = 1L; + private static EELFLogger log = EELFManager.getInstance().getLogger(NameValue.class); + + public NameValue() + { + + } + + public NameValue(String name, Object value) + { + this.name = name; + this.value = value; + } + + @ApiModelProperty(value = "Name.") + private String name; + + @ApiModelProperty(value = "Value.") + private Object value; + + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public Object getValue() { + return value; + } + + + public void setValue(Object value) { + this.value = value; + } + + + public String toString() { + ObjectMapper mapper = new ObjectMapper(); + try { + return mapper.writeValueAsString(this); + } catch (JsonProcessingException e) { + log.debug("Error in toString()", e); + } + return ""; + } + +} |