Skip to main content
summaryrefslogtreecommitdiffstats
blob: 5cc530f973b21e09b7dbed9f43b016089e638811 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/********************************************************************************
 * Copyright (c) 2015-2018 Contributors to the Eclipse Foundation
 *
 * See the NOTICE file(s) distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License v. 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0.
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 ********************************************************************************/


package org.eclipse.mdm.api.base.notification;

import java.util.List;

import org.eclipse.mdm.api.base.adapter.EntityType;
import org.eclipse.mdm.api.base.model.Entity;
import org.eclipse.mdm.api.base.model.User;

/**
 * Listener interface for notifications.
 * 
 * @since 1.0.0
 * @author Matthias Koller, Peak Solution GmbH
 */
public interface NotificationListener {
	/**
	 * Called when a new instance element was created by the server.
	 * 
	 * @param entities
	 *            A list of newly created entities.
	 * @param user
	 *            The user who created the entities.
	 */
	void instanceCreated(List<? extends Entity> entities, User user);

	/**
	 * Called when a existing instance element was modified by the server.
	 * 
	 * @param entities
	 *            A list of modified entities.
	 * @param user
	 *            The user who modified the entities.
	 */
	void instanceModified(List<? extends Entity> entities, User user);

	/**
	 * Called when a existing instance element was deleted by the server.
	 * 
	 * @param entityType
	 *            EntityType of the deleted entities.
	 * @param entities
	 *            A list with the IDs of deleted entities.
	 * @param user
	 *            The user who deleted the entities.
	 */
	void instanceDeleted(EntityType entityType, List<String> ids, User user);

	/**
	 * Called when the application model is changed by the server
	 * 
	 * @param entityType
	 *            Modified entityType.
	 * @param user
	 *            The user who modified the application model.
	 */
	void modelModified(EntityType entityType, User user);

	/**
	 * Called when security related information is changed by the server
	 * 
	 * @param entityType
	 *            EntityType with changed security
	 * @param entities
	 *            A list with the IDs of entities related to the change. Empty
	 *            if change was only relevant for entityType.
	 * @param user
	 *            The user who modified security information.
	 */
	void securityModified(EntityType entityType, List<String> ids, User user);
}

Back to the top