2 * Copyright © 2018-2019 AT&T Intellectual Property.
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 package org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization
19 import org.onap.ccsdk.cds.blueprintsprocessor.functions.message.prioritization.db.MessagePrioritization
22 interface MessagePrioritizationStateService {
24 suspend fun saveMessage(message: MessagePrioritization): MessagePrioritization
26 suspend fun getMessage(id: String): MessagePrioritization
28 suspend fun getMessages(ids: List<String>): List<MessagePrioritization>?
30 suspend fun getExpiryEligibleMessages(count: Int): List<MessagePrioritization>?
32 suspend fun getMessageForStatesNotExpiredIn(group: String, states: List<String>, count: Int):
33 List<MessagePrioritization>?
35 suspend fun getMessageForStatesExpired(group: String, states: List<String>, count: Int):
36 List<MessagePrioritization>?
38 suspend fun getExpiredMessages(expiryDate: Date, count: Int): List<MessagePrioritization>?
40 suspend fun getExpiredMessages(group: String, expiryDate: Date, count: Int): List<MessagePrioritization>?
42 suspend fun getCorrelatedMessages(
46 correlationIds: String
47 ): List<MessagePrioritization>?
49 suspend fun updateMessagesState(ids: List<String>, state: String)
51 suspend fun updateMessageState(id: String, state: String): MessagePrioritization
53 suspend fun setMessageState(id: String, state: String)
55 suspend fun setMessagesPriority(ids: List<String>, priority: String)
57 suspend fun setMessagesState(ids: List<String>, state: String)
59 suspend fun setMessageStateANdError(id: String, state: String, error: String)
61 suspend fun setMessageStateAndAggregatedIds(id: String, state: String, aggregatedIds: List<String>)
63 suspend fun deleteMessage(id: String)
65 suspend fun deleteMessages(id: List<String>)
67 suspend fun deleteExpiredMessage(retentionDays: Int)
69 suspend fun deleteMessageByGroup(group: String)
71 suspend fun deleteMessageStates(group: String, states: List<String>)