Class MacMetadata
- java.lang.Object
-
- com.day.cq.analytics.testandtarget.mac.MacMetadata
-
@ProviderType public class MacMetadata extends Object
Holds the Marketing Cloud Metadata which is attached to objects exported to Target. Not all objects require this metadata, so for now it's only attached to offers and activities
-
-
Constructor Summary
Constructors Constructor Description MacMetadata()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MacMetadata
addAttribute(String attributeName, String attributeValue)
Adds a Marketing Cloud Metadata attribute / value pair to this offer request.MacMetadata
addAttribute(String attributeName, String[] attributeValues)
Adds a Marketing Cloud Metadata attribute / value pair to this offer request.static MacMetadata
generateMandatoryMetadata(String editUrl, String remoteModifiedBy)
Generates the mandatory metadata.Map<String,String>
getMarketingCloudMetadata()
Retrieves the list of the Marketing Cloud Metadata attributes.String
getValue(String attributeName)
Retrieves the value of a specific attribute from this metadata setString[]
getValues(String attributeName)
Retrieves the value of a specific attribute from this metadata set, specifying what type should the returned value bevoid
removeAttribute(String attributeName)
Removes a Marketing Cloud Metadata attribute from the list.
-
-
-
Method Detail
-
addAttribute
@Nonnull public MacMetadata addAttribute(@Nonnull String attributeName, @Nonnull String attributeValue)
Adds a Marketing Cloud Metadata attribute / value pair to this offer request. The following restrictions apply:- the attributeName or attributeValue must not exceed 250 chars in length
- The maximum size of the MAC Metadata list is 15 items
RuntimeException
if any of the above mentioned restrictions are hit.- Parameters:
attributeName
- the name of the attributeattributeValue
- the value of the attribute- Returns:
MacMetadata
-
addAttribute
public MacMetadata addAttribute(@Nonnull String attributeName, @Nonnull String[] attributeValues)
Adds a Marketing Cloud Metadata attribute / value pair to this offer request. The following restrictions apply:- the attributeName or attributeValue must not exceed 250 chars in length
- The maximum size of the MAC Metadata list is 15 items
RuntimeException
if any of the above mentioned restrictions are hit.- Parameters:
attributeName
- the name of the attributeattributeValues
- the values of the attributes- Returns:
MacMetadata
-
removeAttribute
public void removeAttribute(@Nonnull String attributeName)
Removes a Marketing Cloud Metadata attribute from the list.- Parameters:
attributeName
- the name of the attribute.
-
getMarketingCloudMetadata
public Map<String,String> getMarketingCloudMetadata()
Retrieves the list of the Marketing Cloud Metadata attributes.- Returns:
- a
Map
having the attribute names as keys and the attribute values as values.
-
getValue
@Nullable public String getValue(@Nonnull String attributeName)
Retrieves the value of a specific attribute from this metadata set
-
getValues
@Nullable public String[] getValues(@Nonnull String attributeName)
Retrieves the value of a specific attribute from this metadata set, specifying what type should the returned value be- Parameters:
attributeName
- the name of the attribute- Returns:
- the value cast to the specified type
-
generateMandatoryMetadata
@Nonnull public static MacMetadata generateMandatoryMetadata(@Nonnull String editUrl, @Nonnull String remoteModifiedBy)
Generates the mandatory metadata. The mandatory metadata contains the following attributes:- The edit url of the object, i.e. the full URL used to open the object in it's editor in AEM
- The user that perform the last modification
- The source product name (in our case Adobe Experience Manager)
- Parameters:
editUrl
- the URL which is used to access the objectremoteModifiedBy
- the user which performed the last modification- Returns:
- a
MacMetadata
object containing the three attributes above
-
-