Class MacMetadata
- java.lang.Object
-
- com.day.cq.analytics.testandtarget.mac.MacMetadata
-
@ProviderType public class MacMetadata extends java.lang.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(java.lang.String attributeName, java.lang.String attributeValue)
Adds a Marketing Cloud Metadata attribute / value pair to this offer request.MacMetadata
addAttribute(java.lang.String attributeName, java.lang.String[] attributeValues)
Adds a Marketing Cloud Metadata attribute / value pair to this offer request.static MacMetadata
generateMandatoryMetadata(java.lang.String editUrl, java.lang.String remoteModifiedBy)
Generates the mandatory metadata.java.util.Map<java.lang.String,java.lang.String>
getMarketingCloudMetadata()
Retrieves the list of the Marketing Cloud Metadata attributes.java.lang.String
getValue(java.lang.String attributeName)
Retrieves the value of a specific attribute from this metadata setjava.lang.String[]
getValues(java.lang.String attributeName)
Retrieves the value of a specific attribute from this metadata set, specifying what type should the returned value bevoid
removeAttribute(java.lang.String attributeName)
Removes a Marketing Cloud Metadata attribute from the list.
-
-
-
Method Detail
-
addAttribute
@Nonnull public MacMetadata addAttribute(@Nonnull java.lang.String attributeName, @Nonnull java.lang.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 java.lang.String attributeName, @Nonnull java.lang.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 java.lang.String attributeName)
Removes a Marketing Cloud Metadata attribute from the list.- Parameters:
attributeName
- the name of the attribute.
-
getMarketingCloudMetadata
public java.util.Map<java.lang.String,java.lang.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 java.lang.String getValue(@Nonnull java.lang.String attributeName)
Retrieves the value of a specific attribute from this metadata set- Parameters:
attributeName
- the name of the attribute- Returns:
- a
String
containing the value, ornull
if the value is not found or it's not aString
.
-
getValues
@Nullable public java.lang.String[] getValues(@Nonnull java.lang.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 java.lang.String editUrl, @Nonnull java.lang.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
-
-