forked from eclipse-ditto/ditto
-
Notifications
You must be signed in to change notification settings - Fork 7
/
PolicyEventStrategies.java
executable file
·70 lines (64 loc) · 3.55 KB
/
PolicyEventStrategies.java
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
/*
* Copyright (c) 2019 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 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipse.ditto.services.policies.persistence.actors.strategies.events;
import org.eclipse.ditto.model.policies.Policy;
import org.eclipse.ditto.services.utils.persistentactors.events.AbstractEventStrategies;
import org.eclipse.ditto.signals.events.policies.PolicyCreated;
import org.eclipse.ditto.signals.events.policies.PolicyDeleted;
import org.eclipse.ditto.signals.events.policies.PolicyEntriesModified;
import org.eclipse.ditto.signals.events.policies.PolicyEntryCreated;
import org.eclipse.ditto.signals.events.policies.PolicyEntryDeleted;
import org.eclipse.ditto.signals.events.policies.PolicyEntryModified;
import org.eclipse.ditto.signals.events.policies.PolicyEvent;
import org.eclipse.ditto.signals.events.policies.PolicyModified;
import org.eclipse.ditto.signals.events.policies.ResourceCreated;
import org.eclipse.ditto.signals.events.policies.ResourceDeleted;
import org.eclipse.ditto.signals.events.policies.ResourceModified;
import org.eclipse.ditto.signals.events.policies.ResourcesModified;
import org.eclipse.ditto.signals.events.policies.SubjectActivated;
import org.eclipse.ditto.signals.events.policies.SubjectCreated;
import org.eclipse.ditto.signals.events.policies.SubjectDeleted;
import org.eclipse.ditto.signals.events.policies.SubjectModified;
import org.eclipse.ditto.signals.events.policies.SubjectsActivated;
import org.eclipse.ditto.signals.events.policies.SubjectsModified;
/**
* Holds all {@link org.eclipse.ditto.signals.events.policies.PolicyEvent} strategies.
*/
public final class PolicyEventStrategies extends AbstractEventStrategies<PolicyEvent, Policy> {
private static final PolicyEventStrategies INSTANCE = new PolicyEventStrategies();
private PolicyEventStrategies() {
addStrategy(PolicyCreated.class, new PolicyCreatedStrategy());
addStrategy(PolicyModified.class, new PolicyModifiedStrategy());
addStrategy(PolicyDeleted.class, new PolicyDeletedStrategy());
addStrategy(PolicyEntriesModified.class, new PolicyEntriesModifiedStrategy());
addStrategy(PolicyEntryCreated.class, new PolicyEntryCreatedStrategy());
addStrategy(PolicyEntryModified.class, new PolicyEntryModifiedStrategy());
addStrategy(PolicyEntryDeleted.class, new PolicyEntryDeletedStrategy());
addStrategy(SubjectsModified.class, new SubjectsModifiedStrategy());
addStrategy(SubjectsActivated.class, new SubjectsActivatedStrategy());
addStrategy(SubjectCreated.class, new SubjectCreatedStrategy());
addStrategy(SubjectModified.class, new SubjectModifiedStrategy());
addStrategy(SubjectDeleted.class, new SubjectDeletedStrategy());
addStrategy(SubjectActivated.class, new SubjectActivatedStrategy());
addStrategy(ResourcesModified.class, new ResourcesModifiedStrategy());
addStrategy(ResourceCreated.class, new ResourceCreatedStrategy());
addStrategy(ResourceModified.class, new ResourceModifiedStrategy());
addStrategy(ResourceDeleted.class, new ResourceDeletedStrategy());
}
/**
* @return the unique {@code PolicyEventStrategies} instance.
*/
public static PolicyEventStrategies getInstance() {
return INSTANCE;
}
}