public class AuditEntitiesUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Optional<String> |
getExtraAttributeByI18nKeyOrName(com.atlassian.audit.entity.AuditEntity auditEntity,
String i18nKey,
String name)
Returns extra attribute value of the audit entity.
|
static com.atlassian.audit.entity.AuditAttribute |
newAuditAttribute(String nameI18nKey,
String value)
Creates a new instance of
AuditAttribute using the passed parameters. |
static List<com.atlassian.audit.entity.AuditAttribute> |
newAuditAttributes(Map<String,String> attributes)
Creates a new list of
AuditAttributes using the passed attribute map. |
static com.atlassian.audit.entity.AuditResource |
newAuditResource(String name,
String type,
String id)
Creates a new instace of
AuditResource using the passed parameters |
static com.atlassian.audit.entity.AuditType |
newAuditType(com.atlassian.audit.entity.CoverageArea area,
AuditingCategory category,
String actionI18nKey,
com.atlassian.audit.entity.CoverageLevel level)
Deprecated.
since v8.12.2
Instead use newAuditType(CoverageArea, String, String, CoverageLevel). |
static com.atlassian.audit.entity.AuditType |
newAuditType(com.atlassian.audit.entity.CoverageArea area,
String categoryI18nKey,
String actionI18nKey,
com.atlassian.audit.entity.CoverageLevel level)
Creates a new
AuditType instance using the passed parameters. |
static com.atlassian.audit.entity.AuditType |
newAuditTypeWithTranslations(com.atlassian.audit.entity.CoverageArea area,
String categoryI18nKey,
String actionI18nKey,
com.atlassian.audit.entity.CoverageLevel level,
String categoryTranslation,
String actionTranslation)
Creates a new
AuditType instance using the passed parameters. |
static com.atlassian.audit.entity.ChangedValue |
newChangedValue(String i18nKey,
String to)
Creates a new instance of
ChangedValue using the passed parameters. |
static com.atlassian.audit.entity.ChangedValue |
newChangedValue(String i18nKey,
String from,
String to)
Creates a new instance of
ChangedValue using the passed parameters. |
static com.atlassian.audit.entity.ChangedValue |
newChangedValueWithTranslation(String i18nKey,
String from,
String to,
String keyTranslation)
Creates a new instance of
ChangedValue using the passed parameters. |
public static com.atlassian.audit.entity.AuditType newAuditTypeWithTranslations(@Nonnull com.atlassian.audit.entity.CoverageArea area, @Nonnull String categoryI18nKey, @Nonnull String actionI18nKey, @Nonnull com.atlassian.audit.entity.CoverageLevel level, @Nullable String categoryTranslation, @Nullable String actionTranslation)
AuditType instance using the passed parameters.
AuditEntityConverter
to perform migration of the old audit logs to the new system in case the category or action I18n Keys are empty.
Avoid in favor of newAuditType(CoverageArea, String, String, CoverageLevel).area - coverage areacategoryI18nKey - auditing category i18n keyactionI18nKey - action i18n keylevel - coverage levelcategoryTranslation - the translation for the category keyactionTranslation - the translation for the action keyAuditType@Deprecated public static com.atlassian.audit.entity.AuditType newAuditType(@Nonnull com.atlassian.audit.entity.CoverageArea area, @Nonnull AuditingCategory category, @Nonnull String actionI18nKey, @Nonnull com.atlassian.audit.entity.CoverageLevel level)
newAuditType(CoverageArea, String, String, CoverageLevel).AuditType instance using the passed parameters.area - coverage areacategory - auditing categoryactionI18nKey - action i18n keylevel - coverage levelAuditTypepublic static com.atlassian.audit.entity.AuditType newAuditType(@Nonnull com.atlassian.audit.entity.CoverageArea area, @Nonnull String categoryI18nKey, @Nonnull String actionI18nKey, @Nonnull com.atlassian.audit.entity.CoverageLevel level)
AuditType instance using the passed parameters.area - coverage areacategoryI18nKey - auditing category i18n key. It is recommended to use categories from AuditCategory.actionI18nKey - action i18n keylevel - coverage levelAuditTypepublic static com.atlassian.audit.entity.AuditAttribute newAuditAttribute(@Nonnull String nameI18nKey, @Nullable String value)
AuditAttribute using the passed parameters.nameI18nKey - attribute i18n key namevalue - attribute valueAuditAttributepublic static List<com.atlassian.audit.entity.AuditAttribute> newAuditAttributes(@Nonnull Map<String,String> attributes)
AuditAttributes using the passed attribute map.attributes - map containing attributes with i18n key name as a key and attribute value as a valueAuditAttributespublic static com.atlassian.audit.entity.ChangedValue newChangedValue(@Nonnull String i18nKey, @Nullable String to)
ChangedValue using the passed parameters.i18nKey - changed value i18n keyto - changed value toChangedValuepublic static com.atlassian.audit.entity.ChangedValue newChangedValue(@Nonnull String i18nKey, @Nullable String from, @Nullable String to)
ChangedValue using the passed parameters.i18nKey - changed value i18n keyfrom - changed value fromto - changed value toChangedValuepublic static com.atlassian.audit.entity.ChangedValue newChangedValueWithTranslation(@Nonnull String i18nKey, @Nullable String from, @Nullable String to, @Nullable String keyTranslation)
ChangedValue using the passed parameters.i18nKey - changed value i18n keyfrom - changed value fromto - changed value tokeyTranslation - translation for the keyChangedValuepublic static com.atlassian.audit.entity.AuditResource newAuditResource(@Nonnull String name, @Nonnull String type, @Nonnull String id)
AuditResource using the passed parametersname - the unique name of the resourcetype - of the resource see AssociatedItem.Typeid - of the resourceAuditResourcepublic static Optional<String> getExtraAttributeByI18nKeyOrName(@Nonnull com.atlassian.audit.entity.AuditEntity auditEntity, @Nonnull String i18nKey, @Nonnull String name)
auditEntity - entity containing extra attributesi18nKey - the i18n key of the audit entity extra attributename - the name of the audit entity extra attributeCopyright © 2002-2024 Atlassian. All Rights Reserved.