2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 ////////////////////////////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_NPPService
19 /// \brief The file contains declaration of CFilePersistence class.
20 /// This class is responsible for persisting and retrieving of files.
23 ////////////////////////////////////////////////////////////////////////////////////////////////////
25 #ifndef NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSIST_FILE_H_
26 #define NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSIST_FILE_H_
28 #include <native_service/ns_np_service.h>
31 #include "ns_npp_persistence.h"
33 // Forward declaration of classes.
38 * This class is responsible for persisting and retrieving of files..
40 class CFilePersistence : public CPersistence {
42 TSourceRegistryList m_mPersistFileRegistry;
45 ////////////////////////////////////////////////////////////////////////////////////////////////
47 /// Constructor of CFilePersistence class
53 ////////////////////////////////////////////////////////////////////////////////////////////////
56 ////////////////////////////////////////////////////////////////////////////////////////////////
58 /// Destructor of CFilePersistence class
64 ////////////////////////////////////////////////////////////////////////////////////////////////
67 ////////////////////////////////////////////////////////////////////////////////////////////////
69 /// Request for release file to persistent storage. File persist will be done at shutdown.
71 /// \param [IN] f_cappname
72 /// string - Name of the application requesting for persistence
74 /// \param [IN] f_ctag
75 /// string - File will be persist against this tag.
77 /// \param [IN] f_cmempath
78 /// string - File which needs to persist.
80 /// \param [IN] enotificationpersistentservicereleasetype
81 /// EFrameworkunifiedReleaseType - eFrameworkunifiedNotOnRelease = 0 :not on release
82 /// eFrameworkunifiedPersistOnShutdown :persist on shutdown
83 /// eFrameworkunifiedPersistInstantly :persist instantly
85 /// \param [IN] f_cusername
86 /// std::string - If tag is registered as user, then f_cusername holds the name of user,
87 /// else an empty string
89 /// \return EFrameworkunifiedStatus
90 // EFrameworkunifiedStatus - success or failure status
92 ////////////////////////////////////////////////////////////////////////////////////////////////
93 EFrameworkunifiedStatus Release(std::string f_cappname, std::string f_ctag, std::string f_cmempath,
94 EFrameworkunifiedReleaseType enotificationpersistentservicereleasetype, std::string f_cusername);
96 ////////////////////////////////////////////////////////////////////////////////////////////////
98 /// Load file from persistent memory to the specified location.
100 /// \param [IN] f_cappname
101 /// string - Name of the application requesting for persistence
103 /// \param [IN] f_ctag
104 /// string - File corresponding to this tag will be retrieved.
106 /// \param [IN] f_cretrievepath
107 /// string - Filepath for retrieved file.
109 /// \param [IN] f_cusername
110 /// std::string - If tag is registered as user, then f_cusername holds the name of user,
111 /// else an empty string
113 /// \return EFrameworkunifiedStatus
114 // EFrameworkunifiedStatus - success or failure status
116 ////////////////////////////////////////////////////////////////////////////////////////////////
117 EFrameworkunifiedStatus Load(std::string f_cappname, std::string f_ctag, std::string f_cretrievepath,
118 std::string f_cusername);
121 #endif // NOTIFICATION_PERSISTENT_SERVICE_SERVER_INCLUDE_NS_NPP_PERSIST_FILE_H_