1 /*******************************************************************************
2 * ============LICENSE_START========================================================================
3 * ONAP : ccsdk feature sdnr wt
4 * =================================================================================================
5 * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6 * =================================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software distributed under the License
13 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14 * or implied. See the License for the specific language governing permissions and limitations under
16 * ============LICENSE_END==========================================================================
17 ******************************************************************************/
18 package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
20 import java.time.LocalDateTime;
21 import java.util.Date;
22 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
28 public interface NetconfTimeStamp {
31 * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format
33 * @return String with Date in NETCONF/YANG Format Version 1.0.
35 String getTimeStampAsNetconfString();
38 * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format
40 * @return String with Date in NETCONF/YANG Format Version 1.0.
42 String getTimeStampAsNetconfString(Date date);
45 * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
47 * @return DateAndTime Type 1.0. Date in NETCONF/YANG Format Version 1.0.
49 DateAndTime getTimeStamp();
52 * Get time from date as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
53 * @param date specifying the date and time
54 * @return DateAndTime Type 1.0. Date in NETCONF/YANG Format Version 1.0.
56 DateAndTime getTimeStamp(Date date);
59 * Get time from date as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
60 * @param date specifying the date and time
61 * @return DateAndTime Type 1.0. Date in NETCONF/YANG Format Version 1.0.
63 DateAndTime getTimeStamp(String date);
66 * Return the String with a NETCONF time converted to long
68 * @param netconfTime as String according the formats given above
69 * @return Epoch milliseconds
70 * @throws IllegalArgumentException In case of no compliant time format definition for the string
72 long getTimeStampFromNetconfAsMilliseconds(String netconfTime) throws IllegalArgumentException;
75 * Deliver String result.
77 * @param netconfTime as String according the formats given above
78 * @return If successful: String in ISO8601 Format for database and presentation. If "wrong formed
79 * input" the Input string with the prefix "Maleformed date" is delivered back.
81 String getTimeStampFromNetconf(String netconfTime);
83 Date getDateFromNetconf(String netconfTime);
85 String getTimeStampAsNetconfString(LocalDateTime dt);