5bed9f7a3a3fcab2a58ca3e2214ddeb1a3c0fec2
[ccsdk/features.git] /
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
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
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
15  * the License.
16  * ============LICENSE_END==========================================================================
17  ******************************************************************************/
18 package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
19
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;
23
24 /**
25  * @author herbert
26  *
27  */
28 public interface NetconfTimeStamp {
29
30         /**
31          * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format
32          *
33          * @return String with Date in NETCONF/YANG Format Version 1.0.
34          */
35         String getTimeStampAsNetconfString();
36
37         /**
38          * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format
39         
40          * @return String with Date in NETCONF/YANG Format Version 1.0.
41          */
42         String getTimeStampAsNetconfString(Date date);
43
44         /**
45          * Get actual timestamp as NETCONF specific type NETCONF/YANG 1.0 Format in GMT
46          *
47          * @return DateAndTime Type 1.0. Date in NETCONF/YANG Format Version 1.0.
48          */
49         DateAndTime getTimeStamp();
50
51         /**
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.
55          */
56         DateAndTime getTimeStamp(Date date);
57
58         /**
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.
62          */
63         DateAndTime getTimeStamp(String date);
64
65         /**
66          * Return the String with a NETCONF time converted to long
67          *
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
71          */
72         long getTimeStampFromNetconfAsMilliseconds(String netconfTime) throws IllegalArgumentException;
73
74         /**
75          * Deliver String result.
76          *
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.
80          */
81         String getTimeStampFromNetconf(String netconfTime);
82
83         Date getDateFromNetconf(String netconfTime);
84
85         String getTimeStampAsNetconfString(LocalDateTime dt);
86
87 }