You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by jb...@apache.org on 2013/01/21 10:09:04 UTC

svn commit: r1436230 [3/14] - in /syncope/trunk: ./ client/ client/src/main/java/org/apache/syncope/annotation/ client/src/main/java/org/apache/syncope/client/ client/src/main/java/org/apache/syncope/client/mod/ client/src/main/java/org/apache/syncope/...

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/report/StaticReportletConf.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,103 @@
+/*
+ * 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.report;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.apache.syncope.common.types.TraceLevel;
+
+public class StaticReportletConf extends AbstractReportletConf {
+
+    private static final long serialVersionUID = -4814950086361753689L;
+
+    private String stringField;
+
+    private Long longField;
+
+    private Double doubleField;
+
+    private Date dateField;
+
+    private TraceLevel traceLevel;
+
+    private List<String> listField;
+
+    public StaticReportletConf() {
+        super();
+    }
+
+    public StaticReportletConf(final String name) {
+        super(name);
+        listField = new ArrayList<String>();
+    }
+
+    public Date getDateField() {
+        return dateField == null
+                ? null
+                : new Date(dateField.getTime());
+    }
+
+    public void setDateField(Date dateField) {
+        this.dateField = dateField == null
+                ? null
+                : new Date(dateField.getTime());
+    }
+
+    public Double getDoubleField() {
+        return doubleField;
+    }
+
+    public void setDoubleField(Double doubleField) {
+        this.doubleField = doubleField;
+    }
+
+    public List<String> getListField() {
+        return listField;
+    }
+
+    public void setListField(List<String> listField) {
+        this.listField = listField;
+    }
+
+    public Long getLongField() {
+        return longField;
+    }
+
+    public void setLongField(Long longField) {
+        this.longField = longField;
+    }
+
+    public String getStringField() {
+        return stringField;
+    }
+
+    public void setStringField(String stringField) {
+        this.stringField = stringField;
+    }
+
+    public TraceLevel getTraceLevel() {
+        return traceLevel;
+    }
+
+    public void setTraceLevel(TraceLevel traceLevel) {
+        this.traceLevel = traceLevel;
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/report/UserReportletConf.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,113 @@
+/*
+ * 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.report;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.syncope.common.annotation.FormAttributeField;
+import org.apache.syncope.common.search.NodeCond;
+import org.apache.syncope.common.types.IntMappingType;
+
+public class UserReportletConf extends AbstractReportletConf {
+
+    public enum Feature {
+
+        id,
+        username,
+        workflowId,
+        status,
+        creationDate,
+        lastLoginDate,
+        changePwdDate,
+        passwordHistorySize,
+        failedLoginCount,
+        memberships,
+        resources
+
+    }
+
+    private static final long serialVersionUID = 6602717600064602764L;
+
+    private NodeCond matchingCond;
+
+    @FormAttributeField(schema = IntMappingType.UserSchema)
+    private List<String> attrs;
+
+    @FormAttributeField(schema = IntMappingType.UserDerivedSchema)
+    private List<String> derAttrs;
+
+    @FormAttributeField(schema = IntMappingType.UserVirtualSchema)
+    private List<String> virAttrs;
+
+    private List<Feature> features;
+
+    public UserReportletConf() {
+        super();
+    }
+
+    public UserReportletConf(final String name) {
+        super(name);
+
+        attrs = new ArrayList<String>();
+        derAttrs = new ArrayList<String>();
+        virAttrs = new ArrayList<String>();
+        features = new ArrayList<Feature>();
+    }
+
+    public List<String> getAttrs() {
+        return attrs;
+    }
+
+    public void setAttrs(List<String> attrs) {
+        this.attrs = attrs;
+    }
+
+    public List<String> getDerAttrs() {
+        return derAttrs;
+    }
+
+    public void setDerAttrs(List<String> derAttrs) {
+        this.derAttrs = derAttrs;
+    }
+
+    public List<Feature> getFeatures() {
+        return features;
+    }
+
+    public void setFeatures(List<Feature> features) {
+        this.features = features;
+    }
+
+    public NodeCond getMatchingCond() {
+        return matchingCond;
+    }
+
+    public void setMatchingCond(NodeCond matchingCond) {
+        this.matchingCond = matchingCond;
+    }
+
+    public List<String> getVirAttrs() {
+        return virAttrs;
+    }
+
+    public void setVirAttrs(List<String> virAttrs) {
+        this.virAttrs = virAttrs;
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/search/AttributableCond.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/search/AttributableCond.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/search/AttributableCond.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/search/AttributableCond.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,34 @@
+/*
+ * 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.search;
+
+/**
+ * Search condition to be applied when comparing bean field values.
+ */
+public class AttributableCond extends AttributeCond implements SearchCond {
+
+    private static final long serialVersionUID = -1880319220462653955L;
+
+    public AttributableCond() {
+    }
+
+    public AttributableCond(final Type conditionType) {
+        super(conditionType);
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/search/AttributeCond.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/search/AttributeCond.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/search/AttributeCond.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/search/AttributeCond.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,86 @@
+/*
+ * 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.search;
+
+import org.apache.syncope.common.AbstractBaseBean;
+
+/**
+ * Search condition to be applied when comparing attribute values.
+ */
+public class AttributeCond extends AbstractBaseBean implements SearchCond {
+
+    private static final long serialVersionUID = 3275277728404021417L;
+
+    public enum Type {
+
+        LIKE,
+        EQ,
+        GT,
+        LT,
+        GE,
+        LE,
+        ISNULL,
+        ISNOTNULL
+
+    }
+
+    private Type type;
+
+    private String schema;
+
+    private String expression;
+
+    public AttributeCond() {
+        super();
+    }
+
+    public AttributeCond(final Type conditionType) {
+        super();
+        this.type = conditionType;
+    }
+
+    public final String getExpression() {
+        return expression;
+    }
+
+    public final void setExpression(final String conditionExpression) {
+        this.expression = conditionExpression;
+    }
+
+    public final String getSchema() {
+        return schema;
+    }
+
+    public final void setSchema(final String conditionSchema) {
+        this.schema = conditionSchema;
+    }
+
+    public final Type getType() {
+        return type;
+    }
+
+    public final void setType(final Type conditionType) {
+        this.type = conditionType;
+    }
+
+    @Override
+    public final boolean isValid() {
+        return type != null && schema != null && (type == Type.ISNULL || type == Type.ISNOTNULL || expression != null);
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/search/EntitlementCond.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/search/EntitlementCond.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/search/EntitlementCond.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/search/EntitlementCond.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,41 @@
+/*
+ * 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.search;
+
+import org.apache.syncope.common.AbstractBaseBean;
+
+public class EntitlementCond extends AbstractBaseBean implements SearchCond {
+
+    private static final long serialVersionUID = -4077781080368377428L;
+
+    private String expression;
+
+    public String getExpression() {
+        return expression;
+    }
+
+    public void setExpression(final String expression) {
+        this.expression = expression;
+    }
+
+    @Override
+    public boolean isValid() {
+        return expression != null;
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/search/MembershipCond.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/search/MembershipCond.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/search/MembershipCond.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/search/MembershipCond.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,58 @@
+/*
+ * 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.search;
+
+import org.apache.syncope.common.AbstractBaseBean;
+
+/**
+ * Search condition to be applied when searching for memberships.
+ */
+public class MembershipCond extends AbstractBaseBean implements SearchCond {
+
+    private static final long serialVersionUID = -728155256293925989L;
+
+    private Long roleId;
+
+    private String roleName;
+
+    public MembershipCond() {
+        super();
+    }
+
+    public Long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(Long roleId) {
+        this.roleId = roleId;
+    }
+
+    public String getRoleName() {
+        return roleName;
+    }
+
+    public void setRoleName(String roleName) {
+        this.roleName = roleName;
+    }
+
+    @Override
+    public final boolean isValid() {
+        return !(roleId == null && roleName == null);
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/search/NodeCond.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/search/NodeCond.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/search/NodeCond.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/search/NodeCond.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,242 @@
+/*
+ * 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.search;
+
+import org.apache.syncope.common.AbstractBaseBean;
+import org.codehaus.jackson.annotate.JsonIgnore;
+
+public class NodeCond extends AbstractBaseBean {
+
+    public enum Type {
+
+        LEAF,
+        NOT_LEAF,
+        AND,
+        OR
+
+    }
+
+    private Type type;
+
+    private AttributableCond attributableCond;
+
+    private AttributeCond attributeCond;
+
+    private MembershipCond membershipCond;
+
+    private ResourceCond resourceCond;
+
+    private EntitlementCond entitlementCond;
+
+    private NodeCond leftNodeCond;
+
+    private NodeCond rightNodeCond;
+
+    public static NodeCond getLeafCond(final AttributableCond syncopeUserCond) {
+        NodeCond nodeCond = new NodeCond();
+
+        nodeCond.type = Type.LEAF;
+        nodeCond.attributableCond = syncopeUserCond;
+
+        return nodeCond;
+    }
+
+    public static NodeCond getLeafCond(final AttributeCond attributeCond) {
+        NodeCond nodeCond = new NodeCond();
+
+        nodeCond.type = Type.LEAF;
+        nodeCond.attributeCond = attributeCond;
+
+        return nodeCond;
+    }
+
+    public static NodeCond getLeafCond(final MembershipCond membershipCond) {
+        NodeCond nodeCond = new NodeCond();
+
+        nodeCond.type = Type.LEAF;
+        nodeCond.membershipCond = membershipCond;
+
+        return nodeCond;
+    }
+
+    public static NodeCond getLeafCond(final ResourceCond resourceCond) {
+        NodeCond nodeCond = new NodeCond();
+
+        nodeCond.type = Type.LEAF;
+        nodeCond.resourceCond = resourceCond;
+
+        return nodeCond;
+    }
+
+    public static NodeCond getLeafCond(final EntitlementCond entitlementCond) {
+        NodeCond nodeCond = new NodeCond();
+
+        nodeCond.type = Type.LEAF;
+        nodeCond.entitlementCond = entitlementCond;
+
+        return nodeCond;
+    }
+
+    public static NodeCond getNotLeafCond(final AttributableCond syncopeUserCond) {
+        NodeCond nodeCond = getLeafCond(syncopeUserCond);
+        nodeCond.type = Type.NOT_LEAF;
+        return nodeCond;
+    }
+
+    public static NodeCond getNotLeafCond(final AttributeCond attributeCond) {
+        NodeCond nodeCond = getLeafCond(attributeCond);
+        nodeCond.type = Type.NOT_LEAF;
+        return nodeCond;
+    }
+
+    public static NodeCond getNotLeafCond(final MembershipCond membershipCond) {
+        NodeCond nodeCond = getLeafCond(membershipCond);
+        nodeCond.type = Type.NOT_LEAF;
+        return nodeCond;
+    }
+
+    public static NodeCond getNotLeafCond(final ResourceCond resourceCond) {
+        NodeCond nodeCond = getLeafCond(resourceCond);
+        nodeCond.type = Type.NOT_LEAF;
+        return nodeCond;
+    }
+
+    public static NodeCond getNotLeafCond(final EntitlementCond entitlementCond) {
+        NodeCond nodeCond = getLeafCond(entitlementCond);
+        nodeCond.type = Type.NOT_LEAF;
+        return nodeCond;
+    }
+
+    public static NodeCond getAndCond(final NodeCond leftCond, final NodeCond rightCond) {
+        NodeCond nodeCond = new NodeCond();
+
+        nodeCond.type = Type.AND;
+        nodeCond.leftNodeCond = leftCond;
+        nodeCond.rightNodeCond = rightCond;
+
+        return nodeCond;
+    }
+
+    public static NodeCond getOrCond(final NodeCond leftCond, final NodeCond rightCond) {
+        NodeCond nodeCond = new NodeCond();
+
+        nodeCond.type = Type.OR;
+        nodeCond.leftNodeCond = leftCond;
+        nodeCond.rightNodeCond = rightCond;
+
+        return nodeCond;
+    }
+
+    public AttributableCond getAttributableCond() {
+        return attributableCond;
+    }
+
+    public void setAttributableCond(final AttributableCond attributableCond) {
+        this.attributableCond = attributableCond;
+    }
+
+    public AttributeCond getAttributeCond() {
+        return attributeCond;
+    }
+
+    public void setAttributeCond(final AttributeCond attributeCond) {
+        this.attributeCond = attributeCond;
+    }
+
+    public MembershipCond getMembershipCond() {
+        return membershipCond;
+    }
+
+    public void setMembershipCond(final MembershipCond membershipCond) {
+        this.membershipCond = membershipCond;
+    }
+
+    public ResourceCond getResourceCond() {
+        return resourceCond;
+    }
+
+    public void setResourceCond(final ResourceCond resourceCond) {
+        this.resourceCond = resourceCond;
+    }
+
+    public EntitlementCond getEntitlementCond() {
+        return entitlementCond;
+    }
+
+    public void setEntitlementCond(final EntitlementCond entitlementCond) {
+        this.entitlementCond = entitlementCond;
+    }
+
+    public NodeCond getLeftNodeCond() {
+        return leftNodeCond;
+    }
+
+    public void setLeftNodeCond(final NodeCond leftNodeCond) {
+        this.leftNodeCond = leftNodeCond;
+    }
+
+    public NodeCond getRightNodeCond() {
+        return rightNodeCond;
+    }
+
+    public void setRightNodeCond(final NodeCond rightNodeCond) {
+        this.rightNodeCond = rightNodeCond;
+    }
+
+    public Type getType() {
+        return type;
+    }
+
+    public void setType(final Type type) {
+        this.type = type;
+    }
+
+    @JsonIgnore
+    public boolean isValid() {
+        boolean isValid = false;
+
+        if (type == null) {
+            return isValid;
+        }
+
+        switch (type) {
+            case LEAF:
+            case NOT_LEAF:
+                isValid = (attributableCond != null || attributeCond != null || membershipCond != null
+                        || resourceCond != null || entitlementCond != null)
+                        && (attributableCond == null || attributableCond.isValid())
+                        && (attributeCond == null || attributeCond.isValid())
+                        && (membershipCond == null || membershipCond.isValid())
+                        && (resourceCond == null || resourceCond.isValid())
+                        && (entitlementCond == null || entitlementCond.isValid());
+                break;
+
+            case AND:
+            case OR:
+                isValid = (leftNodeCond == null || rightNodeCond == null)
+                        ? false
+                        : leftNodeCond.isValid() && rightNodeCond.isValid();
+                break;
+
+            default:
+        }
+
+        return isValid;
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/search/ResourceCond.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/search/ResourceCond.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/search/ResourceCond.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/search/ResourceCond.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,42 @@
+/*
+ * 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.search;
+
+import org.apache.syncope.common.AbstractBaseBean;
+
+/**
+ * Search condition to be applied when searching for associated resources.
+ */
+public class ResourceCond extends AbstractBaseBean implements SearchCond {
+
+    private String resourceName;
+
+    public String getResourceName() {
+        return resourceName;
+    }
+
+    public void setResourceName(String resourceName) {
+        this.resourceName = resourceName;
+    }
+
+    @Override
+    public final boolean isValid() {
+        return resourceName != null;
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/search/SearchCond.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/search/SearchCond.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/search/SearchCond.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/search/SearchCond.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,27 @@
+/*
+ * 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.search;
+
+import org.codehaus.jackson.annotate.JsonIgnore;
+
+public interface SearchCond {
+
+    @JsonIgnore
+    boolean isValid();
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConfigurationService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,68 @@
+/*
+ * 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.services;
+
+import java.util.List;
+import java.util.Set;
+
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.core.Response;
+
+import org.apache.syncope.common.to.ConfigurationTO;
+import org.apache.syncope.common.to.MailTemplateTO;
+import org.apache.syncope.common.to.ValidatorTO;
+
+@Path("configurations")
+public interface ConfigurationService {
+
+    @POST
+    Response create(ConfigurationTO configurationTO);
+
+    @GET
+    @Path("dbDump")
+    Response dbExport();
+
+    @DELETE
+    @Path("{key}")
+    void delete(@PathParam("key") String key);
+
+    @GET
+    @Path("mailTemplates")
+    Set<MailTemplateTO> getMailTemplates();
+
+    @GET
+    @Path("validators")
+    Set<ValidatorTO> getValidators();
+
+    @GET
+    List<ConfigurationTO> list();
+
+    @GET
+    @Path("{key}")
+    ConfigurationTO read(@PathParam("key") String key);
+
+    @PUT
+    @Path("{key}")
+    ConfigurationTO update(@PathParam("key") String key, ConfigurationTO configurationTO);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ConnectorService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,87 @@
+/*
+ * 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.services;
+
+import java.util.List;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+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;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.Response;
+
+import org.apache.syncope.common.to.ConnBundleTO;
+import org.apache.syncope.common.to.ConnInstanceTO;
+import org.apache.syncope.common.to.SchemaTO;
+import org.apache.syncope.common.types.ConnConfProperty;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@Path("connectors")
+public interface ConnectorService {
+
+    @POST
+    Response create(ConnInstanceTO connectorTO);
+
+    @DELETE
+    @Path("{connectorId}")
+    void delete(@PathParam("connectorId") Long connectorId);
+
+    @GET
+    @Path("bundles")
+    List<ConnBundleTO> getBundles(@QueryParam("lang") String lang);
+
+    @GET
+    @Path("{connectorId}/configuration")
+    List<ConnConfProperty> getConfigurationProperties(
+            @PathParam("connectorId") Long connectorId);
+
+    @POST
+    @Path("{connectorId}/schemas")
+    List<SchemaTO> getSchemaNames(
+            @PathParam("connectorId") Long connectorId,
+            ConnInstanceTO connectorTO,
+            @QueryParam("showall") @DefaultValue("false") boolean showall);
+
+    @GET
+    List<ConnInstanceTO> list(@QueryParam("lang") String lang);
+
+    @GET
+    @Path("{connectorId}")
+    ConnInstanceTO read(@PathParam("connectorId") Long connectorId);
+
+    @GET
+    @RequestMapping(method = RequestMethod.GET, value = "/{resourceName}/connectorBean")
+    ConnInstanceTO readConnectorBean(
+            @MatrixParam("resourceName") String resourceName);
+
+    @PUT
+    @Path("{connectorId}")
+    void update(@PathParam("connectorId") Long connectorId,
+            ConnInstanceTO connectorTO);
+
+    @POST
+    @Path("validate")
+    @RequestMapping(method = RequestMethod.POST, value = "/check")
+    boolean validate(ConnInstanceTO connectorTO);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/EntitlementService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/EntitlementService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/EntitlementService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/EntitlementService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,43 @@
+/*
+ * 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.services;
+
+import java.util.Set;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+import org.apache.syncope.common.to.EntitlementTO;
+
+@Path("entitlements")
+public interface EntitlementService {
+
+    /**
+     * @return Returns a collection of all known entitlements.
+     */
+    @GET
+    Set<EntitlementTO> getAllEntitlements();
+
+    /**
+     * @return Returns a collection of entitlements assigned to user making this request (Service Call).
+     */
+    @GET
+    @Path("own")
+    Set<EntitlementTO> getMyEntitlements();
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/LoggerService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,62 @@
+/*
+ * 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.services;
+
+import ch.qos.logback.classic.Level;
+import java.util.List;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+
+import org.apache.syncope.common.to.LoggerTO;
+import org.apache.syncope.common.types.AuditLoggerName;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@Path("logger")
+public interface LoggerService {
+
+    //TODO use list(LoggerType) signature for both normal logger and audit logger instead of two different methods
+    @GET
+    @RequestMapping(method = RequestMethod.GET, value = "/log/list")
+    List<LoggerTO> listLogs();
+
+    @GET
+    @Path("audit")
+    @RequestMapping(method = RequestMethod.GET, value = "/audit/list")
+    List<AuditLoggerName> listAudits();
+
+    @PUT
+    @Path("{name}/level")
+    @RequestMapping(method = RequestMethod.POST, value = "/log/{name}/{level}")
+    LoggerTO update(@PathParam("name") String name, Level level);
+
+    @DELETE
+    @Path("{name}")
+    @RequestMapping(method = RequestMethod.GET, value = "/log/delete/{name}")
+    LoggerTO delete(@PathParam("name") String name);
+
+    // TODO refactor this method to use update()
+    void enableAudit(AuditLoggerName auditLoggerName);
+
+    // TODO refactor this method to use delete()
+    void disableAudit(AuditLoggerName auditLoggerName);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/NotificationService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,51 @@
+/*
+ * 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.services;
+
+import java.util.List;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+
+import org.apache.syncope.common.to.NotificationTO;
+
+@Path("notifications")
+public interface NotificationService {
+
+    @GET
+    @Path("{notificationId}")
+    NotificationTO read(@PathParam("notificationId") Long notificationId);
+
+    @GET
+    List<NotificationTO> list();
+
+    @POST
+    NotificationTO create(NotificationTO notificationTO);
+
+    @PUT
+    @Path("{notificationId}")
+    NotificationTO update(@PathParam("notificationId") Long notificationId, NotificationTO notificationTO);
+
+    @DELETE
+    @Path("{notificationId}")
+    NotificationTO delete(@PathParam("notificationId") Long notificationId);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/PolicyService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,57 @@
+/*
+ * 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.services;
+
+import java.util.List;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+
+import org.apache.syncope.common.to.PolicyTO;
+import org.apache.syncope.common.types.PolicyType;
+
+@Path("policies/{kind}")
+public interface PolicyService {
+
+    @POST
+    <T extends PolicyTO> T create(@PathParam("kind") PolicyType type, T policyTO);
+
+    // TODO: policyClass is required only for Spring RestTemplate mock. Must be removed for CXF
+    @DELETE
+    @Path("{policyId}")
+    <T extends PolicyTO> T delete(@PathParam("kind") PolicyType type, @PathParam("policyId") Long policyId);
+
+    @GET
+    <T extends PolicyTO> List<T> listByType(@PathParam("kind") PolicyType type);
+
+    @GET
+    @Path("{policyId}")
+    <T extends PolicyTO> T read(@PathParam("kind") PolicyType type, @PathParam("policyId") Long policyId);
+
+    @GET
+    @Path("global")
+    <T extends PolicyTO> T readGlobal(@PathParam("kind") PolicyType type);
+
+    @PUT
+    @Path("{policyId}")
+    <T extends PolicyTO> T update(@PathParam("kind") PolicyType type,@PathParam("policyId") Long policyId, T policyTO);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ReportService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,96 @@
+/*
+ * 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.services;
+
+import java.util.List;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+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.to.ReportExecTO;
+import org.apache.syncope.common.to.ReportTO;
+import org.apache.syncope.common.types.ReportExecExportFormat;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+@Path("reports")
+public interface ReportService {
+
+    @POST
+    ReportTO create(ReportTO reportTO);
+
+    @PUT
+    @Path("{reportId}")
+    ReportTO update(@PathParam("reportId") Long reportId, ReportTO reportTO);
+
+    @GET
+    @Path("count")
+    int count();
+
+    @GET
+    List<ReportTO> list();
+
+    @GET
+    List<ReportTO> list(@QueryParam("page") int page,
+            @QueryParam("size") @DefaultValue("25") int size);
+
+    @GET
+    @Path("executions")
+    List<ReportExecTO> listExecutions();
+
+    @GET
+    @Path("reportletConfClasses")
+    List<String> getReportletConfClasses();
+
+    @GET
+    @Path("{reportId}")
+    ReportTO read(@PathParam("reportId") Long reportId);
+
+    @GET
+    @Path("executions/{executionId}")
+    ReportExecTO readExecution(@PathParam("executionId") Long executionId);
+
+    @GET
+    @Path("executions/{executionId}")
+    @Produces(MediaType.APPLICATION_OCTET_STREAM)
+    Response exportExecutionResult(@PathParam("executionId") Long executionId,
+            @QueryParam("format") ReportExecExportFormat fmt);
+
+    @POST
+    @Path("{reportId}/execute")
+    ReportExecTO execute(@PathParam("reportId") Long reportId);
+
+    @DELETE
+    @Path("{reportId}")
+    @RequestMapping(method = RequestMethod.GET, value = "/delete/{reportId}")
+    ReportTO delete(@PathParam("reportId") Long reportId);
+
+    @DELETE
+    @Path("executions/{executionId}")
+    @RequestMapping(method = RequestMethod.GET, value = "/execution/delete/{executionId}")
+    ReportExecTO deleteExecution(@PathParam("executionId") Long executionId);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/ResourceService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,72 @@
+/*
+ * 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.services;
+
+import java.util.List;
+import java.util.Set;
+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;
+import javax.ws.rs.PathParam;
+
+import org.apache.syncope.common.to.ConnObjectTO;
+import org.apache.syncope.common.to.ResourceTO;
+import org.apache.syncope.common.types.AttributableType;
+
+@Path("resources")
+public interface ResourceService {
+
+    @POST
+    ResourceTO create(ResourceTO resourceTO);
+
+    @PUT
+    @Path("{resourceName}")
+    ResourceTO update(@PathParam("resourceName") String resourceName, ResourceTO resourceTO);
+
+    @DELETE
+    @Path("{resourceName}")
+    ResourceTO delete(@PathParam("resourceName") String resourceName);
+
+    @GET
+    @Path("{resourceName}")
+    ResourceTO read(@PathParam("resourceName") String resourceName);
+
+    // TODO: is it resource method?
+    @GET
+    @Path("propagationActionsClasses")
+    Set<String> getPropagationActionsClasses();
+
+    @GET
+    List<ResourceTO> list();
+
+    @GET
+    List<ResourceTO> list(@MatrixParam("connInstanceId") Long connInstanceId);
+
+    @GET
+    @Path("{resourceName}/{type}/{objectId}")
+    ConnObjectTO getConnector(@PathParam("resourceName") String resourceName,
+            @PathParam("type") AttributableType type, @PathParam("objectId") String objectId);
+
+    @POST
+    @Path("validate")
+    boolean check(ResourceTO resourceTO);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/RoleService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,83 @@
+/*
+ * 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.services;
+
+import java.util.List;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+import org.apache.syncope.common.search.NodeCond;
+import org.apache.syncope.common.mod.RoleMod;
+import org.apache.syncope.common.to.RoleTO;
+
+@Path("roles")
+public interface RoleService {
+
+    @GET
+    @Path("{roleId}/children")
+    List<RoleTO> children(@PathParam("roleId") Long roleId);
+
+    @GET
+    @Path("count")
+    Integer count();
+
+    @POST
+    RoleTO create(RoleTO roleTO);
+
+    @DELETE
+    @Path("{roleId}")
+    RoleTO delete(@PathParam("roleId") Long roleId);
+
+    @GET
+    List<RoleTO> list();
+
+    @GET
+    List<RoleTO> list(@QueryParam("page") int page, @QueryParam("size") @DefaultValue("25") int size);
+
+    @GET
+    @Path("{roleId}/parent")
+    RoleTO parent(@PathParam("roleId") Long roleId);
+
+    @GET
+    @Path("{roleId}")
+    RoleTO read(@PathParam("roleId") Long roleId);
+
+    @POST
+    @Path("search")
+    List<RoleTO> search(NodeCond searchCondition);
+
+    @POST
+    @Path("search")
+    List<RoleTO> search(NodeCond searchCondition, @QueryParam("page") int page,
+            @QueryParam("size") @DefaultValue("25") int size);
+
+    @POST
+    @Path("search/count")
+    int searchCount(NodeCond searchCondition);
+
+    RoleTO selfRead(Long roleId);
+
+    @POST
+    @Path("{roleId}")
+    RoleTO update(@PathParam("roleId") Long roleId, RoleMod roleMod);
+}
\ No newline at end of file

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/SchemaService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,81 @@
+/*
+ * 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.services;
+
+import java.util.List;
+
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+
+import org.apache.syncope.common.to.AbstractSchemaTO;
+import org.apache.syncope.common.types.AttributableType;
+
+@Path("schemas/{kind}/{type}")
+public interface SchemaService {
+
+    enum SchemaType {
+
+        NORMAL("schema"),
+        DERIVED("derivedSchema"),
+        VIRTUAL("virtualSchema");
+
+        private final String name;
+
+        private SchemaType(String name) {
+            this.name = name;
+        }
+
+        @Override
+        public String toString() {
+            return name;
+        }
+    }
+
+    @POST
+    <T extends AbstractSchemaTO> T create(@PathParam("kind") AttributableType kind,
+            @PathParam("type") SchemaType type,
+            T schemaTO);
+
+    @DELETE
+    @Path("{name}")
+    <T extends AbstractSchemaTO> T delete(@PathParam("kind") AttributableType kind,
+            @PathParam("type") SchemaType type,
+            @PathParam("name") String schemaName);
+
+    @GET
+    <T extends AbstractSchemaTO> List<T> list(@PathParam("kind") AttributableType kind,
+            @PathParam("type") SchemaType type);
+
+    @GET
+    @Path("{name}")
+    <T extends AbstractSchemaTO> T read(@PathParam("kind") AttributableType kind,
+            @PathParam("type") SchemaType type,
+            @PathParam("name") String schemaName);
+
+    @PUT
+    @Path("{name}")
+    <T extends AbstractSchemaTO> T update(@PathParam("kind") AttributableType kind,
+            @PathParam("type") SchemaType type,
+            @PathParam("name") String schemaName,
+            T schemaTO);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/TaskService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,99 @@
+/*
+ * 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.services;
+
+import java.util.List;
+import java.util.Set;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.HeaderParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+
+import org.apache.syncope.common.to.TaskExecTO;
+import org.apache.syncope.common.to.TaskTO;
+import org.apache.syncope.common.types.PropagationTaskExecStatus;
+import org.apache.syncope.common.types.TaskType;
+
+@Path("tasks")
+public interface TaskService {
+
+    @GET
+    @Path("{type}/count")
+    int count(@PathParam("type") TaskType taskType);
+
+    @POST
+    <T extends TaskTO> T create(T taskTO);
+
+    @DELETE
+    @Path("{type}/{taskId}")
+    <T extends TaskTO> T delete(@PathParam("type") TaskType taskType, @PathParam("taskId") Long taskId);
+
+    @DELETE
+    @Path("executions/{executionId}")
+    TaskExecTO deleteExecution(@PathParam("executionId") Long executionId);
+
+    @POST
+    @Path("{taskId}/execute")
+    TaskExecTO execute(@PathParam("taskId") Long taskId,
+            @QueryParam("dryRun") @DefaultValue("false") boolean dryRun);
+
+    @GET
+    @Path("jobClasses")
+    Set<String> getJobClasses();
+
+    @GET
+    @Path("syncActionsClasses")
+    Set<String> getSyncActionsClasses();
+
+    @GET
+    @Path("{type}")
+    <T extends TaskTO> List<T> list(@PathParam("type") TaskType taskType);
+
+    @GET
+    @Path("{type}")
+    <T extends TaskTO> List<T> list(@PathParam("type") TaskType taskType, @QueryParam("page") int page,
+            @QueryParam("size") @DefaultValue("25") int size);
+
+    @GET
+    @Path("{type}/executions")
+    List<TaskExecTO> listExecutions(@PathParam("type") TaskType taskType);
+
+    @GET
+    @Path("{type}/{taskId}")
+    <T extends TaskTO> T read(@PathParam("type") TaskType taskType, @PathParam("taskId") Long taskId);
+
+    @GET
+    @Path("executions/{executionId}")
+    TaskExecTO readExecution(@PathParam("executionId") Long executionId);
+
+    @POST
+    @Path("executions/{executionId}/report")
+    //TODO create new TaskExecutionReportTO object which contains status and message
+    TaskExecTO report(@PathParam("executionId") Long executionId,
+            @HeaderParam("Execution-Status") PropagationTaskExecStatus status, String message);
+
+    @PUT
+    @Path("{taskId}")
+    <T extends TaskTO> T update(@PathParam("taskId") Long taskId, T taskTO);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserRequestService.java Mon Jan 21 09:08:54 2013
@@ -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.common.services;
+
+import java.util.List;
+import javax.ws.rs.DELETE;
+import javax.ws.rs.GET;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import org.apache.syncope.common.mod.UserMod;
+import org.apache.syncope.common.to.UserRequestTO;
+import org.apache.syncope.common.to.UserTO;
+
+@Path("requests/user")
+public interface UserRequestService {
+
+    @GET
+    @Path("create/allowed")
+    boolean isCreateAllowed();
+
+    @POST
+    @Path("create")
+    UserRequestTO create(UserTO userTO);
+
+    @POST
+    @Path("update")
+    UserRequestTO update(UserMod userMod);
+
+    @POST
+    @Path("delete")
+    UserRequestTO delete(Long userId);
+
+    @GET
+    List<UserRequestTO> list();
+
+    @GET
+    @Path("{requestId}")
+    UserRequestTO read(@PathParam("requestId") Long requestId);
+
+    @DELETE
+    @Path("{requestId}")
+    UserRequestTO deleteRequest(@PathParam("requestId") Long requestId);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/UserService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,126 @@
+/*
+ * 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.services;
+
+import java.util.List;
+
+import javax.ws.rs.DELETE;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.GET;
+import javax.ws.rs.MatrixParam;
+import javax.ws.rs.POST;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+import javax.ws.rs.QueryParam;
+
+import org.apache.syncope.common.mod.StatusMod;
+import org.apache.syncope.common.mod.UserMod;
+import org.apache.syncope.common.search.NodeCond;
+import org.apache.syncope.common.to.UserTO;
+import org.apache.syncope.common.to.WorkflowFormTO;
+
+@Path("users")
+public interface UserService {
+
+    UserTO activate(long userId, String token);
+
+    UserTO activateByUsername(String username, String token);
+
+    @POST
+    @Path("workflow/task/{taskId}/claim")
+    WorkflowFormTO claimForm(@PathParam("taskId") String taskId);
+
+    @GET
+    @Path("count")
+    int count();
+
+    @POST
+    UserTO create(UserTO userTO);
+
+    @DELETE
+    @Path("{userId}")
+    UserTO delete(@PathParam("userId") Long userId);
+
+    @POST
+    UserTO executeWorkflow(@PathParam("taskId") String taskId, UserTO userTO);
+
+    @GET
+    @Path("{userId}/workflow/form")
+    WorkflowFormTO getFormForUser(@PathParam("userId") Long userId);
+
+    @GET
+    @Path("workflow/form")
+    List<WorkflowFormTO> getForms();
+
+    @GET
+    List<UserTO> list();
+
+    @GET
+    List<UserTO> list(@QueryParam("page") int page,
+            @QueryParam("size") @DefaultValue("25") int size);
+
+    UserTO reactivate(long userId);
+
+    UserTO reactivate(long userId, String query);
+
+    UserTO reactivateByUsername(String username);
+
+    @GET
+    @Path("{userId}")
+    UserTO read(@PathParam("userId") Long userId);
+
+    @GET
+    UserTO read(@MatrixParam("uname") String username);
+
+    UserTO readSelf();
+
+    @POST
+    @Path("search")
+    List<UserTO> search(NodeCond searchCondition);
+
+    @POST
+    @Path("search")
+    List<UserTO> search(NodeCond searchCondition, @QueryParam("page") int page,
+            @QueryParam("size") @DefaultValue("25") int size);
+
+    @POST
+    @Path("search/count")
+    int searchCount(NodeCond searchCondition);
+
+    @POST
+    @Path("user/{userId}/status")
+    public abstract UserTO setStatus(@PathParam("userId") Long userId, StatusMod statusUpdate);
+
+    @POST
+    @Path("workflow/form")
+    UserTO submitForm(WorkflowFormTO form);
+
+    UserTO suspend(long userId);
+
+    UserTO suspend(long userId, String query);
+
+    UserTO suspendByUsername(String username);
+
+    @POST
+    @Path("{userId}")
+    UserTO update(@PathParam("userId") Long userId, UserMod userMod);
+
+    @GET
+    Boolean verifyPassword(@MatrixParam("uname") String username, @MatrixParam("pwd") String password);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/services/WorkflowService.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,43 @@
+/*
+ * 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.services;
+
+import java.util.List;
+import javax.ws.rs.GET;
+import javax.ws.rs.PUT;
+import javax.ws.rs.Path;
+import javax.ws.rs.PathParam;
+
+import org.apache.syncope.common.to.WorkflowDefinitionTO;
+
+@Path("workflows")
+public interface WorkflowService {
+
+    @GET
+    @Path("{kind}")
+    WorkflowDefinitionTO getDefinition(@PathParam("kind") String kind);
+
+    @PUT
+    @Path("{kind}")
+    void updateDefinition(@PathParam("kind") String kind, WorkflowDefinitionTO definition);
+
+    @GET
+    @Path("{kind}/tasks")
+    List<String> getDefinedTasks(@PathParam("kind") String kind);
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractAttributableTO.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,171 @@
+/*
+ * 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.to;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import org.codehaus.jackson.annotate.JsonIgnore;
+
+public abstract class AbstractAttributableTO extends ConnObjectTO {
+
+    private static final long serialVersionUID = 4083884098736820255L;
+
+    private long id;
+
+    private List<AttributeTO> derivedAttributes;
+
+    private List<AttributeTO> virtualAttributes;
+
+    private Set<String> resources;
+
+    private List<PropagationTO> propagationTOs;
+
+    protected AbstractAttributableTO() {
+        super();
+
+        derivedAttributes = new ArrayList<AttributeTO>();
+        virtualAttributes = new ArrayList<AttributeTO>();
+        resources = new HashSet<String>();
+        propagationTOs = new ArrayList<PropagationTO>();
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(final long id) {
+        this.id = id;
+    }
+
+    @JsonIgnore
+    public Map<String, AttributeTO> getDerivedAttributeMap() {
+        Map<String, AttributeTO> result;
+
+        if (derivedAttributes == null) {
+            result = Collections.emptyMap();
+        } else {
+            result = new HashMap<String, AttributeTO>(derivedAttributes.size());
+            for (AttributeTO attributeTO : derivedAttributes) {
+                result.put(attributeTO.getSchema(), attributeTO);
+            }
+            result = Collections.unmodifiableMap(result);
+        }
+
+        return result;
+    }
+
+    @JsonIgnore
+    public Map<String, AttributeTO> getVirtualAttributeMap() {
+        Map<String, AttributeTO> result;
+
+        if (derivedAttributes == null) {
+            result = Collections.emptyMap();
+        } else {
+            result = new HashMap<String, AttributeTO>(virtualAttributes.size());
+            for (AttributeTO attributeTO : virtualAttributes) {
+                result.put(attributeTO.getSchema(), attributeTO);
+            }
+            result = Collections.unmodifiableMap(result);
+        }
+
+        return result;
+    }
+
+    public boolean addDerivedAttribute(final AttributeTO derivedAttribute) {
+        return derivedAttributes.add(derivedAttribute);
+    }
+
+    public boolean removeDerivedAttribute(final AttributeTO derivedAttribute) {
+        return derivedAttributes.remove(derivedAttribute);
+    }
+
+    public List<AttributeTO> getDerivedAttributes() {
+        return derivedAttributes;
+    }
+
+    public void setDerivedAttributes(final List<AttributeTO> derivedAttributes) {
+
+        this.derivedAttributes = derivedAttributes;
+    }
+
+    public boolean addVirtualAttribute(final AttributeTO virtualAttribute) {
+        return virtualAttributes.add(virtualAttribute);
+    }
+
+    public boolean removeVirtualAttribute(final AttributeTO virtualAttribute) {
+        return virtualAttributes.remove(virtualAttribute);
+    }
+
+    public List<AttributeTO> getVirtualAttributes() {
+        return virtualAttributes;
+    }
+
+    public void setVirtualAttributes(final List<AttributeTO> virtualAttributes) {
+        this.virtualAttributes = virtualAttributes;
+    }
+
+    public boolean addResource(final String resource) {
+        return resources.add(resource);
+    }
+
+    public boolean removeResource(final String resource) {
+        return resources.remove(resource);
+    }
+
+    public Set<String> getResources() {
+        return resources;
+    }
+
+    public void setResources(final Set<String> resources) {
+        this.resources = resources;
+    }
+
+    public boolean addPropagationTO(final PropagationTO status) {
+        return propagationTOs.add(status);
+    }
+
+    public boolean removePropagationTO(final String resource) {
+        if (resource != null && getPropagationTOs().isEmpty()) {
+            final List<PropagationTO> toBeRemoved = new ArrayList<PropagationTO>();
+
+            for (PropagationTO propagationTO : getPropagationTOs()) {
+                if (resource.equals(propagationTO.getResourceName())) {
+                    toBeRemoved.add(propagationTO);
+                }
+            }
+
+            return propagationTOs.removeAll(toBeRemoved);
+        }
+        return false;
+    }
+
+    public List<PropagationTO> getPropagationTOs() {
+        return propagationTOs;
+    }
+
+    public void setPropagationTOs(final List<PropagationTO> propagationTOs) {
+        this.propagationTOs.clear();
+        this.propagationTOs.addAll(propagationTOs);
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractExecTO.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,86 @@
+/*
+ * 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.to;
+
+import java.util.Date;
+
+import org.apache.syncope.common.AbstractBaseBean;
+
+public class AbstractExecTO extends AbstractBaseBean {
+
+    private static final long serialVersionUID = -4621191979198357081L;
+
+    protected long id;
+
+    protected String status;
+
+    protected String message;
+
+    protected Date startDate;
+
+    protected Date endDate;
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    public void setMessage(String message) {
+        this.message = message;
+    }
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+
+    public Date getStartDate() {
+        return startDate == null
+                ? null
+                : new Date(startDate.getTime());
+    }
+
+    public void setStartDate(Date startDate) {
+        if (startDate != null) {
+            this.startDate = new Date(startDate.getTime());
+        }
+    }
+
+    public Date getEndDate() {
+        return endDate == null
+                ? null
+                : new Date(endDate.getTime());
+    }
+
+    public void setEndDate(Date endDate) {
+        if (endDate != null) {
+            this.endDate = new Date(endDate.getTime());
+        }
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractSchemaTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractSchemaTO.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractSchemaTO.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AbstractSchemaTO.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,40 @@
+/*
+ * 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.to;
+
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.syncope.common.AbstractBaseBean;
+
+@XmlType
+public abstract class AbstractSchemaTO extends AbstractBaseBean {
+
+    private static final long serialVersionUID = 4088388951694301759L;
+
+    private String name;
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(final String name) {
+        this.name = name;
+    }
+
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AccountPolicyTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AccountPolicyTO.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AccountPolicyTO.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AccountPolicyTO.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,49 @@
+/*
+ * 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.to;
+
+import org.apache.syncope.common.types.AccountPolicySpec;
+import org.apache.syncope.common.types.PolicyType;
+
+public class AccountPolicyTO extends PolicyTO {
+
+    private static final long serialVersionUID = -1557150042828800134L;
+
+    private AccountPolicySpec specification;
+
+    public AccountPolicyTO() {
+        this(false);
+    }
+
+    public AccountPolicyTO(boolean global) {
+        super();
+
+        this.type = global
+                ? PolicyType.GLOBAL_ACCOUNT
+                : PolicyType.ACCOUNT;
+    }
+
+    public void setSpecification(final AccountPolicySpec specification) {
+        this.specification = specification;
+    }
+
+    public AccountPolicySpec getSpecification() {
+        return specification;
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/AttributeTO.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,112 @@
+/*
+ * 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.to;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.syncope.common.AbstractBaseBean;
+
+public class AttributeTO extends AbstractBaseBean {
+
+    private static final long serialVersionUID = 4941691338796323623L;
+
+    /**
+     * Name of the schema that this attribute is referring to.
+     */
+    private String schema;
+
+    /**
+     * Set of (string) values of this attribute.
+     */
+    private List<String> values;
+
+    /**
+     * Whether this attribute is read-only or not.
+     */
+    private boolean readonly;
+
+    /**
+     * Default constructor.
+     */
+    public AttributeTO() {
+        super();
+        values = new ArrayList<String>();
+        readonly = false;
+    }
+
+    /**
+     * @return the name of the schema that this attribute is referring to
+     */
+    public String getSchema() {
+        return schema;
+    }
+
+    /**
+     * @param schema name to be set
+     */
+    public void setSchema(final String schema) {
+        this.schema = schema;
+
+    }
+
+    /**
+     * @param value an attribute value to be added
+     * @return whether the operation succeeded or not
+     */
+    public boolean addValue(final String value) {
+        return value == null || isReadonly()
+                ? false
+                : values.add(value);
+    }
+
+    /**
+     * @param value an attribute value to be removed
+     * @return whether the operation succeeded or not
+     */
+    public boolean removeValue(final String value) {
+        return value == null || isReadonly()
+                ? false
+                : values.remove(value);
+    }
+
+    /**
+     * @return attribute values as strings
+     */
+    public List<String> getValues() {
+        return values;
+    }
+
+    /**
+     * @param values set of (string) values
+     */
+    public void setValues(final List<String> values) {
+        if (!isReadonly()) {
+            this.values = values;
+        }
+    }
+
+    public boolean isReadonly() {
+        return readonly;
+    }
+
+    public void setReadonly(boolean readonly) {
+        this.readonly = readonly;
+    }
+}

Added: syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConfigurationTO.java
URL: http://svn.apache.org/viewvc/syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConfigurationTO.java?rev=1436230&view=auto
==============================================================================
--- syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConfigurationTO.java (added)
+++ syncope/trunk/common/src/main/java/org/apache/syncope/common/to/ConfigurationTO.java Mon Jan 21 09:08:54 2013
@@ -0,0 +1,51 @@
+/*
+ * 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.to;
+
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.syncope.common.AbstractBaseBean;
+
+@XmlRootElement(name = "configuration")
+@XmlType
+public class ConfigurationTO extends AbstractBaseBean {
+
+    private static final long serialVersionUID = -3825039700228595590L;
+
+    private String key;
+
+    private String value;
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(final String key) {
+        this.key = key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(final String value) {
+        this.value = value;
+    }
+}