Class WhatIfSubmissionJPA
- java.lang.Object
-
- com.activeviam.tools.whatif.example.WhatIfSubmissionJPA
-
- All Implemented Interfaces:
IWhatIfSubmission
,Serializable
@Entity public class WhatIfSubmissionJPA extends Object implements IWhatIfSubmission, Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WhatIfSubmissionJPA()
WhatIfSubmissionJPA(String name, List<IWhatIfDefinition> whatIfDefiniions, String userId, String branchName, long masterEpoch)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDiff(Object definitionId, List<Map<String,Object>> before, List<Map<String,Object>> after)
Add a difference of the execution of a definitionString
getBranchName()
Get the branch where the submission will be executedLocalDateTime
getCreationDate()
Get the date when the submission was createdWhatIfDiff
getDiff()
Get the differences after the executionMap<Object,Set<String>>
getDistributedAddress()
In distributed environment returns the address where all the definitions in the submission were executedLocalDateTime
getExecutionDate()
Get the date when the submission was executedLong
getId()
Get the id of the submissionlong
getMasterEpoch()
Get the master epoch of the current submissionString
getName()
Get the name of the submissionWhatIfStatus
getStatus()
Get the status of the submissionString
getUserId()
Get the id of the user who created the submissionList<IWhatIfDefinition>
getWhatIfDefinitions()
Get all theIWhatIfDefinition
included in the submissionvoid
setBranchName(String branchName)
Set the name of the branch where execute the submissionvoid
setCreationDate(LocalDateTime creationDate)
void
setDiff(WhatIfDiff diff)
Set the diff in of the submissionvoid
setDistributedAddress(Map<Object,Set<String>> distributedAddress)
In distributed environment set the address where all the definitions in the submission will be executedvoid
setExecutionDate(LocalDateTime executionDate)
Set the date of the executionvoid
setId(Long id)
Set the Id of the submissionvoid
setMasterEpoch(long masterEpoch)
void
setName(String name)
void
setStatus(WhatIfStatus status)
Set the status of the submissionvoid
setUserId(String userId)
void
setWhatIfDefinitions(List<IWhatIfDefinition> whatIfDefinitions)
-
-
-
Constructor Detail
-
WhatIfSubmissionJPA
public WhatIfSubmissionJPA()
-
WhatIfSubmissionJPA
public WhatIfSubmissionJPA(String name, List<IWhatIfDefinition> whatIfDefiniions, String userId, String branchName, long masterEpoch)
-
-
Method Detail
-
getStatus
public WhatIfStatus getStatus()
Description copied from interface:IWhatIfSubmission
Get the status of the submission- Specified by:
getStatus
in interfaceIWhatIfSubmission
- Returns:
- status of the submission
-
setStatus
public void setStatus(WhatIfStatus status)
Description copied from interface:IWhatIfSubmission
Set the status of the submission- Specified by:
setStatus
in interfaceIWhatIfSubmission
- Parameters:
status
- status of the submission
-
getUserId
public String getUserId()
Description copied from interface:IWhatIfSubmission
Get the id of the user who created the submission- Specified by:
getUserId
in interfaceIWhatIfSubmission
- Returns:
- id of the user
-
setUserId
public void setUserId(String userId)
-
getBranchName
public String getBranchName()
Description copied from interface:IWhatIfSubmission
Get the branch where the submission will be executed- Specified by:
getBranchName
in interfaceIWhatIfSubmission
- Returns:
- name of the bran
-
setBranchName
public void setBranchName(String branchName)
Description copied from interface:IWhatIfSubmission
Set the name of the branch where execute the submission- Specified by:
setBranchName
in interfaceIWhatIfSubmission
- Parameters:
branchName
- name of the branch
-
getDiff
public WhatIfDiff getDiff()
Description copied from interface:IWhatIfSubmission
Get the differences after the execution- Specified by:
getDiff
in interfaceIWhatIfSubmission
- Returns:
WhatIfDiff
the difference in the stores after and before the execution
-
addDiff
public void addDiff(Object definitionId, List<Map<String,Object>> before, List<Map<String,Object>> after)
Description copied from interface:IWhatIfSubmission
Add a difference of the execution of a definition- Specified by:
addDiff
in interfaceIWhatIfSubmission
- Parameters:
definitionId
- The id of the definitionbefore
- the data before the execution of the submissionafter
- the data after the execution of the submission
-
getWhatIfDefinitions
public List<IWhatIfDefinition> getWhatIfDefinitions()
Description copied from interface:IWhatIfSubmission
Get all theIWhatIfDefinition
included in the submission- Specified by:
getWhatIfDefinitions
in interfaceIWhatIfSubmission
- Returns:
- a list with all the definition
-
setWhatIfDefinitions
public void setWhatIfDefinitions(List<IWhatIfDefinition> whatIfDefinitions)
-
getMasterEpoch
public long getMasterEpoch()
Description copied from interface:IWhatIfSubmission
Get the master epoch of the current submission- Specified by:
getMasterEpoch
in interfaceIWhatIfSubmission
- Returns:
- the epoch of the submission
-
setMasterEpoch
public void setMasterEpoch(long masterEpoch)
-
getCreationDate
public LocalDateTime getCreationDate()
Description copied from interface:IWhatIfSubmission
Get the date when the submission was created- Specified by:
getCreationDate
in interfaceIWhatIfSubmission
- Returns:
- the date of creation
-
getExecutionDate
public LocalDateTime getExecutionDate()
Description copied from interface:IWhatIfSubmission
Get the date when the submission was executed- Specified by:
getExecutionDate
in interfaceIWhatIfSubmission
- Returns:
- the date of execution
-
getId
public Long getId()
Description copied from interface:IWhatIfSubmission
Get the id of the submission- Specified by:
getId
in interfaceIWhatIfSubmission
- Returns:
- the id of the submission
-
getName
public String getName()
Description copied from interface:IWhatIfSubmission
Get the name of the submission- Specified by:
getName
in interfaceIWhatIfSubmission
- Returns:
- the name of the submission
-
setName
public void setName(String name)
-
setCreationDate
public void setCreationDate(LocalDateTime creationDate)
-
setExecutionDate
public void setExecutionDate(LocalDateTime executionDate)
Description copied from interface:IWhatIfSubmission
Set the date of the execution- Specified by:
setExecutionDate
in interfaceIWhatIfSubmission
- Parameters:
executionDate
- date of execution
-
setId
public void setId(Long id)
Description copied from interface:IWhatIfSubmission
Set the Id of the submission- Specified by:
setId
in interfaceIWhatIfSubmission
- Parameters:
id
- submission id
-
setDiff
public void setDiff(WhatIfDiff diff)
Description copied from interface:IWhatIfSubmission
Set the diff in of the submission- Specified by:
setDiff
in interfaceIWhatIfSubmission
- Parameters:
diff
- difference to set
-
getDistributedAddress
public Map<Object,Set<String>> getDistributedAddress()
Description copied from interface:IWhatIfSubmission
In distributed environment returns the address where all the definitions in the submission were executed- Specified by:
getDistributedAddress
in interfaceIWhatIfSubmission
- Returns:
- a map containing the couple (DefinitionId,Addresses) containing the addresses where a specific definition in this submission was executed
-
setDistributedAddress
public void setDistributedAddress(Map<Object,Set<String>> distributedAddress)
Description copied from interface:IWhatIfSubmission
In distributed environment set the address where all the definitions in the submission will be executed- Specified by:
setDistributedAddress
in interfaceIWhatIfSubmission
- Parameters:
distributedAddress
- a map containing the couple (DefinitionId,Addresses) containing the addresses where a specific definition in this submission was executed
-
-