Class ContentMigrationRecord
- java.lang.Object
-
- org.onehippo.forge.content.exim.core.ContentMigrationRecord
-
- All Implemented Interfaces:
Serializable
public class ContentMigrationRecord extends Object implements Serializable
Content Migration record which is used to keep execution information of a unit of content migration work item.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ContentMigrationRecord()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getAttribute(String name)
Finds and returns the attribute value by thename
if found.AtomicInteger
getAttributeAsAtomicInteger(String name, boolean create)
Gets an attribute value asAtomicInteger
object if found.Collection<Object>
getAttributeAsCollection(String name, boolean create)
Gets an attribute value asCollection
object if found.String
getAttributeAsString(String name)
Gets an attribute value asString
object if found.Map<String,Object>
getAttributeMap()
Returns an unmodifiable map of extra custom attributes.Set<String>
getAttributeNames()
Returns an unmodifiable set of extra custom attribute names.String
getContentId()
Returns the content node identifier of the associated subject content processed.String
getContentPath()
Returns the content path of the associated subject content processed.String
getContentType()
Returns the content primary node type name of the associated subject content processed.String
getErrorMessage()
Returns the error detail message if the unit of content migration work item in this record failed.boolean
isProcessed()
Returns true if the unit of content migration work item in this record was processed.boolean
isSucceeded()
Returns true if the unit of content migration work item in this record was done successfully.Object
removeAttribute(String name)
Removes an attribute byname
and returns the removed attribute value if found.void
setAttribute(String name, Object value)
Sets an extra custom attribute.void
setContentId(String contentId)
Sets the content node identifier of the associated subject content processing.void
setContentPath(String contentPath)
Sets the content path of the associated subject content processing.void
setContentType(String contentType)
Sets the content primary node type name of the associated subject content processing.void
setErrorMessage(String errorMessage)
Set the error detail message if the unit of content migration work item in this record failed.void
setProcessed(boolean processed)
Sets whether or not the unit of content migration work item in this record was processed.void
setSucceeded(boolean succeeded)
Sets whether or not the unit of content migration work item in this record was done successfully.String
toString()
-
-
-
Method Detail
-
isProcessed
public boolean isProcessed()
Returns true if the unit of content migration work item in this record was processed.- Returns:
- true if the unit of content migration work item in this record was processed
-
setProcessed
public void setProcessed(boolean processed)
Sets whether or not the unit of content migration work item in this record was processed.- Parameters:
processed
- whether or not the unit of content migration work item in this record was processed
-
isSucceeded
public boolean isSucceeded()
Returns true if the unit of content migration work item in this record was done successfully.- Returns:
- true if the unit of content migration work item in this record was done successfully
-
setSucceeded
public void setSucceeded(boolean succeeded)
Sets whether or not the unit of content migration work item in this record was done successfully.- Parameters:
succeeded
- whether or not the unit of content migration work item in this record was done successfully
-
getErrorMessage
public String getErrorMessage()
Returns the error detail message if the unit of content migration work item in this record failed.- Returns:
- the error detail message if the unit of content migration work item in this record failed
-
setErrorMessage
public void setErrorMessage(String errorMessage)
Set the error detail message if the unit of content migration work item in this record failed.- Parameters:
errorMessage
- the error detail message if the unit of content migration work item in this record failed
-
getContentType
public String getContentType()
Returns the content primary node type name of the associated subject content processed.- Returns:
- the content primary node type name of the associated subject content processed
-
setContentType
public void setContentType(String contentType)
Sets the content primary node type name of the associated subject content processing.- Parameters:
contentType
- the content primary node type name of the associated subject content processing
-
getContentId
public String getContentId()
Returns the content node identifier of the associated subject content processed.- Returns:
- the content primary node identifier of the associated subject content processed
-
setContentId
public void setContentId(String contentId)
Sets the content node identifier of the associated subject content processing.- Parameters:
contentId
- the content node identifier of the associated subject content processing
-
getContentPath
public String getContentPath()
Returns the content path of the associated subject content processed.- Returns:
- the content path of the associated subject content processed
-
setContentPath
public void setContentPath(String contentPath)
Sets the content path of the associated subject content processing.- Parameters:
contentPath
- the content path of the associated subject content processing
-
getAttributeMap
public Map<String,Object> getAttributeMap()
Returns an unmodifiable map of extra custom attributes.- Returns:
- an unmodifiable map of extra custom attributes
-
getAttributeNames
public Set<String> getAttributeNames()
Returns an unmodifiable set of extra custom attribute names.- Returns:
- an unmodifiable set of extra custom attribute names
-
setAttribute
public void setAttribute(String name, Object value)
Sets an extra custom attribute.- Parameters:
name
- attribute namevalue
- attribute value
-
getAttribute
public Object getAttribute(String name)
Finds and returns the attribute value by thename
if found. Otherwise, return null.- Parameters:
name
- attribute name- Returns:
- attribute value if found. Otherwise null.
-
getAttributeAsString
public String getAttributeAsString(String name)
Gets an attribute value asString
object if found. If not found, returns an empty string instead. This method is useful if you want to retrieve an attribute always as string or empty string value when it is null.- Parameters:
name
- attribute name- Returns:
- an attribute value as
String
object if found. If not found, returns an empty string instead
-
getAttributeAsAtomicInteger
public AtomicInteger getAttributeAsAtomicInteger(String name, boolean create)
Gets an attribute value asAtomicInteger
object if found. If not found, returns null whencreate
is false, or sets and returns a newAtomicInteger
object whencreate
is true. This method is useful if you want to record a counter for some reason while processing data.- Parameters:
name
- attribute namecreate
- whether or not to create if attribute not found byname
- Returns:
- an attribute value as
AtomicInteger
object if found. If not found, returns null whencreate
is false, or sets and returns a newAtomicInteger
object whencreate
is true.
-
getAttributeAsCollection
public Collection<Object> getAttributeAsCollection(String name, boolean create)
Gets an attribute value asCollection
object if found. If not found, returns null whencreate
is false, or sets and returns a newCollection
object whencreate
is true. This method is useful if you want to add data in the record for some reason while processing data.- Parameters:
name
- attribute namecreate
- whether or not to create if attribute not found byname
- Returns:
- an attribute value as
Collection
object if found. If not found, returns null whencreate
is false, or sets and returns a newCollection
object whencreate
is true.
-
removeAttribute
public Object removeAttribute(String name)
Removes an attribute byname
and returns the removed attribute value if found. If not found, returns null.- Parameters:
name
- attribute name- Returns:
- removed attribute value if found. If not found, returns null.
-
-