Interface AuditMessagesManagerImplApi
- All Known Implementing Classes:
AuditMessagesManagerImpl
public interface AuditMessagesManagerImplApi
This interface represents AuditMessagesManagerImpl methods.
- Author:
- Pavel Zlámal
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkAuditerConsumerExists
(PerunSession session, String consumerName) Returns TRUE if auditer consumer with specified name exist.void
createAuditerConsumer
(PerunSession perunSession, String consumerName) Creates new auditer consumer with last processed id which equals current auditer log max id.getAllAuditerConsumers
(PerunSession perunSession) Get all registered auditer consumers as map name(String)=lastProcessedId(Integer).int
getAuditerMessagesCount
(PerunSession perunSession) Get count of all messages in auditLOG.int
getLastMessageId
(PerunSession perunSession) Get ID of last (newest) message in audit log (max_id).getMessages
(PerunSession perunSession, int count) Returns exact number of newest audit messages defined by 'count' param (disregarding message IDs).getMessagesByCount
(PerunSession perunSession, int count) Returns all messages with IDs within the range from max(ID) to (max(ID)-count), where number of returned messages is equal or less than 'count' param, because some IDs could be skipped in the sequence.getMessagesByIdAndCount
(PerunSession perunSession, int id, int count) Returns "count" number of messages that are more or equal than the given ID (ascending order), i.e.getMessagesPage
(PerunSession perunSession, MessagesPageQuery query) Returns page of audit messages.pollConsumerEvents
(PerunSession perunSession, String consumerName, int lastProcessedId) Returns list of AuditEvents from audit log with IDs > lastProcessedId for registered auditer consumer.pollConsumerMessages
(PerunSession perunSession, String consumerName) Returns list of AuditMessages from audit log with IDs > lastProcessedId for registered auditer consumer.pollConsumerMessages
(PerunSession perunSession, String consumerName, int lastProcessedId) Returns list of AuditMessages from audit log with IDs > lastProcessedId for registered auditer consumer.void
setLastProcessedId
(PerunSession perunSession, String consumerName, int lastProcessedId) Deprecated.
-
Method Details
-
checkAuditerConsumerExists
Returns TRUE if auditer consumer with specified name exist.- Parameters:
session
- PerunSessionconsumerName
- Name of consumer to check- Returns:
- TRUE if consumer exists by name / FALSE otherwise
- Throws:
InternalErrorException
- When implementation fails
-
createAuditerConsumer
Creates new auditer consumer with last processed id which equals current auditer log max id.- Parameters:
perunSession
- perun sessionconsumerName
- new name for consumer- Throws:
InternalErrorException
- When implementation fails
-
getAllAuditerConsumers
Get all registered auditer consumers as map name(String)=lastProcessedId(Integer).- Parameters:
perunSession
- perun session- Returns:
- Mapping of auditer consumer names to their last processed ID.
- Throws:
InternalErrorException
- When implementation fails
-
getAuditerMessagesCount
Get count of all messages in auditLOG.- Parameters:
perunSession
- perun session- Returns:
- Count of all messages in audit log
- Throws:
InternalErrorException
- When implementation fails
-
getLastMessageId
Get ID of last (newest) message in audit log (max_id).- Parameters:
perunSession
- perun session- Returns:
- ID of last (newest) message.
- Throws:
InternalErrorException
- When implementation fails
-
getMessages
Returns exact number of newest audit messages defined by 'count' param (disregarding message IDs). If there is less messages present, then all of them are returned.- Parameters:
perunSession
- perun sessioncount
- Count of returned messages.- Returns:
- List of audit messages
- Throws:
InternalErrorException
- When implementation fails
-
getMessagesByCount
Returns all messages with IDs within the range from max(ID) to (max(ID)-count), where number of returned messages is equal or less than 'count' param, because some IDs could be skipped in the sequence.- Parameters:
perunSession
- perun sessioncount
- Number of IDs to subtract from max(ID)- Returns:
- List of audit messages
- Throws:
InternalErrorException
- When implementation fails
-
getMessagesByIdAndCount
Returns "count" number of messages that are more or equal than the given ID (ascending order), i.e. the method returns newer messages by provided ID.- Parameters:
perunSession
- perun sessionid
- starting id from which the messages will be takencount
- Number of messages that will be returned- Returns:
- List of audit messages
-
getMessagesPage
Returns page of audit messages. Query parameter specifies offset and page size and allows filtering by name of event. Total count is only estimated.- Parameters:
perunSession
- perun session- Returns:
- Page of audit messages
- Throws:
InternalErrorException
- When implementation fails
-
pollConsumerEvents
List<AuditEvent> pollConsumerEvents(PerunSession perunSession, String consumerName, int lastProcessedId) Returns list of AuditEvents from audit log with IDs > lastProcessedId for registered auditer consumer. Number of returned events for one call is limited (by default 10 000). You might need to fetch additional events by repeating this call.- Parameters:
perunSession
- perun sessionconsumerName
- consumer to get messages forlastProcessedId
- id of the last message- Returns:
- List of audit messages
- Throws:
InternalErrorException
- When implementation fails
-
pollConsumerMessages
Returns list of AuditMessages from audit log with IDs > lastProcessedId for registered auditer consumer. Number of returned messages for one call is limited (by default 10 000). You might need to fetch additional messages by repeating this call.- Parameters:
perunSession
- perun sessionconsumerName
- consumer to get messages for- Returns:
- List of audit messages
- Throws:
InternalErrorException
- When implementation fails
-
pollConsumerMessages
List<AuditMessage> pollConsumerMessages(PerunSession perunSession, String consumerName, int lastProcessedId) Returns list of AuditMessages from audit log with IDs > lastProcessedId for registered auditer consumer. Number of returned messages for one call is limited (by default 10 000). You might need to fetch additional messages by repeating this call.- Parameters:
perunSession
- perun sessionconsumerName
- consumer to get messages forlastProcessedId
- id of the last message- Returns:
- List of audit messages
- Throws:
InternalErrorException
- When implementation fails
-
setLastProcessedId
@Deprecated void setLastProcessedId(PerunSession perunSession, String consumerName, int lastProcessedId) Deprecated.Set ID of last processed message for specified consumer.- Parameters:
perunSession
- perun sessionconsumerName
- name of consumerlastProcessedId
- id of last processed message in consumer- Throws:
InternalErrorException
- When implementation fails
-