Package com.atlan.samples.reporters
Class AbstractReporter
- java.lang.Object
-
- com.atlan.samples.reporters.AbstractReporter
-
- Direct Known Subclasses:
AssetReporter,EnrichmentReporter,SlackDiscussionReporter,UserReporter
public abstract class AbstractReporter extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static doubleBYTES_IN_GBstatic java.lang.StringTIMESTAMP_FORMAT
-
Constructor Summary
Constructors Constructor Description AbstractReporter()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static java.lang.StringgetAssetLink(java.lang.String guid)protected java.lang.StringgetAtlanTags(com.atlan.model.assets.Asset asset)Retrieve a comma-separated list of all Atlan tags assigned to the provided asset, whether directly or through propagation.intgetBatchSize()java.lang.StringgetBucket()protected java.lang.StringgetComplexList(java.util.Collection<java.lang.String> items)Retrieve a list of multiple complex values as a single string, basically JSON-structured.protected static intgetCount(java.util.Collection<?> collection)protected java.lang.StringgetDelimitedList(java.util.Collection<java.lang.String> items)Retrieve a list of multiple values as a single string, separated by the provided delimiter.java.lang.StringgetDelimiter()protected static java.lang.StringgetDescription(com.atlan.model.assets.Asset asset)protected java.lang.StringgetDirectAtlanTags(com.atlan.model.assets.Asset asset)Retrieve a comma-separated list of only the directly-assigned (not propagated) Atlan tags to the provided asset.java.lang.StringgetFilename()protected static java.lang.StringgetFormattedDateTime(java.lang.Long ts)protected java.lang.StringgetGroupOwners(com.atlan.model.assets.Asset asset)protected static java.lang.StringgetREADME(com.atlan.model.assets.Asset asset)software.amazon.awssdk.regions.RegiongetRegion()protected java.lang.StringgetStringValueForField(com.atlan.model.assets.Asset from, com.atlan.model.fields.AtlanField field)Translates the provided value for the provided field on the provided asset into a string representation that can be encoded into a single cell of Excel / CSV.protected java.lang.StringgetUserOwners(com.atlan.model.assets.Asset asset)protected static java.lang.StringgetValue(com.atlan.model.enums.AtlanEnum e)protected voidparseParametersFromEvent(java.util.Map<java.lang.String,java.lang.String> event)Extract the configuration parameters to use from the lambda payload (or equivalent).protected static java.lang.StringprotectFromNull(java.lang.Object o)protected java.lang.StringserializeAssetRefToCSV(com.atlan.model.assets.Asset asset)Serialize the provided asset reference into a form that can be stored in a single cell of CSV.protected java.lang.StringserializeStructToCSV(com.atlan.model.structs.AtlanStruct struct)Serialize the provided struct into a form that can be stored in a single cell of CSV.protected java.lang.StringserializeValueToCSV(java.lang.String fromGuid, java.lang.Object value)Serialize the provided value into a form that can be stored in a single cell of CSV.voidsetFilename(java.lang.String _filename)protected voidsetFilenameWithPrefix(java.util.Map<java.lang.String,java.lang.String> event, java.lang.String prefix)protected voidsetFilenameWithPrefix(java.util.Map<java.lang.String,java.lang.String> event, java.lang.String prefix, java.lang.String extension)
-
-
-
Field Detail
-
BYTES_IN_GB
public static final double BYTES_IN_GB
- See Also:
- Constant Field Values
-
TIMESTAMP_FORMAT
public static final java.lang.String TIMESTAMP_FORMAT
- See Also:
- Constant Field Values
-
-
Method Detail
-
parseParametersFromEvent
protected void parseParametersFromEvent(java.util.Map<java.lang.String,java.lang.String> event)
Extract the configuration parameters to use from the lambda payload (or equivalent).- Parameters:
event- configuration payload from the lambda function (or equivalent)
-
setFilenameWithPrefix
protected void setFilenameWithPrefix(java.util.Map<java.lang.String,java.lang.String> event, java.lang.String prefix)
-
setFilenameWithPrefix
protected void setFilenameWithPrefix(java.util.Map<java.lang.String,java.lang.String> event, java.lang.String prefix, java.lang.String extension)
-
getFormattedDateTime
protected static java.lang.String getFormattedDateTime(java.lang.Long ts)
-
getAssetLink
protected static java.lang.String getAssetLink(java.lang.String guid)
-
getDescription
protected static java.lang.String getDescription(com.atlan.model.assets.Asset asset)
-
getUserOwners
protected java.lang.String getUserOwners(com.atlan.model.assets.Asset asset)
-
getGroupOwners
protected java.lang.String getGroupOwners(com.atlan.model.assets.Asset asset)
-
getCount
protected static int getCount(java.util.Collection<?> collection)
-
getValue
protected static java.lang.String getValue(com.atlan.model.enums.AtlanEnum e)
-
protectFromNull
protected static java.lang.String protectFromNull(java.lang.Object o)
-
getREADME
protected static java.lang.String getREADME(com.atlan.model.assets.Asset asset)
-
getAtlanTags
protected java.lang.String getAtlanTags(com.atlan.model.assets.Asset asset)
Retrieve a comma-separated list of all Atlan tags assigned to the provided asset, whether directly or through propagation.- Parameters:
asset- for which to find Atlan tags- Returns:
- comma-separated list of the Atlan tags
-
getDirectAtlanTags
protected java.lang.String getDirectAtlanTags(com.atlan.model.assets.Asset asset)
Retrieve a comma-separated list of only the directly-assigned (not propagated) Atlan tags to the provided asset.- Parameters:
asset- for which to find direct Atlan tags- Returns:
- comma-separated list of the direct Atlan tags
-
getDelimitedList
protected java.lang.String getDelimitedList(java.util.Collection<java.lang.String> items)
Retrieve a list of multiple values as a single string, separated by the provided delimiter.- Parameters:
items- to combine into a single string- Returns:
- a single string of all items separated by the delimiter
-
getComplexList
protected java.lang.String getComplexList(java.util.Collection<java.lang.String> items)
Retrieve a list of multiple complex values as a single string, basically JSON-structured.- Parameters:
items- to combine into a single string- Returns:
- a single string of all items
-
getStringValueForField
protected java.lang.String getStringValueForField(com.atlan.model.assets.Asset from, com.atlan.model.fields.AtlanField field)Translates the provided value for the provided field on the provided asset into a string representation that can be encoded into a single cell of Excel / CSV.- Parameters:
from- the asset from which to read the valuefield- the attribute rom which to read the value- Returns:
- the string-encoded form that can be placed in a single cell
-
serializeValueToCSV
protected java.lang.String serializeValueToCSV(java.lang.String fromGuid, java.lang.Object value)Serialize the provided value into a form that can be stored in a single cell of CSV.- Parameters:
fromGuid- the GUID of the asset being serialized (needed to determine direct vs propagated Atlan tags)value- the value to be serialized- Returns:
- a String representation of the value that can be stored in a single cell of CSV
-
serializeAssetRefToCSV
protected java.lang.String serializeAssetRefToCSV(com.atlan.model.assets.Asset asset)
Serialize the provided asset reference into a form that can be stored in a single cell of CSV.- Parameters:
asset- the related asset to be serialized- Returns:
- a String representation of the related asset
-
serializeStructToCSV
protected java.lang.String serializeStructToCSV(com.atlan.model.structs.AtlanStruct struct)
Serialize the provided struct into a form that can be stored in a single cell of CSV. Note: this is not yet implemented!- Parameters:
struct- the struct instance to be serialized- Returns:
- a String representation of the struct instance
-
setFilename
public void setFilename(java.lang.String _filename)
-
getFilename
public java.lang.String getFilename()
-
getBucket
public java.lang.String getBucket()
-
getRegion
public software.amazon.awssdk.regions.Region getRegion()
-
getBatchSize
public int getBatchSize()
-
getDelimiter
public java.lang.String getDelimiter()
-
-