You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2018/02/13 13:29:03 UTC
[01/10] syncope git commit: Upgrading Disruptor
Repository: syncope
Updated Branches:
refs/heads/2_0_X e3760ec00 -> 6bc2cac16
refs/heads/master be4f145f9 -> dd638b27f
Upgrading Disruptor
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/ffa19a60
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/ffa19a60
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/ffa19a60
Branch: refs/heads/2_0_X
Commit: ffa19a6007bfbdafd761cd288a2193df2c0989ac
Parents: e3760ec
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Mon Feb 12 15:04:08 2018 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Mon Feb 12 15:04:08 2018 +0100
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/ffa19a60/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 3d56a8a..2964f52 100644
--- a/pom.xml
+++ b/pom.xml
@@ -395,7 +395,7 @@ under the License.
<elasticsearch.version>5.6.7</elasticsearch.version>
<log4j.version>2.10.0</log4j.version>
- <disruptor.version>3.3.7</disruptor.version>
+ <disruptor.version>3.3.8</disruptor.version>
<commons-io.version>2.6</commons-io.version>
<commons-email.version>1.5</commons-email.version>
[04/10] syncope git commit: [SYNCOPE-1274] Using Swagger annotations
for TO hierarchies
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
index 0bc7605..1b6cc57 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wicket/markup/html/form/ActionLinksTogglePanel.java
@@ -37,11 +37,11 @@ import org.apache.syncope.common.lib.to.ReportTO;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.to.AttrTO;
import org.apache.syncope.common.lib.to.SecurityQuestionTO;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.to.AccessTokenTO;
import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.JobTO;
-import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
import org.apache.syncope.common.lib.to.WorkflowFormTO;
import org.apache.wicket.PageReference;
@@ -93,8 +93,8 @@ public class ActionLinksTogglePanel<T extends Serializable> extends TogglePanel<
header = ((ReportTO) modelObject).getName();
} else if (modelObject instanceof AttrTO) {
header = ((AttrTO) modelObject).getSchema();
- } else if (modelObject instanceof AbstractPolicyTO) {
- header = ((AbstractPolicyTO) modelObject).getDescription();
+ } else if (modelObject instanceof PolicyTO) {
+ header = ((PolicyTO) modelObject).getDescription();
} else if (modelObject instanceof SecurityQuestionTO) {
header = ((SecurityQuestionTO) modelObject).getContent();
} else if (modelObject instanceof AccessTokenTO) {
@@ -103,8 +103,8 @@ public class ActionLinksTogglePanel<T extends Serializable> extends TogglePanel<
header = ((ExecTO) modelObject).getKey();
} else if (modelObject instanceof WorkflowDefinitionTO) {
header = ((WorkflowDefinitionTO) modelObject).getName();
- } else if (modelObject instanceof SchedTaskTO) {
- header = ((SchedTaskTO) modelObject).getName();
+ } else if (modelObject instanceof ProvisioningTaskTO) {
+ header = ((ProvisioningTaskTO) modelObject).getName();
} else if (modelObject instanceof WorkflowFormTO) {
header = ((WorkflowFormTO) modelObject).getKey();
} else if (modelObject instanceof EntityTO) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
index c7839ca..1cf3db2 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
@@ -52,7 +52,7 @@ import org.apache.syncope.client.console.wizards.WizardMgtPanel;
import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.ReportTO;
-import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
import org.apache.syncope.common.lib.types.JobType;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.wicket.PageReference;
@@ -404,10 +404,10 @@ public class JobWidget extends BaseWidget {
break;
case TASK:
- SchedTaskTO schedTaskTO = new TaskRestClient().
- readSchedTask(SchedTaskTO.class, jobTO.getRefKey());
+ ProvisioningTaskTO schedTaskTO = new TaskRestClient().
+ readSchedTask(ProvisioningTaskTO.class, jobTO.getRefKey());
- SchedTaskWizardBuilder<SchedTaskTO> swb
+ SchedTaskWizardBuilder<ProvisioningTaskTO> swb
= new SchedTaskWizardBuilder<>(schedTaskTO, pageRef);
swb.setEventSink(AvailableJobsPanel.this);
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
index 00cc339..eca2f3a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/any/AbstractAttrs.java
@@ -32,7 +32,7 @@ import org.apache.syncope.client.console.rest.AnyTypeClassRestClient;
import org.apache.syncope.client.console.rest.GroupRestClient;
import org.apache.syncope.client.console.rest.SchemaRestClient;
import org.apache.syncope.common.lib.EntityTOUtils;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.to.AnyTO;
import org.apache.syncope.common.lib.to.AnyTypeClassTO;
import org.apache.syncope.common.lib.to.AttrTO;
@@ -50,7 +50,7 @@ import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.util.ListModel;
-public abstract class AbstractAttrs<S extends AbstractSchemaTO> extends WizardStep implements ICondition {
+public abstract class AbstractAttrs<S extends SchemaTO> extends WizardStep implements ICondition {
private static final long serialVersionUID = -5387344116983102292L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceSecurityPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceSecurityPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceSecurityPanel.java
index f3ff8f5..0ebcec8 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceSecurityPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/wizards/resources/ResourceSecurityPanel.java
@@ -24,7 +24,7 @@ import java.util.Map;
import org.apache.syncope.client.console.rest.PolicyRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.console.wicket.markup.html.form.PolicyRenderer;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.to.ResourceTO;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.wicket.extensions.wizard.WizardStep;
@@ -48,7 +48,7 @@ public class ResourceSecurityPanel extends WizardStep {
@Override
protected Map<String, String> load() {
Map<String, String> res = new HashMap<>();
- for (AbstractPolicyTO policyTO : policyRestClient.getPolicies(PolicyType.PASSWORD)) {
+ for (PolicyTO policyTO : policyRestClient.getPolicies(PolicyType.PASSWORD)) {
res.put(policyTO.getKey(), policyTO.getDescription());
}
return res;
@@ -62,7 +62,7 @@ public class ResourceSecurityPanel extends WizardStep {
@Override
protected Map<String, String> load() {
Map<String, String> res = new HashMap<>();
- for (AbstractPolicyTO policyTO : policyRestClient.getPolicies(PolicyType.ACCOUNT)) {
+ for (PolicyTO policyTO : policyRestClient.getPolicies(PolicyType.ACCOUNT)) {
res.put(policyTO.getKey(), policyTO.getDescription());
}
return res;
@@ -76,7 +76,7 @@ public class ResourceSecurityPanel extends WizardStep {
@Override
protected Map<String, String> load() {
Map<String, String> res = new HashMap<>();
- for (AbstractPolicyTO policyTO : policyRestClient.getPolicies(PolicyType.PULL)) {
+ for (PolicyTO policyTO : policyRestClient.getPolicies(PolicyType.PULL)) {
res.put(policyTO.getKey(), policyTO.getDescription());
}
return res;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/SchemaResponse.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/SchemaResponse.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/SchemaResponse.java
index 38efba2..e59374e 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/SchemaResponse.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/model/SchemaResponse.java
@@ -21,56 +21,56 @@ package org.apache.syncope.client.enduser.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
public class SchemaResponse implements Serializable {
private static final long serialVersionUID = -8896862106241712829L;
- private List<AbstractSchemaTO> plainSchemas = new ArrayList<>();
+ private List<SchemaTO> plainSchemas = new ArrayList<>();
- private List<AbstractSchemaTO> derSchemas = new ArrayList<>();
+ private List<SchemaTO> derSchemas = new ArrayList<>();
- private List<AbstractSchemaTO> virSchemas = new ArrayList<>();
+ private List<SchemaTO> virSchemas = new ArrayList<>();
public SchemaResponse() {
}
- public List<AbstractSchemaTO> getPlainSchemas() {
+ public List<SchemaTO> getPlainSchemas() {
return plainSchemas;
}
- public void setPlainSchemas(final List<AbstractSchemaTO> plainSchemas) {
+ public void setPlainSchemas(final List<SchemaTO> plainSchemas) {
this.plainSchemas = plainSchemas;
}
- public List<AbstractSchemaTO> getDerSchemas() {
+ public List<SchemaTO> getDerSchemas() {
return derSchemas;
}
- public void setDerSchemas(final List<AbstractSchemaTO> derSchemas) {
+ public void setDerSchemas(final List<SchemaTO> derSchemas) {
this.derSchemas = derSchemas;
}
- public List<AbstractSchemaTO> getVirSchemas() {
+ public List<SchemaTO> getVirSchemas() {
return virSchemas;
}
- public void setVirSchemas(final List<AbstractSchemaTO> virSchemas) {
+ public void setVirSchemas(final List<SchemaTO> virSchemas) {
this.virSchemas = virSchemas;
}
- public SchemaResponse plainSchemas(final List<AbstractSchemaTO> value) {
+ public SchemaResponse plainSchemas(final List<SchemaTO> value) {
this.plainSchemas = value;
return this;
}
- public SchemaResponse derSchemas(final List<AbstractSchemaTO> value) {
+ public SchemaResponse derSchemas(final List<SchemaTO> value) {
this.derSchemas = value;
return this;
}
- public SchemaResponse virSchemas(final List<AbstractSchemaTO> value) {
+ public SchemaResponse virSchemas(final List<SchemaTO> value) {
this.virSchemas = value;
return this;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
----------------------------------------------------------------------
diff --git a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
index 36f11f4..f952ed5 100644
--- a/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
+++ b/client/enduser/src/main/java/org/apache/syncope/client/enduser/resources/SchemaResource.java
@@ -38,7 +38,7 @@ import org.apache.syncope.client.enduser.annotations.Resource;
import org.apache.syncope.client.enduser.model.CustomAttribute;
import org.apache.syncope.client.enduser.model.CustomAttributesInfo;
import org.apache.syncope.client.enduser.model.SchemaResponse;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.to.TypeExtensionTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.SchemaType;
@@ -93,8 +93,8 @@ public class SchemaResource extends BaseResource {
Map<String, CustomAttributesInfo> customForm = SyncopeEnduserApplication.get().getCustomForm();
SchemaService schemaService = SyncopeEnduserSession.get().getService(SchemaService.class);
- final List<AbstractSchemaTO> plainSchemas = classes.isEmpty()
- ? Collections.<AbstractSchemaTO>emptyList()
+ final List<SchemaTO> plainSchemas = classes.isEmpty()
+ ? Collections.<SchemaTO>emptyList()
: customForm == null || customForm.isEmpty() || customForm.get(SchemaType.PLAIN.name()) == null
? schemaService.list(
new SchemaQuery.Builder().type(SchemaType.PLAIN).anyTypeClasses(classes).build())
@@ -102,9 +102,9 @@ public class SchemaResource extends BaseResource {
? customizeSchemas(schemaService.list(new SchemaQuery.Builder().type(SchemaType.PLAIN).
anyTypeClasses(classes).build()), group, customForm.get(SchemaType.PLAIN.name()).
getAttributes())
- : Collections.<AbstractSchemaTO>emptyList();
- final List<AbstractSchemaTO> derSchemas = classes.isEmpty()
- ? Collections.<AbstractSchemaTO>emptyList()
+ : Collections.<SchemaTO>emptyList();
+ final List<SchemaTO> derSchemas = classes.isEmpty()
+ ? Collections.<SchemaTO>emptyList()
: customForm == null || customForm.isEmpty() || customForm.get(SchemaType.DERIVED.name()) == null
? schemaService.list(
new SchemaQuery.Builder().type(SchemaType.DERIVED).anyTypeClasses(classes).build())
@@ -112,9 +112,9 @@ public class SchemaResource extends BaseResource {
? customizeSchemas(schemaService.list(new SchemaQuery.Builder().type(SchemaType.DERIVED).
anyTypeClasses(classes).build()), group, customForm.get(SchemaType.DERIVED.name()).
getAttributes())
- : Collections.<AbstractSchemaTO>emptyList();
- final List<AbstractSchemaTO> virSchemas = classes.isEmpty()
- ? Collections.<AbstractSchemaTO>emptyList()
+ : Collections.<SchemaTO>emptyList();
+ final List<SchemaTO> virSchemas = classes.isEmpty()
+ ? Collections.<SchemaTO>emptyList()
: customForm == null || customForm.isEmpty() || customForm.get(SchemaType.VIRTUAL.name()) == null
? schemaService.list(
new SchemaQuery.Builder().type(SchemaType.VIRTUAL).anyTypeClasses(classes).build())
@@ -122,16 +122,16 @@ public class SchemaResource extends BaseResource {
? customizeSchemas(schemaService.list(new SchemaQuery.Builder().type(SchemaType.VIRTUAL).
anyTypeClasses(classes).build()), group, customForm.get(SchemaType.VIRTUAL.name()).
getAttributes())
- : Collections.<AbstractSchemaTO>emptyList();
+ : Collections.<SchemaTO>emptyList();
if (group != null) {
- for (AbstractSchemaTO schema : plainSchemas) {
+ for (SchemaTO schema : plainSchemas) {
schema.setKey(compositeSchemaKey(group, schema.getKey()));
}
- for (AbstractSchemaTO schema : derSchemas) {
+ for (SchemaTO schema : derSchemas) {
schema.setKey(compositeSchemaKey(group, schema.getKey()));
}
- for (AbstractSchemaTO schema : virSchemas) {
+ for (SchemaTO schema : virSchemas) {
schema.setKey(compositeSchemaKey(group, schema.getKey()));
}
}
@@ -160,7 +160,7 @@ public class SchemaResource extends BaseResource {
return response;
}
- private List<AbstractSchemaTO> customizeSchemas(final List<AbstractSchemaTO> schemaTOs, final String groupParam,
+ private List<SchemaTO> customizeSchemas(final List<SchemaTO> schemaTOs, final String groupParam,
final Map<String, CustomAttribute> customForm) {
if (customForm.isEmpty()) {
@@ -168,20 +168,20 @@ public class SchemaResource extends BaseResource {
}
final boolean isGroupBlank = StringUtils.isBlank(groupParam);
- CollectionUtils.filter(schemaTOs, new Predicate<AbstractSchemaTO>() {
+ CollectionUtils.filter(schemaTOs, new Predicate<SchemaTO>() {
@Override
- public boolean evaluate(final AbstractSchemaTO object) {
+ public boolean evaluate(final SchemaTO object) {
return customForm.containsKey(isGroupBlank
? object.getKey()
: compositeSchemaKey(groupParam, object.getKey()));
}
});
- Collections.sort(schemaTOs, new Comparator<AbstractSchemaTO>() {
+ Collections.sort(schemaTOs, new Comparator<SchemaTO>() {
@Override
- public int compare(final AbstractSchemaTO schemaTO1, final AbstractSchemaTO schemaTO2) {
+ public int compare(final SchemaTO schemaTO1, final SchemaTO schemaTO2) {
List<String> order = new ArrayList<>(customForm.keySet());
return order.indexOf(isGroupBlank
? schemaTO1.getKey()
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java
----------------------------------------------------------------------
diff --git a/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java b/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java
index 2cf1021..58f9e99 100644
--- a/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java
+++ b/client/lib/src/main/java/org/apache/syncope/client/lib/SyncopeClientFactoryBean.java
@@ -34,7 +34,7 @@ import org.apache.cxf.feature.LoggingFeature;
import org.apache.cxf.jaxrs.client.JAXRSClientFactoryBean;
import org.apache.cxf.jaxrs.provider.JAXBElementProvider;
import org.apache.cxf.staxutils.DocumentDepthProperties;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.rest.api.DateParamConverterProvider;
import org.apache.syncope.common.rest.api.RESTHeaders;
@@ -102,7 +102,7 @@ public class SyncopeClientFactoryBean {
defaultJAXBProvider.setMarshallerProperties(marshallerProperties);
Map<String, String> collectionWrapperMap = new HashMap<>();
- collectionWrapperMap.put(AbstractPolicyTO.class.getName(), "policies");
+ collectionWrapperMap.put(PolicyTO.class.getName(), "policies");
defaultJAXBProvider.setCollectionWrapperMap(collectionWrapperMap);
return defaultJAXBProvider;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/pom.xml
----------------------------------------------------------------------
diff --git a/common/lib/pom.xml b/common/lib/pom.xml
index 41d0587..d1dd0d5 100644
--- a/common/lib/pom.xml
+++ b/common/lib/pom.xml
@@ -57,6 +57,11 @@ under the License.
</dependency>
<dependency>
+ <groupId>io.swagger</groupId>
+ <artifactId>swagger-annotations</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/AbstractBaseBean.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/AbstractBaseBean.java b/common/lib/src/main/java/org/apache/syncope/common/lib/AbstractBaseBean.java
index 432b766..4562f70 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/AbstractBaseBean.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/AbstractBaseBean.java
@@ -25,7 +25,7 @@ import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.apache.syncope.common.lib.to.ReportTO;
import org.apache.syncope.common.lib.to.GroupTO;
@@ -33,7 +33,7 @@ import org.apache.syncope.common.lib.to.UserTO;
@XmlType
// Reporting here only classes used via PagedResult
-@XmlSeeAlso({ AbstractTaskTO.class, ReportTO.class, GroupTO.class, UserTO.class, AnyObjectTO.class })
+@XmlSeeAlso({ TaskTO.class, ReportTO.class, GroupTO.class, UserTO.class, AnyObjectTO.class })
public abstract class AbstractBaseBean implements Serializable {
private static final long serialVersionUID = 3119542005279892164L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AbstractPatchItem.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AbstractPatchItem.java b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AbstractPatchItem.java
index ee86a88..6f72065 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AbstractPatchItem.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AbstractPatchItem.java
@@ -18,6 +18,8 @@
*/
package org.apache.syncope.common.lib.patch;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
@@ -39,6 +41,8 @@ public abstract class AbstractPatchItem<T> extends AbstractPatch {
private T value;
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public T getValue() {
return value;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyObjectPatch.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyObjectPatch.java b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyObjectPatch.java
index 75298a9..19794a1 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyObjectPatch.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyObjectPatch.java
@@ -19,6 +19,8 @@
package org.apache.syncope.common.lib.patch;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.HashSet;
import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
@@ -28,6 +30,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "anyObjectPatch")
@XmlType
+@ApiModel(parent = AnyPatch.class)
public class AnyObjectPatch extends AnyPatch {
private static final long serialVersionUID = -1644118942622556097L;
@@ -38,6 +41,13 @@ public class AnyObjectPatch extends AnyPatch {
private final Set<MembershipPatch> memberships = new HashSet<>();
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.patch.AnyObjectPatch")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
public StringReplacePatchItem getName() {
return name;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyPatch.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyPatch.java b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyPatch.java
index 0dadbf8..0ab8551 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyPatch.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/AnyPatch.java
@@ -20,20 +20,34 @@ package org.apache.syncope.common.lib.patch;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.PathParam;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import org.apache.syncope.common.lib.AbstractBaseBean;
import org.apache.syncope.common.lib.to.AttrTO;
@XmlType
+@XmlSeeAlso({ UserPatch.class, GroupPatch.class, AnyObjectPatch.class })
+@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "@class")
+@JsonPropertyOrder(value = { "@class", "key" })
+@ApiModel(subTypes = { UserPatch.class, GroupPatch.class, AnyObjectPatch.class }, discriminator = "@class")
public abstract class AnyPatch extends AbstractBaseBean implements AttributablePatch {
private static final long serialVersionUID = -7445489774552440544L;
+ @XmlTransient
+ @JsonProperty("@class")
+ private String discriminator;
+
private String key;
private StringReplacePatchItem realm;
@@ -46,6 +60,15 @@ public abstract class AnyPatch extends AbstractBaseBean implements AttributableP
private final Set<StringPatchItem> resources = new HashSet<>();
+ @ApiModelProperty(name = "@class", required = true, readOnly = false)
+ public abstract String getDiscriminator();
+
+ public void setDiscriminator(final String discriminator) {
+ // do nothing
+ }
+
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public String getKey() {
return key;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
index 027ba41..575012c 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/GroupPatch.java
@@ -20,6 +20,8 @@ package org.apache.syncope.common.lib.patch;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -36,6 +38,7 @@ import org.apache.syncope.common.lib.to.TypeExtensionTO;
@XmlRootElement(name = "groupPatch")
@XmlType
+@ApiModel(parent = AnyPatch.class)
public class GroupPatch extends AnyPatch {
private static final long serialVersionUID = -460284378124440077L;
@@ -53,6 +56,13 @@ public class GroupPatch extends AnyPatch {
private final List<TypeExtensionTO> typeExtensions = new ArrayList<>();
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.patch.GroupPatch")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
public StringReplacePatchItem getName() {
return name;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/patch/UserPatch.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/UserPatch.java b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/UserPatch.java
index 5dc50f1..7fbb3a3 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/patch/UserPatch.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/patch/UserPatch.java
@@ -19,6 +19,8 @@
package org.apache.syncope.common.lib.patch;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.HashSet;
import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
@@ -28,6 +30,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "userPatch")
@XmlType
+@ApiModel(parent = AnyPatch.class)
public class UserPatch extends AnyPatch {
private static final long serialVersionUID = 2872795537911821448L;
@@ -48,6 +51,13 @@ public class UserPatch extends AnyPatch {
private final Set<StringPatchItem> roles = new HashSet<>();
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.patch.UserPatch")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
public StringReplacePatchItem getUsername() {
return username;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AbstractPolicyTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AbstractPolicyTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AbstractPolicyTO.java
deleted file mode 100644
index bc41628..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AbstractPolicyTO.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.common.lib.policy;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import java.util.ArrayList;
-import java.util.List;
-import javax.ws.rs.PathParam;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-import org.apache.syncope.common.lib.to.EntityTO;
-
-@XmlRootElement(name = "abstractPolicy")
-@XmlType
-@XmlSeeAlso({ AccountPolicyTO.class, PasswordPolicyTO.class, PullPolicyTO.class })
-@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
-public abstract class AbstractPolicyTO extends AbstractBaseBean implements EntityTO {
-
- private static final long serialVersionUID = -2903888572649721035L;
-
- private String key;
-
- private String description;
-
- private final List<String> usedByResources = new ArrayList<>();
-
- private final List<String> usedByRealms = new ArrayList<>();
-
- @Override
- public String getKey() {
- return key;
- }
-
- @PathParam("key")
- @Override
- public void setKey(final String key) {
- this.key = key;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(final String description) {
- this.description = description;
- }
-
- @XmlElementWrapper(name = "usedByResources")
- @XmlElement(name = "resource")
- @JsonProperty("usedByResources")
- public List<String> getUsedByResources() {
- return usedByResources;
- }
-
- @XmlElementWrapper(name = "usedByRealms")
- @XmlElement(name = "group")
- @JsonProperty("usedByRealms")
- public List<String> getUsedByRealms() {
- return usedByRealms;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java
index caf2506..a9f3c52 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/AccountPolicyTO.java
@@ -19,16 +19,20 @@
package org.apache.syncope.common.lib.policy;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "accountPolicy")
@XmlType
-public class AccountPolicyTO extends AbstractPolicyTO implements ComposablePolicy<AbstractAccountRuleConf> {
+@ApiModel(parent = PolicyTO.class)
+public class AccountPolicyTO extends PolicyTO implements ComposablePolicy<AbstractAccountRuleConf> {
private static final long serialVersionUID = -1557150042828800134L;
@@ -40,6 +44,15 @@ public class AccountPolicyTO extends AbstractPolicyTO implements ComposablePolic
private final List<String> passthroughResources = new ArrayList<>();
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(
+ name = "@class", required = true, example = "org.apache.syncope.common.lib.policy.AccountPolicyTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
public boolean isPropagateSuspension() {
return propagateSuspension;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java
index b9d6d3e..db4d55c 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PasswordPolicyTO.java
@@ -19,16 +19,20 @@
package org.apache.syncope.common.lib.policy;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "passwordPolicy")
@XmlType
-public class PasswordPolicyTO extends AbstractPolicyTO implements ComposablePolicy<AbstractPasswordRuleConf> {
+@ApiModel(parent = PolicyTO.class)
+public class PasswordPolicyTO extends PolicyTO implements ComposablePolicy<AbstractPasswordRuleConf> {
private static final long serialVersionUID = -5606086441294799690L;
@@ -38,6 +42,15 @@ public class PasswordPolicyTO extends AbstractPolicyTO implements ComposablePoli
private final List<AbstractPasswordRuleConf> ruleConfs = new ArrayList<>();
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(
+ name = "@class", required = true, example = "org.apache.syncope.common.lib.policy.PasswordPolicyTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
public boolean isAllowNullPassword() {
return allowNullPassword;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PolicyTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PolicyTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PolicyTO.java
new file mode 100644
index 0000000..cff315e
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PolicyTO.java
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.policy;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.util.ArrayList;
+import java.util.List;
+import javax.ws.rs.PathParam;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+import org.apache.syncope.common.lib.to.EntityTO;
+
+@XmlRootElement(name = "policy")
+@XmlType
+@XmlSeeAlso({ AccountPolicyTO.class, PasswordPolicyTO.class, PullPolicyTO.class })
+@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "@class")
+@JsonPropertyOrder(value = { "@class", "key", "description" })
+@ApiModel(subTypes = { AccountPolicyTO.class, PasswordPolicyTO.class, PullPolicyTO.class }, discriminator = "@class")
+public abstract class PolicyTO extends AbstractBaseBean implements EntityTO {
+
+ private static final long serialVersionUID = -2903888572649721035L;
+
+ @XmlTransient
+ @JsonProperty("@class")
+ private String discriminator;
+
+ private String key;
+
+ private String description;
+
+ private final List<String> usedByResources = new ArrayList<>();
+
+ private final List<String> usedByRealms = new ArrayList<>();
+
+ @ApiModelProperty(name = "@class", required = true, readOnly = false)
+ public abstract String getDiscriminator();
+
+ public void setDiscriminator(final String discriminator) {
+ // do nothing
+ }
+
+ @ApiModelProperty(readOnly = true)
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @PathParam("key")
+ @Override
+ public void setKey(final String key) {
+ this.key = key;
+ }
+
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(final String description) {
+ this.description = description;
+ }
+
+ @ApiModelProperty(readOnly = true)
+ @XmlElementWrapper(name = "usedByResources")
+ @XmlElement(name = "resource")
+ @JsonProperty("usedByResources")
+ public List<String> getUsedByResources() {
+ return usedByResources;
+ }
+
+ @ApiModelProperty(readOnly = true)
+ @XmlElementWrapper(name = "usedByRealms")
+ @XmlElement(name = "group")
+ @JsonProperty("usedByRealms")
+ public List<String> getUsedByRealms() {
+ return usedByRealms;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PullPolicyTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PullPolicyTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PullPolicyTO.java
index 2618e43..46bc52a 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PullPolicyTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/policy/PullPolicyTO.java
@@ -18,17 +18,34 @@
*/
package org.apache.syncope.common.lib.policy;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "pullPolicy")
@XmlType
-public class PullPolicyTO extends AbstractPolicyTO {
+@ApiModel(parent = PolicyTO.class)
+public class PullPolicyTO extends PolicyTO {
private static final long serialVersionUID = 993024634238024242L;
private PullPolicySpec specification;
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(
+ name = "@class", required = true, example = "org.apache.syncope.common.lib.policy.PullPolicyTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public PullPolicySpec getSpecification() {
return specification;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java
index 1459211..75e454e 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractAnnotatedBean.java
@@ -20,6 +20,7 @@ package org.apache.syncope.common.lib.to;
import org.apache.syncope.common.lib.AbstractBaseBean;
import com.fasterxml.jackson.annotation.JsonIgnore;
+import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.xml.bind.annotation.XmlType;
import org.apache.commons.lang3.StringUtils;
@@ -64,6 +65,7 @@ public class AbstractAnnotatedBean extends AbstractBaseBean {
*/
private Date lastChangeDate;
+ @ApiModelProperty(readOnly = true)
public String getCreator() {
return creator;
}
@@ -72,6 +74,7 @@ public class AbstractAnnotatedBean extends AbstractBaseBean {
this.creator = creator;
}
+ @ApiModelProperty(readOnly = true)
public Date getCreationDate() {
if (creationDate != null) {
return new Date(creationDate.getTime());
@@ -87,6 +90,7 @@ public class AbstractAnnotatedBean extends AbstractBaseBean {
}
}
+ @ApiModelProperty(readOnly = true)
public String getLastModifier() {
return lastModifier;
}
@@ -95,6 +99,7 @@ public class AbstractAnnotatedBean extends AbstractBaseBean {
this.lastModifier = lastModifier;
}
+ @ApiModelProperty(readOnly = true)
public Date getLastChangeDate() {
if (lastChangeDate != null) {
return new Date(lastChangeDate.getTime());
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractProvisioningTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractProvisioningTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractProvisioningTaskTO.java
deleted file mode 100644
index cd7a5ae..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractProvisioningTaskTO.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.common.lib.to;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import java.util.HashSet;
-import java.util.Set;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
-import org.apache.syncope.common.lib.types.MatchingRule;
-import org.apache.syncope.common.lib.types.UnmatchingRule;
-
-@XmlRootElement(name = "abstractProvisioningTask")
-@XmlType
-@XmlSeeAlso({ PushTaskTO.class, PullTaskTO.class })
-public class AbstractProvisioningTaskTO extends SchedTaskTO {
-
- private static final long serialVersionUID = -2143537546915809016L;
-
- private String resource;
-
- private boolean performCreate;
-
- private boolean performUpdate;
-
- private boolean performDelete;
-
- private boolean syncStatus;
-
- private UnmatchingRule unmatchingRule;
-
- private MatchingRule matchingRule;
-
- private final Set<String> actionsClassNames = new HashSet<>();
-
- public String getResource() {
- return resource;
- }
-
- public void setResource(final String resource) {
- this.resource = resource;
- }
-
- public boolean isPerformCreate() {
- return performCreate;
- }
-
- public void setPerformCreate(final boolean performCreate) {
- this.performCreate = performCreate;
- }
-
- public boolean isPerformUpdate() {
- return performUpdate;
- }
-
- public void setPerformUpdate(final boolean performUpdate) {
- this.performUpdate = performUpdate;
- }
-
- public boolean isPerformDelete() {
- return performDelete;
- }
-
- public void setPerformDelete(final boolean performDelete) {
- this.performDelete = performDelete;
- }
-
- public boolean isSyncStatus() {
- return syncStatus;
- }
-
- public void setSyncStatus(final boolean syncStatus) {
- this.syncStatus = syncStatus;
- }
-
- @XmlElementWrapper(name = "actionsClassNames")
- @XmlElement(name = "actionsClassName")
- @JsonProperty("actionsClassNames")
- public Set<String> getActionsClassNames() {
- return actionsClassNames;
- }
-
- public UnmatchingRule getUnmatchingRule() {
- return unmatchingRule;
- }
-
- public void setUnmatchingRule(final UnmatchingRule unmatchigRule) {
- this.unmatchingRule = unmatchigRule;
- }
-
- public MatchingRule getMatchingRule() {
- return matchingRule;
- }
-
- public void setMatchingRule(final MatchingRule matchigRule) {
- this.matchingRule = matchigRule;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractSchemaTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractSchemaTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractSchemaTO.java
deleted file mode 100644
index 2917c98..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractSchemaTO.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.common.lib.to;
-
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-import javax.ws.rs.PathParam;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
-import org.apache.syncope.common.lib.AbstractBaseBean;
-
-@XmlRootElement(name = "abstractSchema")
-@XmlType
-@XmlSeeAlso({ PlainSchemaTO.class, DerSchemaTO.class, VirSchemaTO.class })
-@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
-public abstract class AbstractSchemaTO extends AbstractBaseBean implements EntityTO {
-
- private static final long serialVersionUID = 4088388951694301759L;
-
- private String key;
-
- private String anyTypeClass;
-
- @Override
- public String getKey() {
- return key;
- }
-
- @PathParam("key")
- @Override
- public void setKey(final String key) {
- this.key = key;
- }
-
- public String getAnyTypeClass() {
- return anyTypeClass;
- }
-
- public void setAnyTypeClass(final String anyTypeClass) {
- this.anyTypeClass = anyTypeClass;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java
index 88962c5..f0a6f1e 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractStartEndBean.java
@@ -18,6 +18,7 @@
*/
package org.apache.syncope.common.lib.to;
+import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.xml.bind.annotation.XmlType;
import org.apache.syncope.common.lib.AbstractBaseBean;
@@ -31,6 +32,7 @@ public class AbstractStartEndBean extends AbstractBaseBean {
private Date end;
+ @ApiModelProperty(readOnly = true)
public Date getStart() {
return start == null
? null
@@ -43,6 +45,7 @@ public class AbstractStartEndBean extends AbstractBaseBean {
: new Date(start.getTime());
}
+ @ApiModelProperty(readOnly = true)
public Date getEnd() {
return end == null
? null
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractTaskTO.java
deleted file mode 100644
index 65603f7..0000000
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AbstractTaskTO.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.common.lib.to;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonTypeInfo;
-
-import java.util.ArrayList;
-import java.util.List;
-import javax.ws.rs.PathParam;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSeeAlso;
-import javax.xml.bind.annotation.XmlType;
-
-@XmlRootElement(name = "abstractTask")
-@XmlType
-@XmlSeeAlso({ PropagationTaskTO.class, SchedTaskTO.class, NotificationTaskTO.class })
-@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
-public abstract class AbstractTaskTO extends AbstractStartEndBean implements EntityTO {
-
- private static final long serialVersionUID = 386450127003321197L;
-
- private String key;
-
- private String latestExecStatus;
-
- private final List<ExecTO> executions = new ArrayList<>();
-
- @Override
- public String getKey() {
- return key;
- }
-
- @PathParam("key")
- @Override
- public void setKey(final String key) {
- this.key = key;
- }
-
- public String getLatestExecStatus() {
- return latestExecStatus;
- }
-
- public void setLatestExecStatus(final String latestExecStatus) {
- this.latestExecStatus = latestExecStatus;
- }
-
- @XmlElementWrapper(name = "executions")
- @XmlElement(name = "execution")
- @JsonProperty("executions")
- public List<ExecTO> getExecutions() {
- return executions;
- }
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
index 9581cd9..19955fd 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyObjectTO.java
@@ -20,17 +20,21 @@ package org.apache.syncope.common.lib.to;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.collections4.Predicate;
@XmlRootElement(name = "anyObject")
@XmlType
+@ApiModel(parent = AnyTO.class)
public class AnyObjectTO extends AnyTO implements GroupableRelatableTO {
private static final long serialVersionUID = 8841697496476959639L;
@@ -43,6 +47,14 @@ public class AnyObjectTO extends AnyTO implements GroupableRelatableTO {
private final List<MembershipTO> dynMemberships = new ArrayList<>();
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.to.AnyObjectTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
public String getName() {
return name;
}
@@ -91,6 +103,7 @@ public class AnyObjectTO extends AnyTO implements GroupableRelatableTO {
return memberships;
}
+ @ApiModelProperty(readOnly = true)
@XmlElementWrapper(name = "dynMemberships")
@XmlElement(name = "dynMembership")
@JsonProperty("dynMemberships")
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTO.java
index 7796b62..156cc93 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AnyTO.java
@@ -20,7 +20,10 @@ package org.apache.syncope.common.lib.to;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@@ -28,17 +31,24 @@ import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.collections4.Predicate;
@XmlType
@XmlSeeAlso({ UserTO.class, GroupTO.class, AnyObjectTO.class })
-@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "@class")
+@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "@class")
+@JsonPropertyOrder(value = { "@class", "key", "type", "realm", "username", "name" })
+@ApiModel(subTypes = { UserTO.class, GroupTO.class, AnyObjectTO.class }, discriminator = "@class")
public abstract class AnyTO extends AbstractAnnotatedBean implements EntityTO, AttributableTO {
private static final long serialVersionUID = -754311920679872084L;
+ @XmlTransient
+ @JsonProperty("@class")
+ private String discriminator;
+
private String key;
private String type;
@@ -59,6 +69,14 @@ public abstract class AnyTO extends AbstractAnnotatedBean implements EntityTO, A
private final Set<String> resources = new HashSet<>();
+ @ApiModelProperty(name = "@class", required = true, readOnly = false)
+ public abstract String getDiscriminator();
+
+ public void setDiscriminator(final String discriminator) {
+ // do nothing
+ }
+
+ @ApiModelProperty(readOnly = true)
@Override
public String getKey() {
return key;
@@ -69,6 +87,7 @@ public abstract class AnyTO extends AbstractAnnotatedBean implements EntityTO, A
this.key = key;
}
+ @ApiModelProperty(readOnly = true)
public String getType() {
return type;
}
@@ -85,6 +104,7 @@ public abstract class AnyTO extends AbstractAnnotatedBean implements EntityTO, A
this.realm = realm;
}
+ @ApiModelProperty(readOnly = true)
@XmlElementWrapper(name = "dynRealms")
@XmlElement(name = "dynRealmF")
@JsonProperty("dynRealms")
@@ -92,6 +112,7 @@ public abstract class AnyTO extends AbstractAnnotatedBean implements EntityTO, A
return dynRealms;
}
+ @ApiModelProperty(readOnly = true)
public String getStatus() {
return status;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/AttrTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AttrTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AttrTO.java
index bd63527..7d41199 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/AttrTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/AttrTO.java
@@ -20,6 +20,8 @@ package org.apache.syncope.common.lib.to;
import org.apache.syncope.common.lib.AbstractBaseBean;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
@@ -32,6 +34,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "attribute")
@XmlType
+@ApiModel
public class AttrTO extends AbstractBaseBean {
private static final long serialVersionUID = 4941691338796323623L;
@@ -45,7 +48,7 @@ public class AttrTO extends AbstractBaseBean {
return this;
}
- public Builder schemaInfo(final AbstractSchemaTO schemaInfo) {
+ public Builder schemaInfo(final SchemaTO schemaInfo) {
instance.schemaInfo = schemaInfo;
return this;
}
@@ -73,7 +76,7 @@ public class AttrTO extends AbstractBaseBean {
/**
* (Optional) schema information for this attribute.
*/
- private AbstractSchemaTO schemaInfo;
+ private SchemaTO schemaInfo;
/**
* Name of the schema that this attribute is referring to.
@@ -88,17 +91,20 @@ public class AttrTO extends AbstractBaseBean {
/**
* @return schema information for this attribute; may be {@code NULL}
*/
- public AbstractSchemaTO getSchemaInfo() {
+ @ApiModelProperty(readOnly = true)
+ public SchemaTO getSchemaInfo() {
return schemaInfo;
}
- public void setSchemaInfo(final AbstractSchemaTO schemaInfo) {
+ public void setSchemaInfo(final SchemaTO schemaInfo) {
this.schemaInfo = schemaInfo;
}
/**
* @return the name of the schema that this attribute is referring to
*/
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public String getSchema() {
return schema;
}
@@ -115,9 +121,9 @@ public class AttrTO extends AbstractBaseBean {
/**
* @return attribute values as strings
*/
- @XmlElementWrapper(name = "values")
- @XmlElement(name = "value")
- @JsonProperty("values")
+ @XmlElementWrapper(name = "values", required = true)
+ @XmlElement(name = "value", required = true)
+ @JsonProperty(value = "values", required = true)
public List<String> getValues() {
return values;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java
index dc84864..0114ba9 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/DerSchemaTO.java
@@ -18,17 +18,30 @@
*/
package org.apache.syncope.common.lib.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
-@XmlRootElement(name = "derivedSchema")
+@XmlRootElement(name = "derSchema")
@XmlType
-public class DerSchemaTO extends AbstractSchemaTO {
+@ApiModel(parent = SchemaTO.class)
+public class DerSchemaTO extends SchemaTO {
private static final long serialVersionUID = -6747399803792103108L;
private String expression;
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.to.DerSchemaTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
public String getExpression() {
return expression;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
index 82c4fe3..a651e47 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/GroupTO.java
@@ -20,6 +20,8 @@ package org.apache.syncope.common.lib.to;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -27,6 +29,7 @@ import java.util.Map;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.collections4.IterableUtils;
@@ -36,6 +39,7 @@ import org.apache.syncope.common.lib.types.AnyTypeKind;
@XmlRootElement(name = "group")
@XmlType
+@ApiModel(parent = AnyTO.class)
public class GroupTO extends AnyTO {
private static final long serialVersionUID = -7785920258290147542L;
@@ -61,6 +65,14 @@ public class GroupTO extends AnyTO {
private final List<TypeExtensionTO> typeExtensions = new ArrayList<>();
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.to.GroupTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
@Override
public String getType() {
return AnyTypeKind.GROUP.name();
@@ -103,6 +115,7 @@ public class GroupTO extends AnyTO {
this.udynMembershipCond = uDynMembershipCond;
}
+ @ApiModelProperty(readOnly = true)
public int getStaticUserMembershipCount() {
return staticUserMembershipCount;
}
@@ -111,6 +124,7 @@ public class GroupTO extends AnyTO {
this.staticUserMembershipCount = staticUserMembershipCount;
}
+ @ApiModelProperty(readOnly = true)
public int getDynamicUserMembershipCount() {
return dynamicUserMembershipCount;
}
@@ -119,6 +133,7 @@ public class GroupTO extends AnyTO {
this.dynamicUserMembershipCount = dynamicUserMembershipCount;
}
+ @ApiModelProperty(readOnly = true)
public int getStaticAnyObjectMembershipCount() {
return staticAnyObjectMembershipCount;
}
@@ -127,6 +142,7 @@ public class GroupTO extends AnyTO {
this.staticAnyObjectMembershipCount = staticAnyObjectMembershipCount;
}
+ @ApiModelProperty(readOnly = true)
public int getDynamicAnyObjectMembershipCount() {
return dynamicAnyObjectMembershipCount;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java
index 44155e4..5100406 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/NotificationTaskTO.java
@@ -19,18 +19,22 @@
package org.apache.syncope.common.lib.to;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.HashSet;
import java.util.Set;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.TraceLevel;
@XmlRootElement(name = "notificationTask")
@XmlType
-public class NotificationTaskTO extends AbstractTaskTO {
+@ApiModel(parent = TaskTO.class)
+public class NotificationTaskTO extends TaskTO {
private static final long serialVersionUID = 371671242591093846L;
@@ -54,6 +58,15 @@ public class NotificationTaskTO extends AbstractTaskTO {
private TraceLevel traceLevel;
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.to.NotificationTaskTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
+ @ApiModelProperty(readOnly = true)
public String getNotification() {
return notification;
}
@@ -62,6 +75,7 @@ public class NotificationTaskTO extends AbstractTaskTO {
this.notification = notification;
}
+ @ApiModelProperty(readOnly = true)
public AnyTypeKind getAnyTypeKind() {
return anyTypeKind;
}
@@ -70,6 +84,7 @@ public class NotificationTaskTO extends AbstractTaskTO {
this.anyTypeKind = anyTypeKind;
}
+ @ApiModelProperty(readOnly = true)
public String getEntityKey() {
return entityKey;
}
@@ -78,6 +93,7 @@ public class NotificationTaskTO extends AbstractTaskTO {
this.entityKey = entityKey;
}
+ @ApiModelProperty(readOnly = true)
@XmlElementWrapper(name = "recipients")
@XmlElement(name = "recipient")
@JsonProperty("recipients")
@@ -85,6 +101,7 @@ public class NotificationTaskTO extends AbstractTaskTO {
return recipients;
}
+ @ApiModelProperty(readOnly = true)
public String getSender() {
return sender;
}
@@ -93,6 +110,7 @@ public class NotificationTaskTO extends AbstractTaskTO {
this.sender = sender;
}
+ @ApiModelProperty(readOnly = true)
public String getSubject() {
return subject;
}
@@ -101,6 +119,7 @@ public class NotificationTaskTO extends AbstractTaskTO {
this.subject = subject;
}
+ @ApiModelProperty(readOnly = true)
public String getTextBody() {
return textBody;
}
@@ -109,6 +128,7 @@ public class NotificationTaskTO extends AbstractTaskTO {
this.textBody = textBody;
}
+ @ApiModelProperty(readOnly = true)
public String getHtmlBody() {
return htmlBody;
}
@@ -117,6 +137,7 @@ public class NotificationTaskTO extends AbstractTaskTO {
this.htmlBody = htmlBody;
}
+ @ApiModelProperty(readOnly = true)
public boolean isExecuted() {
return executed;
}
@@ -125,6 +146,7 @@ public class NotificationTaskTO extends AbstractTaskTO {
this.executed = executed;
}
+ @ApiModelProperty(readOnly = true)
public TraceLevel getTraceLevel() {
return traceLevel;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java
index 4568e36..8803013 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PlainSchemaTO.java
@@ -18,16 +18,21 @@
*/
package org.apache.syncope.common.lib.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.common.lib.types.AttrSchemaType;
import org.apache.syncope.common.lib.types.CipherAlgorithm;
-@XmlRootElement(name = "schema")
+@XmlRootElement(name = "plainSchema")
@XmlType
-public class PlainSchemaTO extends AbstractSchemaTO {
+@ApiModel(parent = SchemaTO.class)
+public class PlainSchemaTO extends SchemaTO {
private static final long serialVersionUID = -8133983392476990308L;
@@ -55,6 +60,14 @@ public class PlainSchemaTO extends AbstractSchemaTO {
private String mimeType;
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.to.PlainSchemaTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
public String getConversionPattern() {
return conversionPattern;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java
index 3ef94de..49aaec8 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PropagationTaskTO.java
@@ -18,14 +18,20 @@
*/
package org.apache.syncope.common.lib.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.ResourceOperation;
@XmlRootElement(name = "propagationTask")
@XmlType
-public class PropagationTaskTO extends AbstractTaskTO {
+@ApiModel(parent = TaskTO.class)
+public class PropagationTaskTO extends TaskTO {
private static final long serialVersionUID = 386450127003321197L;
@@ -47,6 +53,16 @@ public class PropagationTaskTO extends AbstractTaskTO {
private String entityKey;
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.to.PropagationTaskTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public String getConnObjectKey() {
return connObjectKey;
}
@@ -63,6 +79,8 @@ public class PropagationTaskTO extends AbstractTaskTO {
this.oldConnObjectKey = oldConnObjectKey;
}
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public String getResource() {
return resource;
}
@@ -71,6 +89,8 @@ public class PropagationTaskTO extends AbstractTaskTO {
this.resource = resource;
}
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public ResourceOperation getOperation() {
return operation;
}
@@ -79,6 +99,8 @@ public class PropagationTaskTO extends AbstractTaskTO {
this.operation = operation;
}
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public String getAttributes() {
return attributes;
}
@@ -87,6 +109,8 @@ public class PropagationTaskTO extends AbstractTaskTO {
this.attributes = attributes;
}
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public String getObjectClassName() {
return objectClassName;
}
@@ -95,6 +119,8 @@ public class PropagationTaskTO extends AbstractTaskTO {
this.objectClassName = objectClassName;
}
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public AnyTypeKind getAnyTypeKind() {
return anyTypeKind;
}
@@ -103,6 +129,8 @@ public class PropagationTaskTO extends AbstractTaskTO {
this.anyTypeKind = anyTypeKind;
}
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public String getAnyType() {
return anyType;
}
@@ -111,6 +139,8 @@ public class PropagationTaskTO extends AbstractTaskTO {
this.anyType = anyType;
}
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public String getEntityKey() {
return entityKey;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java
new file mode 100644
index 0000000..bd45068
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/ProvisioningTaskTO.java
@@ -0,0 +1,122 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import java.util.HashSet;
+import java.util.Set;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.types.MatchingRule;
+import org.apache.syncope.common.lib.types.UnmatchingRule;
+
+@XmlRootElement(name = "provisioningTask")
+@XmlType
+@XmlSeeAlso({ PushTaskTO.class, PullTaskTO.class })
+@ApiModel(parent = SchedTaskTO.class, subTypes = { PushTaskTO.class, PullTaskTO.class }, discriminator = "@class")
+public abstract class ProvisioningTaskTO extends SchedTaskTO {
+
+ private static final long serialVersionUID = -5722284116974636425L;
+
+ private String resource;
+
+ private boolean performCreate;
+
+ private boolean performUpdate;
+
+ private boolean performDelete;
+
+ private boolean syncStatus;
+
+ private UnmatchingRule unmatchingRule;
+
+ private MatchingRule matchingRule;
+
+ private final Set<String> actionsClassNames = new HashSet<>();
+
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
+ public String getResource() {
+ return resource;
+ }
+
+ public void setResource(final String resource) {
+ this.resource = resource;
+ }
+
+ public boolean isPerformCreate() {
+ return performCreate;
+ }
+
+ public void setPerformCreate(final boolean performCreate) {
+ this.performCreate = performCreate;
+ }
+
+ public boolean isPerformUpdate() {
+ return performUpdate;
+ }
+
+ public void setPerformUpdate(final boolean performUpdate) {
+ this.performUpdate = performUpdate;
+ }
+
+ public boolean isPerformDelete() {
+ return performDelete;
+ }
+
+ public void setPerformDelete(final boolean performDelete) {
+ this.performDelete = performDelete;
+ }
+
+ public boolean isSyncStatus() {
+ return syncStatus;
+ }
+
+ public void setSyncStatus(final boolean syncStatus) {
+ this.syncStatus = syncStatus;
+ }
+
+ @XmlElementWrapper(name = "actionsClassNames")
+ @XmlElement(name = "actionsClassName")
+ @JsonProperty("actionsClassNames")
+ public Set<String> getActionsClassNames() {
+ return actionsClassNames;
+ }
+
+ public UnmatchingRule getUnmatchingRule() {
+ return unmatchingRule;
+ }
+
+ public void setUnmatchingRule(final UnmatchingRule unmatchigRule) {
+ this.unmatchingRule = unmatchigRule;
+ }
+
+ public MatchingRule getMatchingRule() {
+ return matchingRule;
+ }
+
+ public void setMatchingRule(final MatchingRule matchigRule) {
+ this.matchingRule = matchigRule;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java
index c65d592..8a1ad64 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PullTaskTO.java
@@ -19,11 +19,15 @@
package org.apache.syncope.common.lib.to;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
@@ -32,16 +36,29 @@ import org.apache.syncope.common.lib.types.PullMode;
@XmlRootElement(name = "pullTask")
@XmlType
@XmlAccessorType(XmlAccessType.FIELD)
-public class PullTaskTO extends AbstractProvisioningTaskTO implements TemplatableTO {
+@ApiModel(parent = ProvisioningTaskTO.class)
+public class PullTaskTO extends ProvisioningTaskTO implements TemplatableTO {
private static final long serialVersionUID = -2143537546915809017L;
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
private PullMode pullMode;
private String reconciliationFilterBuilderClassName;
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
private String destinationRealm;
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.to.PullTaskTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
@XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
private final Map<String, AnyTO> templates = new HashMap<>();
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java
index 7dfc623..2e3c36d 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/PushTaskTO.java
@@ -19,11 +19,15 @@
package org.apache.syncope.common.lib.to;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
@@ -31,15 +35,26 @@ import org.apache.syncope.common.lib.jaxb.XmlGenericMapAdapter;
@XmlRootElement(name = "pushTask")
@XmlType
@XmlAccessorType(XmlAccessType.FIELD)
-public class PushTaskTO extends AbstractProvisioningTaskTO {
+@ApiModel(parent = ProvisioningTaskTO.class)
+public class PushTaskTO extends ProvisioningTaskTO {
private static final long serialVersionUID = -2143537546915809018L;
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
private String sourceRealm;
@XmlJavaTypeAdapter(XmlGenericMapAdapter.class)
private final Map<String, String> filters = new HashMap<>();
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.to.PushTaskTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
public String getSourceRealm() {
return sourceRealm;
}
[02/10] syncope git commit: Upgrading Disruptor
Posted by il...@apache.org.
Upgrading Disruptor
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/38f0b58a
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/38f0b58a
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/38f0b58a
Branch: refs/heads/master
Commit: 38f0b58a59a11044d3cd568b57954d99afa8029c
Parents: be4f145
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Mon Feb 12 15:04:08 2018 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Mon Feb 12 15:04:22 2018 +0100
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/38f0b58a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index fb79724..b27d920 100644
--- a/pom.xml
+++ b/pom.xml
@@ -394,7 +394,7 @@ under the License.
<elasticsearch.version>6.2.1</elasticsearch.version>
<log4j.version>2.10.0</log4j.version>
- <disruptor.version>3.3.7</disruptor.version>
+ <disruptor.version>3.3.8</disruptor.version>
<commons-io.version>2.6</commons-io.version>
<commons-email.version>1.5</commons-email.version>
[09/10] syncope git commit: [SYNCOPE-1262] Remove matrix parameters -
OpenApi wins :-(
Posted by il...@apache.org.
[SYNCOPE-1262] Remove matrix parameters - OpenApi wins :-(
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/6bc2cac1
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/6bc2cac1
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/6bc2cac1
Branch: refs/heads/2_0_X
Commit: 6bc2cac1683aea747dcf02ca6ed31340088f9a33
Parents: e93047e
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Feb 13 14:26:33 2018 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Feb 13 14:26:33 2018 +0100
----------------------------------------------------------------------
.../client/cli/commands/policy/PolicyRead.java | 40 ++++----
.../policy/PolicySyncopeOperations.java | 6 +-
.../client/cli/commands/task/TaskRead.java | 41 +++++----
.../commands/task/TaskSyncopeOperations.java | 6 +-
.../cli/src/main/resources/messages.properties | 4 +-
.../policies/AccountPolicyDirectoryPanel.java | 3 +-
.../policies/PasswordPolicyDirectoryPanel.java | 2 +-
.../console/policies/PolicyDirectoryPanel.java | 14 +--
.../policies/PolicyModalPanelBuilder.java | 12 ++-
.../policies/PolicyRuleDirectoryPanel.java | 11 ++-
.../policies/PolicyRuleWizardBuilder.java | 4 +-
.../console/policies/PolicySpecModalPanel.java | 15 +--
.../policies/PullPolicyDirectoryPanel.java | 2 +-
.../client/console/rest/PolicyRestClient.java | 16 ++--
.../client/console/rest/TaskRestClient.java | 20 ++--
.../tasks/NotificationTaskDirectoryPanel.java | 2 +-
.../tasks/PropagationTaskDirectoryPanel.java | 2 +-
.../tasks/ProvisioningTaskDirectoryPanel.java | 4 +-
.../console/tasks/PullTaskDirectoryPanel.java | 3 +-
.../console/tasks/PushTaskDirectoryPanel.java | 2 +-
.../console/tasks/SchedTaskDirectoryPanel.java | 15 ++-
.../console/tasks/SchedTaskWizardBuilder.java | 10 +-
.../client/console/tasks/SchedTasks.java | 3 +-
.../client/console/widgets/JobWidget.java | 22 +++--
.../syncope/common/rest/api/beans/AnyQuery.java | 3 +-
.../common/rest/api/beans/TaskQuery.java | 4 +-
.../common/rest/api/service/PolicyService.java | 23 +++--
.../common/rest/api/service/TaskService.java | 20 ++--
.../apache/syncope/core/logic/PolicyLogic.java | 73 +++++++++------
.../apache/syncope/core/logic/TaskLogic.java | 32 ++++++-
.../api/dao/ExternalResourceDAO.java | 2 +-
.../core/persistence/api/dao/PolicyDAO.java | 2 +-
.../core/persistence/api/dao/RealmDAO.java | 2 +-
.../core/persistence/api/entity/Policy.java | 26 ------
.../api/entity/policy/AccountPolicy.java | 1 -
.../api/entity/policy/PasswordPolicy.java | 1 -
.../persistence/api/entity/policy/Policy.java | 28 ++++++
.../api/entity/policy/PolicyUtils.java | 28 ++++++
.../api/entity/policy/PolicyUtilsFactory.java | 33 +++++++
.../api/entity/policy/PullPolicy.java | 1 -
.../api/entity/policy/PushPolicy.java | 1 -
.../jpa/dao/JPAExternalResourceDAO.java | 2 +-
.../core/persistence/jpa/dao/JPAPolicyDAO.java | 2 +-
.../core/persistence/jpa/dao/JPARealmDAO.java | 2 +-
.../jpa/entity/policy/AbstractPolicy.java | 2 +-
.../jpa/entity/policy/JPAPolicyUtils.java | 60 ++++++++++++
.../entity/policy/JPAPolicyUtilsFactory.java | 82 +++++++++++++++++
.../entity/EntityValidationListener.java | 2 +-
.../core/persistence/jpa/inner/PolicyTest.java | 2 +-
.../provisioning/api/data/PolicyDataBinder.java | 2 +-
.../java/data/PolicyDataBinderImpl.java | 8 +-
.../java/data/RealmDataBinderImpl.java | 2 +-
.../rest/cxf/service/PolicyServiceImpl.java | 16 ++--
.../core/rest/cxf/service/TaskServiceImpl.java | 25 +++--
ext/swagger-ui/pom.xml | 24 +----
.../core/reference/ITImplementationLookup.java | 3 +-
.../org/apache/syncope/fit/AbstractITCase.java | 5 +-
.../org/apache/syncope/fit/cli/CLIITCase.java | 21 -----
.../syncope/fit/core/AbstractTaskITCase.java | 31 ++++---
.../apache/syncope/fit/core/GroupITCase.java | 3 +-
.../fit/core/IdentityRecertificationITCase.java | 3 +-
.../syncope/fit/core/MembershipITCase.java | 10 +-
.../syncope/fit/core/MigrationITCase.java | 6 +-
.../syncope/fit/core/MultitenancyITCase.java | 7 +-
.../fit/core/NotificationTaskITCase.java | 18 ++--
.../apache/syncope/fit/core/PolicyITCase.java | 28 +++---
.../syncope/fit/core/PropagationTaskITCase.java | 6 +-
.../apache/syncope/fit/core/PullTaskITCase.java | 96 ++++++++++----------
.../apache/syncope/fit/core/PushTaskITCase.java | 32 +++----
.../apache/syncope/fit/core/RealmITCase.java | 5 +-
.../syncope/fit/core/SchedTaskITCase.java | 18 ++--
.../org/apache/syncope/fit/core/UserITCase.java | 15 +--
.../syncope/fit/core/UserIssuesITCase.java | 5 +-
73 files changed, 677 insertions(+), 405 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyRead.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyRead.java
index 5b50a69..26ee655 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyRead.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyRead.java
@@ -19,11 +19,14 @@
package org.apache.syncope.client.cli.commands.policy;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import javax.xml.ws.WebServiceException;
import org.apache.syncope.client.cli.Input;
+import org.apache.syncope.client.cli.util.CommandUtils;
import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.policy.PolicyTO;
+import org.apache.syncope.common.lib.types.PolicyType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -31,7 +34,8 @@ public class PolicyRead extends AbstractPolicyCommand {
private static final Logger LOG = LoggerFactory.getLogger(PolicyRead.class);
- private static final String READ_HELP_MESSAGE = "policy --read {POLICY-KEY} {POLICY-KEY} [...]";
+ private static final String READ_HELP_MESSAGE = "policy --read {POLICY-TYPE} {POLICY-KEY}\n"
+ + " Policy type: ACCOUNT / PASSWORD / PULL / PUSH";
private final Input input;
@@ -40,24 +44,26 @@ public class PolicyRead extends AbstractPolicyCommand {
}
public void read() {
- if (input.parameterNumber() >= 1) {
- final List<PolicyTO> policyTOs = new ArrayList<>();
- for (final String parameter : input.getParameters()) {
- try {
- policyTOs.add(policySyncopeOperations.read(parameter));
- } catch (final NumberFormatException ex) {
- LOG.error("Error reading policy", ex);
- policyResultManager.notBooleanDeletedError("policy", parameter);
- } catch (final WebServiceException | SyncopeClientException ex) {
- LOG.error("Error reading policy", ex);
- if (ex.getMessage().startsWith("NotFound")) {
- policyResultManager.notFoundError("Policy", parameter);
- } else {
- policyResultManager.genericError(ex.getMessage());
- }
+ if (input.parameterNumber() >= 2) {
+ final String[] parameters = Arrays.copyOfRange(input.getParameters(), 1, input.parameterNumber());
+ try {
+ final List<PolicyTO> policyTOs = new ArrayList<>();
+ for (final String parameter : parameters) {
+ policyTOs.add(policySyncopeOperations.read(input.firstParameter(), parameter));
}
+ policyResultManager.printPolicies(policyTOs);
+ } catch (final SyncopeClientException | WebServiceException ex) {
+ LOG.error("Error reading policy", ex);
+ if (ex.getMessage().startsWith("NotFound")) {
+ policyResultManager.notFoundError("Policy", parameters[0]);
+ } else {
+ policyResultManager.genericError(ex.getMessage());
+ }
+ } catch (final IllegalArgumentException ex) {
+ LOG.error("Error reading policy", ex);
+ policyResultManager.typeNotValidError(
+ "policy", input.firstParameter(), CommandUtils.fromEnumToArray(PolicyType.class));
}
- policyResultManager.printPolicies(policyTOs);
} else {
policyResultManager.commandOptionError(READ_HELP_MESSAGE);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicySyncopeOperations.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicySyncopeOperations.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicySyncopeOperations.java
index 9bfad75..f738ad9 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicySyncopeOperations.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicySyncopeOperations.java
@@ -28,8 +28,8 @@ public class PolicySyncopeOperations {
private final PolicyService policyService = SyncopeServices.get(PolicyService.class);
- public <T extends PolicyTO> T read(final String policyKey) {
- return policyService.read(policyKey);
+ public <T extends PolicyTO> T read(final String type, final String policyKey) {
+ return policyService.read(PolicyType.valueOf(type), policyKey);
}
public <T extends PolicyTO> List<T> list(final String policyType) {
@@ -37,6 +37,6 @@ public class PolicySyncopeOperations {
}
public void delete(final String policyKey) {
- policyService.delete(policyKey);
+ policyService.delete(null, policyKey);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java
index 0c05681..be5221a 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java
@@ -19,11 +19,14 @@
package org.apache.syncope.client.cli.commands.task;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import javax.xml.ws.WebServiceException;
import org.apache.syncope.client.cli.Input;
+import org.apache.syncope.client.cli.util.CommandUtils;
import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.to.TaskTO;
+import org.apache.syncope.common.lib.types.TaskType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -31,7 +34,8 @@ public class TaskRead extends AbstractTaskCommand {
private static final Logger LOG = LoggerFactory.getLogger(TaskRead.class);
- private static final String READ_HELP_MESSAGE = "task --read {TASK-KEY} {TASK-KEY} [...]";
+ private static final String READ_HELP_MESSAGE = "task --read {TASK-TYPE} {TASK-KEY}\n"
+ + " Task type: PROPAGATION / NOTIFICATION / SCHEDULED / PULL / PUSH";
private final Input input;
@@ -40,25 +44,26 @@ public class TaskRead extends AbstractTaskCommand {
}
public void read() {
- if (input.parameterNumber() >= 1) {
- final List<TaskTO> taskTOs = new ArrayList<>();
- for (final String parameter : input.getParameters()) {
- try {
- taskTOs.add(taskSyncopeOperations.read(parameter));
- } catch (final NumberFormatException ex) {
- LOG.error("Error reading task", ex);
- taskResultManager.notBooleanDeletedError("task", parameter);
- } catch (final SyncopeClientException | WebServiceException ex) {
- LOG.error("Error reading task", ex);
- if (ex.getMessage().startsWith("NotFound")) {
- taskResultManager.notFoundError("Task", parameter);
- } else {
- taskResultManager.genericError(ex.getMessage());
- }
- break;
+ if (input.parameterNumber() >= 2) {
+ final String[] parameters = Arrays.copyOfRange(input.getParameters(), 1, input.parameterNumber());
+ try {
+ final List<TaskTO> taskTOs = new ArrayList<>();
+ for (final String parameter : parameters) {
+ taskTOs.add(taskSyncopeOperations.read(input.firstParameter(), parameter));
}
+ taskResultManager.printTasks(taskTOs);
+ } catch (final SyncopeClientException | WebServiceException ex) {
+ LOG.error("Error reading task", ex);
+ if (ex.getMessage().startsWith("NotFound")) {
+ taskResultManager.notFoundError("Task", parameters[0]);
+ } else {
+ taskResultManager.genericError(ex.getMessage());
+ }
+ } catch (final IllegalArgumentException ex) {
+ LOG.error("Error reading task", ex);
+ taskResultManager.typeNotValidError(
+ "task", input.firstParameter(), CommandUtils.fromEnumToArray(TaskType.class));
}
- taskResultManager.printTasks(taskTOs);
} else {
taskResultManager.commandOptionError(READ_HELP_MESSAGE);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskSyncopeOperations.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskSyncopeOperations.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskSyncopeOperations.java
index ad94a4f..48fd7c6 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskSyncopeOperations.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskSyncopeOperations.java
@@ -36,12 +36,12 @@ public class TaskSyncopeOperations {
return taskService.listJobs();
}
- public <T extends TaskTO> T read(final String taskKey) {
- return taskService.read(taskKey, true);
+ public <T extends TaskTO> T read(final String type, final String taskKey) {
+ return taskService.read(TaskType.valueOf(type), taskKey, true);
}
public void delete(final String taskKey) {
- taskService.delete(taskKey);
+ taskService.delete(null, taskKey);
}
public List<TaskTO> list(final String type) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/cli/src/main/resources/messages.properties
----------------------------------------------------------------------
diff --git a/client/cli/src/main/resources/messages.properties b/client/cli/src/main/resources/messages.properties
index 0e47a36..48cdc15 100644
--- a/client/cli/src/main/resources/messages.properties
+++ b/client/cli/src/main/resources/messages.properties
@@ -22,14 +22,14 @@ entitlement.help.message=\nUsage: entitlement [options]\n Options:\n --help
group.help.message=\nUsage: group [options]\n Options:\n --help \n --details \n --list \n --read \n Syntax: --read {GROUP-KEY} {GROUP-KEY} [...]\n --read-attr-by-schema-type {GROUP-KEY} {SCHEMA-TYPE}\n Schema type: PLAIN / DERIVED / VIRTUAL\n --read-attr-by-schema {GROUP-KEY} {SCHEMA-TYPE} {SCHEMA-KEY}\n Schema type: PLAIN / DERIVED / VIRTUAL\n --delete \n Syntax: --delete {GROUP-KEY} {GROUP-KEY} [...]\n
logger.help.message=\nUsage: logger [options]\n Options:\n --help \n --details \n --list \n --read \n Syntax: --read {LOG-NAME} {LOG-NAME} [...]\n --update \n Syntax: --update {LOG-NAME}={LOG-LEVEL} {LOG-NAME}={LOG-LEVEL} [...]\n --update-all \n Syntax: --update-all {LOG-LEVEL} \n --create \n Syntax: --create {LOG-NAME}={LOG-LEVEL} {LOG-NAME}={LOG-LEVEL} [...]\n --delete \n Syntax: --delete {LOG-NAME} {LOG-NAME} [...]\n
notification.help.message=\nUsage: notification [options]\n Options:\n --help \n --list \n --read \n Syntax: --read {NOTIFICATION-KEY} \n --delete \n Syntax: --delete {NOTIFICATION-KEY}\n
-policy.help.message=\nUsage: policy [options]\n Options:\n --help \n --details \n --list \n Syntax: --list-policy {POLICY-TYPE} \n Policy type: ACCOUNT / PASSWORD / PULL / PUSH\n --read \n Syntax: --read {POLICY-KEY} {POLICY-KEY} [...]\n --delete \n Syntax: --delete {POLICY-KEY} {POLICY-KEY} [...]\n
+policy.help.message=\nUsage: policy [options]\n Options:\n --help \n --details \n --list \n Syntax: --list-policy {POLICY-TYPE} \n Policy type: ACCOUNT / PASSWORD / PULL / PUSH\n --read \n Syntax: --read {POLICY-TYPE} {POLICY-KEY}\n Policy type: ACCOUNT / PASSWORD / PULL / PUSH\n --delete \n Syntax: --delete {POLICY-KEY} {POLICY-KEY} [...]\n
question.help.message=\nUsage: question [options]\n Options:\n --help \n --list \n --read \n Syntax: --read {QUESTION-KEY} {QUESTION-KEY} [...]\n --delete \n Syntax: --delete {QUESTION-KEY} {QUESTION-KEY} [...]\n
realm.help.message=\nUsage: realm [options]\n Options:\n --help \n --details \n --list \n
report.help.message=\nUsage: report [options]\n Options:\n --help \n --details\n --list \n --list-jobs \n --read \n Syntax: --read {REPORT-KEY} {REPORT-KEY} [...] \n --delete \n Syntax: --delete {REPORT-KEY} {REPORT-KEY} [...]\n --execute \n Syntax: --execute {REPORT-KEY} \n --delete-execution \n Syntax: --delete-execution {EXECUTION-KEY} {EXECUTION-KEY} [...]\n --export-execution-result \n Syntax: --export-execution-result {EXECUTION-KEY} {EXECUTION-KEY} [...] {FORMAT}\n Format: CSV / HTML / PDF / XML / RTF\n
resource.help.message=\nUsage: resource [options]\n Options:\n --help \n --details \n --list \n --read \n Syntax: --read {RESOURCE-KEY} {RESOURCE-KEY} [...]\n --delete \n Syntax: --delete {RESOURCE-KEY} {RESOURCE-KEY} [...]\n
role.help.message=\nUsage: role [options]\n Options:\n --help \n --details \n --list \n --read \n Syntax: --read {ROLE-KEY} {ROLE-KEY} [...]\n --delete \n Syntax: --delete {ROLE-KEY} {ROLE-KEY} [...]\n
schema.help.message=\nUsage: schema [options]\n Options:\n --help \n --details \n --list-all\n --list-plain\n --list-derived\n --list-virtual\n --read {SCHEMA-TYPE} {SCHEMA-KEY}\n Schema type: PLAIN / DERIVED / VIRTUAL\n --delete {SCHEMA-TYPE} {SCHEMA-KEY}\n Schema type: PLAIN / DERIVED / VIRTUAL\n
-task.help.message=\nUsage: task [options]\n Options:\n --help \n --details\n --list\n Syntax: --list {TASK-TYPE} \n Task type: NOTIFICATION / PROPAGATION / PUSH / SCHEDULED / PULL\n --list-running-jobs \n --list-scheduled-jobs \n --read \n Syntax: --read {TASK-KEY} {TASK-KEY} [...]\n --delete \n Syntax: --delete {TASK-KEY} {TASK-KEY} [...]\n --delete-all-prop\n --delete-execution \n Syntax: --delete-execution {TASK-EXEC-KEY} {TASK-EXEC-KEY} [...]\n --execute \n Syntax: --execute {TASK-KEY} {DRY-RUN}\n Dry run: true / false\n
+task.help.message=\nUsage: task [options]\n Options:\n --help \n --details\n --list\n Syntax: --list {TASK-TYPE} \n Task type: NOTIFICATION / PROPAGATION / PUSH / SCHEDULED / PULL\n --list-running-jobs \n --list-scheduled-jobs \n --read \n Syntax: --read {TASK-TYPE} {TASK-KEY}\n Task type: PROPAGATION / NOTIFICATION / SCHEDULED / PULL / PUSH\n --delete \n Syntax: --delete {TASK-KEY} {TASK-KEY} [...]\n --delete-all-prop\n --delete-execution \n Syntax: --delete-execution {TASK-EXEC-KEY} {TASK-EXEC-KEY} [...]\n --execute \n Syntax: --execute {TASK-KEY} {DRY-RUN}\n Dry run: true / false\n
user.help.message=\nUsage: user [options]\n Options:\n --help \n --details \n --list \n --get-user-key\n Syntax: --get-user-key {USERNAME}\n --get-username\n Syntax: --get-username {USER-KEY}\n --read-by-userkey \n Syntax: --read-by-userkey {USER-KEY} {USER-KEY} [...]\n --read-by-username\n Syntax: --read-by-username {USERNAME} {USERNAME} [...]\n --search-by-attribute \n Syntax: --search-by-attribute {REALM} {ATTR-NAME}={ATTR-VALUE}\n --search-by-role \n Syntax: --search-by-role {REALM} {ROLE-KEY}\n --search-by-resource \n Syntax: --search-by-resource {REALM} {RESOURCE-KEY}\n --delete \n Syntax: --delete {USER-KEY} {USER-KEY} [...]\n --delete-all \n Syntax: --delete-all {REALM}\n --delete-by-attribute \n Syntax: --delete-by-attribute {REALM} {ATTR-NAME}={ATTR-VALUE}\n
workflow.help.message=\nUsage: workflow [options]\n Options:\n --help \n --export-diagram {ANY-TYPE-KIND}\n Any type kind: ANY_OBJECT / USER / GROUP\n --export-definition {ANY-TYPE-KIND}\n Any type kind: ANY_OBJECT / USER / GROUP\n
migrate.help.message=\nUsage: migrate [options]\n Options:\n --help \n --conf {SRC} {DST}\n Syncope 1.2.X content.xml SRC absolute path\n Syncope 2.0.X *Content.xml DST absolute path\n
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/policies/AccountPolicyDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/AccountPolicyDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/AccountPolicyDirectoryPanel.java
index 5b0f2f1..a63962c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/AccountPolicyDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/AccountPolicyDirectoryPanel.java
@@ -45,7 +45,8 @@ public class AccountPolicyDirectoryPanel extends PolicyDirectoryPanel<AccountPol
public AccountPolicyDirectoryPanel(final String id, final PageReference pageRef) {
super(id, PolicyType.ACCOUNT, pageRef);
- this.addNewItemPanelBuilder(new PolicyModalPanelBuilder<>(new AccountPolicyTO(), modal, pageRef), true);
+ this.addNewItemPanelBuilder(new PolicyModalPanelBuilder<>(
+ PolicyType.ACCOUNT, new AccountPolicyTO(), modal, pageRef), true);
MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.POLICY_CREATE);
initResultTable();
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/policies/PasswordPolicyDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PasswordPolicyDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PasswordPolicyDirectoryPanel.java
index 59fe831..fde6b62 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PasswordPolicyDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PasswordPolicyDirectoryPanel.java
@@ -45,7 +45,7 @@ public class PasswordPolicyDirectoryPanel extends PolicyDirectoryPanel<PasswordP
super(id, PolicyType.PASSWORD, pageRef);
this.addNewItemPanelBuilder(
- new PolicyModalPanelBuilder<>(new PasswordPolicyTO(), modal, pageRef), true);
+ new PolicyModalPanelBuilder<>(PolicyType.PASSWORD, new PasswordPolicyTO(), modal, pageRef), true);
MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.POLICY_CREATE);
initResultTable();
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
index e54af9d..090e818 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
@@ -79,11 +79,11 @@ public abstract class PolicyDirectoryPanel<T extends PolicyTO>
protected final BaseModal<T> policySpecModal = new BaseModal<>("outer");
- private final PolicyType policyType;
+ private final PolicyType type;
public PolicyDirectoryPanel(final String id, final PolicyType policyType, final PageReference pageRef) {
super(id, pageRef, true);
- this.policyType = policyType;
+ this.type = policyType;
this.restClient = new PolicyRestClient();
ruleCompositionModal.size(Modal.Size.Large);
@@ -109,7 +109,7 @@ public abstract class PolicyDirectoryPanel<T extends PolicyTO>
setFooterVisibility(true);
modal.addSubmitButton();
modal.size(Modal.Size.Large);
-
+
disableCheckBoxes();
}
@@ -143,7 +143,7 @@ public abstract class PolicyDirectoryPanel<T extends PolicyTO>
public void onClick(final AjaxRequestTarget target, final PolicyTO ignore) {
send(PolicyDirectoryPanel.this, Broadcast.EXACT,
new AjaxWizard.EditItemActionEvent<>(
- restClient.getPolicy(model.getObject().getKey()), target));
+ restClient.getPolicy(type, model.getObject().getKey()), target));
}
}, ActionLink.ActionType.EDIT, StandardEntitlement.POLICY_UPDATE);
@@ -170,7 +170,7 @@ public abstract class PolicyDirectoryPanel<T extends PolicyTO>
public void onClick(final AjaxRequestTarget target, final PolicyTO ignore) {
final T policyTO = model.getObject();
try {
- restClient.delete(policyTO.getKey());
+ restClient.delete(type, policyTO.getKey());
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
} catch (SyncopeClientException e) {
@@ -221,14 +221,14 @@ public abstract class PolicyDirectoryPanel<T extends PolicyTO>
@Override
public Iterator<T> iterator(final long first, final long count) {
- List<T> list = restClient.getPolicies(policyType);
+ List<T> list = restClient.getPolicies(type);
Collections.sort(list, comparator);
return list.subList((int) first, (int) first + (int) count).iterator();
}
@Override
public long size() {
- return restClient.getPolicies(policyType).size();
+ return restClient.getPolicies(type).size();
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
index bec070a..234c454 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
@@ -42,6 +42,7 @@ import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.policy.AccountPolicyTO;
import org.apache.syncope.common.lib.policy.PasswordPolicyTO;
import org.apache.syncope.common.lib.to.ResourceTO;
+import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.wicket.Component;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -58,10 +59,15 @@ public class PolicyModalPanelBuilder<T extends PolicyTO> extends AbstractModalPa
private final BaseModal<T> modal;
+ private final PolicyType type;
+
private final PolicyRestClient restClient = new PolicyRestClient();
- public PolicyModalPanelBuilder(final T policyTO, final BaseModal<T> modal, final PageReference pageRef) {
+ public PolicyModalPanelBuilder(
+ final PolicyType type, final T policyTO, final BaseModal<T> modal, final PageReference pageRef) {
+
super(policyTO, pageRef);
+ this.type = type;
this.modal = modal;
}
@@ -156,9 +162,9 @@ public class PolicyModalPanelBuilder<T extends PolicyTO> extends AbstractModalPa
public void onSubmit(final AjaxRequestTarget target, final Form<?> form) {
try {
if (policyTO.getKey() == null) {
- restClient.createPolicy(policyTO);
+ restClient.createPolicy(type, policyTO);
} else {
- restClient.updatePolicy(policyTO);
+ restClient.updatePolicy(type, policyTO);
}
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
Profile.this.modal.close(target);
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
index aa98ea5..3469451 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
@@ -78,6 +78,8 @@ public class PolicyRuleDirectoryPanel<T extends PolicyTO> extends DirectoryPanel
private final BaseModal<T> baseModal;
+ private final PolicyType type;
+
private final String policy;
protected PolicyRuleDirectoryPanel(
@@ -87,6 +89,7 @@ public class PolicyRuleDirectoryPanel<T extends PolicyTO> extends DirectoryPanel
disableCheckBoxes();
this.baseModal = baseModal;
+ this.type = type;
this.policy = policy;
this.restClient = new PolicyRestClient();
@@ -159,7 +162,7 @@ public class PolicyRuleDirectoryPanel<T extends PolicyTO> extends DirectoryPanel
public void onClick(final AjaxRequestTarget target, final PolicyRuleWrapper ignore) {
final RuleConf rule = model.getObject().getConf();
try {
- final T actual = restClient.getPolicy(policy);
+ final T actual = restClient.getPolicy(type, policy);
CollectionUtils.filter(getRuleConf(actual), new Predicate<RuleConf>() {
@Override
@@ -167,7 +170,7 @@ public class PolicyRuleDirectoryPanel<T extends PolicyTO> extends DirectoryPanel
return !object.getName().equals(rule.getName());
}
});
- restClient.updatePolicy(actual);
+ restClient.updatePolicy(type, actual);
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
customActionOnFinishCallback(target);
} catch (SyncopeClientException e) {
@@ -233,7 +236,7 @@ public class PolicyRuleDirectoryPanel<T extends PolicyTO> extends DirectoryPanel
@Override
public Iterator<PolicyRuleWrapper> iterator(final long first, final long count) {
- final T actual = restClient.getPolicy(policy);
+ final T actual = restClient.getPolicy(type, policy);
final ArrayList<PolicyRuleWrapper> rules = CollectionUtils.collect(getRuleConf(actual),
new Transformer<RuleConf, PolicyRuleWrapper>() {
@@ -250,7 +253,7 @@ public class PolicyRuleDirectoryPanel<T extends PolicyTO> extends DirectoryPanel
@Override
public long size() {
- final T actual = restClient.getPolicy(policy);
+ final T actual = restClient.getPolicy(type, policy);
return getRuleConf(actual).size();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
index 6148994..6b6d443 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
@@ -68,7 +68,7 @@ public class PolicyRuleWizardBuilder
BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(modelObject.getConf());
wrapper.setPropertyValue("name", modelObject.getName());
- PolicyTO policyTO = restClient.getPolicy(policy);
+ PolicyTO policyTO = restClient.getPolicy(type, policy);
final ComposablePolicy<RuleConf> composable;
if (policyTO instanceof ComposablePolicy) {
@@ -90,7 +90,7 @@ public class PolicyRuleWizardBuilder
composable.getRuleConfs().add(modelObject.getConf());
}
- restClient.updatePolicy(policyTO);
+ restClient.updatePolicy(type, policyTO);
return modelObject;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
index 6cdf72c..97848c5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
@@ -45,6 +45,7 @@ import org.apache.syncope.common.lib.policy.PullPolicyTO;
import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.ConflictResolutionAction;
+import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -132,7 +133,7 @@ public class PolicySpecModalPanel extends AbstractModalPanel<PullPolicyTO> {
for (CorrelationRule rule : model.getObject()) {
getItem().getSpecification().getCorrelationRules().put(rule.getAny(), rule.getRule());
}
- restClient.updatePolicy(getItem());
+ restClient.updatePolicy(PolicyType.PULL, getItem());
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
this.modal.close(target);
} catch (Exception e) {
@@ -278,18 +279,18 @@ public class PolicySpecModalPanel extends AbstractModalPanel<PullPolicyTO> {
final List<String> choices = StringUtils.isEmpty(rule.getAny())
? new ArrayList<String>()
: CollectionUtils.collect(new SchemaRestClient().getSchemas(SchemaType.PLAIN,
- rule.getAny().equals(AnyTypeKind.USER.name())
- ? AnyTypeKind.USER
- : rule.getAny().equals(AnyTypeKind.GROUP.name())
- ? AnyTypeKind.GROUP
- : AnyTypeKind.ANY_OBJECT), new Transformer<SchemaTO, String>() {
+ rule.getAny().equals(AnyTypeKind.USER.name())
+ ? AnyTypeKind.USER
+ : rule.getAny().equals(AnyTypeKind.GROUP.name())
+ ? AnyTypeKind.GROUP
+ : AnyTypeKind.ANY_OBJECT), new Transformer<SchemaTO, String>() {
@Override
public String transform(final SchemaTO input) {
return input.getKey();
}
}, new ArrayList<String>());
-
+
choices.add("key");
choices.add(rule.getAny().equals(AnyTypeKind.USER.name()) ? "username" : "name");
Collections.sort(choices);
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyDirectoryPanel.java
index 32b81b7..0193eaa 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PullPolicyDirectoryPanel.java
@@ -45,7 +45,7 @@ public class PullPolicyDirectoryPanel extends PolicyDirectoryPanel<PullPolicyTO>
defaultItem.setSpecification(new PullPolicySpec());
this.addNewItemPanelBuilder(
- new PolicyModalPanelBuilder<>(defaultItem, modal, pageRef), true);
+ new PolicyModalPanelBuilder<>(PolicyType.PULL, defaultItem, modal, pageRef), true);
MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.POLICY_CREATE);
initResultTable();
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
index 6b0619e..c6446c8 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
@@ -34,10 +34,10 @@ public class PolicyRestClient extends BaseRestClient {
private static final long serialVersionUID = -1392090291817187902L;
- public <T extends PolicyTO> T getPolicy(final String key) {
+ public <T extends PolicyTO> T getPolicy(final PolicyType type, final String key) {
T policy = null;
try {
- policy = getService(PolicyService.class).read(key);
+ policy = getService(PolicyService.class).read(type, key);
} catch (Exception e) {
LOG.warn("No policy found for id {}", key, e);
}
@@ -58,16 +58,16 @@ public class PolicyRestClient extends BaseRestClient {
return res;
}
- public <T extends PolicyTO> void createPolicy(final T policy) {
- getService(PolicyService.class).create(policy);
+ public <T extends PolicyTO> void createPolicy(final PolicyType type, final T policy) {
+ getService(PolicyService.class).create(type, policy);
}
- public <T extends PolicyTO> void updatePolicy(final T policy) {
- getService(PolicyService.class).update(policy);
+ public <T extends PolicyTO> void updatePolicy(final PolicyType type, final T policy) {
+ getService(PolicyService.class).update(type, policy);
}
- public void delete(final String key) {
- getService(PolicyService.class).delete(key);
+ public void delete(final PolicyType type, final String key) {
+ getService(PolicyService.class).delete(type, key);
}
private class PolicyComparator implements Comparator<PolicyTO>, Serializable {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
index ced4689..d184085 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
@@ -183,19 +183,19 @@ public class TaskRestClient extends BaseRestClient implements ExecutionRestClien
}
public PropagationTaskTO readPropagationTask(final String taskKey) {
- return getService(TaskService.class).read(taskKey, false);
+ return getService(TaskService.class).read(TaskType.PROPAGATION, taskKey, false);
}
public NotificationTaskTO readNotificationTask(final String taskKey) {
- return getService(TaskService.class).read(taskKey, false);
+ return getService(TaskService.class).read(TaskType.NOTIFICATION, taskKey, false);
}
- public <T extends SchedTaskTO> T readSchedTask(final Class<T> reference, final String taskKey) {
- return getService(TaskService.class).read(taskKey, false);
+ public <T extends TaskTO> T readTask(final TaskType type, final String taskKey) {
+ return getService(TaskService.class).read(type, taskKey, false);
}
- public void delete(final String taskKey, final Class<? extends TaskTO> taskToClass) {
- getService(TaskService.class).delete(taskKey);
+ public void delete(final TaskType type, final String taskKey) {
+ getService(TaskService.class).delete(type, taskKey);
}
@Override
@@ -218,12 +218,12 @@ public class TaskRestClient extends BaseRestClient implements ExecutionRestClien
return getService(TaskService.class).listRecentExecutions(max);
}
- public void create(final SchedTaskTO taskTO) {
- getService(TaskService.class).create(taskTO);
+ public void create(final TaskType type, final SchedTaskTO taskTO) {
+ getService(TaskService.class).create(type, taskTO);
}
- public void update(final SchedTaskTO taskTO) {
- getService(TaskService.class).update(taskTO);
+ public void update(final TaskType type, final SchedTaskTO taskTO) {
+ getService(TaskService.class).update(type, taskTO);
}
public BulkActionResult bulkAction(final BulkAction action) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/tasks/NotificationTaskDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/NotificationTaskDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/NotificationTaskDirectoryPanel.java
index 5a48614..9ccf0cb 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/NotificationTaskDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/NotificationTaskDirectoryPanel.java
@@ -160,7 +160,7 @@ public abstract class NotificationTaskDirectoryPanel
@Override
public void onClick(final AjaxRequestTarget target, final NotificationTaskTO modelObject) {
try {
- restClient.delete(taskTO.getKey(), NotificationTaskTO.class);
+ restClient.delete(TaskType.NOTIFICATION, taskTO.getKey());
updateResultTable(target);
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/tasks/PropagationTaskDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/PropagationTaskDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/PropagationTaskDirectoryPanel.java
index 1c63efd..507e33a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/PropagationTaskDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/PropagationTaskDirectoryPanel.java
@@ -167,7 +167,7 @@ public abstract class PropagationTaskDirectoryPanel
@Override
public void onClick(final AjaxRequestTarget target, final PropagationTaskTO modelObject) {
try {
- restClient.delete(taskTO.getKey(), PropagationTaskTO.class);
+ restClient.delete(TaskType.PROPAGATION, taskTO.getKey());
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
PropagationTaskDirectoryPanel.this.getTogglePanel().close(target);
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/tasks/ProvisioningTaskDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/ProvisioningTaskDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/ProvisioningTaskDirectoryPanel.java
index ff45a0a..91f17b8 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/ProvisioningTaskDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/ProvisioningTaskDirectoryPanel.java
@@ -51,10 +51,12 @@ public abstract class ProvisioningTaskDirectoryPanel<T extends ProvisioningTaskT
protected ProvisioningTaskDirectoryPanel(
final BaseModal<?> baseModal,
final MultilevelPanel multiLevelPanelRef,
+ final TaskType taskType,
final Class<T> reference,
final String resource,
final PageReference pageRef) {
- super(baseModal, multiLevelPanelRef, reference, pageRef);
+
+ super(baseModal, multiLevelPanelRef, taskType, reference, pageRef);
this.resource = resource;
this.schedTaskTO.setResource(resource);
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/tasks/PullTaskDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/PullTaskDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/PullTaskDirectoryPanel.java
index 9af1251..a0329d8 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/PullTaskDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/PullTaskDirectoryPanel.java
@@ -39,7 +39,8 @@ public abstract class PullTaskDirectoryPanel extends ProvisioningTaskDirectoryPa
final MultilevelPanel multiLevelPanelRef,
final String resource,
final PageReference pageRef) {
- super(baseModal, multiLevelPanelRef, PullTaskTO.class, resource, pageRef);
+
+ super(baseModal, multiLevelPanelRef, TaskType.PULL, PullTaskTO.class, resource, pageRef);
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/tasks/PushTaskDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/PushTaskDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/PushTaskDirectoryPanel.java
index 440b0e2..ac2dd0b 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/PushTaskDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/PushTaskDirectoryPanel.java
@@ -37,7 +37,7 @@ public abstract class PushTaskDirectoryPanel extends ProvisioningTaskDirectoryPa
final MultilevelPanel multiLevelPanelRef,
final String resource,
final PageReference pageRef) {
- super(baseModal, multiLevelPanelRef, PushTaskTO.class, resource, pageRef);
+ super(baseModal, multiLevelPanelRef, TaskType.PUSH, PushTaskTO.class, resource, pageRef);
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskDirectoryPanel.java
index c19940e..a4b2d51 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskDirectoryPanel.java
@@ -75,6 +75,8 @@ public abstract class SchedTaskDirectoryPanel<T extends SchedTaskTO>
private static final String GROUP_MEMBER_PROVISION_TASKJOB =
"org.apache.syncope.core.provisioning.java.job.GroupMemberProvisionTaskJobDelegate";
+ protected TaskType taskType;
+
protected final Class<T> reference;
protected T schedTaskTO;
@@ -86,9 +88,12 @@ public abstract class SchedTaskDirectoryPanel<T extends SchedTaskTO>
protected SchedTaskDirectoryPanel(
final BaseModal<?> baseModal,
final MultilevelPanel multiLevelPanelRef,
+ final TaskType taskType,
final Class<T> reference,
final PageReference pageRef) {
+
super(baseModal, multiLevelPanelRef, pageRef);
+ this.taskType = taskType;
this.reference = reference;
try {
@@ -97,7 +102,7 @@ public abstract class SchedTaskDirectoryPanel<T extends SchedTaskTO>
LOG.error("Falure instantiating task", e);
}
- this.addNewItemPanelBuilder(new SchedTaskWizardBuilder<>(schedTaskTO, pageRef), true);
+ this.addNewItemPanelBuilder(new SchedTaskWizardBuilder<>(taskType, schedTaskTO, pageRef), true);
MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, StandardEntitlement.TASK_CREATE);
@@ -118,7 +123,7 @@ public abstract class SchedTaskDirectoryPanel<T extends SchedTaskTO>
final TemplatableTO targetObject, final String type, final AnyTO anyTO) {
targetObject.getTemplates().put(type, anyTO);
- new TaskRestClient().update(SchedTaskTO.class.cast(targetObject));
+ new TaskRestClient().update(taskType, SchedTaskTO.class.cast(targetObject));
return targetObject;
}
};
@@ -206,7 +211,7 @@ public abstract class SchedTaskDirectoryPanel<T extends SchedTaskTO>
SchedTaskDirectoryPanel.this.getTogglePanel().close(target);
send(SchedTaskDirectoryPanel.this, Broadcast.EXACT,
new AjaxWizard.EditItemActionEvent<>(
- restClient.readSchedTask(reference, model.getObject().getKey()),
+ restClient.readTask(taskType, model.getObject().getKey()),
target).setResourceModel(
new StringResourceModel("inner.task.edit",
SchedTaskDirectoryPanel.this,
@@ -265,7 +270,7 @@ public abstract class SchedTaskDirectoryPanel<T extends SchedTaskTO>
@Override
public void onClick(final AjaxRequestTarget target, final T ignore) {
try {
- restClient.delete(taskTO.getKey(), reference);
+ restClient.delete(taskType, taskTO.getKey());
SyncopeConsoleSession.get().info(getString(Constants.OPERATION_SUCCEEDED));
target.add(container);
SchedTaskDirectoryPanel.this.getTogglePanel().close(target);
@@ -300,7 +305,7 @@ public abstract class SchedTaskDirectoryPanel<T extends SchedTaskTO>
@Override
protected SchedTasksProvider<T> dataProvider() {
- return new SchedTasksProvider<>(reference, TaskType.SCHEDULED, rows);
+ return new SchedTasksProvider<>(reference, taskType, rows);
}
protected class SchedTasksProvider<T extends SchedTaskTO> extends TaskDataProvider<T> {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskWizardBuilder.java
index 9075ac5..1a78c2d 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskWizardBuilder.java
@@ -42,6 +42,7 @@ import org.apache.syncope.common.lib.to.PushTaskTO;
import org.apache.syncope.common.lib.to.RealmTO;
import org.apache.syncope.common.lib.types.MatchingRule;
import org.apache.syncope.common.lib.types.PullMode;
+import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.common.lib.types.UnmatchingRule;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -59,6 +60,8 @@ public class SchedTaskWizardBuilder<T extends SchedTaskTO> extends AjaxWizardBui
private final TaskRestClient taskRestClient = new TaskRestClient();
+ private final TaskType type;
+
private PushTaskWrapper wrapper;
private CrontabPanel crontabPanel;
@@ -84,8 +87,9 @@ public class SchedTaskWizardBuilder<T extends SchedTaskTO> extends AjaxWizardBui
}
};
- public SchedTaskWizardBuilder(final T taskTO, final PageReference pageRef) {
+ public SchedTaskWizardBuilder(final TaskType type, final T taskTO, final PageReference pageRef) {
super(taskTO, pageRef);
+ this.type = type;
}
@Override
@@ -96,9 +100,9 @@ public class SchedTaskWizardBuilder<T extends SchedTaskTO> extends AjaxWizardBui
modelObject.setCronExpression(crontabPanel.getCronExpression());
if (modelObject.getKey() == null) {
- taskRestClient.create(modelObject);
+ taskRestClient.create(type, modelObject);
} else {
- taskRestClient.update(modelObject);
+ taskRestClient.update(type, modelObject);
}
return modelObject;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTasks.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTasks.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTasks.java
index d0e8907..562d632 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTasks.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTasks.java
@@ -23,6 +23,7 @@ import org.apache.syncope.client.console.panels.MultilevelPanel;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
import org.apache.syncope.common.lib.to.AnyTO;
import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.types.TaskType;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.model.Model;
@@ -39,7 +40,7 @@ public class SchedTasks extends AbstractTasks {
add(mlp);
mlp.setFirstLevel(new SchedTaskDirectoryPanel<SchedTaskTO>(
- baseModal, mlp, SchedTaskTO.class, pageReference) {
+ baseModal, mlp, TaskType.SCHEDULED, SchedTaskTO.class, pageReference) {
private static final long serialVersionUID = -2195387360323687302L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
index 1cf3db2..b41e174 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/widgets/JobWidget.java
@@ -53,8 +53,10 @@ import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.ReportTO;
import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
+import org.apache.syncope.common.lib.to.PullTaskTO;
import org.apache.syncope.common.lib.types.JobType;
import org.apache.syncope.common.lib.types.StandardEntitlement;
+import org.apache.syncope.common.lib.types.TaskType;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
@@ -351,8 +353,7 @@ public class JobWidget extends BaseWidget {
final IModel<JobTO> rowModel) {
JobTO jobTO = rowModel.getObject();
- JobActionPanel panel
- = new JobActionPanel(componentId, jobTO, JobWidget.this, pageRef);
+ JobActionPanel panel = new JobActionPanel(componentId, jobTO, JobWidget.this, pageRef);
MetaDataRoleAuthorizationStrategy.authorize(panel, WebPage.ENABLE,
String.format("%s,%s%s,%s",
StandardEntitlement.TASK_EXECUTE,
@@ -404,11 +405,18 @@ public class JobWidget extends BaseWidget {
break;
case TASK:
- ProvisioningTaskTO schedTaskTO = new TaskRestClient().
- readSchedTask(ProvisioningTaskTO.class, jobTO.getRefKey());
-
- SchedTaskWizardBuilder<ProvisioningTaskTO> swb
- = new SchedTaskWizardBuilder<>(schedTaskTO, pageRef);
+ ProvisioningTaskTO schedTaskTO;
+ try {
+ schedTaskTO = new TaskRestClient().readTask(TaskType.PULL, jobTO.getRefKey());
+ } catch (Exception e) {
+ LOG.debug("Failed to read {} as {}, attempting {}",
+ jobTO.getRefKey(), TaskType.PULL, TaskType.PUSH, e);
+ schedTaskTO = new TaskRestClient().readTask(TaskType.PUSH, jobTO.getRefKey());
+ }
+
+ SchedTaskWizardBuilder<ProvisioningTaskTO> swb =
+ new SchedTaskWizardBuilder<>(schedTaskTO instanceof PullTaskTO
+ ? TaskType.PULL : TaskType.PUSH, schedTaskTO, pageRef);
swb.setEventSink(AvailableJobsPanel.this);
target.add(jobModal.setContent(swb.build(BaseModal.CONTENT_ID, AjaxWizard.Mode.EDIT)));
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/AnyQuery.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/AnyQuery.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/AnyQuery.java
index 1ce1233..aad9157 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/AnyQuery.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/AnyQuery.java
@@ -19,7 +19,6 @@
package org.apache.syncope.common.rest.api.beans;
import javax.ws.rs.DefaultValue;
-import javax.ws.rs.MatrixParam;
import javax.ws.rs.QueryParam;
import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.rest.api.service.JAXRSService;
@@ -63,7 +62,7 @@ public class AnyQuery extends AbstractQuery {
}
@DefaultValue(SyncopeConstants.ROOT_REALM)
- @MatrixParam("realm")
+ @QueryParam("realm")
public void setRealm(final String realm) {
this.realm = realm;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/TaskQuery.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/TaskQuery.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/TaskQuery.java
index dc74d26..c96d7b2 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/TaskQuery.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/beans/TaskQuery.java
@@ -21,7 +21,7 @@ package org.apache.syncope.common.rest.api.beans;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.ws.rs.DefaultValue;
-import javax.ws.rs.MatrixParam;
+import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.TaskType;
@@ -86,7 +86,7 @@ public class TaskQuery extends AbstractQuery {
}
@NotNull
- @MatrixParam("type")
+ @PathParam("type")
public void setType(final TaskType type) {
this.type = type;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
index e9f9b1a..d71cf0a 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
@@ -25,7 +25,6 @@ import javax.validation.constraints.NotNull;
import javax.ws.rs.Consumes;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
-import javax.ws.rs.MatrixParam;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
@@ -48,14 +47,15 @@ public interface PolicyService extends JAXRSService {
/**
* Returns the policy matching the given key.
*
+ * @param type policy type
* @param key key of requested policy
* @param <T> response type (extending PolicyTO)
* @return policy with matching id
*/
@GET
- @Path("{key}")
+ @Path("{type}/{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- <T extends PolicyTO> T read(@NotNull @PathParam("key") String key);
+ <T extends PolicyTO> T read(@NotNull @PathParam("type") PolicyType type, @NotNull @PathParam("key") String key);
/**
* Returns a list of policies of the matching type.
@@ -65,41 +65,46 @@ public interface PolicyService extends JAXRSService {
* @return list of policies with matching type
*/
@GET
+ @Path("{type}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- <T extends PolicyTO> List<T> list(@NotNull @MatrixParam("type") PolicyType type);
+ <T extends PolicyTO> List<T> list(@NotNull @PathParam("type") PolicyType type);
/**
* Create a new policy.
*
+ * @param type policy type
* @param policyTO Policy to be created (needs to match type)
* @return Response object featuring Location header of created policy
*/
@POST
+ @Path("{type}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response create(@NotNull PolicyTO policyTO);
+ Response create(@NotNull @PathParam("type") PolicyType type, @NotNull PolicyTO policyTO);
/**
* Updates policy matching the given key.
*
+ * @param type policy type
* @param policyTO Policy to replace existing policy
* @return an empty response if operation was successful
*/
@PUT
- @Path("{key}")
+ @Path("{type}/{key}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response update(@NotNull PolicyTO policyTO);
+ Response update(@NotNull @PathParam("type") PolicyType type, @NotNull PolicyTO policyTO);
/**
* Delete policy matching the given key.
*
+ * @param type policy type
* @param key key of policy to be deleted
* @return an empty response if operation was successful
*/
@DELETE
- @Path("{key}")
+ @Path("{type}/{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response delete(@NotNull @PathParam("key") String key);
+ Response delete(@NotNull @PathParam("type") PolicyType type, @NotNull @PathParam("key") String key);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
index d23c654..f3f0dbc 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
@@ -39,6 +39,7 @@ import org.apache.syncope.common.lib.to.BulkAction;
import org.apache.syncope.common.lib.to.BulkActionResult;
import org.apache.syncope.common.lib.to.PagedResult;
import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.common.rest.api.beans.TaskQuery;
/**
@@ -53,15 +54,17 @@ public interface TaskService extends ExecutableService {
/**
* Returns the task matching the given key.
*
+ * @param type task type
* @param key key of task to be read
* @param details whether include executions or not, defaults to true
* @param <T> type of taskTO
* @return task with matching id
*/
@GET
- @Path("{key}")
+ @Path("{type}/{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
<T extends TaskTO> T read(
+ @NotNull @PathParam("type") TaskType type,
@NotNull @PathParam("key") String key,
@QueryParam(JAXRSService.PARAM_DETAILS) @DefaultValue("true") boolean details);
@@ -73,40 +76,45 @@ public interface TaskService extends ExecutableService {
* @return paged list of existing tasks matching the given query
*/
@GET
+ @Path("{type}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
<T extends TaskTO> PagedResult<T> list(@BeanParam TaskQuery query);
/**
* Creates a new task.
*
+ * @param type task type
* @param taskTO task to be created
* @return Response object featuring Location header of created task
*/
@POST
+ @Path("{type}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response create(@NotNull SchedTaskTO taskTO);
+ Response create(@NotNull @PathParam("type") TaskType type, @NotNull SchedTaskTO taskTO);
/**
* Updates the task matching the provided key.
*
+ * @param type task type
* @param taskTO updated task to be stored
* @return an empty response if operation was successful
*/
@PUT
- @Path("{key}")
+ @Path("{type}/{key}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response update(@NotNull TaskTO taskTO);
+ Response update(@NotNull @PathParam("type") TaskType type, @NotNull SchedTaskTO taskTO);
/**
* Deletes the task matching the provided key.
*
+ * @param type task type
* @param key key of task to be deleted
* @return an empty response if operation was successful
*/
@DELETE
- @Path("{key}")
+ @Path("{type}/{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response delete(@NotNull @PathParam("key") String key);
+ Response delete(@NotNull @PathParam("type") TaskType type, @NotNull @PathParam("key") String key);
/**
* Executes the provided bulk action.
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/logic/src/main/java/org/apache/syncope/core/logic/PolicyLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/PolicyLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/PolicyLogic.java
index 4d71d88..4285d22 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/PolicyLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/PolicyLogic.java
@@ -24,16 +24,16 @@ import java.util.List;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.lang3.ArrayUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.policy.PolicyTO;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.syncope.core.persistence.api.dao.NotFoundException;
import org.apache.syncope.core.persistence.api.dao.PolicyDAO;
-import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
-import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy;
-import org.apache.syncope.core.persistence.api.entity.Policy;
-import org.apache.syncope.core.persistence.api.entity.policy.PullPolicy;
-import org.apache.syncope.core.persistence.api.entity.policy.PushPolicy;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
+import org.apache.syncope.core.persistence.api.entity.policy.PolicyUtils;
+import org.apache.syncope.core.persistence.api.entity.policy.PolicyUtilsFactory;
import org.apache.syncope.core.provisioning.api.data.PolicyDataBinder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
@@ -48,37 +48,40 @@ public class PolicyLogic extends AbstractTransactionalLogic<PolicyTO> {
@Autowired
private PolicyDataBinder binder;
+ @Autowired
+ private PolicyUtilsFactory policyUtilsFactory;
+
@PreAuthorize("hasRole('" + StandardEntitlement.POLICY_CREATE + "')")
- public <T extends PolicyTO> T create(final T policyTO) {
+ public <T extends PolicyTO> T create(final PolicyType type, final T policyTO) {
+ PolicyUtils policyUtils = policyUtilsFactory.getInstance(policyTO);
+ if (policyUtils.getType() != type) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + type + ", expected " + policyUtils.getType());
+ throw sce;
+ }
+
return binder.getPolicyTO(policyDAO.save(binder.create(policyTO)));
}
@PreAuthorize("hasRole('" + StandardEntitlement.POLICY_UPDATE + "')")
- public PolicyTO update(final PolicyTO policyTO) {
+ public PolicyTO update(final PolicyType type, final PolicyTO policyTO) {
Policy policy = policyDAO.find(policyTO.getKey());
- return binder.getPolicyTO(policyDAO.save(binder.update(policy, policyTO)));
- }
-
- private Class<? extends Policy> getPolicyClass(final PolicyType policyType) {
- switch (policyType) {
- case ACCOUNT:
- return AccountPolicy.class;
-
- case PASSWORD:
- return PasswordPolicy.class;
- case PULL:
- return PullPolicy.class;
-
- case PUSH:
- default:
- return PushPolicy.class;
+ PolicyUtils policyUtils = policyUtilsFactory.getInstance(policy);
+ if (policyUtils.getType() != type) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + type + ", expected " + policyUtils.getType());
+ throw sce;
}
+
+ return binder.getPolicyTO(policyDAO.save(binder.update(policy, policyTO)));
}
@PreAuthorize("hasRole('" + StandardEntitlement.POLICY_LIST + "')")
public <T extends PolicyTO> List<T> list(final PolicyType type) {
- return CollectionUtils.collect(policyDAO.find(getPolicyClass(type)), new Transformer<Policy, T>() {
+ PolicyUtils policyUtils = policyUtilsFactory.getInstance(type);
+
+ return CollectionUtils.collect(policyDAO.find(policyUtils.policyClass()), new Transformer<Policy, T>() {
@Override
public T transform(final Policy input) {
@@ -88,26 +91,40 @@ public class PolicyLogic extends AbstractTransactionalLogic<PolicyTO> {
}
@PreAuthorize("hasRole('" + StandardEntitlement.POLICY_READ + "')")
- public <T extends PolicyTO> T read(final String key) {
+ public <T extends PolicyTO> T read(final PolicyType type, final String key) {
Policy policy = policyDAO.find(key);
if (policy == null) {
throw new NotFoundException("Policy " + key + " not found");
}
+ PolicyUtils policyUtils = policyUtilsFactory.getInstance(policy);
+ if (type != null && policyUtils.getType() != type) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + type + ", expected " + policyUtils.getType());
+ throw sce;
+ }
+
return binder.getPolicyTO(policy);
}
@PreAuthorize("hasRole('" + StandardEntitlement.POLICY_DELETE + "')")
- public <T extends PolicyTO> T delete(final String key) {
+ public <T extends PolicyTO> T delete(final PolicyType type, final String key) {
Policy policy = policyDAO.find(key);
if (policy == null) {
throw new NotFoundException("Policy " + key + " not found");
}
- T policyToDelete = binder.getPolicyTO(policy);
+ PolicyUtils policyUtils = policyUtilsFactory.getInstance(policy);
+ if (type != null && policyUtils.getType() != type) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + type + ", expected " + policyUtils.getType());
+ throw sce;
+ }
+
+ T deleted = binder.getPolicyTO(policy);
policyDAO.delete(policy);
- return policyToDelete;
+ return deleted;
}
@Override
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
index e0aa42c..9603bc8 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
@@ -96,8 +96,13 @@ public class TaskLogic extends AbstractExecutableLogic<TaskTO> {
private TaskUtilsFactory taskUtilsFactory;
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_CREATE + "')")
- public <T extends SchedTaskTO> T createSchedTask(final T taskTO) {
+ public <T extends SchedTaskTO> T createSchedTask(final TaskType type, final T taskTO) {
TaskUtils taskUtils = taskUtilsFactory.getInstance(taskTO);
+ if (taskUtils.getType() != type) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + type + ", expected " + taskUtils.getType());
+ throw sce;
+ }
SchedTask task = binder.createSchedTask(taskTO, taskUtils);
task = taskDAO.save(task);
@@ -119,13 +124,18 @@ public class TaskLogic extends AbstractExecutableLogic<TaskTO> {
}
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_UPDATE + "')")
- public <T extends SchedTaskTO> T updateSchedTask(final SchedTaskTO taskTO) {
+ public <T extends SchedTaskTO> T updateSchedTask(final TaskType type, final SchedTaskTO taskTO) {
SchedTask task = taskDAO.find(taskTO.getKey());
if (task == null) {
throw new NotFoundException("Task " + taskTO.getKey());
}
TaskUtils taskUtils = taskUtilsFactory.getInstance(task);
+ if (taskUtils.getType() != type) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + type + ", expected " + taskUtils.getType());
+ throw sce;
+ }
binder.updateSchedTask(task, taskTO, taskUtils);
task = taskDAO.save(task);
@@ -186,11 +196,19 @@ public class TaskLogic extends AbstractExecutableLogic<TaskTO> {
}
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_READ + "')")
- public <T extends TaskTO> T read(final String key, final boolean details) {
+ public <T extends TaskTO> T read(final TaskType type, final String key, final boolean details) {
Task task = taskDAO.find(key);
if (task == null) {
throw new NotFoundException("Task " + key);
}
+
+ TaskUtils taskUtils = taskUtilsFactory.getInstance(task);
+ if (type != null && taskUtils.getType() != type) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + type + ", expected " + taskUtils.getType());
+ throw sce;
+ }
+
return binder.getTaskTO(task, taskUtilsFactory.getInstance(task), details);
}
@@ -267,12 +285,18 @@ public class TaskLogic extends AbstractExecutableLogic<TaskTO> {
}
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_DELETE + "')")
- public <T extends TaskTO> T delete(final String key) {
+ public <T extends TaskTO> T delete(final TaskType type, final String key) {
Task task = taskDAO.find(key);
if (task == null) {
throw new NotFoundException("Task " + key);
}
+
TaskUtils taskUtils = taskUtilsFactory.getInstance(task);
+ if (type != null && taskUtils.getType() != type) {
+ SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.InvalidRequest);
+ sce.getElements().add("Found " + type + ", expected " + taskUtils.getType());
+ throw sce;
+ }
T taskToDelete = binder.getTaskTO(task, taskUtils, true);
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java
index b48fd79..361ad1d 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java
@@ -20,7 +20,7 @@ package org.apache.syncope.core.persistence.api.dao;
import java.util.List;
import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
-import org.apache.syncope.core.persistence.api.entity.Policy;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
import org.apache.syncope.core.persistence.api.entity.resource.Provision;
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PolicyDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PolicyDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PolicyDAO.java
index 245758b..9402073 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PolicyDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PolicyDAO.java
@@ -20,8 +20,8 @@ package org.apache.syncope.core.persistence.api.dao;
import java.util.List;
import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
-import org.apache.syncope.core.persistence.api.entity.Policy;
public interface PolicyDAO extends DAO<Policy> {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java
index de23601..0338574 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RealmDAO.java
@@ -20,8 +20,8 @@ package org.apache.syncope.core.persistence.api.dao;
import java.util.List;
import java.util.regex.Pattern;
-import org.apache.syncope.core.persistence.api.entity.Policy;
import org.apache.syncope.core.persistence.api.entity.Realm;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
public interface RealmDAO extends DAO<Realm> {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Policy.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Policy.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Policy.java
deleted file mode 100644
index 85fc90e..0000000
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/Policy.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.persistence.api.entity;
-
-public interface Policy extends Entity {
-
- String getDescription();
-
- void setDescription(String description);
-}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/AccountPolicy.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/AccountPolicy.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/AccountPolicy.java
index 6aed282..5cc4192 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/AccountPolicy.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/AccountPolicy.java
@@ -21,7 +21,6 @@ package org.apache.syncope.core.persistence.api.entity.policy;
import java.util.List;
import java.util.Set;
import org.apache.syncope.common.lib.policy.AccountRuleConf;
-import org.apache.syncope.core.persistence.api.entity.Policy;
import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
public interface AccountPolicy extends Policy {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PasswordPolicy.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PasswordPolicy.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PasswordPolicy.java
index a3e565f..33925b7 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PasswordPolicy.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PasswordPolicy.java
@@ -20,7 +20,6 @@ package org.apache.syncope.core.persistence.api.entity.policy;
import java.util.List;
import org.apache.syncope.common.lib.policy.PasswordRuleConf;
-import org.apache.syncope.core.persistence.api.entity.Policy;
public interface PasswordPolicy extends Policy {
[10/10] syncope git commit: Upgrade Tomcat
Posted by il...@apache.org.
Upgrade Tomcat
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/dd638b27
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/dd638b27
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/dd638b27
Branch: refs/heads/master
Commit: dd638b27f631e1b882c113976f94ca3ca4da30bf
Parents: 38f0b58
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Feb 13 14:28:08 2018 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Feb 13 14:28:08 2018 +0100
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/dd638b27/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index b27d920..217daf6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -485,7 +485,7 @@ under the License.
<cargo.log>${log.directory}/cargo.log</cargo.log>
<cargo.output>${log.directory}/cargo-output.log</cargo.output>
- <tomcat.version>9.0.4</tomcat.version>
+ <tomcat.version>9.0.5</tomcat.version>
<phantomjs.driver.version>1.2.0</phantomjs.driver.version>
<phantomjs.version>2.1.1</phantomjs.version>
[08/10] syncope git commit: [SYNCOPE-1262] Remove matrix parameters -
OpenApi wins :-(
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/Policy.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/Policy.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/Policy.java
new file mode 100644
index 0000000..b152221
--- /dev/null
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/Policy.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.persistence.api.entity.policy;
+
+import org.apache.syncope.core.persistence.api.entity.Entity;
+
+public interface Policy extends Entity {
+
+ String getDescription();
+
+ void setDescription(String description);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PolicyUtils.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PolicyUtils.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PolicyUtils.java
new file mode 100644
index 0000000..e712646
--- /dev/null
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PolicyUtils.java
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.persistence.api.entity.policy;
+
+import org.apache.syncope.common.lib.types.PolicyType;
+
+public interface PolicyUtils {
+
+ PolicyType getType();
+
+ Class<? extends Policy> policyClass();
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PolicyUtilsFactory.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PolicyUtilsFactory.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PolicyUtilsFactory.java
new file mode 100644
index 0000000..e3092c0
--- /dev/null
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PolicyUtilsFactory.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.persistence.api.entity.policy;
+
+import org.apache.syncope.common.lib.policy.PolicyTO;
+import org.apache.syncope.common.lib.types.PolicyType;
+
+public interface PolicyUtilsFactory {
+
+ PolicyUtils getInstance(PolicyType type);
+
+ PolicyUtils getInstance(Policy policy);
+
+ PolicyUtils getInstance(Class<? extends PolicyTO> policyClass);
+
+ PolicyUtils getInstance(PolicyTO policyTO);
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PullPolicy.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PullPolicy.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PullPolicy.java
index da82cb7..903c9d7 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PullPolicy.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PullPolicy.java
@@ -19,7 +19,6 @@
package org.apache.syncope.core.persistence.api.entity.policy;
import org.apache.syncope.common.lib.policy.PullPolicySpec;
-import org.apache.syncope.core.persistence.api.entity.Policy;
public interface PullPolicy extends Policy {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PushPolicy.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PushPolicy.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PushPolicy.java
index 4365e72..d6819b7 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PushPolicy.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/policy/PushPolicy.java
@@ -19,7 +19,6 @@
package org.apache.syncope.core.persistence.api.entity.policy;
import org.apache.syncope.common.lib.policy.PushPolicySpec;
-import org.apache.syncope.core.persistence.api.entity.Policy;
public interface PushPolicy extends Policy {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
index f63eff0..21d968f 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAExternalResourceDAO.java
@@ -44,12 +44,12 @@ import org.apache.syncope.core.persistence.api.entity.AnyTypeClass;
import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
import org.apache.syncope.core.persistence.api.entity.resource.MappingItem;
-import org.apache.syncope.core.persistence.api.entity.Policy;
import org.apache.syncope.core.persistence.api.entity.Realm;
import org.apache.syncope.core.persistence.api.entity.VirSchema;
import org.apache.syncope.core.persistence.api.entity.anyobject.AnyObject;
import org.apache.syncope.core.persistence.api.entity.group.Group;
import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
import org.apache.syncope.core.persistence.api.entity.policy.PullPolicy;
import org.apache.syncope.core.persistence.api.entity.resource.Provision;
import org.apache.syncope.core.persistence.api.entity.user.User;
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPolicyDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPolicyDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPolicyDAO.java
index 4c76f44..1ff9c38 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPolicyDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPAPolicyDAO.java
@@ -25,8 +25,8 @@ import org.apache.syncope.core.persistence.api.dao.RealmDAO;
import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy;
-import org.apache.syncope.core.persistence.api.entity.Policy;
import org.apache.syncope.core.persistence.api.entity.Realm;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
import org.apache.syncope.core.persistence.api.entity.policy.PullPolicy;
import org.apache.syncope.core.persistence.api.entity.policy.PushPolicy;
import org.apache.syncope.core.persistence.jpa.entity.policy.AbstractPolicy;
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARealmDAO.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARealmDAO.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARealmDAO.java
index 0f4cb62..64a004f 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARealmDAO.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/dao/JPARealmDAO.java
@@ -31,10 +31,10 @@ import org.apache.syncope.core.persistence.api.dao.MalformedPathException;
import org.apache.syncope.core.persistence.api.dao.RealmDAO;
import org.apache.syncope.core.persistence.api.dao.RoleDAO;
import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
-import org.apache.syncope.core.persistence.api.entity.Policy;
import org.apache.syncope.core.persistence.api.entity.Realm;
import org.apache.syncope.core.persistence.api.entity.Role;
import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
import org.apache.syncope.core.persistence.api.entity.policy.PullPolicy;
import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
import org.apache.syncope.core.persistence.jpa.entity.JPARealm;
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/AbstractPolicy.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/AbstractPolicy.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/AbstractPolicy.java
index 0d5b57c..27fcb85 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/AbstractPolicy.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/AbstractPolicy.java
@@ -22,7 +22,7 @@ import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.validation.constraints.NotNull;
-import org.apache.syncope.core.persistence.api.entity.Policy;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
import org.apache.syncope.core.persistence.jpa.entity.AbstractGeneratedKeyEntity;
@Entity
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAPolicyUtils.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAPolicyUtils.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAPolicyUtils.java
new file mode 100644
index 0000000..d87325e
--- /dev/null
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAPolicyUtils.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.persistence.jpa.entity.policy;
+
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
+import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
+import org.apache.syncope.core.persistence.api.entity.policy.PolicyUtils;
+import org.apache.syncope.core.persistence.api.entity.policy.PullPolicy;
+import org.apache.syncope.core.persistence.api.entity.policy.PushPolicy;
+
+public class JPAPolicyUtils implements PolicyUtils {
+
+ private final PolicyType type;
+
+ protected JPAPolicyUtils(final PolicyType type) {
+ this.type = type;
+ }
+
+ @Override
+ public PolicyType getType() {
+ return type;
+ }
+
+ @Override
+ public Class<? extends Policy> policyClass() {
+ switch (type) {
+ case ACCOUNT:
+ return AccountPolicy.class;
+
+ case PASSWORD:
+ return PasswordPolicy.class;
+
+ case PULL:
+ return PullPolicy.class;
+
+ case PUSH:
+ default:
+ return PushPolicy.class;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAPolicyUtilsFactory.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAPolicyUtilsFactory.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAPolicyUtilsFactory.java
new file mode 100644
index 0000000..6ecd1d0
--- /dev/null
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/policy/JPAPolicyUtilsFactory.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.persistence.jpa.entity.policy;
+
+import org.apache.syncope.common.lib.policy.AccountPolicyTO;
+import org.apache.syncope.common.lib.policy.PasswordPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
+import org.apache.syncope.common.lib.policy.PullPolicyTO;
+import org.apache.syncope.common.lib.types.PolicyType;
+import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
+import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
+import org.apache.syncope.core.persistence.api.entity.policy.PolicyUtils;
+import org.apache.syncope.core.persistence.api.entity.policy.PolicyUtilsFactory;
+import org.springframework.stereotype.Component;
+import org.apache.syncope.core.persistence.api.entity.policy.PullPolicy;
+import org.apache.syncope.core.persistence.api.entity.policy.PushPolicy;
+
+@Component
+public class JPAPolicyUtilsFactory implements PolicyUtilsFactory {
+
+ @Override
+ public PolicyUtils getInstance(final PolicyType type) {
+ return new JPAPolicyUtils(type);
+ }
+
+ @Override
+ public PolicyUtils getInstance(final Policy policy) {
+ PolicyType type;
+ if (policy instanceof AccountPolicy) {
+ type = PolicyType.ACCOUNT;
+ } else if (policy instanceof PasswordPolicy) {
+ type = PolicyType.PASSWORD;
+ } else if (policy instanceof PullPolicy) {
+ type = PolicyType.PULL;
+ } else if (policy instanceof PushPolicy) {
+ type = PolicyType.PUSH;
+ } else {
+ throw new IllegalArgumentException("Invalid policy: " + policy);
+ }
+
+ return getInstance(type);
+ }
+
+ @Override
+ public PolicyUtils getInstance(final Class<? extends PolicyTO> policyClass) {
+ PolicyType type;
+ if (policyClass == AccountPolicyTO.class) {
+ type = PolicyType.ACCOUNT;
+ } else if (policyClass == PasswordPolicyTO.class) {
+ type = PolicyType.PASSWORD;
+ } else if (policyClass == PullPolicyTO.class) {
+ type = PolicyType.PULL;
+ } else {
+ throw new IllegalArgumentException("Invalid PolicyTO class: " + policyClass.getName());
+ }
+
+ return getInstance(type);
+ }
+
+ @Override
+ public PolicyUtils getInstance(final PolicyTO policyTO) {
+ return getInstance(policyTO.getClass());
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/EntityValidationListener.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/EntityValidationListener.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/EntityValidationListener.java
index 3b46f62..4fde449 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/EntityValidationListener.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/validation/entity/EntityValidationListener.java
@@ -31,9 +31,9 @@ import org.apache.syncope.core.persistence.api.entity.Any;
import org.apache.syncope.core.persistence.api.entity.DynMembership;
import org.apache.syncope.core.persistence.api.entity.Entity;
import org.apache.syncope.core.persistence.api.entity.GroupableRelatable;
-import org.apache.syncope.core.persistence.api.entity.Policy;
import org.apache.syncope.core.persistence.api.entity.ProvidedKeyEntity;
import org.apache.syncope.core.persistence.api.entity.Schema;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
import org.apache.syncope.core.persistence.api.entity.task.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PolicyTest.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PolicyTest.java b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PolicyTest.java
index 1086d3e..dc96683 100644
--- a/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PolicyTest.java
+++ b/core/persistence-jpa/src/test/java/org/apache/syncope/core/persistence/jpa/inner/PolicyTest.java
@@ -33,7 +33,7 @@ import org.apache.syncope.core.provisioning.api.serialization.POJOHelper;
import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
import org.apache.syncope.core.persistence.api.dao.PolicyDAO;
import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy;
-import org.apache.syncope.core.persistence.api.entity.Policy;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
import org.apache.syncope.core.persistence.jpa.AbstractTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/PolicyDataBinder.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/PolicyDataBinder.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/PolicyDataBinder.java
index 3ff922d..6fd25ef 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/PolicyDataBinder.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/PolicyDataBinder.java
@@ -19,7 +19,7 @@
package org.apache.syncope.core.provisioning.api.data;
import org.apache.syncope.common.lib.policy.PolicyTO;
-import org.apache.syncope.core.persistence.api.entity.Policy;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
public interface PolicyDataBinder {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java
index b5b074f..81e604a 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java
@@ -29,17 +29,17 @@ import org.apache.syncope.common.lib.policy.PasswordRuleConf;
import org.apache.syncope.common.lib.policy.PullPolicyTO;
import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
import org.apache.syncope.core.persistence.api.dao.RealmDAO;
-import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
import org.apache.syncope.core.persistence.api.entity.EntityFactory;
+import org.apache.syncope.core.persistence.api.entity.Realm;
import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy;
-import org.apache.syncope.core.persistence.api.entity.Policy;
-import org.apache.syncope.core.persistence.api.entity.Realm;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
+import org.apache.syncope.core.persistence.api.entity.policy.PullPolicy;
+import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
-import org.apache.syncope.core.persistence.api.entity.policy.PullPolicy;
@Component
public class PolicyDataBinderImpl implements PolicyDataBinder {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/RealmDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/RealmDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/RealmDataBinderImpl.java
index a07ef06..a92ae41 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/RealmDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/RealmDataBinderImpl.java
@@ -37,9 +37,9 @@ import org.apache.syncope.core.persistence.api.entity.AnyTemplateRealm;
import org.apache.syncope.core.persistence.api.entity.AnyType;
import org.apache.syncope.core.persistence.api.entity.policy.AccountPolicy;
import org.apache.syncope.core.persistence.api.entity.EntityFactory;
-import org.apache.syncope.core.persistence.api.entity.Policy;
import org.apache.syncope.core.persistence.api.entity.policy.PasswordPolicy;
import org.apache.syncope.core.persistence.api.entity.Realm;
+import org.apache.syncope.core.persistence.api.entity.policy.Policy;
import org.apache.syncope.core.persistence.api.entity.resource.ExternalResource;
import org.apache.syncope.core.provisioning.api.data.RealmDataBinder;
import org.slf4j.Logger;
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
index 2925fc7..c115ca6 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
@@ -36,8 +36,8 @@ public class PolicyServiceImpl extends AbstractServiceImpl implements PolicyServ
private PolicyLogic logic;
@Override
- public Response create(final PolicyTO policyTO) {
- PolicyTO policy = logic.create(policyTO);
+ public Response create(final PolicyType type, final PolicyTO policyTO) {
+ PolicyTO policy = logic.create(type, policyTO);
URI location = uriInfo.getAbsolutePathBuilder().path(policy.getKey()).build();
return Response.created(location).
header(RESTHeaders.RESOURCE_KEY, policy.getKey()).
@@ -45,8 +45,8 @@ public class PolicyServiceImpl extends AbstractServiceImpl implements PolicyServ
}
@Override
- public Response delete(final String key) {
- logic.delete(key);
+ public Response delete(final PolicyType type, final String key) {
+ logic.delete(type, key);
return Response.noContent().build();
}
@@ -56,13 +56,13 @@ public class PolicyServiceImpl extends AbstractServiceImpl implements PolicyServ
}
@Override
- public <T extends PolicyTO> T read(final String key) {
- return logic.read(key);
+ public <T extends PolicyTO> T read(final PolicyType type, final String key) {
+ return logic.read(type, key);
}
@Override
- public Response update(final PolicyTO policyTO) {
- logic.update(policyTO);
+ public Response update(final PolicyType type, final PolicyTO policyTO) {
+ logic.update(type, policyTO);
return Response.noContent().build();
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
index 37067a3..cd24751 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
@@ -28,6 +28,7 @@ import org.apache.syncope.common.lib.to.BulkAction;
import org.apache.syncope.common.lib.to.BulkActionResult;
import org.apache.syncope.common.lib.to.PagedResult;
import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.common.rest.api.RESTHeaders;
import org.apache.syncope.common.rest.api.beans.TaskQuery;
import org.apache.syncope.common.rest.api.service.TaskService;
@@ -48,10 +49,10 @@ public class TaskServiceImpl extends AbstractExecutableService implements TaskSe
}
@Override
- public Response create(final SchedTaskTO taskTO) {
+ public Response create(final TaskType type, final SchedTaskTO taskTO) {
SchedTaskTO createdTask;
if (taskTO != null) {
- createdTask = logic.createSchedTask(taskTO);
+ createdTask = logic.createSchedTask(type, taskTO);
} else {
throw new BadRequestException();
}
@@ -63,8 +64,8 @@ public class TaskServiceImpl extends AbstractExecutableService implements TaskSe
}
@Override
- public Response delete(final String key) {
- logic.delete(key);
+ public Response delete(final TaskType type, final String key) {
+ logic.delete(type, key);
return Response.noContent().build();
}
@@ -85,18 +86,14 @@ public class TaskServiceImpl extends AbstractExecutableService implements TaskSe
}
@Override
- public <T extends TaskTO> T read(final String key, final boolean details) {
- return logic.read(key, details);
+ public <T extends TaskTO> T read(final TaskType type, final String key, final boolean details) {
+ return logic.read(type, key, details);
}
@Override
- public Response update(final TaskTO taskTO) {
- if (taskTO instanceof SchedTaskTO) {
- logic.updateSchedTask((SchedTaskTO) taskTO);
- return Response.noContent().build();
- } else {
- throw new BadRequestException();
- }
+ public Response update(final TaskType type, final SchedTaskTO taskTO) {
+ logic.updateSchedTask(type, taskTO);
+ return Response.noContent().build();
}
@Override
@@ -107,7 +104,7 @@ public class TaskServiceImpl extends AbstractExecutableService implements TaskSe
case DELETE:
for (String key : bulkAction.getTargets()) {
try {
- result.getResults().put(logic.delete(key).getKey(), BulkActionResult.Status.SUCCESS);
+ result.getResults().put(logic.delete(null, key).getKey(), BulkActionResult.Status.SUCCESS);
} catch (Exception e) {
LOG.error("Error performing delete for task {}", key, e);
result.getResults().put(key, BulkActionResult.Status.FAILURE);
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/ext/swagger-ui/pom.xml
----------------------------------------------------------------------
diff --git a/ext/swagger-ui/pom.xml b/ext/swagger-ui/pom.xml
index 90524f5..cf9b7a0 100644
--- a/ext/swagger-ui/pom.xml
+++ b/ext/swagger-ui/pom.xml
@@ -119,29 +119,7 @@ under the License.
</execution>
</executions>
</plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <inherited>true</inherited>
- <executions>
- <execution>
- <id>addMatrixParamSupport</id>
- <phase>process-resources</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <target>
- <replace file="${project.build.directory}/swagger-ui/META-INF/resources/webjars/swagger-ui/${swagger-ui.version}/swagger-ui-bundle.js"
- token="function i(e){var t=e.req,n=e.value,r=e.parameter,i=r.name,o=r.style,a=r.explode,s=(0,h.default)({key:r.name,value:n,style:o||"simple",explode:a||!1,escape:!1});t.url=t.url.replace("{"+i+"}",s)}"
- value="function i(e){var t=e.req,r=e.value,n=e.parameter,a=n.name,u=n.style,o=n.explode,i=(0,h.default)({key:n.name,value:r,style:u||"simple",explode:o||!1,escape:"matrix"===u});"matrix"!==u||!n.explode&&void 0!==n.explode?t.url=t.url.replace("{"+a+"}",i):t.url=t.url.concat(i)}"/>
- </target>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
+
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
index 6f552da..b5aa249 100644
--- a/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
+++ b/fit/core-reference/src/main/java/org/apache/syncope/fit/core/reference/ITImplementationLookup.java
@@ -34,6 +34,7 @@ import org.apache.syncope.common.lib.report.ReportletConf;
import org.apache.syncope.common.lib.report.StaticReportletConf;
import org.apache.syncope.common.lib.report.UserReportletConf;
import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.core.logic.TaskLogic;
import org.apache.syncope.core.provisioning.java.job.report.AuditReportlet;
import org.apache.syncope.core.provisioning.java.job.report.GroupReportlet;
@@ -219,7 +220,7 @@ public class ITImplementationLookup implements ImplementationLookup {
task.setJobDelegateClassName(
"org.apache.syncope.core.provisioning.java.job.ElasticsearchReindex");
task.setName("Elasticsearch Reindex");
- task = taskLogic.createSchedTask(task);
+ task = taskLogic.createSchedTask(TaskType.SCHEDULED, task);
taskLogic.execute(task.getKey(), null, false);
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
index c0d600d..1a19ffd 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
@@ -62,6 +62,7 @@ import org.apache.syncope.common.lib.to.RoleTO;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.PatchOperation;
+import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.syncope.common.lib.types.TraceLevel;
import org.apache.syncope.common.rest.api.RESTHeaders;
@@ -486,8 +487,8 @@ public abstract class AbstractITCase {
}
@SuppressWarnings("unchecked")
- protected <T extends PolicyTO> T createPolicy(final T policy) {
- Response response = policyService.create(policy);
+ protected <T extends PolicyTO> T createPolicy(final PolicyType type, final T policy) {
+ Response response = policyService.create(type, policy);
if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
if (ex != null) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
index a18982d..27c2aaf 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/cli/CLIITCase.java
@@ -40,7 +40,6 @@ import org.apache.syncope.client.cli.commands.entitlement.EntitlementCommand;
import org.apache.syncope.client.cli.commands.group.GroupCommand;
import org.apache.syncope.client.cli.commands.install.InstallCommand;
import org.apache.syncope.client.cli.commands.logger.LoggerCommand;
-import org.apache.syncope.client.cli.commands.policy.PolicyCommand;
import org.apache.syncope.client.cli.commands.report.ReportCommand;
import org.apache.syncope.client.cli.commands.role.RoleCommand;
import org.apache.syncope.client.cli.commands.user.UserCommand;
@@ -287,26 +286,6 @@ public class CLIITCase extends AbstractITCase {
}
@Test
- public void policyError() {
- Process process = null;
- try {
- PROCESS_BUILDER.command(getCommand(
- new PolicyCommand().getClass().getAnnotation(Command.class).name(),
- PolicyCommand.PolicyOptions.READ.getOptionName(),
- "wrong"));
- process = PROCESS_BUILDER.start();
- final String result = IOUtils.toString(process.getInputStream(), StandardCharsets.UTF_8);
- assertTrue(result.contains("- Policy wrong doesn't exist"));
- } catch (IOException e) {
- fail(e.getMessage());
- } finally {
- if (process != null) {
- process.destroy();
- }
- }
- }
-
- @Test
public void lastStatements() {
Process process = null;
try {
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
index 4247eda..c2ec86b 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
@@ -58,6 +58,8 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
private final TaskService taskService;
+ private final TaskType type;
+
private final String taskKey;
private final int maxWaitSeconds;
@@ -65,9 +67,11 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
private final boolean dryRun;
public ThreadExec(
- final TaskService taskService, final String taskKey, final int maxWaitSeconds, final boolean dryRun) {
+ final TaskService taskService, final TaskType type, final String taskKey,
+ final int maxWaitSeconds, final boolean dryRun) {
this.taskService = taskService;
+ this.type = type;
this.taskKey = taskKey;
this.maxWaitSeconds = maxWaitSeconds;
this.dryRun = dryRun;
@@ -75,7 +79,7 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
@Override
public ExecTO call() throws Exception {
- return execProvisioningTask(taskService, taskKey, maxWaitSeconds, dryRun);
+ return execProvisioningTask(taskService, type, taskKey, maxWaitSeconds, dryRun);
}
}
@@ -123,10 +127,11 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
}
}
- protected static ExecTO execTask(final TaskService taskService, final String taskKey, final String initialStatus,
- final int maxWaitSeconds, final boolean dryRun) {
+ protected static ExecTO execTask(
+ final TaskService taskService, final TaskType type, final String taskKey,
+ final String initialStatus, final int maxWaitSeconds, final boolean dryRun) {
- TaskTO taskTO = taskService.read(taskKey, true);
+ TaskTO taskTO = taskService.read(type, taskKey, true);
assertNotNull(taskTO);
assertNotNull(taskTO.getExecutions());
@@ -145,7 +150,7 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
} catch (InterruptedException e) {
}
- taskTO = taskService.read(taskTO.getKey(), true);
+ taskTO = taskService.read(type, taskTO.getKey(), true);
assertNotNull(taskTO);
assertNotNull(taskTO.getExecutions());
@@ -159,25 +164,27 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
}
public static ExecTO execProvisioningTask(
- final TaskService taskService, final String taskKey, final int maxWaitSeconds, final boolean dryRun) {
+ final TaskService taskService, final TaskType type, final String taskKey,
+ final int maxWaitSeconds, final boolean dryRun) {
- return execTask(taskService, taskKey, "JOB_FIRED", maxWaitSeconds, dryRun);
+ return execTask(taskService, type, taskKey, "JOB_FIRED", maxWaitSeconds, dryRun);
}
protected static ExecTO execNotificationTask(
final TaskService taskService, final String taskKey, final int maxWaitSeconds) {
- return execTask(taskService, taskKey, NotificationJob.Status.SENT.name(), maxWaitSeconds, false);
+ return execTask(taskService, TaskType.NOTIFICATION, taskKey,
+ NotificationJob.Status.SENT.name(), maxWaitSeconds, false);
}
- protected void execProvisioningTasks(final TaskService taskService,
- final Set<String> taskKeys, final int maxWaitSeconds, final boolean dryRun) throws Exception {
+ protected void execProvisioningTasks(final TaskService taskService, final TaskType type, final Set<String> taskKeys,
+ final int maxWaitSeconds, final boolean dryRun) throws Exception {
ExecutorService service = Executors.newFixedThreadPool(taskKeys.size());
List<Future<ExecTO>> futures = new ArrayList<>();
for (String key : taskKeys) {
- futures.add(service.submit(new ThreadExec(taskService, key, maxWaitSeconds, dryRun)));
+ futures.add(service.submit(new ThreadExec(taskService, type, key, maxWaitSeconds, dryRun)));
// avoid flooding the test server
try {
Thread.sleep(2000);
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
index 1dd55d9..04b141e 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/GroupITCase.java
@@ -89,6 +89,7 @@ import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
import org.apache.syncope.common.lib.types.ResourceAssociationAction;
import org.apache.syncope.common.lib.types.ResourceDeassociationAction;
import org.apache.syncope.common.lib.types.SchemaType;
+import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.common.rest.api.beans.AnyQuery;
import org.apache.syncope.common.rest.api.service.GroupService;
import org.apache.syncope.common.rest.api.service.SyncopeService;
@@ -976,7 +977,7 @@ public class GroupITCase extends AbstractITCase {
do {
Thread.sleep(1000);
- taskTO = taskService.read(exec.getRefKey(), true);
+ taskTO = taskService.read(TaskType.SCHEDULED, exec.getRefKey(), true);
assertNotNull(taskTO);
assertNotNull(taskTO.getExecutions());
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/IdentityRecertificationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/IdentityRecertificationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/IdentityRecertificationITCase.java
index 3a9ee36..1a036a6 100755
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/IdentityRecertificationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/IdentityRecertificationITCase.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
import java.util.List;
import org.apache.syncope.common.lib.to.WorkflowFormPropertyTO;
import org.apache.syncope.common.lib.to.WorkflowFormTO;
+import org.apache.syncope.common.lib.types.TaskType;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
@@ -33,7 +34,7 @@ public class IdentityRecertificationITCase extends AbstractTaskITCase {
@Test
public void recertification() {
- execTask(taskService, "e95555d2-1b09-42c8-b25b-f4c4ec598989", "JOB_FIRED", 50, false);
+ execTask(taskService, TaskType.SCHEDULED, "e95555d2-1b09-42c8-b25b-f4c4ec598989", "JOB_FIRED", 50, false);
List<WorkflowFormTO> forms = userWorkflowService.getForms();
assertFalse(forms.isEmpty());
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MembershipITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MembershipITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MembershipITCase.java
index 6a4abd1..5a67601 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MembershipITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MembershipITCase.java
@@ -53,6 +53,7 @@ import org.apache.syncope.common.lib.types.MappingPurpose;
import org.apache.syncope.common.lib.types.PatchOperation;
import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
import org.apache.syncope.common.lib.types.ResourceDeassociationAction;
+import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.common.rest.api.beans.AnyQuery;
import org.apache.syncope.common.rest.api.service.TaskService;
import org.apache.syncope.fit.AbstractITCase;
@@ -292,15 +293,16 @@ public class MembershipITCase extends AbstractITCase {
userService.delete(user.getKey());
// 4. create pull task and execute
- newTask = taskService.read("7c2242f4-14af-4ab5-af31-cdae23783655", true);
+ newTask = taskService.read(TaskType.PULL, "7c2242f4-14af-4ab5-af31-cdae23783655", true);
newTask.setResource(newResource.getKey());
newTask.setDestinationRealm("/even/two");
- Response response = taskService.create(newTask);
+ Response response = taskService.create(TaskType.PULL, newTask);
newTask = getObject(response.getLocation(), TaskService.class, PullTaskTO.class);
assertNotNull(newTask);
- ExecTO execution = AbstractTaskITCase.execProvisioningTask(taskService, newTask.getKey(), 50, false);
+ ExecTO execution = AbstractTaskITCase.execProvisioningTask(
+ taskService, TaskType.PULL, newTask.getKey(), 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
// 5. verify that pulled user has
@@ -317,7 +319,7 @@ public class MembershipITCase extends AbstractITCase {
fail(e.getMessage());
} finally {
if (newTask != null && !"83f7e85d-9774-43fe-adba-ccd856312994".equals(newTask.getKey())) {
- taskService.delete(newTask.getKey());
+ taskService.delete(TaskType.PULL, newTask.getKey());
}
resourceService.delete(newResource.getKey());
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java
index a7e66be..c5e5cb9 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java
@@ -416,7 +416,7 @@ public class MigrationITCase extends AbstractTaskITCase {
user.getPlainAttrs().add(new AttrTO.Builder().schema("fullname").value("username").build());
task.getTemplates().put(AnyTypeKind.USER.name(), user);
- Response response = taskService.create(task);
+ Response response = taskService.create(TaskType.PULL, task);
task = getObject(response.getLocation(), TaskService.class, PullTaskTO.class);
return task.getKey();
@@ -430,7 +430,7 @@ public class MigrationITCase extends AbstractTaskITCase {
new TaskQuery.Builder(TaskType.PULL).resource(RESOURCE_KEY).build()).getResult()) {
if (PULL_TASK_NAME.equals(PullTaskTO.class.cast(task).getName())) {
- taskService.delete(task.getKey());
+ taskService.delete(TaskType.PULL, task.getKey());
}
}
} catch (Exception e) {
@@ -479,7 +479,7 @@ public class MigrationITCase extends AbstractTaskITCase {
String pullTaskKey = setupPullTask();
// 3. execute pull task
- execProvisioningTask(taskService, pullTaskKey, 50, false);
+ execProvisioningTask(taskService, TaskType.PULL, pullTaskKey, 50, false);
// 4. verify
UserTO user = null;
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
index 5002fdf..4ad582a 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MultitenancyITCase.java
@@ -49,6 +49,7 @@ import org.apache.syncope.common.lib.types.MappingPurpose;
import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.syncope.common.lib.types.PullMode;
+import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.common.rest.api.beans.AnyQuery;
import org.apache.syncope.common.rest.api.beans.SchemaQuery;
import org.apache.syncope.common.rest.api.service.ConnectorService;
@@ -193,15 +194,15 @@ public class MultitenancyITCase extends AbstractITCase {
task.setPullMode(PullMode.FULL_RECONCILIATION);
task.setPerformCreate(true);
- response = adminClient.getService(TaskService.class).create(task);
+ response = adminClient.getService(TaskService.class).create(TaskType.PULL, task);
assertEquals(Response.Status.CREATED.getStatusCode(), response.getStatus());
- task = adminClient.getService(TaskService.class).read(
+ task = adminClient.getService(TaskService.class).read(TaskType.PULL,
StringUtils.substringAfterLast(response.getLocation().toASCIIString(), "/"), true);
assertNotNull(resource);
// pull
ExecTO execution = AbstractTaskITCase.execProvisioningTask(
- adminClient.getService(TaskService.class), task.getKey(), 50, false);
+ adminClient.getService(TaskService.class), TaskType.PULL, task.getKey(), 50, false);
// verify execution status
String status = execution.getStatus();
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java
index a4ca1f4..bab038e 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/NotificationTaskITCase.java
@@ -60,7 +60,7 @@ public class NotificationTaskITCase extends AbstractNotificationTaskITCase {
assertTrue(verifyMail(sender, subject, created.getRight()));
// verify message body
- taskTO = taskService.read(taskTO.getKey(), true);
+ taskTO = taskService.read(TaskType.NOTIFICATION, taskTO.getKey(), true);
assertNotNull(taskTO);
assertTrue(taskTO.isExecuted());
assertNotNull(taskTO.getTextBody());
@@ -106,9 +106,11 @@ public class NotificationTaskITCase extends AbstractNotificationTaskITCase {
int preExecs = taskTO.getExecutions().size();
// 4. verify notification could not be delivered
- execTask(taskService, taskTO.getKey(), NotificationJob.Status.NOT_SENT.name(), 5, false);
+ execTask(
+ taskService, TaskType.NOTIFICATION, taskTO.getKey(), NotificationJob.Status.NOT_SENT.name(), 5,
+ false);
- taskTO = taskService.read(taskTO.getKey(), true);
+ taskTO = taskService.read(TaskType.NOTIFICATION, taskTO.getKey(), true);
assertNotNull(taskTO);
assertFalse(taskTO.isExecuted());
assertTrue(preExecs <= taskTO.getExecutions().size());
@@ -135,11 +137,11 @@ public class NotificationTaskITCase extends AbstractNotificationTaskITCase {
// generate an execution in order to verify the deletion of a notification task with one or more executions
execNotificationTask(taskService, taskTO.getKey(), 50);
- taskTO = taskService.read(taskTO.getKey(), true);
+ taskTO = taskService.read(TaskType.NOTIFICATION, taskTO.getKey(), true);
assertTrue(taskTO.isExecuted());
assertFalse(taskTO.getExecutions().isEmpty());
- taskService.delete(taskTO.getKey());
+ taskService.delete(TaskType.NOTIFICATION, taskTO.getKey());
}
@Test
@@ -159,7 +161,7 @@ public class NotificationTaskITCase extends AbstractNotificationTaskITCase {
execNotificationTask(taskService, taskTO.getKey(), 50);
// 4. verify
- taskTO = taskService.read(taskTO.getKey(), true);
+ taskTO = taskService.read(TaskType.NOTIFICATION, taskTO.getKey(), true);
assertNotNull(taskTO);
assertTrue(taskTO.isExecuted());
assertEquals(1, taskTO.getExecutions().size());
@@ -189,7 +191,7 @@ public class NotificationTaskITCase extends AbstractNotificationTaskITCase {
assertTrue(verifyMail(sender, subject, created.getRight()));
// verify that last exec status was updated
- taskTO = taskService.read(taskTO.getKey(), true);
+ taskTO = taskService.read(TaskType.NOTIFICATION, taskTO.getKey(), true);
assertNotNull(taskTO);
assertTrue(taskTO.isExecuted());
assertTrue(taskTO.getExecutions().isEmpty());
@@ -212,7 +214,7 @@ public class NotificationTaskITCase extends AbstractNotificationTaskITCase {
assertTrue(verifyMail(sender, subject, created.getRight()));
// verify task
- taskTO = taskService.read(taskTO.getKey(), true);
+ taskTO = taskService.read(TaskType.NOTIFICATION, taskTO.getKey(), true);
assertTrue(taskTO.isExecuted());
assertNotNull(taskTO);
assertTrue(taskTO.getRecipients().contains("syncope445@syncope.apache.org"));
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
index 7b8d6d9..5ddbbb9 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PolicyITCase.java
@@ -66,7 +66,7 @@ public class PolicyITCase extends AbstractITCase {
@Test
public void getAccountPolicy() {
- AccountPolicyTO policyTO = policyService.read("06e2ed52-6966-44aa-a177-a0ca7434201f");
+ AccountPolicyTO policyTO = policyService.read(PolicyType.ACCOUNT, "06e2ed52-6966-44aa-a177-a0ca7434201f");
assertNotNull(policyTO);
assertTrue(policyTO.getUsedByResources().isEmpty());
@@ -75,7 +75,7 @@ public class PolicyITCase extends AbstractITCase {
@Test
public void getPasswordPolicy() {
- PasswordPolicyTO policyTO = policyService.read("986d1236-3ac5-4a19-810c-5ab21d79cba1");
+ PasswordPolicyTO policyTO = policyService.read(PolicyType.PASSWORD, "986d1236-3ac5-4a19-810c-5ab21d79cba1");
assertNotNull(policyTO);
assertTrue(policyTO.getUsedByResources().contains(RESOURCE_NAME_NOPROPAGATION));
@@ -84,7 +84,7 @@ public class PolicyITCase extends AbstractITCase {
@Test
public void getPullPolicy() {
- PullPolicyTO policyTO = policyService.read("66691e96-285f-4464-bc19-e68384ea4c85");
+ PullPolicyTO policyTO = policyService.read(PolicyType.PULL, "66691e96-285f-4464-bc19-e68384ea4c85");
assertNotNull(policyTO);
assertTrue(policyTO.getUsedByRealms().isEmpty());
@@ -96,7 +96,7 @@ public class PolicyITCase extends AbstractITCase {
policy.setSpecification(new PullPolicySpec());
try {
- createPolicy(policy);
+ createPolicy(PolicyType.PULL, policy);
fail();
} catch (SyncopeClientException e) {
assertEquals(ClientExceptionType.InvalidPolicy, e.getType());
@@ -107,7 +107,7 @@ public class PolicyITCase extends AbstractITCase {
public void create() {
PullPolicyTO policy = buildPullPolicyTO();
- PullPolicyTO policyTO = createPolicy(policy);
+ PullPolicyTO policyTO = createPolicy(PolicyType.PULL, policy);
assertNotNull(policyTO);
assertEquals(TestPullRule.class.getName(),
@@ -116,21 +116,21 @@ public class PolicyITCase extends AbstractITCase {
@Test
public void update() {
- PasswordPolicyTO globalPolicy = policyService.read("ce93fcda-dc3a-4369-a7b0-a6108c261c85");
+ PasswordPolicyTO globalPolicy = policyService.read(PolicyType.PASSWORD, "ce93fcda-dc3a-4369-a7b0-a6108c261c85");
PasswordPolicyTO policy = SerializationUtils.clone(globalPolicy);
policy.setDescription("A simple password policy");
// create a new password policy using the former as a template
- policy = createPolicy(policy);
+ policy = createPolicy(PolicyType.PASSWORD, policy);
assertNotNull(policy);
assertNotEquals("ce93fcda-dc3a-4369-a7b0-a6108c261c85", policy.getKey());
((DefaultPasswordRuleConf) policy.getRuleConfs().get(0)).setMaxLength(22);
// update new password policy
- policyService.update(policy);
- policy = policyService.read(policy.getKey());
+ policyService.update(PolicyType.PASSWORD, policy);
+ policy = policyService.read(PolicyType.PASSWORD, policy.getKey());
assertNotNull(policy);
assertEquals(22, ((DefaultPasswordRuleConf) policy.getRuleConfs().get(0)).getMaxLength());
@@ -141,13 +141,13 @@ public class PolicyITCase extends AbstractITCase {
public void delete() {
PullPolicyTO policy = buildPullPolicyTO();
- PullPolicyTO policyTO = createPolicy(policy);
+ PullPolicyTO policyTO = createPolicy(PolicyType.PULL, policy);
assertNotNull(policyTO);
- policyService.delete(policyTO.getKey());
+ policyService.delete(PolicyType.PULL, policyTO.getKey());
try {
- policyService.read(policyTO.getKey());
+ policyService.read(PolicyType.PULL, policyTO.getKey());
fail();
} catch (SyncopeClientException e) {
assertNotNull(e);
@@ -169,7 +169,7 @@ public class PolicyITCase extends AbstractITCase {
ruleConf.setMaxLength(8);
policy.getRuleConfs().add(ruleConf);
- policy = createPolicy(policy);
+ policy = createPolicy(PolicyType.ACCOUNT, policy);
assertNotNull(policy);
}
@@ -184,7 +184,7 @@ public class PolicyITCase extends AbstractITCase {
ruleConf.setMaxLength(8);
policy.getRuleConfs().add(ruleConf);
- policy = createPolicy(policy);
+ policy = createPolicy(PolicyType.ACCOUNT, policy);
assertNotNull(policy);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
index d0daa6a..4134b6f 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
@@ -77,7 +77,7 @@ public class PropagationTaskITCase extends AbstractTaskITCase {
@Test
public void read() {
- PropagationTaskTO taskTO = taskService.read("316285cc-ae52-4ea2-a33b-7355e189ac3f", true);
+ PropagationTaskTO taskTO = taskService.read(TaskType.PROPAGATION, "316285cc-ae52-4ea2-a33b-7355e189ac3f", true);
assertNotNull(taskTO);
assertNotNull(taskTO.getExecutions());
assertTrue(taskTO.getExecutions().isEmpty());
@@ -180,12 +180,12 @@ public class PropagationTaskITCase extends AbstractTaskITCase {
}
// check read
- PropagationTaskTO task = taskService.read("1e697572-b896-484c-ae7f-0c8f63fcbc6c", false);
+ PropagationTaskTO task = taskService.read(TaskType.PROPAGATION, "1e697572-b896-484c-ae7f-0c8f63fcbc6c", false);
assertNotNull(task);
assertEquals("1e697572-b896-484c-ae7f-0c8f63fcbc6c", task.getKey());
assertTrue(task.getExecutions().isEmpty());
- task = taskService.read("1e697572-b896-484c-ae7f-0c8f63fcbc6c", true);
+ task = taskService.read(TaskType.PROPAGATION, "1e697572-b896-484c-ae7f-0c8f63fcbc6c", true);
assertNotNull(task);
assertEquals("1e697572-b896-484c-ae7f-0c8f63fcbc6c", task.getKey());
assertFalse(task.getExecutions().isEmpty());
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
index 82e71a0..17d00e9 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
@@ -71,6 +71,7 @@ import org.apache.syncope.common.lib.types.CipherAlgorithm;
import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.apache.syncope.common.lib.types.ConnConfProperty;
import org.apache.syncope.common.lib.types.ConnectorCapability;
+import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
import org.apache.syncope.common.lib.types.ResourceDeassociationAction;
import org.apache.syncope.common.lib.types.PullMode;
@@ -105,9 +106,9 @@ public class PullTaskITCase extends AbstractTaskITCase {
@BeforeClass
public static void testPullActionsSetup() {
- PullTaskTO pullTask = taskService.read(PULL_TASK_KEY, true);
+ PullTaskTO pullTask = taskService.read(TaskType.PULL, PULL_TASK_KEY, true);
pullTask.getActionsClassNames().add(TestPullActions.class.getName());
- taskService.update(pullTask);
+ taskService.update(TaskType.PULL, pullTask);
}
@Test
@@ -147,11 +148,11 @@ public class PullTaskITCase extends AbstractTaskITCase {
groupTemplate.getResources().add(RESOURCE_NAME_LDAP);
task.getTemplates().put(AnyTypeKind.GROUP.name(), groupTemplate);
- Response response = taskService.create(task);
+ Response response = taskService.create(TaskType.PULL, task);
PullTaskTO actual = getObject(response.getLocation(), TaskService.class, PullTaskTO.class);
assertNotNull(actual);
- task = taskService.read(actual.getKey(), true);
+ task = taskService.read(TaskType.PULL, actual.getKey(), true);
assertNotNull(task);
assertEquals(actual.getKey(), task.getKey());
assertEquals(actual.getJobDelegateClassName(), task.getJobDelegateClassName());
@@ -216,7 +217,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
page(1).size(1).build()).getTotalCount();
assertNotNull(usersPre);
- ExecTO exec = execProvisioningTask(taskService, PULL_TASK_KEY, 50, false);
+ ExecTO exec = execProvisioningTask(taskService, TaskType.PULL, PULL_TASK_KEY, 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(exec.getStatus()));
LOG.debug("Execution of task {}:\n{}", PULL_TASK_KEY, exec);
@@ -289,7 +290,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
Set<String> otherPullTaskKeys = new HashSet<>();
otherPullTaskKeys.add("feae4e57-15ca-40d9-b973-8b9015efca49");
otherPullTaskKeys.add("55d5e74b-497e-4bc0-9156-73abef4b9adc");
- execProvisioningTasks(taskService, otherPullTaskKeys, 50, false);
+ execProvisioningTasks(taskService, TaskType.PULL, otherPullTaskKeys, 50, false);
// Matching --> UNLINK
assertFalse(userService.read("test9").getResources().contains(RESOURCE_NAME_CSV));
@@ -301,7 +302,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
@Test
public void dryRun() {
- ExecTO execution = execProvisioningTask(taskService, PULL_TASK_KEY, 50, true);
+ ExecTO execution = execProvisioningTask(taskService, TaskType.PULL, PULL_TASK_KEY, 50, true);
assertEquals(
"Execution of " + execution.getRefDesc() + " failed with message " + execution.getMessage(),
"SUCCESS", execution.getStatus());
@@ -313,7 +314,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
JdbcTemplate jdbcTemplate = new JdbcTemplate(testDataSource);
try {
ExecTO execution = execProvisioningTask(
- taskService, "83f7e85d-9774-43fe-adba-ccd856312994", 50, false);
+ taskService, TaskType.PULL, "83f7e85d-9774-43fe-adba-ccd856312994", 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
userTO = userService.read("testuser1");
@@ -326,7 +327,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
// re-execute the same PullTask: now user must be active
execution = execProvisioningTask(
- taskService, "83f7e85d-9774-43fe-adba-ccd856312994", 50, false);
+ taskService, TaskType.PULL, "83f7e85d-9774-43fe-adba-ccd856312994", 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
userTO = userService.read("testuser1");
@@ -346,7 +347,8 @@ public class PullTaskITCase extends AbstractTaskITCase {
ldapCleanup();
// 0. pull
- ExecTO execution = execProvisioningTask(taskService, "1e419ca4-ea81-4493-a14f-28b90113686d", 50, false);
+ ExecTO execution = execProvisioningTask(
+ taskService, TaskType.PULL, "1e419ca4-ea81-4493-a14f-28b90113686d", 50, false);
// 1. verify execution status
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
@@ -359,7 +361,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
assertNotNull(matchingGroups);
assertEquals(1, matchingGroups.getResult().size());
// SYNCOPE-898
- PullTaskTO task = taskService.read("1e419ca4-ea81-4493-a14f-28b90113686d", false);
+ PullTaskTO task = taskService.read(TaskType.PULL, "1e419ca4-ea81-4493-a14f-28b90113686d", false);
assertEquals("/", task.getDestinationRealm());
assertEquals("/", matchingGroups.getResult().get(0).getRealm());
@@ -390,7 +392,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
assertNull(groupTO.getGroupOwner());
// SYNCOPE-317
- execProvisioningTask(taskService, "1e419ca4-ea81-4493-a14f-28b90113686d", 50, false);
+ execProvisioningTask(taskService, TaskType.PULL, "1e419ca4-ea81-4493-a14f-28b90113686d", 50, false);
// 4. verify that LDAP group membership is propagated as Syncope membership
int i = 0;
@@ -475,12 +477,12 @@ public class PullTaskITCase extends AbstractTaskITCase {
}
// ensure that the pull task does not have the DELETE capability (SYNCOPE-923)
- PullTaskTO pullTask = taskService.read("30cfd653-257b-495f-8665-281281dbcb3d", false);
+ PullTaskTO pullTask = taskService.read(TaskType.PULL, "30cfd653-257b-495f-8665-281281dbcb3d", false);
assertNotNull(pullTask);
assertFalse(pullTask.isPerformDelete());
// 4. pull
- execProvisioningTask(taskService, pullTask.getKey(), 50, false);
+ execProvisioningTask(taskService, TaskType.PULL, pullTask.getKey(), 50, false);
// 5. verify that printer was re-created in Syncope (implies that location does not start with given prefix,
// hence PrefixItemTransformer was applied during pull)
@@ -513,10 +515,10 @@ public class PullTaskITCase extends AbstractTaskITCase {
+ "'" + user2OnTestPull + "', 'user2', 'Rossi', false, 'mail2@apache.org', NULL)");
// 2. create new pull task for test-db, with reconciliation filter (surname 'Rossi')
- task = taskService.read("7c2242f4-14af-4ab5-af31-cdae23783655", true);
+ task = taskService.read(TaskType.PULL, "7c2242f4-14af-4ab5-af31-cdae23783655", true);
task.setPullMode(PullMode.FILTERED_RECONCILIATION);
task.setReconciliationFilterBuilderClassName(TestReconciliationFilterBuilder.class.getName());
- Response response = taskService.create(task);
+ Response response = taskService.create(TaskType.PULL, task);
task = getObject(response.getLocation(), TaskService.class, PullTaskTO.class);
assertNotNull(task);
assertEquals(
@@ -524,7 +526,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
task.getReconciliationFilterBuilderClassName());
// 3. exec task
- ExecTO execution = execProvisioningTask(taskService, task.getKey(), 50, false);
+ ExecTO execution = execProvisioningTask(taskService, TaskType.PULL, task.getKey(), 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
// 4. verify that only enabled user was pulled
@@ -541,7 +543,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
jdbcTemplate.execute("DELETE FROM testpull WHERE id = '" + user1OnTestPull + "'");
jdbcTemplate.execute("DELETE FROM testpull WHERE id = '" + user2OnTestPull + "'");
if (task != null && !"7c2242f4-14af-4ab5-af31-cdae23783655".equals(task.getKey())) {
- taskService.delete(task.getKey());
+ taskService.delete(TaskType.PULL, task.getKey());
}
if (userTO != null) {
userService.delete(userTO.getKey());
@@ -591,7 +593,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
pullTask.setPerformUpdate(true);
pullTask.setPerformDelete(true);
- response = taskService.create(pullTask);
+ response = taskService.create(TaskType.PULL, pullTask);
if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
throw (RuntimeException) clientFactory.getExceptionMapper().fromResponse(response);
}
@@ -606,7 +608,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
+ "(1041, 'syncTokenWithErrors2', 'Surname2', "
+ "false, 'syncTokenWithErrors1@syncope.apache.org', '2015-05-23 13:53:24.293')");
- ExecTO exec = execProvisioningTask(taskService, pullTask.getKey(), 50, false);
+ ExecTO exec = execProvisioningTask(taskService, TaskType.PULL, pullTask.getKey(), 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(exec.getStatus()));
resForTest = resourceService.read(resForTest.getKey());
@@ -616,7 +618,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
+ "SET email='syncTokenWithErrors2@syncope.apache.org', lastModification='2016-05-23 13:53:24.293' "
+ "WHERE ID=1041");
- exec = execProvisioningTask(taskService, pullTask.getKey(), 50, false);
+ exec = execProvisioningTask(taskService, TaskType.PULL, pullTask.getKey(), 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(exec.getStatus()));
resForTest = resourceService.read(resForTest.getKey());
@@ -675,19 +677,19 @@ public class PullTaskITCase extends AbstractTaskITCase {
//-----------------------------
// Update pull task
- PullTaskTO task = taskService.read("81d88f73-d474-4450-9031-605daa4e313f", true);
+ PullTaskTO task = taskService.read(TaskType.PULL, "81d88f73-d474-4450-9031-605daa4e313f", true);
assertNotNull(task);
task.getTemplates().put(AnyTypeKind.USER.name(), template);
- taskService.update(task);
- PullTaskTO actual = taskService.read(task.getKey(), true);
+ taskService.update(TaskType.PULL, task);
+ PullTaskTO actual = taskService.read(TaskType.PULL, task.getKey(), true);
assertNotNull(actual);
assertEquals(task.getKey(), actual.getKey());
assertFalse(actual.getTemplates().get(AnyTypeKind.USER.name()).getResources().isEmpty());
assertFalse(((UserTO) actual.getTemplates().get(AnyTypeKind.USER.name())).getMemberships().isEmpty());
- ExecTO execution = execProvisioningTask(taskService, actual.getKey(), 50, false);
+ ExecTO execution = execProvisioningTask(taskService, TaskType.PULL, actual.getKey(), 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
userTO = userService.read("testuser2");
@@ -712,7 +714,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
+ "('" + id + "', 'issuesyncope230', 'Surname', false, 'syncope230@syncope.apache.org', NULL)");
// 2. execute PullTask for resource-db-pull (table TESTPULL on external H2)
- execProvisioningTask(taskService, "7c2242f4-14af-4ab5-af31-cdae23783655", 50, false);
+ execProvisioningTask(taskService, TaskType.PULL, "7c2242f4-14af-4ab5-af31-cdae23783655", 50, false);
// 3. read e-mail address for user created by the PullTask first execution
UserTO userTO = userService.read("issuesyncope230");
@@ -724,7 +726,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
jdbcTemplate.execute("UPDATE TESTPULL SET email='updatedSYNCOPE230@syncope.apache.org' WHERE id='" + id + "'");
// 5. re-execute the PullTask
- execProvisioningTask(taskService, "7c2242f4-14af-4ab5-af31-cdae23783655", 50, false);
+ execProvisioningTask(taskService, TaskType.PULL, "7c2242f4-14af-4ab5-af31-cdae23783655", 50, false);
// 6. verify that the e-mail was updated
userTO = userService.read("issuesyncope230");
@@ -739,9 +741,9 @@ public class PullTaskITCase extends AbstractTaskITCase {
// -----------------------------
// Add a custom correlation rule
// -----------------------------
- PullPolicyTO policyTO = policyService.read("9454b0d7-2610-400a-be82-fc23cf553dd6");
+ PullPolicyTO policyTO = policyService.read(PolicyType.PULL, "9454b0d7-2610-400a-be82-fc23cf553dd6");
policyTO.getSpecification().getCorrelationRules().put(AnyTypeKind.USER.name(), TestPullRule.class.getName());
- policyService.update(policyTO);
+ policyService.update(PolicyType.PULL, policyTO);
// -----------------------------
PullTaskTO task = new PullTaskTO();
@@ -754,7 +756,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
task.setPerformDelete(true);
task.setPerformUpdate(true);
- Response response = taskService.create(task);
+ Response response = taskService.create(TaskType.PULL, task);
task = getObject(response.getLocation(), TaskService.class, PullTaskTO.class);
UserTO userTO = UserITCase.getUniqueSampleTO("s258_1@apache.org");
@@ -776,9 +778,9 @@ public class PullTaskITCase extends AbstractTaskITCase {
userService.update(userPatch);
- execProvisioningTask(taskService, task.getKey(), 50, false);
+ execProvisioningTask(taskService, TaskType.PULL, task.getKey(), 50, false);
- PullTaskTO executed = taskService.read(task.getKey(), true);
+ PullTaskTO executed = taskService.read(TaskType.PULL, task.getKey(), true);
assertEquals(1, executed.getExecutions().size());
// asser for just one match
@@ -802,7 +804,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
assertEquals(PropagationTaskExecStatus.SUCCESS, result.getPropagationStatuses().get(0).getStatus());
ExecTO taskExecTO = execProvisioningTask(
- taskService, "986867e2-993b-430e-8feb-aa9abb4c1dcd", 50, false);
+ taskService, TaskType.PULL, "986867e2-993b-430e-8feb-aa9abb4c1dcd", 50, false);
assertNotNull(taskExecTO.getStatus());
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(taskExecTO.getStatus()));
@@ -833,7 +835,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
assertTrue(userTO.getVirAttrs().isEmpty());
// Update pull task
- PullTaskTO task = taskService.read("38abbf9e-a1a3-40a1-a15f-7d0ac02f47f1", true);
+ PullTaskTO task = taskService.read(TaskType.PULL, "38abbf9e-a1a3-40a1-a15f-7d0ac02f47f1", true);
assertNotNull(task);
UserTO template = new UserTO();
@@ -843,10 +845,10 @@ public class PullTaskITCase extends AbstractTaskITCase {
task.getTemplates().put(AnyTypeKind.USER.name(), template);
- taskService.update(task);
+ taskService.update(TaskType.PULL, task);
// exec task: one user from CSV will match the user created above and template will be applied
- execProvisioningTask(taskService, task.getKey(), 50, false);
+ execProvisioningTask(taskService, TaskType.PULL, task.getKey(), 50, false);
// check that template was successfully applied...
userTO = userService.read(userTO.getKey());
@@ -890,17 +892,17 @@ public class PullTaskITCase extends AbstractTaskITCase {
pullTask.setPullMode(PullMode.FULL_RECONCILIATION);
pullTask.setResource(RESOURCE_NAME_TESTDB);
pullTask.getActionsClassNames().add(DBPasswordPullActions.class.getName());
- Response taskResponse = taskService.create(pullTask);
+ Response taskResponse = taskService.create(TaskType.PULL, pullTask);
PullTaskTO actual = getObject(taskResponse.getLocation(), TaskService.class, PullTaskTO.class);
assertNotNull(actual);
- pullTask = taskService.read(actual.getKey(), true);
+ pullTask = taskService.read(TaskType.PULL, actual.getKey(), true);
assertNotNull(pullTask);
assertEquals(actual.getKey(), pullTask.getKey());
assertEquals(actual.getJobDelegateClassName(), pullTask.getJobDelegateClassName());
- ExecTO execution = execProvisioningTask(taskService, pullTask.getKey(), 50, false);
+ ExecTO execution = execProvisioningTask(taskService, TaskType.PULL, pullTask.getKey(), 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
// 5. Test the pulled user
@@ -908,7 +910,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
assertNotNull(self);
// 6. Delete PullTask + user
- taskService.delete(pullTask.getKey());
+ taskService.delete(TaskType.PULL, pullTask.getKey());
deleteUser(user.getKey());
}
@@ -970,12 +972,12 @@ public class PullTaskITCase extends AbstractTaskITCase {
pullTask.setPullMode(PullMode.FULL_RECONCILIATION);
pullTask.setResource(RESOURCE_NAME_LDAP);
pullTask.getActionsClassNames().add(LDAPPasswordPullActions.class.getName());
- Response taskResponse = taskService.create(pullTask);
+ Response taskResponse = taskService.create(TaskType.PULL, pullTask);
pullTask = getObject(taskResponse.getLocation(), TaskService.class, PullTaskTO.class);
assertNotNull(pullTask);
- ExecTO execution = execProvisioningTask(taskService, pullTask.getKey(), 50, false);
+ ExecTO execution = execProvisioningTask(taskService, TaskType.PULL, pullTask.getKey(), 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
// 7. Test the pulled user
@@ -986,7 +988,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
} finally {
// Delete PullTask + user + reset the connector
if (pullTask != null) {
- taskService.delete(pullTask.getKey());
+ taskService.delete(TaskType.PULL, pullTask.getKey());
}
if (resourceConnector != null && property != null) {
@@ -1029,13 +1031,13 @@ public class PullTaskITCase extends AbstractTaskITCase {
template.getPlainAttrs().add(attrTO("firstname", "'fixed'"));
pullTask.getTemplates().put(AnyTypeKind.USER.name(), template);
- Response taskResponse = taskService.create(pullTask);
+ Response taskResponse = taskService.create(TaskType.PULL, pullTask);
pullTask = getObject(taskResponse.getLocation(), TaskService.class, PullTaskTO.class);
assertNotNull(pullTask);
assertFalse(pullTask.getTemplates().isEmpty());
// 3. exec the pull task
- ExecTO execution = execProvisioningTask(taskService, pullTask.getKey(), 50, false);
+ ExecTO execution = execProvisioningTask(taskService, TaskType.PULL, pullTask.getKey(), 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
// the user is successfully pulled...
@@ -1071,7 +1073,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
assertEquals("pullFromLDAP2@syncope.apache.org", connObject.getAttr("mail").getValues().get(0));
// 5. exec the pull task again
- execution = execProvisioningTask(taskService, pullTask.getKey(), 50, false);
+ execution = execProvisioningTask(taskService, TaskType.PULL, pullTask.getKey(), 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(execution.getStatus()));
// the internal is updated...
@@ -1089,7 +1091,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
fail(e.getMessage());
} finally {
if (pullTask != null) {
- taskService.delete(pullTask.getKey());
+ taskService.delete(TaskType.PULL, pullTask.getKey());
}
if (propagationGroup != null) {
[06/10] syncope git commit: Upgrading Tomcat
Posted by il...@apache.org.
Upgrading Tomcat
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/e93047e9
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/e93047e9
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/e93047e9
Branch: refs/heads/2_0_X
Commit: e93047e9c56469e9e59e66d8cac4e4c6c464426e
Parents: 8038b05
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Tue Feb 13 13:21:51 2018 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Tue Feb 13 13:21:51 2018 +0100
----------------------------------------------------------------------
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/e93047e9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2964f52..8ea3260 100644
--- a/pom.xml
+++ b/pom.xml
@@ -489,7 +489,7 @@ under the License.
<cargo.log>${log.directory}/cargo.log</cargo.log>
<cargo.output>${log.directory}/cargo-output.log</cargo.output>
- <tomcat.version>8.5.27</tomcat.version>
+ <tomcat.version>8.5.28</tomcat.version>
<phantomjs.driver.version>1.2.0</phantomjs.driver.version>
<phantomjs.version>2.1.1</phantomjs.version>
[05/10] syncope git commit: [SYNCOPE-1274] Using Swagger annotations
for TO hierarchies
Posted by il...@apache.org.
[SYNCOPE-1274] Using Swagger annotations for TO hierarchies
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/8038b056
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/8038b056
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/8038b056
Branch: refs/heads/2_0_X
Commit: 8038b056f7a2870bdd0c2c177856de50f49b52b9
Parents: ffa19a6
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Mon Feb 12 17:29:13 2018 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Mon Feb 12 17:29:13 2018 +0100
----------------------------------------------------------------------
.../client/cli/commands/policy/PolicyRead.java | 4 +-
.../commands/policy/PolicyResultManager.java | 16 +--
.../policy/PolicySyncopeOperations.java | 6 +-
.../client/cli/commands/schema/SchemaRead.java | 4 +-
.../commands/schema/SchemaResultManager.java | 20 +--
.../schema/SchemaSyncopeOperations.java | 12 +-
.../cli/commands/task/TaskDeleteAllProp.java | 4 +-
.../client/cli/commands/task/TaskDetails.java | 28 ++---
.../client/cli/commands/task/TaskRead.java | 4 +-
.../cli/commands/task/TaskResultManager.java | 28 ++---
.../commands/task/TaskSyncopeOperations.java | 8 +-
.../console/commons/TaskDataProvider.java | 4 +-
.../panels/AbstractSchemaDetailsPanel.java | 8 +-
.../client/console/panels/BeanPanel.java | 12 +-
.../console/panels/PlainSchemaDetails.java | 4 +-
.../client/console/panels/RealmDetails.java | 6 +-
.../client/console/panels/SchemaModalPanel.java | 16 +--
.../client/console/panels/SchemaTypePanel.java | 44 +++----
.../client/console/panels/TogglePanel.java | 12 +-
.../console/policies/PolicyDirectoryPanel.java | 12 +-
.../policies/PolicyModalPanelBuilder.java | 4 +-
.../policies/PolicyRuleDirectoryPanel.java | 4 +-
.../policies/PolicyRuleWizardBuilder.java | 4 +-
.../console/policies/PolicySpecModalPanel.java | 9 +-
.../client/console/rest/PolicyRestClient.java | 14 +--
.../client/console/rest/SchemaRestClient.java | 14 +--
.../client/console/rest/TaskRestClient.java | 8 +-
.../tasks/ProvisioningTaskDirectoryPanel.java | 6 +-
.../console/tasks/SchedTaskWizardBuilder.java | 4 +-
.../console/tasks/TaskDirectoryPanel.java | 6 +-
.../console/tasks/TaskExecutionDetails.java | 4 +-
.../html/form/ActionLinksTogglePanel.java | 12 +-
.../client/console/widgets/JobWidget.java | 8 +-
.../console/wizards/any/AbstractAttrs.java | 4 +-
.../resources/ResourceSecurityPanel.java | 8 +-
.../client/enduser/model/SchemaResponse.java | 26 ++--
.../enduser/resources/SchemaResource.java | 36 +++---
.../client/lib/SyncopeClientFactoryBean.java | 4 +-
common/lib/pom.xml | 5 +
.../syncope/common/lib/AbstractBaseBean.java | 4 +-
.../common/lib/patch/AbstractPatchItem.java | 4 +
.../common/lib/patch/AnyObjectPatch.java | 10 ++
.../syncope/common/lib/patch/AnyPatch.java | 23 ++++
.../syncope/common/lib/patch/GroupPatch.java | 10 ++
.../syncope/common/lib/patch/UserPatch.java | 10 ++
.../common/lib/policy/AbstractPolicyTO.java | 83 -------------
.../common/lib/policy/AccountPolicyTO.java | 15 ++-
.../common/lib/policy/PasswordPolicyTO.java | 15 ++-
.../syncope/common/lib/policy/PolicyTO.java | 105 ++++++++++++++++
.../syncope/common/lib/policy/PullPolicyTO.java | 19 ++-
.../common/lib/to/AbstractAnnotatedBean.java | 5 +
.../lib/to/AbstractProvisioningTaskTO.java | 117 ------------------
.../syncope/common/lib/to/AbstractSchemaTO.java | 59 ---------
.../common/lib/to/AbstractStartEndBean.java | 3 +
.../syncope/common/lib/to/AbstractTaskTO.java | 72 -----------
.../syncope/common/lib/to/AnyObjectTO.java | 13 ++
.../org/apache/syncope/common/lib/to/AnyTO.java | 23 +++-
.../apache/syncope/common/lib/to/AttrTO.java | 20 +--
.../syncope/common/lib/to/DerSchemaTO.java | 17 ++-
.../apache/syncope/common/lib/to/GroupTO.java | 16 +++
.../common/lib/to/NotificationTaskTO.java | 24 +++-
.../syncope/common/lib/to/PlainSchemaTO.java | 17 ++-
.../common/lib/to/PropagationTaskTO.java | 32 ++++-
.../common/lib/to/ProvisioningTaskTO.java | 122 +++++++++++++++++++
.../syncope/common/lib/to/PullTaskTO.java | 19 ++-
.../syncope/common/lib/to/PushTaskTO.java | 17 ++-
.../syncope/common/lib/to/SchedTaskTO.java | 24 +++-
.../apache/syncope/common/lib/to/SchemaTO.java | 77 ++++++++++++
.../apache/syncope/common/lib/to/TaskTO.java | 94 ++++++++++++++
.../apache/syncope/common/lib/to/UserTO.java | 21 ++++
.../syncope/common/lib/to/VirSchemaTO.java | 17 ++-
.../syncope/common/lib/types/SchemaType.java | 10 +-
common/rest-api/pom.xml | 5 -
.../common/rest/api/service/PolicyService.java | 10 +-
.../common/rest/api/service/SchemaService.java | 10 +-
.../common/rest/api/service/TaskService.java | 8 +-
.../apache/syncope/core/logic/PolicyLogic.java | 20 +--
.../apache/syncope/core/logic/SchemaLogic.java | 20 +--
.../apache/syncope/core/logic/TaskLogic.java | 16 +--
.../persistence/api/entity/task/TaskUtils.java | 6 +-
.../api/entity/task/TaskUtilsFactory.java | 6 +-
.../jpa/entity/task/JPATaskUtils.java | 6 +-
.../jpa/entity/task/JPATaskUtilsFactory.java | 6 +-
.../provisioning/api/data/PolicyDataBinder.java | 8 +-
.../provisioning/api/data/TaskDataBinder.java | 4 +-
.../java/data/PolicyDataBinderImpl.java | 10 +-
.../java/data/TaskDataBinderImpl.java | 18 +--
.../rest/cxf/service/PolicyServiceImpl.java | 12 +-
.../rest/cxf/service/SchemaServiceImpl.java | 12 +-
.../core/rest/cxf/service/TaskServiceImpl.java | 8 +-
.../src/main/resources/restCXFContext.xml | 2 +-
.../src/main/resources/jboss/restCXFContext.xml | 2 +-
.../org/apache/syncope/fit/AbstractITCase.java | 8 +-
.../syncope/fit/core/AbstractTaskITCase.java | 4 +-
.../syncope/fit/core/MigrationITCase.java | 4 +-
.../syncope/fit/core/PropagationTaskITCase.java | 12 +-
.../apache/syncope/fit/core/PullTaskITCase.java | 6 +-
.../apache/syncope/fit/core/PushTaskITCase.java | 4 +-
.../syncope/fit/core/SchedTaskITCase.java | 4 +-
99 files changed, 1084 insertions(+), 696 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyRead.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyRead.java
index c33cba8..5b50a69 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyRead.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyRead.java
@@ -23,7 +23,7 @@ import java.util.List;
import javax.xml.ws.WebServiceException;
import org.apache.syncope.client.cli.Input;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,7 +41,7 @@ public class PolicyRead extends AbstractPolicyCommand {
public void read() {
if (input.parameterNumber() >= 1) {
- final List<AbstractPolicyTO> policyTOs = new ArrayList<>();
+ final List<PolicyTO> policyTOs = new ArrayList<>();
for (final String parameter : input.getParameters()) {
try {
policyTOs.add(policySyncopeOperations.read(parameter));
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyResultManager.java
index baf9378..97742d3 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicyResultManager.java
@@ -21,7 +21,7 @@ package org.apache.syncope.client.cli.commands.policy;
import java.util.List;
import java.util.Map;
import org.apache.syncope.client.cli.commands.CommonsResultManager;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.policy.AccountPolicyTO;
import org.apache.syncope.common.lib.policy.PasswordPolicyTO;
import org.apache.syncope.common.lib.policy.PullPolicyTO;
@@ -29,9 +29,9 @@ import org.apache.syncope.common.lib.types.PolicyType;
public class PolicyResultManager extends CommonsResultManager {
- public void printPolicies(final List<AbstractPolicyTO> policyTOs) {
+ public void printPolicies(final List<PolicyTO> policyTOs) {
System.out.println("");
- for (AbstractPolicyTO policyTO : policyTOs) {
+ for (PolicyTO policyTO : policyTOs) {
if (policyTO instanceof AccountPolicyTO) {
printAccountPolicy((AccountPolicyTO) policyTO);
} else if (policyTO instanceof PasswordPolicyTO) {
@@ -42,27 +42,27 @@ public class PolicyResultManager extends CommonsResultManager {
}
}
- public void printPoliciesByType(final String policyTypeString, final List<AbstractPolicyTO> policyTOs) {
+ public void printPoliciesByType(final String policyTypeString, final List<PolicyTO> policyTOs) {
System.out.println("");
final PolicyType policyType = PolicyType.valueOf(policyTypeString);
switch (policyType) {
case ACCOUNT:
- for (final AbstractPolicyTO policyTO : policyTOs) {
+ for (final PolicyTO policyTO : policyTOs) {
printAccountPolicy((AccountPolicyTO) policyTO);
}
break;
case PASSWORD:
- for (final AbstractPolicyTO policyTO : policyTOs) {
+ for (final PolicyTO policyTO : policyTOs) {
printPasswordPolicy((PasswordPolicyTO) policyTO);
}
break;
case PUSH:
- for (final AbstractPolicyTO policyTO : policyTOs) {
+ for (final PolicyTO policyTO : policyTOs) {
System.out.println(policyTO);
}
break;
case PULL:
- for (final AbstractPolicyTO policyTO : policyTOs) {
+ for (final PolicyTO policyTO : policyTOs) {
printPullPolicy((PullPolicyTO) policyTO);
}
break;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicySyncopeOperations.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicySyncopeOperations.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicySyncopeOperations.java
index 127818b..9bfad75 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicySyncopeOperations.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/policy/PolicySyncopeOperations.java
@@ -20,7 +20,7 @@ package org.apache.syncope.client.cli.commands.policy;
import java.util.List;
import org.apache.syncope.client.cli.SyncopeServices;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.rest.api.service.PolicyService;
@@ -28,11 +28,11 @@ public class PolicySyncopeOperations {
private final PolicyService policyService = SyncopeServices.get(PolicyService.class);
- public <T extends AbstractPolicyTO> T read(final String policyKey) {
+ public <T extends PolicyTO> T read(final String policyKey) {
return policyService.read(policyKey);
}
- public <T extends AbstractPolicyTO> List<T> list(final String policyType) {
+ public <T extends PolicyTO> List<T> list(final String policyType) {
return policyService.list(PolicyType.valueOf(policyType));
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaRead.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaRead.java
index 0f99ed7..96cd5cc 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaRead.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaRead.java
@@ -25,7 +25,7 @@ import javax.xml.ws.WebServiceException;
import org.apache.syncope.client.cli.Input;
import org.apache.syncope.client.cli.util.CommandUtils;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.types.SchemaType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -47,7 +47,7 @@ public class SchemaRead extends AbstractSchemaCommand {
if (input.parameterNumber() >= 2) {
final String[] parameters = Arrays.copyOfRange(input.getParameters(), 1, input.parameterNumber());
try {
- final List<AbstractSchemaTO> schemaTOs = new ArrayList<>();
+ final List<SchemaTO> schemaTOs = new ArrayList<>();
for (final String parameter : parameters) {
schemaTOs.add(schemaSyncopeOperations.read(input.firstParameter(), parameter));
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaResultManager.java
index cb87fe0..58ce32d 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaResultManager.java
@@ -23,7 +23,7 @@ import java.util.List;
import java.util.Map;
import org.apache.syncope.client.cli.commands.CommonsResultManager;
import org.apache.syncope.client.cli.view.Table;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.to.DerSchemaTO;
import org.apache.syncope.common.lib.to.PlainSchemaTO;
import org.apache.syncope.common.lib.to.VirSchemaTO;
@@ -31,7 +31,7 @@ import org.apache.syncope.common.lib.types.SchemaType;
public class SchemaResultManager extends CommonsResultManager {
- public void toView(final String schemaTypeString, final List<? extends AbstractSchemaTO> schemaTOs) {
+ public void toView(final String schemaTypeString, final List<? extends SchemaTO> schemaTOs) {
switch (SchemaType.valueOf(schemaTypeString)) {
case PLAIN:
printPlainSchemasDetailed(schemaTOs);
@@ -47,9 +47,9 @@ public class SchemaResultManager extends CommonsResultManager {
}
}
- private void printPlainSchemasDetailed(final List<? extends AbstractSchemaTO> schemaTOs) {
+ private void printPlainSchemasDetailed(final List<? extends SchemaTO> schemaTOs) {
System.out.println("");
- for (final AbstractSchemaTO schemaTO : schemaTOs) {
+ for (final SchemaTO schemaTO : schemaTOs) {
printPlanSchemaDetailed((PlainSchemaTO) schemaTO);
}
}
@@ -67,10 +67,10 @@ public class SchemaResultManager extends CommonsResultManager {
System.out.println("");
}
- public void printPlainSchemas(final List<? extends AbstractSchemaTO> schemaTOs) {
+ public void printPlainSchemas(final List<? extends SchemaTO> schemaTOs) {
final Table.TableBuilder tableBuilder =
new Table.TableBuilder("plain schemas").header("schema key").header("type").header("mandatory");
- for (final AbstractSchemaTO schemaTO : schemaTOs) {
+ for (final SchemaTO schemaTO : schemaTOs) {
tableBuilder.rowValues(Arrays.asList(
((PlainSchemaTO) schemaTO).getKey(),
((PlainSchemaTO) schemaTO).getType().toString(),
@@ -79,10 +79,10 @@ public class SchemaResultManager extends CommonsResultManager {
tableBuilder.build().print();
}
- public void fromListDerived(final List<? extends AbstractSchemaTO> schemaTOs) {
+ public void fromListDerived(final List<? extends SchemaTO> schemaTOs) {
final Table.TableBuilder tableBuilder =
new Table.TableBuilder("derived schemas").header("schema key").header("expression");
- for (final AbstractSchemaTO schemaTO : schemaTOs) {
+ for (final SchemaTO schemaTO : schemaTOs) {
tableBuilder.rowValues(Arrays.asList(
((DerSchemaTO) schemaTO).getKey(),
((DerSchemaTO) schemaTO).getExpression()));
@@ -90,10 +90,10 @@ public class SchemaResultManager extends CommonsResultManager {
tableBuilder.build().print();
}
- public void fromListVirtual(final List<? extends AbstractSchemaTO> schemaTOs) {
+ public void fromListVirtual(final List<? extends SchemaTO> schemaTOs) {
final Table.TableBuilder tableBuilder =
new Table.TableBuilder("virtual schemas").header("schema key").header("readonly");
- for (final AbstractSchemaTO schemaTO : schemaTOs) {
+ for (final SchemaTO schemaTO : schemaTOs) {
tableBuilder.rowValues(Arrays.asList(
((VirSchemaTO) schemaTO).getKey(),
String.valueOf(((VirSchemaTO) schemaTO).isReadonly())));
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaSyncopeOperations.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaSyncopeOperations.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaSyncopeOperations.java
index 92f9bf3..79cb89a 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaSyncopeOperations.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/schema/SchemaSyncopeOperations.java
@@ -20,7 +20,7 @@ package org.apache.syncope.client.cli.commands.schema;
import java.util.List;
import org.apache.syncope.client.cli.SyncopeServices;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.syncope.common.rest.api.beans.SchemaQuery;
import org.apache.syncope.common.rest.api.service.SchemaService;
@@ -29,23 +29,23 @@ public class SchemaSyncopeOperations {
private final SchemaService schemaService = SyncopeServices.get(SchemaService.class);
- public <T extends AbstractSchemaTO> T read(final String schemaTypeString, final String schemaName) {
+ public <T extends SchemaTO> T read(final String schemaTypeString, final String schemaName) {
return schemaService.read(SchemaType.valueOf(schemaTypeString), schemaName);
}
- public <T extends AbstractSchemaTO> List<T> list(final String schemaTypeString) {
+ public <T extends SchemaTO> List<T> list(final String schemaTypeString) {
return schemaService.list(new SchemaQuery.Builder().type(SchemaType.valueOf(schemaTypeString)).build());
}
- public <T extends AbstractSchemaTO> List<T> listPlain() {
+ public <T extends SchemaTO> List<T> listPlain() {
return schemaService.list(new SchemaQuery.Builder().type(SchemaType.PLAIN).build());
}
- public <T extends AbstractSchemaTO> List<T> listDerived() {
+ public <T extends SchemaTO> List<T> listDerived() {
return schemaService.list(new SchemaQuery.Builder().type(SchemaType.DERIVED).build());
}
- public <T extends AbstractSchemaTO> List<T> listVirtual() {
+ public <T extends SchemaTO> List<T> listVirtual() {
return schemaService.list(new SchemaQuery.Builder().type(SchemaType.VIRTUAL).build());
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDeleteAllProp.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDeleteAllProp.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDeleteAllProp.java
index 4f41428..7d1660b 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDeleteAllProp.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDeleteAllProp.java
@@ -21,7 +21,7 @@ package org.apache.syncope.client.cli.commands.task;
import javax.xml.ws.WebServiceException;
import org.apache.syncope.client.cli.Input;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -40,7 +40,7 @@ public class TaskDeleteAllProp extends AbstractTaskCommand {
public void delete() {
if (input.parameterNumber() == 0) {
- for (final AbstractTaskTO taskTO : taskSyncopeOperations.listPropagationTask()) {
+ for (final TaskTO taskTO : taskSyncopeOperations.listPropagationTask()) {
final String taskId = String.valueOf(taskTO.getKey());
try {
taskSyncopeOperations.delete(taskId);
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDetails.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDetails.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDetails.java
index bb00255..71132fc 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDetails.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskDetails.java
@@ -24,12 +24,12 @@ import org.apache.commons.collections4.map.LinkedMap;
import org.apache.syncope.client.cli.Input;
import org.apache.syncope.client.cli.util.CommandUtils;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.NotificationTaskTO;
import org.apache.syncope.common.lib.to.PropagationTaskTO;
import org.apache.syncope.common.lib.to.PushTaskTO;
-import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
import org.apache.syncope.common.lib.to.PullTaskTO;
import org.apache.syncope.common.lib.types.PullMode;
import org.apache.syncope.common.lib.types.TaskType;
@@ -52,12 +52,12 @@ public class TaskDetails extends AbstractTaskCommand {
if (input.parameterNumber() == 0) {
try {
final Map<String, String> details = new LinkedMap<>();
- final List<AbstractTaskTO> notificationTaskTOs =
+ final List<TaskTO> notificationTaskTOs =
taskSyncopeOperations.list(TaskType.NOTIFICATION.name());
- final List<AbstractTaskTO> propagationTaskTOs = taskSyncopeOperations.list(TaskType.PROPAGATION.name());
- final List<AbstractTaskTO> pushTaskTOs = taskSyncopeOperations.list(TaskType.PUSH.name());
- final List<AbstractTaskTO> scheduledTaskTOs = taskSyncopeOperations.list(TaskType.SCHEDULED.name());
- final List<AbstractTaskTO> pullTaskTOs = taskSyncopeOperations.list(TaskType.PULL.name());
+ final List<TaskTO> propagationTaskTOs = taskSyncopeOperations.list(TaskType.PROPAGATION.name());
+ final List<TaskTO> pushTaskTOs = taskSyncopeOperations.list(TaskType.PUSH.name());
+ final List<TaskTO> scheduledTaskTOs = taskSyncopeOperations.list(TaskType.SCHEDULED.name());
+ final List<TaskTO> pullTaskTOs = taskSyncopeOperations.list(TaskType.PULL.name());
final List<JobTO> jobTOs = taskSyncopeOperations.listJobs();
final int notificationTaskSize = notificationTaskTOs.size();
final int propagationTaskSize = propagationTaskTOs.size();
@@ -68,14 +68,14 @@ public class TaskDetails extends AbstractTaskCommand {
final int jobsSize = jobTOs.size();
int notificationNotExecuted = 0;
- for (final AbstractTaskTO notificationTaskTO : notificationTaskTOs) {
+ for (final TaskTO notificationTaskTO : notificationTaskTOs) {
if (!((NotificationTaskTO) notificationTaskTO).isExecuted()) {
notificationNotExecuted++;
}
}
int propagationNotExecuted = 0;
- for (final AbstractTaskTO propagationTaskTO : propagationTaskTOs) {
+ for (final TaskTO propagationTaskTO : propagationTaskTOs) {
if (((PropagationTaskTO) propagationTaskTO).getExecutions() == null
|| ((PropagationTaskTO) propagationTaskTO).getExecutions().isEmpty()) {
propagationNotExecuted++;
@@ -83,23 +83,23 @@ public class TaskDetails extends AbstractTaskCommand {
}
int pushNotExecuted = 0;
- for (final AbstractTaskTO pushTaskTO : pushTaskTOs) {
+ for (final TaskTO pushTaskTO : pushTaskTOs) {
if (((PushTaskTO) pushTaskTO).getExecutions() == null
|| ((PushTaskTO) pushTaskTO).getExecutions().isEmpty()) {
pushNotExecuted++;
}
}
- for (final AbstractTaskTO scheduledTaskTO : scheduledTaskTOs) {
- if (((SchedTaskTO) scheduledTaskTO).getExecutions() == null
- || ((SchedTaskTO) scheduledTaskTO).getExecutions().isEmpty()) {
+ for (final TaskTO scheduledTaskTO : scheduledTaskTOs) {
+ if (((ProvisioningTaskTO) scheduledTaskTO).getExecutions() == null
+ || ((ProvisioningTaskTO) scheduledTaskTO).getExecutions().isEmpty()) {
scheduledNotExecuted++;
}
}
int pullNotExecuted = 0;
int pullFull = 0;
- for (final AbstractTaskTO pullTaskTO : pullTaskTOs) {
+ for (final TaskTO pullTaskTO : pullTaskTOs) {
if (((PullTaskTO) pullTaskTO).getExecutions() == null
|| ((PullTaskTO) pullTaskTO).getExecutions().isEmpty()) {
pullNotExecuted++;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java
index 14ebc30..0c05681 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskRead.java
@@ -23,7 +23,7 @@ import java.util.List;
import javax.xml.ws.WebServiceException;
import org.apache.syncope.client.cli.Input;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,7 +41,7 @@ public class TaskRead extends AbstractTaskCommand {
public void read() {
if (input.parameterNumber() >= 1) {
- final List<AbstractTaskTO> taskTOs = new ArrayList<>();
+ final List<TaskTO> taskTOs = new ArrayList<>();
for (final String parameter : input.getParameters()) {
try {
taskTOs.add(taskSyncopeOperations.read(parameter));
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskResultManager.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskResultManager.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskResultManager.java
index 5516440..b5263d3 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskResultManager.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskResultManager.java
@@ -21,61 +21,61 @@ package org.apache.syncope.client.cli.commands.task;
import java.util.List;
import java.util.Map;
import org.apache.syncope.client.cli.commands.CommonsResultManager;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.AnyTO;
import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.NotificationTaskTO;
import org.apache.syncope.common.lib.to.PropagationTaskTO;
import org.apache.syncope.common.lib.to.PushTaskTO;
-import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
import org.apache.syncope.common.lib.to.PullTaskTO;
import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.types.TaskType;
public class TaskResultManager extends CommonsResultManager {
- public void printTasks(final List<AbstractTaskTO> taskTOs) {
+ public void printTasks(final List<TaskTO> taskTOs) {
System.out.println("");
- for (final AbstractTaskTO taskTO : taskTOs) {
+ for (final TaskTO taskTO : taskTOs) {
if (taskTO instanceof NotificationTaskTO) {
printNotificationTask((NotificationTaskTO) taskTO);
} else if (taskTO instanceof PropagationTaskTO) {
printPropagationTask((PropagationTaskTO) taskTO);
} else if (taskTO instanceof PushTaskTO) {
printPushTask((PushTaskTO) taskTO);
- } else if (taskTO instanceof SchedTaskTO) {
- printScheduledTask((SchedTaskTO) taskTO);
+ } else if (taskTO instanceof ProvisioningTaskTO) {
+ printScheduledTask((ProvisioningTaskTO) taskTO);
} else if (taskTO instanceof PullTaskTO) {
printPullTask((PullTaskTO) taskTO);
}
}
}
- public void printTasksType(final String taskTypeString, final List<AbstractTaskTO> taskTOs) {
+ public void printTasksType(final String taskTypeString, final List<TaskTO> taskTOs) {
System.out.println("");
switch (TaskType.valueOf(taskTypeString)) {
case NOTIFICATION:
- for (final AbstractTaskTO taskTO : taskTOs) {
+ for (final TaskTO taskTO : taskTOs) {
printNotificationTask(((NotificationTaskTO) taskTO));
}
break;
case PROPAGATION:
- for (final AbstractTaskTO taskTO : taskTOs) {
+ for (final TaskTO taskTO : taskTOs) {
printPropagationTask((PropagationTaskTO) taskTO);
}
break;
case PUSH:
- for (final AbstractTaskTO taskTO : taskTOs) {
+ for (final TaskTO taskTO : taskTOs) {
printPushTask((PushTaskTO) taskTO);
}
break;
case SCHEDULED:
- for (final AbstractTaskTO taskTO : taskTOs) {
- printScheduledTask((SchedTaskTO) taskTO);
+ for (final TaskTO taskTO : taskTOs) {
+ printScheduledTask((ProvisioningTaskTO) taskTO);
}
break;
case PULL:
- for (final AbstractTaskTO taskTO : taskTOs) {
+ for (final TaskTO taskTO : taskTOs) {
printPullTask((PullTaskTO) taskTO);
}
break;
@@ -141,7 +141,7 @@ public class TaskResultManager extends CommonsResultManager {
System.out.println("");
}
- private void printScheduledTask(final SchedTaskTO schedTaskTO) {
+ private void printScheduledTask(final ProvisioningTaskTO schedTaskTO) {
System.out.println(" - Scheduled task key: " + schedTaskTO.getKey());
System.out.println(" name: " + schedTaskTO.getName());
System.out.println(" cron expression: " + schedTaskTO.getCronExpression());
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskSyncopeOperations.java
----------------------------------------------------------------------
diff --git a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskSyncopeOperations.java b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskSyncopeOperations.java
index 7ac8593..ad94a4f 100644
--- a/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskSyncopeOperations.java
+++ b/client/cli/src/main/java/org/apache/syncope/client/cli/commands/task/TaskSyncopeOperations.java
@@ -20,7 +20,7 @@ package org.apache.syncope.client.cli.commands.task;
import java.util.List;
import org.apache.syncope.client.cli.SyncopeServices;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.types.TaskType;
@@ -36,7 +36,7 @@ public class TaskSyncopeOperations {
return taskService.listJobs();
}
- public <T extends AbstractTaskTO> T read(final String taskKey) {
+ public <T extends TaskTO> T read(final String taskKey) {
return taskService.read(taskKey, true);
}
@@ -44,11 +44,11 @@ public class TaskSyncopeOperations {
taskService.delete(taskKey);
}
- public List<AbstractTaskTO> list(final String type) {
+ public List<TaskTO> list(final String type) {
return taskService.list(new TaskQuery.Builder(TaskType.valueOf(type)).build()).getResult();
}
- public List<AbstractTaskTO> listPropagationTask() {
+ public List<TaskTO> listPropagationTask() {
return taskService.list(new TaskQuery.Builder(TaskType.PROPAGATION).build()).getResult();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/commons/TaskDataProvider.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/commons/TaskDataProvider.java b/client/console/src/main/java/org/apache/syncope/client/console/commons/TaskDataProvider.java
index 46312cb..50f6fe7 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/commons/TaskDataProvider.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/commons/TaskDataProvider.java
@@ -18,13 +18,13 @@
*/
package org.apache.syncope.client.console.commons;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.types.TaskType;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.IModel;
-public abstract class TaskDataProvider<T extends AbstractTaskTO> extends DirectoryDataProvider<T> {
+public abstract class TaskDataProvider<T extends TaskTO> extends DirectoryDataProvider<T> {
private static final long serialVersionUID = -20112718133295756L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSchemaDetailsPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSchemaDetailsPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSchemaDetailsPanel.java
index ebddc5b..03729e9 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSchemaDetailsPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/AbstractSchemaDetailsPanel.java
@@ -19,7 +19,7 @@
package org.apache.syncope.client.console.panels;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.wicket.PageReference;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.panel.Panel;
@@ -36,14 +36,14 @@ public abstract class AbstractSchemaDetailsPanel extends Panel {
protected static final String FORM = "form";
- protected final Form<AbstractSchemaTO> schemaForm;
+ protected final Form<SchemaTO> schemaForm;
- protected final AbstractSchemaTO schemaTO;
+ protected final SchemaTO schemaTO;
public AbstractSchemaDetailsPanel(
final String id,
final PageReference pageReference,
- final AbstractSchemaTO schemaTO) {
+ final SchemaTO schemaTO) {
super(id);
this.schemaTO = schemaTO;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/panels/BeanPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/BeanPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/BeanPanel.java
index 56c897d..8b606af 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/BeanPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/BeanPanel.java
@@ -49,7 +49,7 @@ import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.report.Schema;
import org.apache.syncope.common.lib.report.SearchCondition;
import org.apache.syncope.common.lib.search.AbstractFiqlSearchConditionBuilder;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
@@ -191,7 +191,7 @@ public class BeanPanel<T extends Serializable> extends Panel {
if (listItemType.equals(String.class) && schemaAnnot != null) {
SchemaRestClient schemaRestClient = new SchemaRestClient();
- final List<AbstractSchemaTO> choices = new ArrayList<>();
+ final List<SchemaTO> choices = new ArrayList<>();
for (SchemaType type : schemaAnnot.type()) {
switch (type) {
@@ -214,15 +214,13 @@ public class BeanPanel<T extends Serializable> extends Panel {
}
}
- panel = new AjaxPalettePanel.Builder<String>().setName(fieldName).build(
- "value",
+ panel = new AjaxPalettePanel.Builder<String>().setName(fieldName).build("value",
new PropertyModel<List<String>>(bean.getObject(), fieldName),
new ListModel<>(
- CollectionUtils.collect(
- choices, new Transformer<AbstractSchemaTO, String>() {
+ CollectionUtils.collect(choices, new Transformer<SchemaTO, String>() {
@Override
- public String transform(final AbstractSchemaTO input) {
+ public String transform(final SchemaTO input) {
return input.getKey();
}
}, new ArrayList<String>()))).hideLabel();
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
index 443703b..3788b64 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/PlainSchemaDetails.java
@@ -36,7 +36,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.AjaxCheckBoxPan
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.MultiFieldPanel;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.to.PlainSchemaTO;
import org.apache.syncope.common.lib.types.AttrSchemaType;
import org.apache.syncope.common.lib.types.CipherAlgorithm;
@@ -294,7 +294,7 @@ public class PlainSchemaDetails extends AbstractSchemaDetailsPanel {
}
- private void showHide(final AbstractSchemaTO schema, final AjaxDropDownChoicePanel<AttrSchemaType> type,
+ private void showHide(final SchemaTO schema, final AjaxDropDownChoicePanel<AttrSchemaType> type,
final WebMarkupContainer conversionParams, final AjaxTextFieldPanel conversionPattern,
final WebMarkupContainer enumParams, final AjaxTextFieldPanel enumerationValuesPanel,
final MultiFieldPanel<String> enumerationValues, final MultiFieldPanel<String> enumerationKeys,
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
index 4f48c3c..6ab447d 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/RealmDetails.java
@@ -34,7 +34,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
import org.apache.syncope.client.console.wicket.markup.html.form.PolicyRenderer;
import org.apache.syncope.common.lib.EntityTOUtils;
import org.apache.syncope.common.lib.SyncopeConstants;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.to.RealmTO;
import org.apache.syncope.common.lib.to.ResourceTO;
import org.apache.syncope.common.lib.types.PolicyType;
@@ -65,7 +65,7 @@ public class RealmDetails extends Panel {
@Override
protected Map<String, String> load() {
Map<String, String> res = new LinkedHashMap<>();
- for (AbstractPolicyTO policyTO : policyRestClient.getPolicies(PolicyType.ACCOUNT)) {
+ for (PolicyTO policyTO : policyRestClient.getPolicies(PolicyType.ACCOUNT)) {
res.put(policyTO.getKey(), policyTO.getDescription());
}
return res;
@@ -79,7 +79,7 @@ public class RealmDetails extends Panel {
@Override
protected Map<String, String> load() {
Map<String, String> res = new LinkedHashMap<>();
- for (AbstractPolicyTO policyTO : policyRestClient.getPolicies(PolicyType.PASSWORD)) {
+ for (PolicyTO policyTO : policyRestClient.getPolicies(PolicyType.PASSWORD)) {
res.put(policyTO.getKey(), policyTO.getDescription());
}
return res;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java
index 4b191b5..e149c05 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaModalPanel.java
@@ -21,7 +21,7 @@ package org.apache.syncope.client.console.panels;
import java.util.Arrays;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.to.DerSchemaTO;
import org.apache.syncope.common.lib.to.PlainSchemaTO;
import org.apache.syncope.common.lib.to.VirSchemaTO;
@@ -30,17 +30,17 @@ import org.apache.wicket.PageReference;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.Model;
-public class SchemaModalPanel extends AbstractModalPanel<AbstractSchemaTO> {
+public class SchemaModalPanel extends AbstractModalPanel<SchemaTO> {
private static final long serialVersionUID = -4681998932778822125L;
private final AbstractSchemaDetailsPanel schemaPanel;
- private final AbstractSchemaTO schemaTO;
+ private final SchemaTO schemaTO;
public SchemaModalPanel(
- final BaseModal<AbstractSchemaTO> modal,
- final AbstractSchemaTO schemaTO,
+ final BaseModal<SchemaTO> modal,
+ final SchemaTO schemaTO,
final PageReference pageRef) {
super(modal, pageRef);
@@ -64,13 +64,13 @@ public class SchemaModalPanel extends AbstractModalPanel<AbstractSchemaTO> {
}
private AbstractSchemaDetailsPanel getSchemaPanel(final String id,
- final SchemaType schemaType, final BaseModal<AbstractSchemaTO> modal) {
+ final SchemaType schemaType, final BaseModal<SchemaTO> modal) {
final AbstractSchemaDetailsPanel panel;
if (schemaTO.getKey() != null) {
try {
- final Class<? extends AbstractSchemaTO> schemaTOClass = schemaType.getToClass();
- modal.setFormModel((AbstractSchemaTO) schemaTOClass.newInstance());
+ final Class<? extends SchemaTO> schemaTOClass = schemaType.getToClass();
+ modal.setFormModel((SchemaTO) schemaTOClass.newInstance());
} catch (InstantiationException | IllegalAccessException ex) {
LOG.error("SchemaType not found", ex);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypePanel.java
index af1b84c..30c5050 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/SchemaTypePanel.java
@@ -43,7 +43,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
import org.apache.syncope.client.console.wizards.AbstractModalPanelBuilder;
import org.apache.syncope.client.console.wizards.AjaxWizard;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.to.AttrTO;
import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.syncope.common.lib.types.StandardEntitlement;
@@ -60,7 +60,7 @@ import org.apache.wicket.model.IModel;
import org.apache.wicket.model.ResourceModel;
import org.springframework.util.ReflectionUtils;
-public class SchemaTypePanel extends TypesDirectoryPanel<AbstractSchemaTO, SchemaProvider, SchemaRestClient> {
+public class SchemaTypePanel extends TypesDirectoryPanel<SchemaTO, SchemaProvider, SchemaRestClient> {
private static final long serialVersionUID = 3905038169553185171L;
@@ -89,15 +89,15 @@ public class SchemaTypePanel extends TypesDirectoryPanel<AbstractSchemaTO, Schem
try {
this.addNewItemPanelBuilder(
- new AbstractModalPanelBuilder<AbstractSchemaTO>(schemaType.getToClass().newInstance(), pageRef) {
+ new AbstractModalPanelBuilder<SchemaTO>(schemaType.getToClass().newInstance(), pageRef) {
private static final long serialVersionUID = -6388405037134399367L;
@Override
- public WizardModalPanel<AbstractSchemaTO> build(
+ public WizardModalPanel<SchemaTO> build(
final String id, final int index, final AjaxWizard.Mode mode) {
- final AbstractSchemaTO modelObject = newModelObject();
+ final SchemaTO modelObject = newModelObject();
return new SchemaModalPanel(modal, modelObject, pageRef) {
private static final long serialVersionUID = -6227956682141146095L;
@@ -148,17 +148,17 @@ public class SchemaTypePanel extends TypesDirectoryPanel<AbstractSchemaTO, Schem
}
@Override
- protected List<IColumn<AbstractSchemaTO, String>> getColumns() {
- final List<IColumn<AbstractSchemaTO, String>> columns = new ArrayList<>();
+ protected List<IColumn<SchemaTO, String>> getColumns() {
+ final List<IColumn<SchemaTO, String>> columns = new ArrayList<>();
for (final String field : COL_NAMES.get(schemaType)) {
final Field clazzField = ReflectionUtils.findField(schemaType.getToClass(), field);
if (clazzField != null) {
if (clazzField.getType().equals(Boolean.class) || clazzField.getType().equals(boolean.class)) {
- columns.add(new BooleanPropertyColumn<AbstractSchemaTO>(new ResourceModel(field), field, field));
+ columns.add(new BooleanPropertyColumn<SchemaTO>(new ResourceModel(field), field, field));
} else {
- final IColumn<AbstractSchemaTO, String> column = new PropertyColumn<AbstractSchemaTO, String>(
+ final IColumn<SchemaTO, String> column = new PropertyColumn<SchemaTO, String>(
new ResourceModel(field), field, field) {
private static final long serialVersionUID = 3282547854226892169L;
@@ -183,24 +183,24 @@ public class SchemaTypePanel extends TypesDirectoryPanel<AbstractSchemaTO, Schem
}
@Override
- public ActionsPanel<AbstractSchemaTO> getActions(final IModel<AbstractSchemaTO> model) {
- final ActionsPanel<AbstractSchemaTO> panel = super.getActions(model);
- panel.add(new ActionLink<AbstractSchemaTO>() {
+ public ActionsPanel<SchemaTO> getActions(final IModel<SchemaTO> model) {
+ final ActionsPanel<SchemaTO> panel = super.getActions(model);
+ panel.add(new ActionLink<SchemaTO>() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
- public void onClick(final AjaxRequestTarget target, final AbstractSchemaTO ignore) {
+ public void onClick(final AjaxRequestTarget target, final SchemaTO ignore) {
send(SchemaTypePanel.this, Broadcast.EXACT,
new AjaxWizard.EditItemActionEvent<>(model.getObject(), target));
}
}, ActionLink.ActionType.EDIT, StandardEntitlement.SCHEMA_UPDATE);
- panel.add(new ActionLink<AbstractSchemaTO>() {
+ panel.add(new ActionLink<SchemaTO>() {
private static final long serialVersionUID = -3722207913631435501L;
@Override
- public void onClick(final AjaxRequestTarget target, final AbstractSchemaTO ignore) {
+ public void onClick(final AjaxRequestTarget target, final SchemaTO ignore) {
try {
switch (schemaType) {
case DERIVED:
@@ -230,11 +230,11 @@ public class SchemaTypePanel extends TypesDirectoryPanel<AbstractSchemaTO, Schem
return panel;
}
- protected final class SchemaProvider extends DirectoryDataProvider<AbstractSchemaTO> {
+ protected final class SchemaProvider extends DirectoryDataProvider<SchemaTO> {
private static final long serialVersionUID = -185944053385660794L;
- private final SortableDataProviderComparator<AbstractSchemaTO> comparator;
+ private final SortableDataProviderComparator<SchemaTO> comparator;
private final SchemaType schemaType;
@@ -249,8 +249,8 @@ public class SchemaTypePanel extends TypesDirectoryPanel<AbstractSchemaTO, Schem
}
@Override
- public Iterator<AbstractSchemaTO> iterator(final long first, final long count) {
- final List<AbstractSchemaTO> list = restClient.getSchemas(this.schemaType);
+ public Iterator<SchemaTO> iterator(final long first, final long count) {
+ final List<SchemaTO> list = restClient.getSchemas(this.schemaType);
Collections.sort(list, comparator);
if (SchemaType.PLAIN == this.schemaType) {
@@ -264,8 +264,8 @@ public class SchemaTypePanel extends TypesDirectoryPanel<AbstractSchemaTO, Schem
}
}, configurations);
- final List<AbstractSchemaTO> res = new ArrayList<>();
- for (AbstractSchemaTO item : list) {
+ final List<SchemaTO> res = new ArrayList<>();
+ for (SchemaTO item : list) {
if (!configurations.contains(item.getKey())) {
res.add(item);
}
@@ -285,7 +285,7 @@ public class SchemaTypePanel extends TypesDirectoryPanel<AbstractSchemaTO, Schem
}
@Override
- public IModel<AbstractSchemaTO> model(final AbstractSchemaTO object) {
+ public IModel<SchemaTO> model(final SchemaTO object) {
return new CompoundPropertyModel<>(object);
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java b/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
index 6db536b..edf934f 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/panels/TogglePanel.java
@@ -30,7 +30,7 @@ import org.apache.syncope.client.console.wizards.any.AnyWrapper;
import org.apache.syncope.client.console.wizards.any.GroupWrapper;
import org.apache.syncope.client.console.wizards.any.UserWrapper;
import org.apache.syncope.client.console.wizards.resources.ResourceProvision;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.to.AccessTokenTO;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.apache.syncope.common.lib.to.AttrTO;
@@ -39,7 +39,7 @@ import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.GroupTO;
import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.ReportTO;
-import org.apache.syncope.common.lib.to.SchedTaskTO;
+import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
import org.apache.syncope.common.lib.to.SecurityQuestionTO;
import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.to.WorkflowDefinitionTO;
@@ -194,8 +194,8 @@ public abstract class TogglePanel<T extends Serializable> extends WizardMgtPanel
key = ((ReportTO) modelObject).getKey();
} else if (modelObject instanceof AttrTO) {
key = ((AttrTO) modelObject).getSchemaInfo().getKey();
- } else if (modelObject instanceof AbstractPolicyTO) {
- key = ((AbstractPolicyTO) modelObject).getKey();
+ } else if (modelObject instanceof PolicyTO) {
+ key = ((PolicyTO) modelObject).getKey();
} else if (modelObject instanceof SecurityQuestionTO) {
key = ((SecurityQuestionTO) modelObject).getKey();
} else if (modelObject instanceof AccessTokenTO) {
@@ -204,8 +204,8 @@ public abstract class TogglePanel<T extends Serializable> extends WizardMgtPanel
key = ((ExecTO) modelObject).getKey();
} else if (modelObject instanceof WorkflowDefinitionTO) {
key = ((WorkflowDefinitionTO) modelObject).getKey();
- } else if (modelObject instanceof SchedTaskTO) {
- key = ((SchedTaskTO) modelObject).getKey();
+ } else if (modelObject instanceof ProvisioningTaskTO) {
+ key = ((ProvisioningTaskTO) modelObject).getKey();
} else if (modelObject instanceof WorkflowFormTO) {
key = ((WorkflowFormTO) modelObject).getKey();
} else if (modelObject instanceof EntityTO) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
index 166b9e2..e54af9d 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyDirectoryPanel.java
@@ -42,7 +42,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
import org.apache.syncope.client.console.wizards.AjaxWizard;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -60,7 +60,7 @@ import org.apache.wicket.model.StringResourceModel;
*
* @param <T> policy type.
*/
-public abstract class PolicyDirectoryPanel<T extends AbstractPolicyTO>
+public abstract class PolicyDirectoryPanel<T extends PolicyTO>
extends DirectoryPanel<T, T, DirectoryDataProvider<T>, PolicyRestClient> {
private static final long serialVersionUID = 4984337552918213290L;
@@ -140,7 +140,7 @@ public abstract class PolicyDirectoryPanel<T extends AbstractPolicyTO>
private static final long serialVersionUID = -3722207913631435501L;
@Override
- public void onClick(final AjaxRequestTarget target, final AbstractPolicyTO ignore) {
+ public void onClick(final AjaxRequestTarget target, final PolicyTO ignore) {
send(PolicyDirectoryPanel.this, Broadcast.EXACT,
new AjaxWizard.EditItemActionEvent<>(
restClient.getPolicy(model.getObject().getKey()), target));
@@ -152,8 +152,8 @@ public abstract class PolicyDirectoryPanel<T extends AbstractPolicyTO>
private static final long serialVersionUID = -3722207913631435501L;
@Override
- public void onClick(final AjaxRequestTarget target, final AbstractPolicyTO ignore) {
- final AbstractPolicyTO clone = SerializationUtils.clone(model.getObject());
+ public void onClick(final AjaxRequestTarget target, final PolicyTO ignore) {
+ final PolicyTO clone = SerializationUtils.clone(model.getObject());
clone.setKey(null);
send(PolicyDirectoryPanel.this, Broadcast.EXACT,
new AjaxWizard.EditItemActionEvent<>(clone, target));
@@ -167,7 +167,7 @@ public abstract class PolicyDirectoryPanel<T extends AbstractPolicyTO>
private static final long serialVersionUID = -3722207913631435501L;
@Override
- public void onClick(final AjaxRequestTarget target, final AbstractPolicyTO ignore) {
+ public void onClick(final AjaxRequestTarget target, final PolicyTO ignore) {
final T policyTO = model.getObject();
try {
restClient.delete(policyTO.getKey());
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
index 7507d04..bec070a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyModalPanelBuilder.java
@@ -38,7 +38,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPa
import org.apache.syncope.client.console.wicket.markup.html.form.FieldPanel;
import org.apache.syncope.client.console.wizards.AbstractModalPanelBuilder;
import org.apache.syncope.client.console.wizards.AjaxWizard;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.policy.AccountPolicyTO;
import org.apache.syncope.common.lib.policy.PasswordPolicyTO;
import org.apache.syncope.common.lib.to.ResourceTO;
@@ -52,7 +52,7 @@ import org.apache.wicket.model.LoadableDetachableModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.model.util.ListModel;
-public class PolicyModalPanelBuilder<T extends AbstractPolicyTO> extends AbstractModalPanelBuilder<T> {
+public class PolicyModalPanelBuilder<T extends PolicyTO> extends AbstractModalPanelBuilder<T> {
private static final long serialVersionUID = 5945391813567245081L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
index fd3c72e..aa98ea5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleDirectoryPanel.java
@@ -45,7 +45,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
import org.apache.syncope.client.console.wizards.AjaxWizard;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.policy.RuleConf;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.wicket.PageReference;
@@ -70,7 +70,7 @@ import org.apache.wicket.model.StringResourceModel;
*
* @param <T> policy type.
*/
-public class PolicyRuleDirectoryPanel<T extends AbstractPolicyTO> extends DirectoryPanel<
+public class PolicyRuleDirectoryPanel<T extends PolicyTO> extends DirectoryPanel<
PolicyRuleWrapper, PolicyRuleWrapper, DirectoryDataProvider<PolicyRuleWrapper>, PolicyRestClient>
implements ModalPanel {
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
index 698c3f5..6148994 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicyRuleWizardBuilder.java
@@ -30,7 +30,7 @@ import org.apache.syncope.client.console.rest.PolicyRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownChoicePanel;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.policy.ComposablePolicy;
import org.apache.syncope.common.lib.policy.RuleConf;
import org.apache.syncope.common.lib.types.PolicyType;
@@ -68,7 +68,7 @@ public class PolicyRuleWizardBuilder
BeanWrapper wrapper = PropertyAccessorFactory.forBeanPropertyAccess(modelObject.getConf());
wrapper.setPropertyValue("name", modelObject.getName());
- AbstractPolicyTO policyTO = restClient.getPolicy(policy);
+ PolicyTO policyTO = restClient.getPolicy(policy);
final ComposablePolicy<RuleConf> composable;
if (policyTO instanceof ComposablePolicy) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
index 57b3616..6cdf72c 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/policies/PolicySpecModalPanel.java
@@ -42,7 +42,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownCho
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
import org.apache.syncope.client.console.wicket.markup.html.form.MultiPanel;
import org.apache.syncope.common.lib.policy.PullPolicyTO;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.ConflictResolutionAction;
import org.apache.syncope.common.lib.types.SchemaType;
@@ -277,16 +277,15 @@ public class PolicySpecModalPanel extends AbstractModalPanel<PullPolicyTO> {
private static List<String> getPlainSchemas(final CorrelationRule rule) {
final List<String> choices = StringUtils.isEmpty(rule.getAny())
? new ArrayList<String>()
- : CollectionUtils.collect(
- new SchemaRestClient().getSchemas(SchemaType.PLAIN,
+ : CollectionUtils.collect(new SchemaRestClient().getSchemas(SchemaType.PLAIN,
rule.getAny().equals(AnyTypeKind.USER.name())
? AnyTypeKind.USER
: rule.getAny().equals(AnyTypeKind.GROUP.name())
? AnyTypeKind.GROUP
- : AnyTypeKind.ANY_OBJECT), new Transformer<AbstractSchemaTO, String>() {
+ : AnyTypeKind.ANY_OBJECT), new Transformer<SchemaTO, String>() {
@Override
- public String transform(final AbstractSchemaTO input) {
+ public String transform(final SchemaTO input) {
return input.getKey();
}
}, new ArrayList<String>());
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
index 759600e..6b0619e 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/PolicyRestClient.java
@@ -23,7 +23,7 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.rest.api.service.PolicyService;
@@ -34,7 +34,7 @@ public class PolicyRestClient extends BaseRestClient {
private static final long serialVersionUID = -1392090291817187902L;
- public <T extends AbstractPolicyTO> T getPolicy(final String key) {
+ public <T extends PolicyTO> T getPolicy(final String key) {
T policy = null;
try {
policy = getService(PolicyService.class).read(key);
@@ -45,7 +45,7 @@ public class PolicyRestClient extends BaseRestClient {
}
@SuppressWarnings("unchecked")
- public <T extends AbstractPolicyTO> List<T> getPolicies(final PolicyType type) {
+ public <T extends PolicyTO> List<T> getPolicies(final PolicyType type) {
final List<T> res = new ArrayList<>();
try {
@@ -58,11 +58,11 @@ public class PolicyRestClient extends BaseRestClient {
return res;
}
- public <T extends AbstractPolicyTO> void createPolicy(final T policy) {
+ public <T extends PolicyTO> void createPolicy(final T policy) {
getService(PolicyService.class).create(policy);
}
- public <T extends AbstractPolicyTO> void updatePolicy(final T policy) {
+ public <T extends PolicyTO> void updatePolicy(final T policy) {
getService(PolicyService.class).update(policy);
}
@@ -70,12 +70,12 @@ public class PolicyRestClient extends BaseRestClient {
getService(PolicyService.class).delete(key);
}
- private class PolicyComparator implements Comparator<AbstractPolicyTO>, Serializable {
+ private class PolicyComparator implements Comparator<PolicyTO>, Serializable {
private static final long serialVersionUID = -4921433085213223115L;
@Override
- public int compare(final AbstractPolicyTO left, final AbstractPolicyTO right) {
+ public int compare(final PolicyTO left, final PolicyTO right) {
return left == null ? -1 : right == null ? 1 : left.getDescription().compareTo(right.getDescription());
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
index 600afb3..b902715 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/SchemaRestClient.java
@@ -23,7 +23,7 @@ import java.util.List;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.EntityTOUtils;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.to.AnyTypeTO;
import org.apache.syncope.common.lib.to.DerSchemaTO;
import org.apache.syncope.common.lib.to.PlainSchemaTO;
@@ -41,7 +41,7 @@ public class SchemaRestClient extends BaseRestClient {
private static final long serialVersionUID = -2479730152700312373L;
- public <T extends AbstractSchemaTO> List<T> getSchemas(final SchemaType schemaType, final AnyTypeKind kind) {
+ public <T extends SchemaTO> List<T> getSchemas(final SchemaType schemaType, final AnyTypeKind kind) {
final AnyTypeService client = getService(AnyTypeService.class);
final List<String> classes = new ArrayList<>();
@@ -65,7 +65,7 @@ public class SchemaRestClient extends BaseRestClient {
return getSchemas(schemaType, classes.toArray(new String[] {}));
}
- public <T extends AbstractSchemaTO> List<T> getSchemas(final SchemaType schemaType, final String typeName) {
+ public <T extends SchemaTO> List<T> getSchemas(final SchemaType schemaType, final String typeName) {
AnyTypeTO type = null;
try {
@@ -81,7 +81,7 @@ public class SchemaRestClient extends BaseRestClient {
}
}
- public <T extends AbstractSchemaTO> List<T> getSchemas(final SchemaType schemaType, final String... kind) {
+ public <T extends SchemaTO> List<T> getSchemas(final SchemaType schemaType, final String... kind) {
List<T> schemas = new ArrayList<>();
try {
@@ -103,7 +103,7 @@ public class SchemaRestClient extends BaseRestClient {
try {
CollectionUtils.collect(getSchemas(schemaType),
- EntityTOUtils.<AbstractSchemaTO>keyTransformer(), schemaNames);
+ EntityTOUtils.<SchemaTO>keyTransformer(), schemaNames);
} catch (SyncopeClientException e) {
LOG.error("While getting all user schema names", e);
}
@@ -128,11 +128,11 @@ public class SchemaRestClient extends BaseRestClient {
}
- public void create(final SchemaType schemaType, final AbstractSchemaTO modelObject) {
+ public void create(final SchemaType schemaType, final SchemaTO modelObject) {
getService(SchemaService.class).create(schemaType, modelObject);
}
- public void update(final SchemaType schemaType, final AbstractSchemaTO modelObject) {
+ public void update(final SchemaType schemaType, final SchemaTO modelObject) {
getService(SchemaService.class).update(schemaType, modelObject);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java b/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
index be0929b..ced4689 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/rest/TaskRestClient.java
@@ -20,7 +20,7 @@ package org.apache.syncope.client.console.rest;
import java.util.Date;
import java.util.List;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.BulkAction;
import org.apache.syncope.common.lib.to.BulkActionResult;
import org.apache.syncope.common.lib.to.NotificationTaskTO;
@@ -134,7 +134,7 @@ public class TaskRestClient extends BaseRestClient implements ExecutionRestClien
}
@SuppressWarnings("unchecked")
- public <T extends AbstractTaskTO> List<T> list(
+ public <T extends TaskTO> List<T> list(
final Class<T> reference, final int page, final int size, final SortParam<String> sort) {
return (List<T>) getService(TaskService.class).
@@ -144,7 +144,7 @@ public class TaskRestClient extends BaseRestClient implements ExecutionRestClien
}
@SuppressWarnings("unchecked")
- public <T extends AbstractTaskTO> List<T> list(
+ public <T extends TaskTO> List<T> list(
final String resource,
final Class<T> reference,
final int page,
@@ -194,7 +194,7 @@ public class TaskRestClient extends BaseRestClient implements ExecutionRestClien
return getService(TaskService.class).read(taskKey, false);
}
- public void delete(final String taskKey, final Class<? extends AbstractTaskTO> taskToClass) {
+ public void delete(final String taskKey, final Class<? extends TaskTO> taskToClass) {
getService(TaskService.class).delete(taskKey);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/tasks/ProvisioningTaskDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/ProvisioningTaskDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/ProvisioningTaskDirectoryPanel.java
index 0fa0f7b..ff45a0a 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/ProvisioningTaskDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/ProvisioningTaskDirectoryPanel.java
@@ -27,7 +27,7 @@ import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.
import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.DatePropertyColumn;
import org.apache.syncope.client.console.wicket.extensions.markup.html.repeater.data.table.KeyPropertyColumn;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.AbstractProvisioningTaskTO;
+import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
import org.apache.syncope.common.lib.to.PullTaskTO;
import org.apache.syncope.common.lib.to.PushTaskTO;
import org.apache.syncope.common.lib.types.TaskType;
@@ -41,7 +41,7 @@ import org.apache.wicket.model.StringResourceModel;
*
* @param <T> Sched task type.
*/
-public abstract class ProvisioningTaskDirectoryPanel<T extends AbstractProvisioningTaskTO>
+public abstract class ProvisioningTaskDirectoryPanel<T extends ProvisioningTaskTO>
extends SchedTaskDirectoryPanel<T> {
private static final long serialVersionUID = 4984337552918213290L;
@@ -104,7 +104,7 @@ public abstract class ProvisioningTaskDirectoryPanel<T extends AbstractProvision
return columns;
}
- protected class ProvisioningTasksProvider<T extends AbstractProvisioningTaskTO> extends SchedTasksProvider<T> {
+ protected class ProvisioningTasksProvider<T extends ProvisioningTaskTO> extends SchedTasksProvider<T> {
private static final long serialVersionUID = 4725679400450513556L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskWizardBuilder.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskWizardBuilder.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskWizardBuilder.java
index dccc22a..9075ac5 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskWizardBuilder.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/SchedTaskWizardBuilder.java
@@ -35,7 +35,7 @@ import org.apache.syncope.client.console.wicket.markup.html.form.AjaxDropDownCho
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxPalettePanel;
import org.apache.syncope.client.console.wicket.markup.html.form.AjaxTextFieldPanel;
import org.apache.syncope.client.console.wizards.AjaxWizardBuilder;
-import org.apache.syncope.common.lib.to.AbstractProvisioningTaskTO;
+import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
import org.apache.syncope.common.lib.to.SchedTaskTO;
import org.apache.syncope.common.lib.to.PullTaskTO;
import org.apache.syncope.common.lib.to.PushTaskTO;
@@ -265,7 +265,7 @@ public class SchedTaskWizardBuilder<T extends SchedTaskTO> extends AjaxWizardBui
WebMarkupContainer provisioningTaskSpecifics = new WebMarkupContainer("provisioningTaskSpecifics");
add(provisioningTaskSpecifics.setRenderBodyOnly(true));
- if (taskTO instanceof AbstractProvisioningTaskTO) {
+ if (taskTO instanceof ProvisioningTaskTO) {
jobDelegateClassName.setEnabled(false).setVisible(false);
} else {
provisioningTaskSpecifics.setEnabled(false).setVisible(false);
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/tasks/TaskDirectoryPanel.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/TaskDirectoryPanel.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/TaskDirectoryPanel.java
index 956afd6..56a17a9 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/TaskDirectoryPanel.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/TaskDirectoryPanel.java
@@ -27,7 +27,7 @@ import org.apache.syncope.client.console.panels.ModalPanel;
import org.apache.syncope.client.console.panels.MultilevelPanel;
import org.apache.syncope.client.console.rest.TaskRestClient;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.types.TaskType;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -41,7 +41,7 @@ import org.apache.wicket.model.IModel;
*
* @param <T> task type.
*/
-public abstract class TaskDirectoryPanel<T extends AbstractTaskTO>
+public abstract class TaskDirectoryPanel<T extends TaskTO>
extends DirectoryPanel<T, T, TaskDataProvider<T>, TaskRestClient> implements ModalPanel {
private static final long serialVersionUID = 4984337552918213290L;
@@ -66,7 +66,7 @@ public abstract class TaskDirectoryPanel<T extends AbstractTaskTO>
protected abstract void viewTask(T taskTO, AjaxRequestTarget target);
- protected abstract class TasksProvider<T extends AbstractTaskTO> extends DirectoryDataProvider<T> {
+ protected abstract class TasksProvider<T extends TaskTO> extends DirectoryDataProvider<T> {
private static final long serialVersionUID = -20112718133295756L;
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/client/console/src/main/java/org/apache/syncope/client/console/tasks/TaskExecutionDetails.java
----------------------------------------------------------------------
diff --git a/client/console/src/main/java/org/apache/syncope/client/console/tasks/TaskExecutionDetails.java b/client/console/src/main/java/org/apache/syncope/client/console/tasks/TaskExecutionDetails.java
index 263eca3..ef243f3 100644
--- a/client/console/src/main/java/org/apache/syncope/client/console/tasks/TaskExecutionDetails.java
+++ b/client/console/src/main/java/org/apache/syncope/client/console/tasks/TaskExecutionDetails.java
@@ -21,7 +21,7 @@ package org.apache.syncope.client.console.tasks;
import org.apache.syncope.client.console.panels.MultilevelPanel;
import org.apache.syncope.client.console.rest.TaskRestClient;
import org.apache.syncope.client.console.wicket.markup.html.bootstrap.dialog.BaseModal;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
@@ -30,7 +30,7 @@ import org.apache.wicket.ajax.AjaxRequestTarget;
*
* @param <T> actual type of task
*/
-public class TaskExecutionDetails<T extends AbstractTaskTO> extends MultilevelPanel.SecondLevel {
+public class TaskExecutionDetails<T extends TaskTO> extends MultilevelPanel.SecondLevel {
private static final long serialVersionUID = -4110576026663173545L;
[07/10] syncope git commit: [SYNCOPE-1262] Remove matrix parameters -
OpenApi wins :-(
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
index 751516d..e79c3f7 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
@@ -81,7 +81,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
@Test
public void read() {
PushTaskTO pushTaskTO = taskService.<PushTaskTO>read(
- "0bc11a19-6454-45c2-a4e3-ceef84e5d79b", true);
+ TaskType.PUSH, "0bc11a19-6454-45c2-a4e3-ceef84e5d79b", true);
assertEquals(UnmatchingRule.ASSIGN, pushTaskTO.getUnmatchingRule());
assertEquals(MatchingRule.UPDATE, pushTaskTO.getMatchingRule());
}
@@ -109,11 +109,11 @@ public class PushTaskITCase extends AbstractTaskITCase {
SyncopeClient.getGroupSearchConditionBuilder().isNotNull("cool").query());
task.setMatchingRule(MatchingRule.LINK);
- final Response response = taskService.create(task);
+ final Response response = taskService.create(TaskType.PUSH, task);
final PushTaskTO actual = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
assertNotNull(actual);
- task = taskService.read(actual.getKey(), true);
+ task = taskService.read(TaskType.PUSH, actual.getKey(), true);
assertNotNull(task);
assertEquals(task.getKey(), actual.getKey());
assertEquals(task.getJobDelegateClassName(), actual.getJobDelegateClassName());
@@ -130,7 +130,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
assertFalse(groupService.read("29f96485-729e-4d31-88a1-6fc60e4677f3").
getResources().contains(RESOURCE_NAME_LDAP));
- execProvisioningTask(taskService, "fd905ba5-9d56-4f51-83e2-859096a67b75", 50, false);
+ execProvisioningTask(taskService, TaskType.PUSH, "fd905ba5-9d56-4f51-83e2-859096a67b75", 50, false);
assertNotNull(resourceService.readConnObject(
RESOURCE_NAME_LDAP, AnyTypeKind.GROUP.name(), "29f96485-729e-4d31-88a1-6fc60e4677f3"));
@@ -155,7 +155,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
// ------------------------------------------
// Unmatching --> Assign --> dryRuyn
// ------------------------------------------
- execProvisioningTask(taskService, "af558be4-9d2f-4359-bf85-a554e6e90be1", 50, true);
+ execProvisioningTask(taskService, TaskType.PUSH, "af558be4-9d2f-4359-bf85-a554e6e90be1", 50, true);
assertEquals(0, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='vivaldi'").size());
assertFalse(userService.read("b3cbc78d-32e6-4bd4-92e0-bbe07566a2ee").
getResources().contains(RESOURCE_NAME_TESTDB2));
@@ -166,7 +166,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
pushTaskKeys.add("97f327b6-2eff-4d35-85e8-d581baaab855");
pushTaskKeys.add("03aa2a04-4881-4573-9117-753f81b04865");
pushTaskKeys.add("5e5f7c7e-9de7-4c6a-99f1-4df1af959807");
- execProvisioningTasks(taskService, pushTaskKeys, 50, false);
+ execProvisioningTasks(taskService, TaskType.PUSH, pushTaskKeys, 50, false);
// ------------------------------------------
// Unatching --> Ignore
@@ -217,7 +217,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
// ------------------------------------------
// Matching --> Deprovision --> dryRuyn
// ------------------------------------------
- execProvisioningTask(taskService, "c46edc3a-a18b-4af2-b707-f4a415507496", 50, true);
+ execProvisioningTask(taskService, TaskType.PUSH, "c46edc3a-a18b-4af2-b707-f4a415507496", 50, true);
assertTrue(userService.read("1417acbe-cbf6-4277-9372-e75e04f97000").
getResources().contains(RESOURCE_NAME_TESTDB2));
assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='rossini'").size());
@@ -228,7 +228,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
pushTaskKeys.add("c46edc3a-a18b-4af2-b707-f4a415507496");
pushTaskKeys.add("5e5f7c7e-9de7-4c6a-99f1-4df1af959807");
- execProvisioningTasks(taskService, pushTaskKeys, 50, false);
+ execProvisioningTasks(taskService, TaskType.PUSH, pushTaskKeys, 50, false);
// ------------------------------------------
// Matching --> Deprovision && Ignore
@@ -251,7 +251,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
// ------------------------------------------
// Matching --> Link
// ------------------------------------------
- execProvisioningTask(taskService, "51318433-cce4-4f71-8f45-9534b6c9c819", 50, false);
+ execProvisioningTask(taskService, TaskType.PUSH, "51318433-cce4-4f71-8f45-9534b6c9c819", 50, false);
assertTrue(userService.read("74cd8ece-715a-44a4-a736-e17b46c4e7e6").
getResources().contains(RESOURCE_NAME_TESTDB2));
assertEquals(1, jdbcTemplate.queryForList("SELECT ID FROM test2 WHERE ID='verdi'").size());
@@ -261,7 +261,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
pushTaskKeys.add("24b1be9c-7e3b-443a-86c9-798ebce5eaf2");
pushTaskKeys.add("375c7b7f-9e3a-4833-88c9-b7787b0a69f2");
- execProvisioningTasks(taskService, pushTaskKeys, 50, false);
+ execProvisioningTasks(taskService, TaskType.PUSH, pushTaskKeys, 50, false);
// ------------------------------------------
// Matching --> Unlink && Update
@@ -288,11 +288,11 @@ public class PushTaskITCase extends AbstractTaskITCase {
task.setPerformDelete(true);
task.setPerformUpdate(true);
- Response response = taskService.create(task);
+ Response response = taskService.create(TaskType.PUSH, task);
PushTaskTO pushTask = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
assertNotNull(pushTask);
- ExecTO exec = execProvisioningTask(taskService, pushTask.getKey(), 50, false);
+ ExecTO exec = execProvisioningTask(taskService, TaskType.PUSH, pushTask.getKey(), 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(exec.getStatus()));
// 2. check
@@ -375,12 +375,12 @@ public class PushTaskITCase extends AbstractTaskITCase {
task.getFilters().put(AnyTypeKind.GROUP.name(),
SyncopeClient.getGroupSearchConditionBuilder().is("name").equalTo(groupTO.getName()).query());
- response = taskService.create(task);
+ response = taskService.create(TaskType.PUSH, task);
PushTaskTO push = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
assertNotNull(push);
// execute the new task
- ExecTO exec = execProvisioningTask(taskService, push.getKey(), 50, false);
+ ExecTO exec = execProvisioningTask(taskService, TaskType.PUSH, push.getKey(), 50, false);
assertEquals(PropagationTaskExecStatus.SUCCESS, PropagationTaskExecStatus.valueOf(exec.getStatus()));
} finally {
groupService.delete(groupTO.getKey());
@@ -405,7 +405,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
task.setMatchingRule(MatchingRule.IGNORE);
task.setUnmatchingRule(UnmatchingRule.IGNORE);
- Response response = taskService.create(task);
+ Response response = taskService.create(TaskType.PUSH, task);
PushTaskTO actual = getObject(response.getLocation(), TaskService.class, PushTaskTO.class);
assertNotNull(actual);
@@ -429,7 +429,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
notification = getObject(responseNotification.getLocation(), NotificationService.class, NotificationTO.class);
assertNotNull(notification);
- execProvisioningTask(taskService, actual.getKey(), 50, false);
+ execProvisioningTask(taskService, TaskType.PUSH, actual.getKey(), 50, false);
NotificationTaskTO taskTO = findNotificationTask(notification.getKey(), 50);
assertNotNull(taskTO);
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
index bbe9ac5..94fe099 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/RealmITCase.java
@@ -37,6 +37,7 @@ import org.apache.syncope.common.lib.to.RealmTO;
import org.apache.syncope.common.lib.policy.DefaultAccountRuleConf;
import org.apache.syncope.common.lib.to.ProvisioningResult;
import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
import org.apache.syncope.common.rest.api.service.RealmService;
import org.apache.syncope.fit.AbstractITCase;
@@ -142,7 +143,7 @@ public class RealmITCase extends AbstractITCase {
ruleConf.setMaxLength(8);
policy.getRuleConfs().add(ruleConf);
- policy = createPolicy(policy);
+ policy = createPolicy(PolicyType.ACCOUNT, policy);
assertNotNull(policy);
// 2. create realm with policy assigned
@@ -158,7 +159,7 @@ public class RealmITCase extends AbstractITCase {
assertEquals(policy.getKey(), actual.getAccountPolicy());
// 3. remove policy
- policyService.delete(policy.getKey());
+ policyService.delete(PolicyType.ACCOUNT, policy.getKey());
// 4. verify
actual = getRealm(actual.getFullPath());
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
index 858a520..3ae3a6d 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
@@ -71,7 +71,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
@Test
public void update() {
- SchedTaskTO task = taskService.read(SCHED_TASK_KEY, true);
+ SchedTaskTO task = taskService.read(TaskType.SCHEDULED, SCHED_TASK_KEY, true);
assertNotNull(task);
SchedTaskTO taskMod = new SchedTaskTO();
@@ -79,8 +79,8 @@ public class SchedTaskITCase extends AbstractTaskITCase {
taskMod.setName(task.getName());
taskMod.setCronExpression(null);
- taskService.update(taskMod);
- SchedTaskTO actual = taskService.read(taskMod.getKey(), true);
+ taskService.update(TaskType.SCHEDULED, taskMod);
+ SchedTaskTO actual = taskService.read(TaskType.SCHEDULED, taskMod.getKey(), true);
assertNotNull(actual);
assertEquals(task.getKey(), actual.getKey());
assertNull(actual.getCronExpression());
@@ -93,7 +93,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
task.setName("deferred");
task.setJobDelegateClassName(TestSampleJobDelegate.class.getName());
- Response response = taskService.create(task);
+ Response response = taskService.create(TaskType.SCHEDULED, task);
task = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
assertNotNull(task);
@@ -112,7 +112,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
} catch (InterruptedException e) {
}
- task = taskService.read(task.getKey(), true);
+ task = taskService.read(TaskType.SCHEDULED, task.getKey(), true);
assertNotNull(task);
assertNotNull(task.getExecutions());
@@ -135,13 +135,13 @@ public class SchedTaskITCase extends AbstractTaskITCase {
task.setDescription("issueSYNCOPE144 Description");
task.setJobDelegateClassName(TestSampleJobDelegate.class.getName());
- Response response = taskService.create(task);
+ Response response = taskService.create(TaskType.SCHEDULED, task);
task = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
assertNotNull(task);
assertEquals("issueSYNCOPE144", task.getName());
assertEquals("issueSYNCOPE144 Description", task.getDescription());
- task = taskService.read(task.getKey(), true);
+ task = taskService.read(TaskType.SCHEDULED, task.getKey(), true);
assertNotNull(task);
assertEquals("issueSYNCOPE144", task.getName());
assertEquals("issueSYNCOPE144 Description", task.getDescription());
@@ -149,7 +149,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
task.setName("issueSYNCOPE144_2");
task.setDescription("issueSYNCOPE144 Description_2");
- response = taskService.create(task);
+ response = taskService.create(TaskType.SCHEDULED, task);
task = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
assertNotNull(task);
assertEquals("issueSYNCOPE144_2", task.getName());
@@ -166,7 +166,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
task.setDescription("issueSYNCOPE660 Description");
task.setJobDelegateClassName(TestSampleJobDelegate.class.getName());
- Response response = taskService.create(task);
+ Response response = taskService.create(TaskType.SCHEDULED, task);
task = getObject(response.getLocation(), TaskService.class, SchedTaskTO.class);
jobs = taskService.listJobs();
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
index 77e1072..166ed86 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserITCase.java
@@ -70,6 +70,7 @@ import org.apache.syncope.common.lib.to.UserTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.apache.syncope.common.lib.types.PatchOperation;
+import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
import org.apache.syncope.common.lib.types.ResourceAssociationAction;
import org.apache.syncope.common.lib.types.ResourceDeassociationAction;
@@ -262,7 +263,7 @@ public class UserITCase extends AbstractITCase {
assertFalse(tasks.getResult().isEmpty());
String maxKey = tasks.getResult().iterator().next().getKey();
- PropagationTaskTO taskTO = taskService.read(maxKey, true);
+ PropagationTaskTO taskTO = taskService.read(TaskType.PROPAGATION, maxKey, true);
assertNotNull(taskTO);
int maxTaskExecutions = taskTO.getExecutions().size();
@@ -310,7 +311,7 @@ public class UserITCase extends AbstractITCase {
assertEquals(newMaxKey, maxKey);
// get last task
- taskTO = taskService.read(newMaxKey, true);
+ taskTO = taskService.read(TaskType.PROPAGATION, newMaxKey, true);
assertNotNull(taskTO);
assertEquals(maxTaskExecutions, taskTO.getExecutions().size());
@@ -662,7 +663,7 @@ public class UserITCase extends AbstractITCase {
// all update executions have to be registered
newMaxKey = tasks.getResult().iterator().next().getKey();
- PropagationTaskTO taskTO = taskService.read(newMaxKey, true);
+ PropagationTaskTO taskTO = taskService.read(TaskType.PROPAGATION, newMaxKey, true);
assertNotNull(taskTO);
assertEquals(1, taskTO.getExecutions().size());
@@ -928,13 +929,13 @@ public class UserITCase extends AbstractITCase {
AccountPolicyTO accountPolicy = new AccountPolicyTO();
accountPolicy.setDescription("Account Policy with custom rules");
accountPolicy.getRuleConfs().add(new TestAccountRuleConf());
- accountPolicy = createPolicy(accountPolicy);
+ accountPolicy = createPolicy(PolicyType.ACCOUNT, accountPolicy);
assertNotNull(accountPolicy);
PasswordPolicyTO passwordPolicy = new PasswordPolicyTO();
passwordPolicy.setDescription("Password Policy with custom rules");
passwordPolicy.getRuleConfs().add(new TestPasswordRuleConf());
- passwordPolicy = createPolicy(passwordPolicy);
+ passwordPolicy = createPolicy(PolicyType.PASSWORD, passwordPolicy);
assertNotNull(passwordPolicy);
RealmTO realm = realmService.list("/even/two").get(0);
@@ -972,8 +973,8 @@ public class UserITCase extends AbstractITCase {
realm.setPasswordPolicy(oldPasswordPolicy);
realmService.update(realm);
- policyService.delete(passwordPolicy.getKey());
- policyService.delete(accountPolicy.getKey());
+ policyService.delete(PolicyType.PASSWORD, passwordPolicy.getKey());
+ policyService.delete(PolicyType.ACCOUNT, accountPolicy.getKey());
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/6bc2cac1/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
index 716300e..f785884 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/UserIssuesITCase.java
@@ -67,6 +67,7 @@ import org.apache.syncope.common.lib.types.CipherAlgorithm;
import org.apache.syncope.common.lib.types.ClientExceptionType;
import org.apache.syncope.common.lib.types.MappingPurpose;
import org.apache.syncope.common.lib.types.PatchOperation;
+import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.lib.types.PropagationTaskExecStatus;
import org.apache.syncope.core.provisioning.java.propagation.DBPasswordPropagationActions;
import org.apache.syncope.core.provisioning.java.propagation.LDAPPasswordPropagationActions;
@@ -1192,7 +1193,7 @@ public class UserIssuesITCase extends AbstractITCase {
ruleConf.setUsernameAllowed(false);
passwordPolicy.getRuleConfs().add(ruleConf);
- passwordPolicy = createPolicy(passwordPolicy);
+ passwordPolicy = createPolicy(PolicyType.PASSWORD, passwordPolicy);
assertNotNull(passwordPolicy);
RealmTO realm = realmService.list("/even/two").get(0);
@@ -1219,7 +1220,7 @@ public class UserIssuesITCase extends AbstractITCase {
realm.setPasswordPolicy(oldPasswordPolicy);
realmService.update(realm);
- policyService.delete(passwordPolicy.getKey());
+ policyService.delete(PolicyType.PASSWORD, passwordPolicy.getKey());
}
}
[03/10] syncope git commit: [SYNCOPE-1274] Using Swagger annotations
for TO hierarchies
Posted by il...@apache.org.
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java
index 90748ec..656cd07 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchedTaskTO.java
@@ -18,16 +18,21 @@
*/
package org.apache.syncope.common.lib.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
-
+import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;
@XmlRootElement(name = "schedTask")
@XmlType
-@XmlSeeAlso(AbstractProvisioningTaskTO.class)
-public class SchedTaskTO extends AbstractTaskTO {
+@XmlSeeAlso({ ProvisioningTaskTO.class })
+@ApiModel(parent = TaskTO.class, subTypes = { ProvisioningTaskTO.class }, discriminator = "@class")
+public class SchedTaskTO extends TaskTO {
private static final long serialVersionUID = -5722284116974636425L;
@@ -47,6 +52,14 @@ public class SchedTaskTO extends AbstractTaskTO {
private boolean active = true;
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.to.SchedTaskTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
public Date getStartAt() {
return startAt == null ? null : new Date(startAt.getTime());
}
@@ -71,6 +84,7 @@ public class SchedTaskTO extends AbstractTaskTO {
this.jobDelegateClassName = jobDelegateClassName;
}
+ @ApiModelProperty(readOnly = true)
public Date getLastExec() {
return lastExec == null ? null : new Date(lastExec.getTime());
}
@@ -79,6 +93,7 @@ public class SchedTaskTO extends AbstractTaskTO {
this.lastExec = lastExec == null ? null : new Date(lastExec.getTime());
}
+ @ApiModelProperty(readOnly = true)
public Date getNextExec() {
return nextExec == null ? null : new Date(nextExec.getTime());
}
@@ -99,6 +114,8 @@ public class SchedTaskTO extends AbstractTaskTO {
return name;
}
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public void setName(final String name) {
this.name = name;
}
@@ -110,5 +127,4 @@ public class SchedTaskTO extends AbstractTaskTO {
public void setActive(final boolean active) {
this.active = active;
}
-
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchemaTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchemaTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchemaTO.java
new file mode 100644
index 0000000..b5ff3aa
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/SchemaTO.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import javax.ws.rs.PathParam;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import org.apache.syncope.common.lib.AbstractBaseBean;
+
+@XmlRootElement(name = "schema")
+@XmlType
+@XmlSeeAlso({ PlainSchemaTO.class, DerSchemaTO.class, VirSchemaTO.class })
+@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "@class")
+@JsonPropertyOrder(value = { "@class", "key" })
+@ApiModel(subTypes = { PlainSchemaTO.class, DerSchemaTO.class, VirSchemaTO.class }, discriminator = "@class")
+public abstract class SchemaTO extends AbstractBaseBean implements EntityTO {
+
+ private static final long serialVersionUID = 4088388951694301759L;
+
+ @XmlTransient
+ @JsonProperty("@class")
+ private String discriminator;
+
+ private String key;
+
+ private String anyTypeClass;
+
+ @ApiModelProperty(name = "@class", required = true, readOnly = false)
+ public abstract String getDiscriminator();
+
+ public void setDiscriminator(final String discriminator) {
+ // do nothing
+ }
+
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @PathParam("key")
+ @Override
+ public void setKey(final String key) {
+ this.key = key;
+ }
+
+ public String getAnyTypeClass() {
+ return anyTypeClass;
+ }
+
+ public void setAnyTypeClass(final String anyTypeClass) {
+ this.anyTypeClass = anyTypeClass;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/TaskTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/TaskTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/TaskTO.java
new file mode 100644
index 0000000..f7aab55
--- /dev/null
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/TaskTO.java
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.common.lib.to;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.ws.rs.PathParam;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlElementWrapper;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "task")
+@XmlType
+@XmlSeeAlso({ PropagationTaskTO.class, ProvisioningTaskTO.class, NotificationTaskTO.class })
+@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "@class")
+@JsonPropertyOrder(value = { "@class", "key" })
+@ApiModel(
+ subTypes = { PropagationTaskTO.class, ProvisioningTaskTO.class, NotificationTaskTO.class },
+ discriminator = "@class")
+public abstract class TaskTO extends AbstractStartEndBean implements EntityTO {
+
+ private static final long serialVersionUID = 386450127003321197L;
+
+ @XmlTransient
+ @JsonProperty("@class")
+ private String discriminator;
+
+ private String key;
+
+ private String latestExecStatus;
+
+ private final List<ExecTO> executions = new ArrayList<>();
+
+ @ApiModelProperty(name = "@class", required = true, readOnly = false)
+ public abstract String getDiscriminator();
+
+ public void setDiscriminator(final String discriminator) {
+ // do nothing
+ }
+
+ @ApiModelProperty(readOnly = true)
+ @Override
+ public String getKey() {
+ return key;
+ }
+
+ @PathParam("key")
+ @Override
+ public void setKey(final String key) {
+ this.key = key;
+ }
+
+ @ApiModelProperty(readOnly = true)
+ public String getLatestExecStatus() {
+ return latestExecStatus;
+ }
+
+ public void setLatestExecStatus(final String latestExecStatus) {
+ this.latestExecStatus = latestExecStatus;
+ }
+
+ @ApiModelProperty(readOnly = true)
+ @XmlElementWrapper(name = "executions")
+ @XmlElement(name = "execution")
+ @JsonProperty("executions")
+ public List<ExecTO> getExecutions() {
+ return executions;
+ }
+}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
index 5efe6a5..1f0fa4d 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/UserTO.java
@@ -20,6 +20,8 @@ package org.apache.syncope.common.lib.to;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -34,6 +36,7 @@ import org.apache.syncope.common.lib.types.AnyTypeKind;
@XmlRootElement(name = "user")
@XmlType
+@ApiModel(parent = AnyTO.class)
public class UserTO extends AnyTO implements GroupableRelatableTO {
private static final long serialVersionUID = 7791304495192615740L;
@@ -71,6 +74,13 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
private final List<MembershipTO> dynMemberships = new ArrayList<>();
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.to.UserTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
@Override
public String getType() {
return AnyTypeKind.USER.name();
@@ -96,6 +106,7 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
return roles;
}
+ @ApiModelProperty(readOnly = true)
@XmlElementWrapper(name = "dynRoles")
@XmlElement(name = "role")
@JsonProperty("dynRoles")
@@ -103,6 +114,7 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
return dynRoles;
}
+ @ApiModelProperty(readOnly = true)
public String getToken() {
return token;
}
@@ -111,6 +123,7 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
this.token = token;
}
+ @ApiModelProperty(readOnly = true)
public Date getTokenExpireTime() {
if (tokenExpireTime != null) {
return new Date(tokenExpireTime.getTime());
@@ -126,6 +139,8 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
}
}
+ @JsonProperty(required = true)
+ @XmlElement(required = true)
public String getUsername() {
return username;
}
@@ -134,6 +149,7 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
this.username = username;
}
+ @ApiModelProperty(readOnly = true)
public Date getChangePwdDate() {
if (changePwdDate != null) {
return new Date(changePwdDate.getTime());
@@ -141,10 +157,12 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
return null;
}
+ @ApiModelProperty(readOnly = true)
public Integer getFailedLogins() {
return failedLogins;
}
+ @ApiModelProperty(readOnly = true)
public Date getLastLoginDate() {
if (lastLoginDate != null) {
return new Date(lastLoginDate.getTime());
@@ -188,6 +206,7 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
this.securityAnswer = securityAnswer;
}
+ @ApiModelProperty(readOnly = true)
public boolean isSuspended() {
return suspended;
}
@@ -196,6 +215,7 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
this.suspended = suspended;
}
+ @ApiModelProperty(readOnly = true)
public boolean isMustChangePassword() {
return mustChangePassword;
}
@@ -244,6 +264,7 @@ public class UserTO extends AnyTO implements GroupableRelatableTO {
return memberships;
}
+ @ApiModelProperty(readOnly = true)
@XmlElementWrapper(name = "dynMemberships")
@XmlElement(name = "dynMembership")
@JsonProperty("dynMemberships")
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/to/VirSchemaTO.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/to/VirSchemaTO.java b/common/lib/src/main/java/org/apache/syncope/common/lib/to/VirSchemaTO.java
index 1f10e6b..54d5f8e 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/to/VirSchemaTO.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/to/VirSchemaTO.java
@@ -18,10 +18,15 @@
*/
package org.apache.syncope.common.lib.to;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlTransient;
-@XmlRootElement(name = "virtualSchema")
-public class VirSchemaTO extends AbstractSchemaTO {
+@XmlRootElement(name = "virSchema")
+@ApiModel(parent = SchemaTO.class)
+public class VirSchemaTO extends SchemaTO {
private static final long serialVersionUID = -8198557479659701343L;
@@ -33,6 +38,14 @@ public class VirSchemaTO extends AbstractSchemaTO {
private String extAttrName;
+ @XmlTransient
+ @JsonProperty("@class")
+ @ApiModelProperty(name = "@class", required = true, example = "org.apache.syncope.common.lib.to.VirSchemaTO")
+ @Override
+ public String getDiscriminator() {
+ return getClass().getName();
+ }
+
public boolean isReadonly() {
return readonly;
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/lib/src/main/java/org/apache/syncope/common/lib/types/SchemaType.java
----------------------------------------------------------------------
diff --git a/common/lib/src/main/java/org/apache/syncope/common/lib/types/SchemaType.java b/common/lib/src/main/java/org/apache/syncope/common/lib/types/SchemaType.java
index 673666d..82f17ee 100644
--- a/common/lib/src/main/java/org/apache/syncope/common/lib/types/SchemaType.java
+++ b/common/lib/src/main/java/org/apache/syncope/common/lib/types/SchemaType.java
@@ -19,7 +19,7 @@
package org.apache.syncope.common.lib.types;
import javax.xml.bind.annotation.XmlEnum;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.to.DerSchemaTO;
import org.apache.syncope.common.lib.to.PlainSchemaTO;
import org.apache.syncope.common.lib.to.VirSchemaTO;
@@ -40,17 +40,17 @@ public enum SchemaType {
*/
VIRTUAL(VirSchemaTO.class);
- private final Class<? extends AbstractSchemaTO> toClass;
+ private final Class<? extends SchemaTO> toClass;
- SchemaType(final Class<? extends AbstractSchemaTO> toClass) {
+ SchemaType(final Class<? extends SchemaTO> toClass) {
this.toClass = toClass;
}
- public Class<? extends AbstractSchemaTO> getToClass() {
+ public Class<? extends SchemaTO> getToClass() {
return toClass;
}
- public static SchemaType fromToClass(final Class<? extends AbstractSchemaTO> toClass) {
+ public static SchemaType fromToClass(final Class<? extends SchemaTO> toClass) {
SchemaType schemaType = null;
if (PlainSchemaTO.class.equals(toClass)) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/rest-api/pom.xml
----------------------------------------------------------------------
diff --git a/common/rest-api/pom.xml b/common/rest-api/pom.xml
index 4c7ed38..9847c53 100644
--- a/common/rest-api/pom.xml
+++ b/common/rest-api/pom.xml
@@ -47,11 +47,6 @@ under the License.
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
</dependency>
-
- <dependency>
- <groupId>io.swagger</groupId>
- <artifactId>swagger-annotations</artifactId>
- </dependency>
<dependency>
<groupId>org.apache.syncope.common</groupId>
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
index a8ca01c..e9f9b1a 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/PolicyService.java
@@ -33,7 +33,7 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.types.PolicyType;
/**
@@ -55,7 +55,7 @@ public interface PolicyService extends JAXRSService {
@GET
@Path("{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- <T extends AbstractPolicyTO> T read(@NotNull @PathParam("key") String key);
+ <T extends PolicyTO> T read(@NotNull @PathParam("key") String key);
/**
* Returns a list of policies of the matching type.
@@ -66,7 +66,7 @@ public interface PolicyService extends JAXRSService {
*/
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- <T extends AbstractPolicyTO> List<T> list(@NotNull @MatrixParam("type") PolicyType type);
+ <T extends PolicyTO> List<T> list(@NotNull @MatrixParam("type") PolicyType type);
/**
* Create a new policy.
@@ -77,7 +77,7 @@ public interface PolicyService extends JAXRSService {
@POST
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response create(@NotNull AbstractPolicyTO policyTO);
+ Response create(@NotNull PolicyTO policyTO);
/**
* Updates policy matching the given key.
@@ -89,7 +89,7 @@ public interface PolicyService extends JAXRSService {
@Path("{key}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response update(@NotNull AbstractPolicyTO policyTO);
+ Response update(@NotNull PolicyTO policyTO);
/**
* Delete policy matching the given key.
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
index 578e403..afb84a5 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/SchemaService.java
@@ -33,7 +33,7 @@ import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.syncope.common.rest.api.beans.SchemaQuery;
@@ -56,7 +56,7 @@ public interface SchemaService extends JAXRSService {
@GET
@Path("{type}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- <T extends AbstractSchemaTO> List<T> list(@BeanParam SchemaQuery query);
+ <T extends SchemaTO> List<T> list(@BeanParam SchemaQuery query);
/**
* Returns schema matching the given type and key.
@@ -69,7 +69,7 @@ public interface SchemaService extends JAXRSService {
@GET
@Path("{type}/{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- <T extends AbstractSchemaTO> T read(
+ <T extends SchemaTO> T read(
@NotNull @PathParam("type") SchemaType type, @NotNull @PathParam("key") String key);
/**
@@ -83,7 +83,7 @@ public interface SchemaService extends JAXRSService {
@Path("{type}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response create(@NotNull @PathParam("type") SchemaType type, @NotNull AbstractSchemaTO schemaTO);
+ Response create(@NotNull @PathParam("type") SchemaType type, @NotNull SchemaTO schemaTO);
/**
* Updates the schema matching the given type and key.
@@ -96,7 +96,7 @@ public interface SchemaService extends JAXRSService {
@Path("{type}/{key}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response update(@NotNull @PathParam("type") SchemaType type, @NotNull AbstractSchemaTO schemaTO);
+ Response update(@NotNull @PathParam("type") SchemaType type, @NotNull SchemaTO schemaTO);
/**
* Deletes the schema matching the given type and key.
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
----------------------------------------------------------------------
diff --git a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
index 1e7bcd2..d23c654 100644
--- a/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
+++ b/common/rest-api/src/main/java/org/apache/syncope/common/rest/api/service/TaskService.java
@@ -34,7 +34,7 @@ import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.BulkAction;
import org.apache.syncope.common.lib.to.BulkActionResult;
import org.apache.syncope.common.lib.to.PagedResult;
@@ -61,7 +61,7 @@ public interface TaskService extends ExecutableService {
@GET
@Path("{key}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- <T extends AbstractTaskTO> T read(
+ <T extends TaskTO> T read(
@NotNull @PathParam("key") String key,
@QueryParam(JAXRSService.PARAM_DETAILS) @DefaultValue("true") boolean details);
@@ -74,7 +74,7 @@ public interface TaskService extends ExecutableService {
*/
@GET
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- <T extends AbstractTaskTO> PagedResult<T> list(@BeanParam TaskQuery query);
+ <T extends TaskTO> PagedResult<T> list(@BeanParam TaskQuery query);
/**
* Creates a new task.
@@ -95,7 +95,7 @@ public interface TaskService extends ExecutableService {
@PUT
@Path("{key}")
@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
- Response update(@NotNull AbstractTaskTO taskTO);
+ Response update(@NotNull TaskTO taskTO);
/**
* Deletes the task matching the provided key.
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/logic/src/main/java/org/apache/syncope/core/logic/PolicyLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/PolicyLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/PolicyLogic.java
index 0cffd0c..4d71d88 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/PolicyLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/PolicyLogic.java
@@ -24,7 +24,7 @@ import java.util.List;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.lang3.ArrayUtils;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.lib.types.StandardEntitlement;
import org.apache.syncope.core.persistence.api.dao.NotFoundException;
@@ -40,7 +40,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;
@Component
-public class PolicyLogic extends AbstractTransactionalLogic<AbstractPolicyTO> {
+public class PolicyLogic extends AbstractTransactionalLogic<PolicyTO> {
@Autowired
private PolicyDAO policyDAO;
@@ -49,12 +49,12 @@ public class PolicyLogic extends AbstractTransactionalLogic<AbstractPolicyTO> {
private PolicyDataBinder binder;
@PreAuthorize("hasRole('" + StandardEntitlement.POLICY_CREATE + "')")
- public <T extends AbstractPolicyTO> T create(final T policyTO) {
+ public <T extends PolicyTO> T create(final T policyTO) {
return binder.getPolicyTO(policyDAO.save(binder.create(policyTO)));
}
@PreAuthorize("hasRole('" + StandardEntitlement.POLICY_UPDATE + "')")
- public AbstractPolicyTO update(final AbstractPolicyTO policyTO) {
+ public PolicyTO update(final PolicyTO policyTO) {
Policy policy = policyDAO.find(policyTO.getKey());
return binder.getPolicyTO(policyDAO.save(binder.update(policy, policyTO)));
}
@@ -77,7 +77,7 @@ public class PolicyLogic extends AbstractTransactionalLogic<AbstractPolicyTO> {
}
@PreAuthorize("hasRole('" + StandardEntitlement.POLICY_LIST + "')")
- public <T extends AbstractPolicyTO> List<T> list(final PolicyType type) {
+ public <T extends PolicyTO> List<T> list(final PolicyType type) {
return CollectionUtils.collect(policyDAO.find(getPolicyClass(type)), new Transformer<Policy, T>() {
@Override
@@ -88,7 +88,7 @@ public class PolicyLogic extends AbstractTransactionalLogic<AbstractPolicyTO> {
}
@PreAuthorize("hasRole('" + StandardEntitlement.POLICY_READ + "')")
- public <T extends AbstractPolicyTO> T read(final String key) {
+ public <T extends PolicyTO> T read(final String key) {
Policy policy = policyDAO.find(key);
if (policy == null) {
throw new NotFoundException("Policy " + key + " not found");
@@ -98,7 +98,7 @@ public class PolicyLogic extends AbstractTransactionalLogic<AbstractPolicyTO> {
}
@PreAuthorize("hasRole('" + StandardEntitlement.POLICY_DELETE + "')")
- public <T extends AbstractPolicyTO> T delete(final String key) {
+ public <T extends PolicyTO> T delete(final String key) {
Policy policy = policyDAO.find(key);
if (policy == null) {
throw new NotFoundException("Policy " + key + " not found");
@@ -111,7 +111,7 @@ public class PolicyLogic extends AbstractTransactionalLogic<AbstractPolicyTO> {
}
@Override
- protected AbstractPolicyTO resolveReference(final Method method, final Object... args)
+ protected PolicyTO resolveReference(final Method method, final Object... args)
throws UnresolvedReferenceException {
String key = null;
@@ -120,8 +120,8 @@ public class PolicyLogic extends AbstractTransactionalLogic<AbstractPolicyTO> {
for (int i = 0; key == null && i < args.length; i++) {
if (args[i] instanceof String) {
key = (String) args[i];
- } else if (args[i] instanceof AbstractPolicyTO) {
- key = ((AbstractPolicyTO) args[i]).getKey();
+ } else if (args[i] instanceof PolicyTO) {
+ key = ((PolicyTO) args[i]).getKey();
}
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/logic/src/main/java/org/apache/syncope/core/logic/SchemaLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/SchemaLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/SchemaLogic.java
index 97da0f6..b06c918 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/SchemaLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/SchemaLogic.java
@@ -26,7 +26,7 @@ import org.apache.commons.collections4.Transformer;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.to.DerSchemaTO;
import org.apache.syncope.common.lib.to.PlainSchemaTO;
import org.apache.syncope.common.lib.to.VirSchemaTO;
@@ -50,7 +50,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;
@Component
-public class SchemaLogic extends AbstractTransactionalLogic<AbstractSchemaTO> {
+public class SchemaLogic extends AbstractTransactionalLogic<SchemaTO> {
@Autowired
private PlainSchemaDAO plainSchemaDAO;
@@ -92,7 +92,7 @@ public class SchemaLogic extends AbstractTransactionalLogic<AbstractSchemaTO> {
@PreAuthorize("hasRole('" + StandardEntitlement.SCHEMA_CREATE + "')")
@SuppressWarnings("unchecked")
- public <T extends AbstractSchemaTO> T create(final SchemaType schemaType, final T schemaTO) {
+ public <T extends SchemaTO> T create(final SchemaType schemaType, final T schemaTO) {
if (StringUtils.isBlank(schemaTO.getKey())) {
SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.RequiredValuesMissing);
sce.getElements().add("Schema key");
@@ -146,7 +146,7 @@ public class SchemaLogic extends AbstractTransactionalLogic<AbstractSchemaTO> {
@PreAuthorize("isAuthenticated()")
@SuppressWarnings("unchecked")
- public <T extends AbstractSchemaTO> List<T> list(
+ public <T extends SchemaTO> List<T> list(
final SchemaType schemaType, final List<String> anyTypeClasses) {
List<AnyTypeClass> classes = new ArrayList<>(anyTypeClasses == null ? 0 : anyTypeClasses.size());
@@ -207,7 +207,7 @@ public class SchemaLogic extends AbstractTransactionalLogic<AbstractSchemaTO> {
@PreAuthorize("isAuthenticated()")
@SuppressWarnings("unchecked")
- public <T extends AbstractSchemaTO> T read(final SchemaType schemaType, final String schemaKey) {
+ public <T extends SchemaTO> T read(final SchemaType schemaType, final String schemaKey) {
T read;
switch (schemaType) {
case VIRTUAL:
@@ -242,7 +242,7 @@ public class SchemaLogic extends AbstractTransactionalLogic<AbstractSchemaTO> {
}
@PreAuthorize("hasRole('" + StandardEntitlement.SCHEMA_UPDATE + "')")
- public <T extends AbstractSchemaTO> void update(final SchemaType schemaType, final T schemaTO) {
+ public <T extends SchemaTO> void update(final SchemaType schemaType, final T schemaTO) {
if (!doesSchemaExist(schemaType, schemaTO.getKey())) {
throw new NotFoundException(schemaType + "/" + schemaTO.getKey());
}
@@ -278,7 +278,7 @@ public class SchemaLogic extends AbstractTransactionalLogic<AbstractSchemaTO> {
}
@Override
- protected AbstractSchemaTO resolveReference(final Method method, final Object... args)
+ protected SchemaTO resolveReference(final Method method, final Object... args)
throws UnresolvedReferenceException {
String kind = null;
@@ -291,15 +291,15 @@ public class SchemaLogic extends AbstractTransactionalLogic<AbstractSchemaTO> {
} else {
key = (String) args[i];
}
- } else if (args[i] instanceof AbstractSchemaTO) {
- key = ((AbstractSchemaTO) args[i]).getKey();
+ } else if (args[i] instanceof SchemaTO) {
+ key = ((SchemaTO) args[i]).getKey();
}
}
}
if (key != null) {
try {
- AbstractSchemaTO result = null;
+ SchemaTO result = null;
PlainSchema plainSchema = plainSchemaDAO.find(key);
if (plainSchema == null) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
----------------------------------------------------------------------
diff --git a/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java b/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
index d1cc82c..e0aa42c 100644
--- a/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
+++ b/core/logic/src/main/java/org/apache/syncope/core/logic/TaskLogic.java
@@ -29,7 +29,7 @@ import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.tuple.Pair;
import org.apache.commons.lang3.tuple.Triple;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.BulkActionResult;
import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.JobTO;
@@ -66,7 +66,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Component;
@Component
-public class TaskLogic extends AbstractExecutableLogic<AbstractTaskTO> {
+public class TaskLogic extends AbstractExecutableLogic<TaskTO> {
@Autowired
private TaskDAO taskDAO;
@@ -148,7 +148,7 @@ public class TaskLogic extends AbstractExecutableLogic<AbstractTaskTO> {
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_LIST + "')")
@SuppressWarnings("unchecked")
- public <T extends AbstractTaskTO> Pair<Integer, List<T>> list(
+ public <T extends TaskTO> Pair<Integer, List<T>> list(
final TaskType type,
final String resource,
final String notification,
@@ -186,7 +186,7 @@ public class TaskLogic extends AbstractExecutableLogic<AbstractTaskTO> {
}
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_READ + "')")
- public <T extends AbstractTaskTO> T read(final String key, final boolean details) {
+ public <T extends TaskTO> T read(final String key, final boolean details) {
Task task = taskDAO.find(key);
if (task == null) {
throw new NotFoundException("Task " + key);
@@ -267,7 +267,7 @@ public class TaskLogic extends AbstractExecutableLogic<AbstractTaskTO> {
}
@PreAuthorize("hasRole('" + StandardEntitlement.TASK_DELETE + "')")
- public <T extends AbstractTaskTO> T delete(final String key) {
+ public <T extends TaskTO> T delete(final String key) {
Task task = taskDAO.find(key);
if (task == null) {
throw new NotFoundException("Task " + key);
@@ -390,7 +390,7 @@ public class TaskLogic extends AbstractExecutableLogic<AbstractTaskTO> {
}
@Override
- protected AbstractTaskTO resolveReference(final Method method, final Object... args)
+ protected TaskTO resolveReference(final Method method, final Object... args)
throws UnresolvedReferenceException {
String key = null;
@@ -401,8 +401,8 @@ public class TaskLogic extends AbstractExecutableLogic<AbstractTaskTO> {
for (int i = 0; key == null && i < args.length; i++) {
if (args[i] instanceof String) {
key = (String) args[i];
- } else if (args[i] instanceof AbstractTaskTO) {
- key = ((AbstractTaskTO) args[i]).getKey();
+ } else if (args[i] instanceof TaskTO) {
+ key = ((TaskTO) args[i]).getKey();
}
}
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/TaskUtils.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/TaskUtils.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/TaskUtils.java
index 2e00784..96bde02 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/TaskUtils.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/TaskUtils.java
@@ -18,7 +18,7 @@
*/
package org.apache.syncope.core.persistence.api.entity.task;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.types.TaskType;
public interface TaskUtils {
@@ -27,10 +27,10 @@ public interface TaskUtils {
<T extends Task> T newTask();
- <T extends AbstractTaskTO> T newTaskTO();
+ <T extends TaskTO> T newTaskTO();
<T extends Task> Class<T> taskClass();
- <T extends AbstractTaskTO> Class<T> taskTOClass();
+ <T extends TaskTO> Class<T> taskTOClass();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/TaskUtilsFactory.java
----------------------------------------------------------------------
diff --git a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/TaskUtilsFactory.java b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/TaskUtilsFactory.java
index 6da4de9..78cbfcb 100644
--- a/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/TaskUtilsFactory.java
+++ b/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/entity/task/TaskUtilsFactory.java
@@ -18,7 +18,7 @@
*/
package org.apache.syncope.core.persistence.api.entity.task;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.types.TaskType;
public interface TaskUtilsFactory {
@@ -27,7 +27,7 @@ public interface TaskUtilsFactory {
TaskUtils getInstance(Task task);
- TaskUtils getInstance(Class<? extends AbstractTaskTO> taskClass);
+ TaskUtils getInstance(Class<? extends TaskTO> taskClass);
- TaskUtils getInstance(AbstractTaskTO taskTO);
+ TaskUtils getInstance(TaskTO taskTO);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPATaskUtils.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPATaskUtils.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPATaskUtils.java
index 0905533..3f9c720 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPATaskUtils.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPATaskUtils.java
@@ -18,7 +18,7 @@
*/
package org.apache.syncope.core.persistence.jpa.entity.task;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.NotificationTaskTO;
import org.apache.syncope.common.lib.to.PropagationTaskTO;
import org.apache.syncope.common.lib.to.PushTaskTO;
@@ -110,7 +110,7 @@ public final class JPATaskUtils implements TaskUtils {
}
@Override
- public <T extends AbstractTaskTO> Class<T> taskTOClass() {
+ public <T extends TaskTO> Class<T> taskTOClass() {
Class<T> result = null;
switch (type) {
@@ -141,7 +141,7 @@ public final class JPATaskUtils implements TaskUtils {
}
@Override
- public <T extends AbstractTaskTO> T newTaskTO() {
+ public <T extends TaskTO> T newTaskTO() {
final Class<T> taskClass = taskTOClass();
try {
return taskClass == null ? null : taskClass.newInstance();
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPATaskUtilsFactory.java
----------------------------------------------------------------------
diff --git a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPATaskUtilsFactory.java b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPATaskUtilsFactory.java
index a26debd..be38e3a 100644
--- a/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPATaskUtilsFactory.java
+++ b/core/persistence-jpa/src/main/java/org/apache/syncope/core/persistence/jpa/entity/task/JPATaskUtilsFactory.java
@@ -18,7 +18,7 @@
*/
package org.apache.syncope.core.persistence.jpa.entity.task;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.NotificationTaskTO;
import org.apache.syncope.common.lib.to.PropagationTaskTO;
import org.apache.syncope.common.lib.to.PushTaskTO;
@@ -64,7 +64,7 @@ public class JPATaskUtilsFactory implements TaskUtilsFactory {
}
@Override
- public TaskUtils getInstance(final Class<? extends AbstractTaskTO> taskClass) {
+ public TaskUtils getInstance(final Class<? extends TaskTO> taskClass) {
TaskType type;
if (taskClass == PropagationTaskTO.class) {
type = TaskType.PROPAGATION;
@@ -84,7 +84,7 @@ public class JPATaskUtilsFactory implements TaskUtilsFactory {
}
@Override
- public TaskUtils getInstance(final AbstractTaskTO taskTO) {
+ public TaskUtils getInstance(final TaskTO taskTO) {
return getInstance(taskTO.getClass());
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/PolicyDataBinder.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/PolicyDataBinder.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/PolicyDataBinder.java
index cea03df..3ff922d 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/PolicyDataBinder.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/PolicyDataBinder.java
@@ -18,15 +18,15 @@
*/
package org.apache.syncope.core.provisioning.api.data;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.core.persistence.api.entity.Policy;
public interface PolicyDataBinder {
- <T extends Policy> T create(AbstractPolicyTO policyTO);
+ <T extends Policy> T create(PolicyTO policyTO);
- <T extends Policy> T update(T policy, AbstractPolicyTO policyTO);
+ <T extends Policy> T update(T policy, PolicyTO policyTO);
- <T extends AbstractPolicyTO> T getPolicyTO(Policy policy);
+ <T extends PolicyTO> T getPolicyTO(Policy policy);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/TaskDataBinder.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/TaskDataBinder.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/TaskDataBinder.java
index f5869d6..9746031 100644
--- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/TaskDataBinder.java
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/TaskDataBinder.java
@@ -18,7 +18,7 @@
*/
package org.apache.syncope.core.provisioning.api.data;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.SchedTaskTO;
import org.apache.syncope.core.persistence.api.entity.task.SchedTask;
@@ -36,6 +36,6 @@ public interface TaskDataBinder {
ExecTO getExecTO(TaskExec execution);
- <T extends AbstractTaskTO> T getTaskTO(Task task, TaskUtils taskUtil, boolean details);
+ <T extends TaskTO> T getTaskTO(Task task, TaskUtils taskUtil, boolean details);
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java
index 35eac98..b5b074f 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/PolicyDataBinderImpl.java
@@ -21,7 +21,7 @@ package org.apache.syncope.core.provisioning.java.data;
import org.apache.syncope.core.provisioning.api.data.PolicyDataBinder;
import org.apache.syncope.common.lib.policy.AbstractAccountRuleConf;
import org.apache.syncope.common.lib.policy.AbstractPasswordRuleConf;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.policy.AccountPolicyTO;
import org.apache.syncope.common.lib.policy.AccountRuleConf;
import org.apache.syncope.common.lib.policy.PasswordPolicyTO;
@@ -56,7 +56,7 @@ public class PolicyDataBinderImpl implements PolicyDataBinder {
private EntityFactory entityFactory;
@SuppressWarnings("unchecked")
- private <T extends Policy> T getPolicy(final T policy, final AbstractPolicyTO policyTO) {
+ private <T extends Policy> T getPolicy(final T policy, final PolicyTO policyTO) {
T result = policy;
if (policyTO instanceof PasswordPolicyTO) {
@@ -115,18 +115,18 @@ public class PolicyDataBinderImpl implements PolicyDataBinder {
}
@Override
- public <T extends Policy> T create(final AbstractPolicyTO policyTO) {
+ public <T extends Policy> T create(final PolicyTO policyTO) {
return getPolicy(null, policyTO);
}
@Override
- public <T extends Policy> T update(final T policy, final AbstractPolicyTO policyTO) {
+ public <T extends Policy> T update(final T policy, final PolicyTO policyTO) {
return getPolicy(policy, policyTO);
}
@SuppressWarnings("unchecked")
@Override
- public <T extends AbstractPolicyTO> T getPolicyTO(final Policy policy) {
+ public <T extends PolicyTO> T getPolicyTO(final Policy policy) {
T policyTO = null;
if (policy instanceof PasswordPolicy) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/TaskDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/TaskDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/TaskDataBinderImpl.java
index c2e655d..83ba635 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/TaskDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/TaskDataBinderImpl.java
@@ -24,8 +24,8 @@ import org.apache.commons.collections4.Predicate;
import org.apache.syncope.core.provisioning.api.data.TaskDataBinder;
import org.apache.commons.lang3.StringUtils;
import org.apache.syncope.common.lib.SyncopeClientException;
-import org.apache.syncope.common.lib.to.AbstractProvisioningTaskTO;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.ProvisioningTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.AnyTO;
import org.apache.syncope.common.lib.to.PropagationTaskTO;
import org.apache.syncope.common.lib.to.PushTaskTO;
@@ -109,7 +109,7 @@ public class TaskDataBinderImpl implements TaskDataBinder {
@Autowired
private TaskUtilsFactory taskUtilsFactory;
- private void fill(final ProvisioningTask task, final AbstractProvisioningTaskTO taskTO) {
+ private void fill(final ProvisioningTask task, final ProvisioningTaskTO taskTO) {
if (task instanceof PushTask && taskTO instanceof PushTaskTO) {
PushTask pushTask = (PushTask) task;
final PushTaskTO pushTaskTO = (PushTaskTO) taskTO;
@@ -205,7 +205,7 @@ public class TaskDataBinderImpl implements TaskDataBinder {
@Override
public SchedTask createSchedTask(final SchedTaskTO taskTO, final TaskUtils taskUtils) {
- Class<? extends AbstractTaskTO> taskTOClass = taskUtils.taskTOClass();
+ Class<? extends TaskTO> taskTOClass = taskUtils.taskTOClass();
if (taskTOClass == null || !taskTOClass.equals(taskTO.getClass())) {
throw new IllegalArgumentException(String.format("Expected %s, found %s", taskTOClass, taskTO.getClass()));
}
@@ -219,8 +219,8 @@ public class TaskDataBinderImpl implements TaskDataBinder {
if (taskUtils.getType() == TaskType.SCHEDULED) {
task.setJobDelegateClassName(taskTO.getJobDelegateClassName());
- } else if (taskTO instanceof AbstractProvisioningTaskTO) {
- AbstractProvisioningTaskTO provisioningTaskTO = (AbstractProvisioningTaskTO) taskTO;
+ } else if (taskTO instanceof ProvisioningTaskTO) {
+ ProvisioningTaskTO provisioningTaskTO = (ProvisioningTaskTO) taskTO;
ExternalResource resource = resourceDAO.find(provisioningTaskTO.getResource());
if (resource == null) {
@@ -236,7 +236,7 @@ public class TaskDataBinderImpl implements TaskDataBinder {
@Override
public void updateSchedTask(final SchedTask task, final SchedTaskTO taskTO, final TaskUtils taskUtils) {
- Class<? extends AbstractTaskTO> taskTOClass = taskUtils.taskTOClass();
+ Class<? extends TaskTO> taskTOClass = taskUtils.taskTOClass();
if (taskTOClass == null || !taskTOClass.equals(taskTO.getClass())) {
throw new IllegalArgumentException(String.format("Expected %s, found %s", taskTOClass, taskTO.getClass()));
}
@@ -252,7 +252,7 @@ public class TaskDataBinderImpl implements TaskDataBinder {
task.setActive(taskTO.isActive());
if (task instanceof ProvisioningTask) {
- fill((ProvisioningTask) task, (AbstractProvisioningTaskTO) taskTO);
+ fill((ProvisioningTask) task, (ProvisioningTaskTO) taskTO);
}
}
@@ -303,7 +303,7 @@ public class TaskDataBinderImpl implements TaskDataBinder {
}
@Override
- public <T extends AbstractTaskTO> T getTaskTO(final Task task, final TaskUtils taskUtils, final boolean details) {
+ public <T extends TaskTO> T getTaskTO(final Task task, final TaskUtils taskUtils, final boolean details) {
T taskTO = taskUtils.newTaskTO();
BeanUtils.copyProperties(task, taskTO, IGNORE_TASK_PROPERTIES);
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
index 64f765d..2925fc7 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/PolicyServiceImpl.java
@@ -21,7 +21,7 @@ package org.apache.syncope.core.rest.cxf.service;
import java.net.URI;
import java.util.List;
import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.syncope.common.rest.api.RESTHeaders;
import org.apache.syncope.common.rest.api.service.PolicyService;
@@ -36,8 +36,8 @@ public class PolicyServiceImpl extends AbstractServiceImpl implements PolicyServ
private PolicyLogic logic;
@Override
- public Response create(final AbstractPolicyTO policyTO) {
- AbstractPolicyTO policy = logic.create(policyTO);
+ public Response create(final PolicyTO policyTO) {
+ PolicyTO policy = logic.create(policyTO);
URI location = uriInfo.getAbsolutePathBuilder().path(policy.getKey()).build();
return Response.created(location).
header(RESTHeaders.RESOURCE_KEY, policy.getKey()).
@@ -51,17 +51,17 @@ public class PolicyServiceImpl extends AbstractServiceImpl implements PolicyServ
}
@Override
- public <T extends AbstractPolicyTO> List<T> list(final PolicyType type) {
+ public <T extends PolicyTO> List<T> list(final PolicyType type) {
return logic.list(type);
}
@Override
- public <T extends AbstractPolicyTO> T read(final String key) {
+ public <T extends PolicyTO> T read(final String key) {
return logic.read(key);
}
@Override
- public Response update(final AbstractPolicyTO policyTO) {
+ public Response update(final PolicyTO policyTO) {
logic.update(policyTO);
return Response.noContent().build();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
index b6c7397..f650839 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/SchemaServiceImpl.java
@@ -21,7 +21,7 @@ package org.apache.syncope.core.rest.cxf.service;
import java.net.URI;
import java.util.List;
import javax.ws.rs.core.Response;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.types.SchemaType;
import org.apache.syncope.common.rest.api.RESTHeaders;
import org.apache.syncope.common.rest.api.beans.SchemaQuery;
@@ -37,8 +37,8 @@ public class SchemaServiceImpl extends AbstractServiceImpl implements SchemaServ
private SchemaLogic logic;
@Override
- public Response create(final SchemaType schemaType, final AbstractSchemaTO schemaTO) {
- AbstractSchemaTO created = logic.create(schemaType, schemaTO);
+ public Response create(final SchemaType schemaType, final SchemaTO schemaTO) {
+ SchemaTO created = logic.create(schemaType, schemaTO);
URI location = uriInfo.getAbsolutePathBuilder().path(created.getKey()).build();
return Response.created(location).
@@ -53,17 +53,17 @@ public class SchemaServiceImpl extends AbstractServiceImpl implements SchemaServ
}
@Override
- public <T extends AbstractSchemaTO> List<T> list(final SchemaQuery query) {
+ public <T extends SchemaTO> List<T> list(final SchemaQuery query) {
return logic.list(query.getType(), query.getAnyTypeClasses());
}
@Override
- public <T extends AbstractSchemaTO> T read(final SchemaType schemaType, final String key) {
+ public <T extends SchemaTO> T read(final SchemaType schemaType, final String key) {
return logic.read(schemaType, key);
}
@Override
- public Response update(final SchemaType schemaType, final AbstractSchemaTO schemaTO) {
+ public Response update(final SchemaType schemaType, final SchemaTO schemaTO) {
logic.update(schemaType, schemaTO);
return Response.noContent().build();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
index 47a860c..37067a3 100644
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/TaskServiceImpl.java
@@ -23,7 +23,7 @@ import java.util.List;
import javax.ws.rs.BadRequestException;
import javax.ws.rs.core.Response;
import org.apache.commons.lang3.tuple.Pair;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.BulkAction;
import org.apache.syncope.common.lib.to.BulkActionResult;
import org.apache.syncope.common.lib.to.PagedResult;
@@ -70,7 +70,7 @@ public class TaskServiceImpl extends AbstractExecutableService implements TaskSe
@SuppressWarnings("unchecked")
@Override
- public <T extends AbstractTaskTO> PagedResult<T> list(final TaskQuery query) {
+ public <T extends TaskTO> PagedResult<T> list(final TaskQuery query) {
Pair<Integer, List<T>> result = logic.list(
query.getType(),
query.getResource(),
@@ -85,12 +85,12 @@ public class TaskServiceImpl extends AbstractExecutableService implements TaskSe
}
@Override
- public <T extends AbstractTaskTO> T read(final String key, final boolean details) {
+ public <T extends TaskTO> T read(final String key, final boolean details) {
return logic.read(key, details);
}
@Override
- public Response update(final AbstractTaskTO taskTO) {
+ public Response update(final TaskTO taskTO) {
if (taskTO instanceof SchedTaskTO) {
logic.updateSchedTask((SchedTaskTO) taskTO);
return Response.noContent().build();
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/core/rest-cxf/src/main/resources/restCXFContext.xml
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/resources/restCXFContext.xml b/core/rest-cxf/src/main/resources/restCXFContext.xml
index a3637c7..a31ec25 100644
--- a/core/rest-cxf/src/main/resources/restCXFContext.xml
+++ b/core/rest-cxf/src/main/resources/restCXFContext.xml
@@ -50,7 +50,7 @@ under the License.
<map>
<entry>
<key>
- <value>org.apache.syncope.common.lib.policy.AbstractPolicyTO</value>
+ <value>org.apache.syncope.common.lib.policy.PolicyTO</value>
</key>
<value>policies</value>
</entry>
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/main/resources/jboss/restCXFContext.xml b/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
index ebeba58..d5181c7 100644
--- a/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
+++ b/fit/core-reference/src/main/resources/jboss/restCXFContext.xml
@@ -50,7 +50,7 @@ under the License.
<map>
<entry>
<key>
- <value>org.apache.syncope.common.lib.policy.AbstractPolicyTO</value>
+ <value>org.apache.syncope.common.lib.policy.PolicyTO</value>
</key>
<value>policies</value>
</entry>
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
index 49b4cb2..c0d600d 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/AbstractITCase.java
@@ -47,8 +47,8 @@ import org.apache.syncope.common.lib.patch.AnyObjectPatch;
import org.apache.syncope.common.lib.patch.AttrPatch;
import org.apache.syncope.common.lib.patch.GroupPatch;
import org.apache.syncope.common.lib.patch.UserPatch;
-import org.apache.syncope.common.lib.policy.AbstractPolicyTO;
-import org.apache.syncope.common.lib.to.AbstractSchemaTO;
+import org.apache.syncope.common.lib.policy.PolicyTO;
+import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.apache.syncope.common.lib.to.AttrTO;
import org.apache.syncope.common.lib.to.ConnInstanceTO;
@@ -334,7 +334,7 @@ public abstract class AbstractITCase {
}
@SuppressWarnings("unchecked")
- protected <T extends AbstractSchemaTO> T createSchema(final SchemaType type, final T schemaTO) {
+ protected <T extends SchemaTO> T createSchema(final SchemaType type, final T schemaTO) {
Response response = schemaService.create(type, schemaTO);
if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
@@ -486,7 +486,7 @@ public abstract class AbstractITCase {
}
@SuppressWarnings("unchecked")
- protected <T extends AbstractPolicyTO> T createPolicy(final T policy) {
+ protected <T extends PolicyTO> T createPolicy(final T policy) {
Response response = policyService.create(policy);
if (response.getStatusInfo().getStatusCode() != Response.Status.CREATED.getStatusCode()) {
Exception ex = clientFactory.getExceptionMapper().fromResponse(response);
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
index 9f882d3..4247eda 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/AbstractTaskITCase.java
@@ -33,7 +33,7 @@ import java.util.concurrent.TimeUnit;
import org.apache.syncope.client.lib.SyncopeClient;
import org.apache.syncope.common.lib.SyncopeConstants;
import org.apache.syncope.common.lib.patch.DeassociationPatch;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.ExecTO;
import org.apache.syncope.common.lib.to.GroupTO;
import org.apache.syncope.common.lib.to.NotificationTaskTO;
@@ -126,7 +126,7 @@ public abstract class AbstractTaskITCase extends AbstractITCase {
protected static ExecTO execTask(final TaskService taskService, final String taskKey, final String initialStatus,
final int maxWaitSeconds, final boolean dryRun) {
- AbstractTaskTO taskTO = taskService.read(taskKey, true);
+ TaskTO taskTO = taskService.read(taskKey, true);
assertNotNull(taskTO);
assertNotNull(taskTO.getExecutions());
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java
index fdb4865..a7e66be 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/MigrationITCase.java
@@ -31,7 +31,7 @@ import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.collections4.Predicate;
import org.apache.syncope.common.lib.SyncopeClientException;
import org.apache.syncope.common.lib.SyncopeConstants;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.AnyTypeClassTO;
import org.apache.syncope.common.lib.to.AttrTO;
import org.apache.syncope.common.lib.to.BulkAction;
@@ -426,7 +426,7 @@ public class MigrationITCase extends AbstractTaskITCase {
public void migrateFromSyncope12() throws InterruptedException {
// 1. cleanup
try {
- for (AbstractTaskTO task : taskService.list(
+ for (TaskTO task : taskService.list(
new TaskQuery.Builder(TaskType.PULL).resource(RESOURCE_KEY).build()).getResult()) {
if (PULL_TASK_NAME.equals(PullTaskTO.class.cast(task).getName())) {
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
index f4aa9bf..d0daa6a 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PropagationTaskITCase.java
@@ -28,7 +28,7 @@ import java.util.List;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.lang3.SerializationUtils;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.apache.syncope.common.lib.to.BulkAction;
import org.apache.syncope.common.lib.to.ConnObjectTO;
@@ -55,7 +55,7 @@ public class PropagationTaskITCase extends AbstractTaskITCase {
assertNotNull(tasks);
assertEquals(2, tasks.getResult().size());
- for (AbstractTaskTO task : tasks.getResult()) {
+ for (TaskTO task : tasks.getResult()) {
assertNotNull(task);
}
@@ -65,7 +65,7 @@ public class PropagationTaskITCase extends AbstractTaskITCase {
assertEquals(2, tasks.getPage());
assertEquals(2, tasks.getResult().size());
- for (AbstractTaskTO task : tasks.getResult()) {
+ for (TaskTO task : tasks.getResult()) {
assertNotNull(task);
}
@@ -167,15 +167,15 @@ public class PropagationTaskITCase extends AbstractTaskITCase {
}
// check list
- PagedResult<AbstractTaskTO> tasks = taskService.list(
+ PagedResult<TaskTO> tasks = taskService.list(
new TaskQuery.Builder(TaskType.PROPAGATION).page(1).size(2).details(false).build());
- for (AbstractTaskTO item : tasks.getResult()) {
+ for (TaskTO item : tasks.getResult()) {
assertTrue(item.getExecutions().isEmpty());
}
tasks = taskService.list(
new TaskQuery.Builder(TaskType.PROPAGATION).page(1).size(2).details(true).build());
- for (AbstractTaskTO item : tasks.getResult()) {
+ for (TaskTO item : tasks.getResult()) {
assertFalse(item.getExecutions().isEmpty());
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
index 3e1fa27..82e71a0 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PullTaskITCase.java
@@ -51,7 +51,7 @@ import org.apache.syncope.common.lib.patch.DeassociationPatch;
import org.apache.syncope.common.lib.patch.PasswordPatch;
import org.apache.syncope.common.lib.patch.UserPatch;
import org.apache.syncope.common.lib.policy.PullPolicyTO;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.AnyObjectTO;
import org.apache.syncope.common.lib.to.AttrTO;
import org.apache.syncope.common.lib.to.ConnInstanceTO;
@@ -121,7 +121,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
public void list() {
PagedResult<PullTaskTO> tasks = taskService.list(new TaskQuery.Builder(TaskType.PULL).build());
assertFalse(tasks.getResult().isEmpty());
- for (AbstractTaskTO task : tasks.getResult()) {
+ for (TaskTO task : tasks.getResult()) {
if (!(task instanceof PullTaskTO)) {
fail();
}
@@ -1057,7 +1057,7 @@ public class PullTaskITCase extends AbstractTaskITCase {
getLdapRemoteObject(RESOURCE_LDAP_ADMIN_DN, RESOURCE_LDAP_ADMIN_PWD, userDn.getValues().get(0)));
// ...and propagated
- PagedResult<AbstractTaskTO> propagationTasks = taskService.list(new TaskQuery.Builder(TaskType.PROPAGATION).
+ PagedResult<TaskTO> propagationTasks = taskService.list(new TaskQuery.Builder(TaskType.PROPAGATION).
resource(RESOURCE_NAME_DBPULL).
anyTypeKind(AnyTypeKind.USER).entityKey(user.getKey()).build());
assertEquals(1, propagationTasks.getSize());
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
index fe62261..751516d 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/PushTaskITCase.java
@@ -31,7 +31,7 @@ import javax.sql.DataSource;
import javax.ws.rs.core.Response;
import org.apache.syncope.client.lib.SyncopeClient;
import org.apache.syncope.common.lib.SyncopeConstants;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.to.AnyTypeClassTO;
import org.apache.syncope.common.lib.to.PagedResult;
import org.apache.syncope.common.lib.to.PushTaskTO;
@@ -90,7 +90,7 @@ public class PushTaskITCase extends AbstractTaskITCase {
public void list() {
PagedResult<PushTaskTO> tasks = taskService.list(new TaskQuery.Builder(TaskType.PUSH).build());
assertFalse(tasks.getResult().isEmpty());
- for (AbstractTaskTO task : tasks.getResult()) {
+ for (TaskTO task : tasks.getResult()) {
if (!(task instanceof PushTaskTO)) {
fail();
}
http://git-wip-us.apache.org/repos/asf/syncope/blob/8038b056/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
----------------------------------------------------------------------
diff --git a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
index c155831..858a520 100644
--- a/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
+++ b/fit/core-reference/src/test/java/org/apache/syncope/fit/core/SchedTaskITCase.java
@@ -32,13 +32,13 @@ import javax.ws.rs.core.Response;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.lang3.time.DateUtils;
-import org.apache.syncope.common.lib.to.AbstractTaskTO;
import org.apache.syncope.common.lib.to.JobTO;
import org.apache.syncope.common.lib.to.PagedResult;
import org.apache.syncope.common.lib.to.PushTaskTO;
import org.apache.syncope.common.lib.to.SchedTaskTO;
import org.apache.syncope.common.lib.to.PullTaskTO;
import org.apache.syncope.common.lib.to.ExecTO;
+import org.apache.syncope.common.lib.to.TaskTO;
import org.apache.syncope.common.lib.types.JobAction;
import org.apache.syncope.common.lib.types.TaskType;
import org.apache.syncope.common.rest.api.beans.ExecuteQuery;
@@ -62,7 +62,7 @@ public class SchedTaskITCase extends AbstractTaskITCase {
PagedResult<SchedTaskTO> tasks =
taskService.list(new TaskQuery.Builder(TaskType.SCHEDULED).build());
assertFalse(tasks.getResult().isEmpty());
- for (AbstractTaskTO task : tasks.getResult()) {
+ for (TaskTO task : tasks.getResult()) {
if (!(task instanceof SchedTaskTO) || task instanceof PullTaskTO || task instanceof PushTaskTO) {
fail();
}