View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.syncope.core.provisioning.api.propagation;
20  
21  import java.util.Optional;
22  import org.apache.syncope.common.lib.request.AnyUR;
23  import org.apache.syncope.common.lib.types.AnyTypeKind;
24  import org.apache.syncope.common.lib.types.ResourceOperation;
25  import org.apache.syncope.core.persistence.api.entity.ExternalResource;
26  import org.apache.syncope.core.persistence.api.entity.task.PropagationData;
27  import org.apache.syncope.core.provisioning.api.Connector;
28  import org.identityconnectors.framework.common.objects.ConnectorObject;
29  import org.identityconnectors.framework.common.objects.ObjectClass;
30  
31  public class PropagationTaskInfo {
32  
33      private String key;
34  
35      private final ExternalResource resource;
36  
37      private final ResourceOperation operation;
38  
39      private final ObjectClass objectClass;
40  
41      private final AnyTypeKind anyTypeKind;
42  
43      private final String anyType;
44  
45      private final String entityKey;
46  
47      private String connObjectKey;
48  
49      private String oldConnObjectKey;
50  
51      private final PropagationData propagationData;
52  
53      private Connector connector;
54  
55      private Optional<ConnectorObject> beforeObj = Optional.empty();
56  
57      private AnyUR updateRequest;
58  
59      public PropagationTaskInfo(
60              final ExternalResource resource,
61              final ResourceOperation operation,
62              final ObjectClass objectClass,
63              final AnyTypeKind anyTypeKind,
64              final String anyType,
65              final String entityKey,
66              final String connObjectKey,
67              final PropagationData propagationData) {
68  
69          this.resource = resource;
70          this.operation = operation;
71          this.objectClass = objectClass;
72          this.anyTypeKind = anyTypeKind;
73          this.anyType = anyType;
74          this.entityKey = entityKey;
75          this.connObjectKey = connObjectKey;
76          this.propagationData = propagationData;
77      }
78  
79      public void setKey(final String key) {
80          this.key = key;
81      }
82  
83      public String getKey() {
84          return key;
85      }
86  
87      public ExternalResource getResource() {
88          return resource;
89      }
90  
91      public ResourceOperation getOperation() {
92          return operation;
93      }
94  
95      public ObjectClass getObjectClass() {
96          return objectClass;
97      }
98  
99      public AnyTypeKind getAnyTypeKind() {
100         return anyTypeKind;
101     }
102 
103     public String getAnyType() {
104         return anyType;
105     }
106 
107     public String getEntityKey() {
108         return entityKey;
109     }
110 
111     public String getConnObjectKey() {
112         return connObjectKey;
113     }
114 
115     public void setConnObjectKey(final String connObjectKey) {
116         this.connObjectKey = connObjectKey;
117     }
118 
119     public String getOldConnObjectKey() {
120         return oldConnObjectKey;
121     }
122 
123     public void setOldConnObjectKey(final String oldConnObjectKey) {
124         this.oldConnObjectKey = oldConnObjectKey;
125     }
126 
127     public PropagationData getPropagationData() {
128         return propagationData;
129     }
130 
131     public Connector getConnector() {
132         return connector;
133     }
134 
135     public void setConnector(final Connector connector) {
136         this.connector = connector;
137     }
138 
139     public Optional<ConnectorObject> getBeforeObj() {
140         return beforeObj;
141     }
142 
143     public void setBeforeObj(final Optional<ConnectorObject> beforeObj) {
144         this.beforeObj = beforeObj;
145     }
146 
147     public AnyUR getUpdateRequest() {
148         return updateRequest;
149     }
150 
151     public void setUpdateRequest(final AnyUR updateRequest) {
152         this.updateRequest = updateRequest;
153     }
154 
155     @Override
156     public String toString() {
157         return "PropagationTaskInfo{"
158                 + "key=" + key
159                 + ",resource=" + resource.getKey()
160                 + ", operation=" + operation
161                 + ", objectClass=" + objectClass
162                 + ", anyTypeKind=" + anyTypeKind
163                 + ", anyType=" + anyType
164                 + ", entityKey=" + entityKey
165                 + ", connObjectKey=" + connObjectKey
166                 + ", oldConnObjectKey=" + oldConnObjectKey
167                 + ", propagationData=" + propagationData
168                 + ", connector=" + connector
169                 + ", beforeObj=" + beforeObj
170                 + ", updateRequest=" + updateRequest
171                 + '}';
172     }
173 }