Class DefaultActivityHolder
java.lang.Object
org.ametys.plugins.repository.activities.DefaultActivityHolder
- All Implemented Interfaces:
ActivityHolder
Default implementation for an
ActivityHolder
This implementation is backed by a ModifiableTraversableAmetysObject
-
Field Summary
Fields inherited from interface org.ametys.plugins.repository.activities.ActivityHolder
ACTIVITIES_ROOT_NODE_NAME, ACTIVITY_NAME_PREFIX, JCR_UTC_FORMAT
-
Constructor Summary
ConstructorDescriptionDefaultActivityHolder
(ModifiableTraversableAmetysObject rootCollection, DefaultActivityHolderFactory factory) Create a defaultActivityHolder
-
Method Summary
Modifier and TypeMethodDescriptionaddActivity
(ZonedDateTime date, ActivityType type, Map<String, Object> parameters, UserIdentity author, String eventId) Add an activity to the activity holderaddActivity
(ActivityType type, Map<String, Object> parameters, String eventId) Add an activity to the activity holderReturns the activity nodesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.repository.activities.ActivityHolder
addActivity
-
Constructor Details
-
DefaultActivityHolder
public DefaultActivityHolder(ModifiableTraversableAmetysObject rootCollection, DefaultActivityHolderFactory factory) Create a defaultActivityHolder
- Parameters:
rootCollection
- the ametys object backing this activity holderfactory
- theDefaultActivityHolderFactory
which creates the AmetysObject
-
-
Method Details
-
getActivities
Returns the activity nodes- Specified by:
getActivities
in interfaceActivityHolder
- Returns:
- The activities
- Throws:
javax.jcr.RepositoryException
- if failed to get activity nodes
-
addActivity
public Activity addActivity(ActivityType type, Map<String, Object> parameters, String eventId) throws javax.jcr.RepositoryExceptionDescription copied from interface:ActivityHolder
Add an activity to the activity holder- Specified by:
addActivity
in interfaceActivityHolder
- Parameters:
type
- the typeparameters
- the parameterseventId
- the id of the event- Returns:
- the activity
- Throws:
javax.jcr.RepositoryException
- when an error occurred
-
addActivity
public Activity addActivity(ZonedDateTime date, ActivityType type, Map<String, Object> parameters, UserIdentity author, String eventId) throws javax.jcr.RepositoryExceptionAdd an activity to the activity holder- Specified by:
addActivity
in interfaceActivityHolder
- Parameters:
date
- the datetype
- the typeparameters
- the parametersauthor
- the authoreventId
- the id of the event- Returns:
- the activity
- Throws:
javax.jcr.RepositoryException
- when an error occurred
-