2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.policy.drools.apps.controlloop.feature.trans;
23 import java.util.List;
24 import java.util.UUID;
25 import org.onap.policy.controlloop.VirtualControlLoopNotification;
26 import org.onap.policy.drools.system.PolicyController;
29 * Control Loop Metrics Tracker.
31 public interface ControlLoopMetrics {
34 * Singleton manager object.
36 ControlLoopMetrics manager = new CacheBasedControlLoopMetricsManager();
39 * Gets all transaction identifiers being monitored.
41 * @return transaction id list
43 List<UUID> getTransactionIds();
46 * Gets all detailed transactions.
48 * @return list of transactions
50 List<VirtualControlLoopNotification> getTransactions();
53 * Track controller's notification events.
55 * @param controller policy controller sending out notification
56 * @param notification notification
58 void transactionEvent(PolicyController controller, VirtualControlLoopNotification notification);
61 * Gets an in-progress transaction.
63 * @param requestId request ID
64 * @return in progress notification
66 VirtualControlLoopNotification getTransaction(UUID requestId);
69 * Removes an in-progress transaction.
71 * @param requestId request ID
73 void removeTransaction(UUID requestId);
87 long getCacheOccupancy();
92 * @param cacheSize cache size
94 void setMaxCacheSize(long cacheSize);
97 * Cached transaction expiration timeout in seconds.
99 * @return transaction timeout in seconds
101 long getTransactionTimeout();
104 * Sets transaction timeout in seconds.
106 * @param transactionTimeout transaction timeout in seconds
108 void setTransactionTimeout(long transactionTimeout);
113 * @param cacheSize new cache size
114 * @param transactionTimeout new transaction timeout in seconds
116 void resetCache(long cacheSize, long transactionTimeout);
119 * Refresh underlying transaction management.