Search in sources :

Example 1 with UserManagementEvent

use of org.alfresco.sync.events.types.UserManagementEvent in project alfresco-repository by Alfresco.

the class PersonServiceImpl method publishEvent.

/**
 * Publish new user event
 *
 * @param eventType String
 * @param properties Map<QName, Serializable>
 */
private void publishEvent(String eventType, Map<QName, Serializable> properties) {
    if (properties == null)
        return;
    final String managedUsername = (String) properties.get(ContentModel.PROP_USERNAME);
    final String managedFirstname = (String) properties.get(ContentModel.PROP_FIRSTNAME);
    final String managedLastname = (String) properties.get(ContentModel.PROP_LASTNAME);
    final String eventTType = eventType;
    eventPublisher.publishEvent(new EventPreparator() {

        @Override
        public Event prepareEvent(String user, String networkId, String transactionId) {
            return new UserManagementEvent(eventTType, transactionId, networkId, new Date().getTime(), user, managedUsername, managedFirstname, managedLastname);
        }
    });
}
Also used : EventPreparator(org.alfresco.sync.repo.events.EventPreparator) Event(org.alfresco.sync.events.types.Event) UserManagementEvent(org.alfresco.sync.events.types.UserManagementEvent) Date(java.util.Date) UserManagementEvent(org.alfresco.sync.events.types.UserManagementEvent)

Aggregations

Date (java.util.Date)1 Event (org.alfresco.sync.events.types.Event)1 UserManagementEvent (org.alfresco.sync.events.types.UserManagementEvent)1 EventPreparator (org.alfresco.sync.repo.events.EventPreparator)1