Class AuditLogBuilderImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.audit.AuditLogBuilderImpl
-
- All Implemented Interfaces:
AuditLogBuilder
public class AuditLogBuilderImpl extends Object implements AuditLogBuilder
- Author:
- Maxim.Manuylov Date: 27.04.2009
-
-
Field Summary
Fields Modifier and Type Field Description static String
AUDIT_MAX_NUMBER_OF_IDS_FOR_IN_CONDITION
static String
USER_ACTION_CONDITION
-
Constructor Summary
Constructors Constructor Description AuditLogBuilderImpl(SQLRunnerEx sqlRunner, ProjectManager projectManager, CommentManager commentManager, SecurityContext securityContext, ObjectFinderProvider objectFinderProvider, AuditAdditionalObjectProvider additionalObjectProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFilter(AuditLogFilter filter)
Adds a filter for log actions.AuditLogAction
findLastAction()
Set<String>
getAllObjectIds(ObjectType objectType)
Returns set of all distinct ids for objects of the specified typeList<AuditLogAction>
getLogActions(int maxActions)
Returns built list of the audit log actions according to all filters.void
setActionTypes(ActionType... actionTypes)
Sets a set of action types we are interested invoid
setActionTypeSet(ActionTypeSet actionTypeSet)
Sets a set of action types we are interested invoid
setCommentId(long commentId)
Sets comment id we are interested invoid
setObjectId(String objectId)
Sets object id we are interested invoid
setObjectIds(Collection<String> objectIds)
Sets collection of ids of objects we're interested in.void
setUserAction(boolean userAction)
Only retrieve actions performed by usersvoid
setUserId(long userId)
Sets user id we are interested in
-
-
-
Field Detail
-
AUDIT_MAX_NUMBER_OF_IDS_FOR_IN_CONDITION
public static final String AUDIT_MAX_NUMBER_OF_IDS_FOR_IN_CONDITION
- See Also:
- Constant Field Values
-
USER_ACTION_CONDITION
public static final String USER_ACTION_CONDITION
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AuditLogBuilderImpl
public AuditLogBuilderImpl(@NotNull SQLRunnerEx sqlRunner, @NotNull ProjectManager projectManager, @NotNull CommentManager commentManager, @NotNull SecurityContext securityContext, @NotNull ObjectFinderProvider objectFinderProvider, @NotNull AuditAdditionalObjectProvider additionalObjectProvider)
-
-
Method Detail
-
setObjectId
public void setObjectId(@NotNull String objectId)
Description copied from interface:AuditLogBuilder
Sets object id we are interested in- Specified by:
setObjectId
in interfaceAuditLogBuilder
- Parameters:
objectId
- id of the object
-
setObjectIds
public void setObjectIds(@NotNull Collection<String> objectIds)
Description copied from interface:AuditLogBuilder
Sets collection of ids of objects we're interested in.- Specified by:
setObjectIds
in interfaceAuditLogBuilder
- Parameters:
objectIds
- ids of objects
-
setUserId
public void setUserId(long userId)
Description copied from interface:AuditLogBuilder
Sets user id we are interested in- Specified by:
setUserId
in interfaceAuditLogBuilder
- Parameters:
userId
- id of the user
-
setUserAction
public void setUserAction(boolean userAction)
Description copied from interface:AuditLogBuilder
Only retrieve actions performed by users- Specified by:
setUserAction
in interfaceAuditLogBuilder
- Parameters:
userAction
- if true, only users actions are returned, if false all actions are returned
-
setCommentId
public void setCommentId(long commentId)
Description copied from interface:AuditLogBuilder
Sets comment id we are interested in- Specified by:
setCommentId
in interfaceAuditLogBuilder
- Parameters:
commentId
- id of the comment
-
setActionTypeSet
public void setActionTypeSet(ActionTypeSet actionTypeSet)
Description copied from interface:AuditLogBuilder
Sets a set of action types we are interested in- Specified by:
setActionTypeSet
in interfaceAuditLogBuilder
- Parameters:
actionTypeSet
- action type set
-
setActionTypes
public void setActionTypes(ActionType... actionTypes)
Description copied from interface:AuditLogBuilder
Sets a set of action types we are interested in- Specified by:
setActionTypes
in interfaceAuditLogBuilder
- Parameters:
actionTypes
- action types
-
addFilter
public void addFilter(@NotNull AuditLogFilter filter)
Description copied from interface:AuditLogBuilder
Adds a filter for log actions. Action will be accepted if all the filters accept it.- Specified by:
addFilter
in interfaceAuditLogBuilder
- Parameters:
filter
- filter
-
getAllObjectIds
@NotNull public Set<String> getAllObjectIds(@NotNull ObjectType objectType)
Description copied from interface:AuditLogBuilder
Returns set of all distinct ids for objects of the specified type- Specified by:
getAllObjectIds
in interfaceAuditLogBuilder
- Returns:
- set of all distinct ids for objects of the specified type
-
getLogActions
@NotNull public List<AuditLogAction> getLogActions(int maxActions)
Description copied from interface:AuditLogBuilder
Returns built list of the audit log actions according to all filters.- Specified by:
getLogActions
in interfaceAuditLogBuilder
- Parameters:
maxActions
- if -1 returns all actions, otherwise returns no more than specified number of actions- Returns:
- built list of the audit log actions according to all filters
-
findLastAction
@Nullable public AuditLogAction findLastAction()
- Specified by:
findLastAction
in interfaceAuditLogBuilder
- Returns:
- the last action corresponding to specified filters or null, if there is no such action
-
-