Return-Path: X-Original-To: apmail-syncope-commits-archive@www.apache.org Delivered-To: apmail-syncope-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8684C10202 for ; Thu, 12 Feb 2015 09:14:08 +0000 (UTC) Received: (qmail 42690 invoked by uid 500); 12 Feb 2015 09:14:08 -0000 Delivered-To: apmail-syncope-commits-archive@syncope.apache.org Received: (qmail 42628 invoked by uid 500); 12 Feb 2015 09:14:08 -0000 Mailing-List: contact commits-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list commits@syncope.apache.org Received: (qmail 40629 invoked by uid 99); 12 Feb 2015 09:14:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2015 09:14:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7D1BBE07D9; Thu, 12 Feb 2015 09:14:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ilgrosso@apache.org To: commits@syncope.apache.org Date: Thu, 12 Feb 2015 09:14:47 -0000 Message-Id: <85b45281106d47c9809e769348b15f24@git.apache.org> In-Reply-To: <64f969544ff44a74afca1584bc629083@git.apache.org> References: <64f969544ff44a74afca1584bc629083@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [42/54] [abbrv] [partial] syncope git commit: [SYNCOPE-620] Renaming 'server' after 'core', to provide continuity with older releases (especially for archetype) http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/pom.xml ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/pom.xml b/syncope620/core/persistence-api/pom.xml new file mode 100644 index 0000000..48ceb63 --- /dev/null +++ b/syncope620/core/persistence-api/pom.xml @@ -0,0 +1,78 @@ + + + + + 4.0.0 + + + org.apache.syncope + syncope-core + 2.0.0-SNAPSHOT + + + Apache Syncope Core Persistence API + Apache Syncope Core Persistence API + org.apache.syncope.core + syncope-core-persistence-api + jar + + + ${basedir}/../.. + + + + + javax.validation + validation-api + + + + net.tirasa.connid + connector-framework + + + net.tirasa.connid + connector-framework-internal + + + net.tirasa.connid + slf4j-logging + + + + org.apache.syncope.common + syncope-common-lib + ${project.version} + + + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + org.apache.maven.plugins + maven-pmd-plugin + + + + http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/RoleEntitlementUtil.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/RoleEntitlementUtil.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/RoleEntitlementUtil.java new file mode 100644 index 0000000..f395828 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/RoleEntitlementUtil.java @@ -0,0 +1,88 @@ +/* + * 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; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.regex.Pattern; +import org.apache.syncope.core.persistence.api.entity.Entitlement; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Utility class for manipulating entitlements. + */ +public final class RoleEntitlementUtil { + + private static final Pattern ROLE_ENTITLEMENT_NAME_PATTERN = Pattern.compile("^ROLE_([\\d])+"); + + private static final Logger LOG = LoggerFactory.getLogger(RoleEntitlementUtil.class); + + public static String getEntitlementNameFromRoleKey(final Long roleKey) { + return "ROLE_" + roleKey; + } + + public static boolean isRoleEntitlement(final String entitlementName) { + return ROLE_ENTITLEMENT_NAME_PATTERN.matcher(entitlementName).matches(); + } + + public static Long getRoleKey(final String entitlementName) { + Long result = null; + + if (isRoleEntitlement(entitlementName)) { + try { + result = Long.valueOf(entitlementName.substring(entitlementName.indexOf('_') + 1)); + } catch (Exception e) { + LOG.error("unable to parse {} to Long", entitlementName, e); + } + } + + return result; + } + + public static Set getRoleKeys(final Set entitlements) { + Set result = new HashSet<>(); + + for (String entitlement : entitlements) { + if (isRoleEntitlement(entitlement)) { + Long roleId = getRoleKey(entitlement); + if (roleId != null) { + result.add(roleId); + } + } + } + + return result; + } + + public static Set getRoleKeys(final List entitlements) { + Set names = new HashSet<>(entitlements.size()); + for (Entitlement entitlement : entitlements) { + names.add(entitlement.getKey()); + } + return getRoleKeys(names); + } + + /** + * Private default constructor, for static-only classes. + */ + private RoleEntitlementUtil() { + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/SyncopeLoader.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/SyncopeLoader.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/SyncopeLoader.java new file mode 100644 index 0000000..be0caed --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/SyncopeLoader.java @@ -0,0 +1,35 @@ +/* + * 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; + +/** + * Marker interface for Syncope components initialization. + */ +public interface SyncopeLoader { + + /** + * @return the priority that the implementing class has in the initialization process. + */ + Integer getPriority(); + + /** + * Perform initialization operations. + */ + void load(); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidEntityException.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidEntityException.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidEntityException.java new file mode 100644 index 0000000..213e947 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidEntityException.java @@ -0,0 +1,129 @@ +/* + * 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.attrvalue.validation; + +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import javax.validation.ConstraintViolation; +import javax.validation.ValidationException; +import org.apache.syncope.common.lib.types.EntityViolationType; + +/** + * Exception thrown when any JPA entity fails bean validation. + */ +public class InvalidEntityException extends ValidationException { + + private static final long serialVersionUID = 3249297275444409691L; + + private final String entityClassSimpleName; + + private final Map, Set> violations = new HashMap<>(); + + /** + * Constructs a singleton map of violations from given parameters. + * + * @param entityClass class of invalid entity + * @param entityViolationType type of violation found + * @param message message to be associated to the violation + */ + public InvalidEntityException(final Class entityClass, + final EntityViolationType entityViolationType, final String message) { + + super(); + + this.entityClassSimpleName = entityClass.getSimpleName(); + + entityViolationType.setMessage(message.trim()); + + this.violations.put(entityClass, EnumSet.noneOf(EntityViolationType.class)); + this.violations.get(entityClass).add(entityViolationType); + } + + /** + * Constructs a map of violations out of given ConstraintViolation set. + * + * @param entityClassSimpleName simple class name of invalid entity + * @param violations as returned by bean validation + */ + public InvalidEntityException(final String entityClassSimpleName, + final Set> violations) { + + super(); + + this.entityClassSimpleName = entityClassSimpleName; + + for (ConstraintViolation violation : violations) { + int firstComma = violation.getMessageTemplate().indexOf(';'); + + final String key = violation.getMessageTemplate().substring( + 0, firstComma > 0 ? firstComma : violation.getMessageTemplate().length()); + + final String message = violation.getMessageTemplate().substring(firstComma > 0 ? firstComma + 1 : 0); + + EntityViolationType entityViolationType; + + try { + entityViolationType = EntityViolationType.valueOf(key.trim()); + } catch (IllegalArgumentException e) { + entityViolationType = EntityViolationType.Standard; + } + + entityViolationType.setMessage(message.trim()); + + if (!this.violations.containsKey(violation.getLeafBean().getClass())) { + this.violations.put(violation.getLeafBean().getClass(), EnumSet.noneOf(EntityViolationType.class)); + } + + this.violations.get(violation.getLeafBean().getClass()).add(entityViolationType); + } + } + + public final boolean hasViolation(final EntityViolationType type) { + boolean found = false; + for (Class entity : violations.keySet()) { + if (violations.get(entity).contains(type)) { + found = true; + } + } + + return found; + } + + public String getEntityClassSimpleName() { + return entityClassSimpleName; + } + + public final Map, Set> getViolations() { + return violations; + } + + @Override + public String getMessage() { + StringBuilder sb = new StringBuilder(); + + for (Class entity : violations.keySet()) { + sb.append(entity.getSimpleName()).append(" ").append(violations.get(entity).toString()).append(", "); + } + sb.delete(sb.lastIndexOf(", "), sb.length()); + + return sb.toString(); + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidPlainAttrValueException.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidPlainAttrValueException.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidPlainAttrValueException.java new file mode 100644 index 0000000..d529973 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/InvalidPlainAttrValueException.java @@ -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.core.persistence.api.attrvalue.validation; + +import javax.validation.ValidationException; +import org.apache.syncope.core.persistence.api.entity.PlainAttrValue; + +public class InvalidPlainAttrValueException extends ValidationException { + + private static final long serialVersionUID = -5023202610580202148L; + + public InvalidPlainAttrValueException(final String errorMessage) { + super(errorMessage); + } + + public InvalidPlainAttrValueException(final String errorMessage, final Throwable cause) { + super(errorMessage, cause); + } + + public InvalidPlainAttrValueException(final PlainAttrValue value) { + this("Could not validate " + value.getValue()); + } + + public InvalidPlainAttrValueException(final PlainAttrValue value, Throwable cause) { + this("Could not validate " + value.getValue(), cause); + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/ParsingValidationException.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/ParsingValidationException.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/ParsingValidationException.java new file mode 100644 index 0000000..1537da5 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/ParsingValidationException.java @@ -0,0 +1,30 @@ +/* + * 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.attrvalue.validation; + +import javax.validation.ValidationException; + +public class ParsingValidationException extends ValidationException { + + private static final long serialVersionUID = 5669262895008285522L; + + public ParsingValidationException(final String message, final Throwable cause) { + super(message, cause); + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/Validator.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/Validator.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/Validator.java new file mode 100644 index 0000000..2f55132 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/attrvalue/validation/Validator.java @@ -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.core.persistence.api.attrvalue.validation; + +import org.apache.syncope.core.persistence.api.entity.PlainAttrValue; + +public interface Validator { + + void validate(String value, PlainAttrValue attrValue) + throws ParsingValidationException, InvalidPlainAttrValueException; +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/content/ContentExporter.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/content/ContentExporter.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/content/ContentExporter.java new file mode 100644 index 0000000..67508f7 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/content/ContentExporter.java @@ -0,0 +1,29 @@ +/* + * 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.content; + +import java.io.OutputStream; +import javax.xml.transform.TransformerConfigurationException; +import org.xml.sax.SAXException; + +public interface ContentExporter { + + void export(OutputStream output, String uwfPrefix, String rwfPrefix) + throws SAXException, TransformerConfigurationException; +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/content/ContentLoader.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/content/ContentLoader.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/content/ContentLoader.java new file mode 100644 index 0000000..67435fa --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/content/ContentLoader.java @@ -0,0 +1,25 @@ +/* + * 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.content; + +import org.apache.syncope.core.persistence.api.SyncopeLoader; + +public interface ContentLoader extends SyncopeLoader { + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AttrTemplateDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AttrTemplateDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AttrTemplateDAO.java new file mode 100644 index 0000000..e4a1f15 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/AttrTemplateDAO.java @@ -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.core.persistence.api.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.entity.AttrTemplate; +import org.apache.syncope.core.persistence.api.entity.Schema; + +public interface AttrTemplateDAO extends DAO, Long> { + + > T find(Long key, Class reference); + + > List findBySchemaName(String schemaName, Class reference); + + > void delete(Long key, Class reference); + + > void delete(T attrTemplate); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ConfDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ConfDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ConfDAO.java new file mode 100644 index 0000000..0c2e477 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ConfDAO.java @@ -0,0 +1,35 @@ +/* + * 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.dao; + +import org.apache.syncope.core.persistence.api.entity.conf.CPlainAttr; +import org.apache.syncope.core.persistence.api.entity.conf.Conf; + +public interface ConfDAO extends DAO { + + CPlainAttr find(String key); + + CPlainAttr find(String key, String defaultValue); + + Conf get(); + + Conf save(CPlainAttr attr); + + Conf delete(String key); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ConnInstanceDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ConnInstanceDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ConnInstanceDAO.java new file mode 100644 index 0000000..a263df7 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ConnInstanceDAO.java @@ -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.core.persistence.api.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.ConnInstance; + +public interface ConnInstanceDAO extends DAO { + + ConnInstance find(Long key); + + List findAll(); + + ConnInstance save(ConnInstance connector) throws InvalidEntityException; + + void delete(Long key); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DAO.java new file mode 100644 index 0000000..4452890 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DAO.java @@ -0,0 +1,32 @@ +/* + * 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.dao; + +import org.apache.syncope.core.persistence.api.entity.Entity; + +public interface DAO, KEY> { + + void refresh(E entity); + + void detach(E entity); + + void flush(); + + void clear(); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DerAttrDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DerAttrDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DerAttrDAO.java new file mode 100644 index 0000000..49d6748 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DerAttrDAO.java @@ -0,0 +1,36 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.DerAttr; + +public interface DerAttrDAO extends DAO { + + T find(Long key, Class reference); + + List findAll(Class reference); + + T save(T derAttr) throws InvalidEntityException; + + void delete(Long key, Class reference); + + void delete(T derAttr); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DerSchemaDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DerSchemaDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DerSchemaDAO.java new file mode 100644 index 0000000..78a481f --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DerSchemaDAO.java @@ -0,0 +1,38 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.AttributableUtil; +import org.apache.syncope.core.persistence.api.entity.DerAttr; +import org.apache.syncope.core.persistence.api.entity.DerSchema; + +public interface DerSchemaDAO extends DAO { + + T find(String name, Class reference); + + List findAll(Class reference); + + List findAttrs(DerSchema schema, Class reference); + + T save(T derSchema) throws InvalidEntityException; + + void delete(String name, AttributableUtil attributableUtil); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DuplicateException.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DuplicateException.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DuplicateException.java new file mode 100644 index 0000000..5cd1da0 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/DuplicateException.java @@ -0,0 +1,35 @@ +/* + * 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.dao; + +/** + * Thrown when something is not found. + */ +public class DuplicateException extends RuntimeException { + + private static final long serialVersionUID = -8200698688516957508L; + + public DuplicateException(final String msg) { + super(msg); + } + + public DuplicateException(final String msg, final Exception cause) { + super(msg, cause); + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/EntitlementDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/EntitlementDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/EntitlementDAO.java new file mode 100644 index 0000000..e1ef492 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/EntitlementDAO.java @@ -0,0 +1,39 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.Entitlement; +import org.apache.syncope.core.persistence.api.entity.role.Role; + +public interface EntitlementDAO extends DAO { + + Entitlement find(String key); + + List findAll(); + + Entitlement save(Entitlement entitlement) throws InvalidEntityException; + + Entitlement saveRoleEntitlement(Role role); + + void delete(String key); + + void delete(Entitlement entitlement); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java new file mode 100644 index 0000000..18cb51b --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ExternalResourceDAO.java @@ -0,0 +1,47 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.common.lib.types.IntMappingType; +import org.apache.syncope.common.lib.types.PolicyType; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.ExternalResource; +import org.apache.syncope.core.persistence.api.entity.MappingItem; +import org.apache.syncope.core.persistence.api.entity.Policy; + +public interface ExternalResourceDAO extends DAO { + + ExternalResource find(String key); + + List findByPolicy(Policy policy); + + List findWithoutPolicy(PolicyType type); + + List findAll(); + + List findAllByPriority(); + + ExternalResource save(ExternalResource resource) throws InvalidEntityException; + + void deleteMapping( + String schemaName, IntMappingType intMappingType, Class reference); + + void delete(String key); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/LoggerDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/LoggerDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/LoggerDAO.java new file mode 100644 index 0000000..3ba7f3f --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/LoggerDAO.java @@ -0,0 +1,37 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.common.lib.types.LoggerType; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.Logger; + +public interface LoggerDAO extends DAO { + + Logger find(String key); + + List findAll(LoggerType type); + + Logger save(Logger logger) throws InvalidEntityException; + + void delete(String key); + + void delete(Logger logger); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/MembershipDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/MembershipDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/MembershipDAO.java new file mode 100644 index 0000000..62d50fe --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/MembershipDAO.java @@ -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.core.persistence.api.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.membership.Membership; +import org.apache.syncope.core.persistence.api.entity.role.Role; +import org.apache.syncope.core.persistence.api.entity.user.User; + +public interface MembershipDAO extends DAO { + + Membership find(Long key); + + Membership find(User user, Role role); + + List findAll(); + + Membership save(Membership membership) throws InvalidEntityException; + + void delete(Long key); + + Membership authFetch(Long key); + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/NotFoundException.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/NotFoundException.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/NotFoundException.java new file mode 100644 index 0000000..8b78503 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/NotFoundException.java @@ -0,0 +1,35 @@ +/* + * 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.dao; + +/** + * Thrown when something is not found. + */ +public class NotFoundException extends RuntimeException { + + private static final long serialVersionUID = 4810651769126663581L; + + public NotFoundException(final String msg) { + super(msg); + } + + public NotFoundException(final String msg, final Exception cause) { + super(msg, cause); + } +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/NotificationDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/NotificationDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/NotificationDAO.java new file mode 100644 index 0000000..a70489c --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/NotificationDAO.java @@ -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.core.persistence.api.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.Notification; + +public interface NotificationDAO extends DAO { + + Notification find(Long key); + + List findAll(); + + Notification save(Notification notification) throws InvalidEntityException; + + void delete(Long key); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainAttrDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainAttrDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainAttrDAO.java new file mode 100644 index 0000000..1aa5d5c --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainAttrDAO.java @@ -0,0 +1,30 @@ +/* + * 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.dao; + +import org.apache.syncope.core.persistence.api.entity.PlainAttr; + +public interface PlainAttrDAO extends DAO { + + T find(Long key, Class reference); + + void delete(Long key, Class reference); + + void delete(T attr); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainAttrValueDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainAttrValueDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainAttrValueDAO.java new file mode 100644 index 0000000..d20a253 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainAttrValueDAO.java @@ -0,0 +1,36 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.PlainAttrValue; + +public interface PlainAttrValueDAO extends DAO { + + T find(Long key, Class reference); + + List findAll(Class reference); + + T save(T attributeValue) throws InvalidEntityException; + + void delete(Long key, Class reference); + + void delete(T attributeValue); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainSchemaDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainSchemaDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainSchemaDAO.java new file mode 100644 index 0000000..791ddaf --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PlainSchemaDAO.java @@ -0,0 +1,38 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.AttributableUtil; +import org.apache.syncope.core.persistence.api.entity.PlainAttr; +import org.apache.syncope.core.persistence.api.entity.PlainSchema; + +public interface PlainSchemaDAO extends DAO { + + T find(String key, Class reference); + + List findAll(Class reference); + + List findAttrs(PlainSchema schema, Class reference); + + T save(T schema) throws InvalidEntityException; + + void delete(String name, AttributableUtil attributableUtil); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PolicyDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PolicyDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PolicyDAO.java new file mode 100644 index 0000000..0eefcbb --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/PolicyDAO.java @@ -0,0 +1,48 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.common.lib.types.PolicyType; +import org.apache.syncope.core.persistence.api.entity.AccountPolicy; +import org.apache.syncope.core.persistence.api.entity.ExternalResource; +import org.apache.syncope.core.persistence.api.entity.PasswordPolicy; +import org.apache.syncope.core.persistence.api.entity.Policy; +import org.apache.syncope.core.persistence.api.entity.SyncPolicy; + +public interface PolicyDAO extends DAO { + + T find(Long key); + + List find(PolicyType type); + + List findByResource(ExternalResource resource); + + PasswordPolicy getGlobalPasswordPolicy(); + + AccountPolicy getGlobalAccountPolicy(); + + SyncPolicy getGlobalSyncPolicy(); + + List findAll(); + + T save(T policy); + + void delete(T policy); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ReportDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ReportDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ReportDAO.java new file mode 100644 index 0000000..3be0df7 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ReportDAO.java @@ -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.core.persistence.api.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.dao.search.OrderByClause; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.Report; + +public interface ReportDAO extends DAO { + + Report find(Long key); + + List findAll(); + + List findAll(int page, int itemsPerPage, List orderByClauses); + + int count(); + + Report save(Report report) throws InvalidEntityException; + + void delete(Long key); + + void delete(Report report); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ReportExecDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ReportExecDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ReportExecDAO.java new file mode 100644 index 0000000..726628f --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/ReportExecDAO.java @@ -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.core.persistence.api.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.Report; +import org.apache.syncope.core.persistence.api.entity.ReportExec; + +public interface ReportExecDAO extends DAO { + + ReportExec find(Long key); + + ReportExec findLatestStarted(Report report); + + ReportExec findLatestEnded(Report report); + + List findAll(); + + ReportExec save(ReportExec execution) throws InvalidEntityException; + + void delete(Long key); + + void delete(ReportExec execution); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RoleDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RoleDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RoleDAO.java new file mode 100644 index 0000000..bad9b47 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/RoleDAO.java @@ -0,0 +1,92 @@ +/* + * 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.dao; + +import java.util.List; +import java.util.Map; +import org.apache.syncope.common.lib.types.PolicyType; +import org.apache.syncope.common.lib.types.PropagationByResource; +import org.apache.syncope.core.persistence.api.dao.search.OrderByClause; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.Entitlement; +import org.apache.syncope.core.persistence.api.entity.ExternalResource; +import org.apache.syncope.core.persistence.api.entity.Policy; +import org.apache.syncope.core.persistence.api.entity.membership.Membership; +import org.apache.syncope.core.persistence.api.entity.role.RDerAttr; +import org.apache.syncope.core.persistence.api.entity.role.RPlainAttr; +import org.apache.syncope.core.persistence.api.entity.role.RPlainAttrValue; +import org.apache.syncope.core.persistence.api.entity.role.RVirAttr; +import org.apache.syncope.core.persistence.api.entity.role.Role; + +public interface RoleDAO extends SubjectDAO { + + Role find(Long key); + + List find(String name); + + Role find(String name, Long parent); + + List findOwnedByUser(Long userId); + + List findOwnedByRole(Long roleId); + + List findByEntitlement(Entitlement entitlement); + + List findByPolicy(Policy policy); + + List findWithoutPolicy(PolicyType type); + + List findAncestors(Role role); + + List findChildren(Role role); + + List findDescendants(Role role); + + List findByDerAttrValue(String schemaName, String value); + + List findByAttrValue(String schemaName, RPlainAttrValue attrValue); + + Role findByAttrUniqueValue(String schemaName, RPlainAttrValue attrUniqueValue); + + List findByResource(ExternalResource resource); + + List findAll(); + + List findAll(int page, int itemsPerPage, List orderBy); + + List findMemberships(Role role); + + int count(); + + Role save(Role role) throws InvalidEntityException; + + void delete(Role role); + + void delete(Long key); + + Role authFetch(Long key); + + /** + * Finds users having resources assigned exclusively because of memberships of the given role. + * + * @param roleKey role key + * @return map containing pairs with user key and operations to be performed on those resources (DELETE, typically). + */ + Map findUsersWithIndirectResources(Long roleKey); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SecurityQuestionDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SecurityQuestionDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SecurityQuestionDAO.java new file mode 100644 index 0000000..ba66a4b --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SecurityQuestionDAO.java @@ -0,0 +1,35 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion; + +public interface SecurityQuestionDAO extends DAO { + + SecurityQuestion find(Long key); + + List findAll(); + + SecurityQuestion save(SecurityQuestion securityQuestion) throws InvalidEntityException; + + void delete(Long key); + +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SubjectDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SubjectDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SubjectDAO.java new file mode 100644 index 0000000..9e909d7 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SubjectDAO.java @@ -0,0 +1,44 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.entity.AttributableUtil; +import org.apache.syncope.core.persistence.api.entity.DerAttr; +import org.apache.syncope.core.persistence.api.entity.ExternalResource; +import org.apache.syncope.core.persistence.api.entity.PlainAttr; +import org.apache.syncope.core.persistence.api.entity.PlainAttrValue; +import org.apache.syncope.core.persistence.api.entity.Subject; +import org.apache.syncope.core.persistence.api.entity.VirAttr; + +public interface SubjectDAO

+ extends DAO, Long> { + + List> findByAttrValue( + String schemaName, PlainAttrValue attrValue, AttributableUtil attrUtil); + + Subject findByAttrUniqueValue( + String schemaName, PlainAttrValue attrUniqueValue, AttributableUtil attrUtil); + + List> findByDerAttrValue( + String schemaName, String value, AttributableUtil attrUtil); + + List> findByResource( + ExternalResource resource, AttributableUtil attrUtil); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SubjectSearchDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SubjectSearchDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SubjectSearchDAO.java new file mode 100644 index 0000000..08e1851 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/SubjectSearchDAO.java @@ -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.core.persistence.api.dao; + +import java.util.List; +import java.util.Set; +import org.apache.syncope.common.lib.types.SubjectType; +import org.apache.syncope.core.persistence.api.dao.search.OrderByClause; +import org.apache.syncope.core.persistence.api.dao.search.SearchCond; +import org.apache.syncope.core.persistence.api.entity.DerAttr; +import org.apache.syncope.core.persistence.api.entity.PlainAttr; +import org.apache.syncope.core.persistence.api.entity.Subject; +import org.apache.syncope.core.persistence.api.entity.VirAttr; + +public interface SubjectSearchDAO extends DAO, Long> { + + /** + * @param adminRoles the set of admin roles owned by the caller + * @param searchCondition the search condition + * @param type user or role + * @return size of search result + */ + int count(Set adminRoles, SearchCond searchCondition, SubjectType type); + + /** + * @param adminRoles the set of admin roles owned by the caller + * @param searchCondition the search condition + * @param type user or role + * @param user/role + * @return the list of users/roles matching the given search condition + */ + > List search( + Set adminRoles, SearchCond searchCondition, SubjectType type); + + /** + * @param adminRoles the set of admin roles owned by the caller + * @param searchCondition the search condition + * @param orderBy list of ordering clauses + * @param type user or role + * @param user/role + * @return the list of users/roles matching the given search condition + */ + > List search( + Set adminRoles, SearchCond searchCondition, List orderBy, SubjectType type); + + /** + * @param adminRoles the set of admin roles owned by the caller + * @param searchCondition the search condition + * @param page position of the first result, start from 1 + * @param itemsPerPage number of results per page + * @param orderBy list of ordering clauses + * @param type user or role + * @param user/role + * @return the list of users/roles matching the given search condition (in the given page) + */ + > List search( + Set adminRoles, SearchCond searchCondition, int page, int itemsPerPage, + List orderBy, SubjectType type); + + /** + * Verify if user/role matches the given search condition. + * + * @param subject to be checked + * @param searchCondition to be verified + * @param type user or role + * @param user/role + * @return true if user/role matches searchCondition + */ + > boolean matches(T subject, SearchCond searchCondition, SubjectType type); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskDAO.java new file mode 100644 index 0000000..28c90a6 --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskDAO.java @@ -0,0 +1,52 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.common.lib.types.TaskType; +import org.apache.syncope.core.persistence.api.dao.search.OrderByClause; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.ExternalResource; +import org.apache.syncope.core.persistence.api.entity.task.Task; + +public interface TaskDAO extends DAO { + + Class getEntityReference(TaskType type); + + T find(Long key); + + List findToExec(TaskType type); + + List findAll(ExternalResource resource, TaskType type); + + List findAll(TaskType type); + + List findAll( + int page, int itemsPerPage, List orderByClauses, TaskType type); + + int count(TaskType type); + + T save(T task) throws InvalidEntityException; + + void delete(Long key); + + void delete(Task task); + + void deleteAll(ExternalResource resource, TaskType type); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskExecDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskExecDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskExecDAO.java new file mode 100644 index 0000000..e0f58ff --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/TaskExecDAO.java @@ -0,0 +1,44 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.common.lib.types.TaskType; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.task.Task; +import org.apache.syncope.core.persistence.api.entity.task.TaskExec; + +public interface TaskExecDAO extends DAO { + + TaskExec find(Long key); + + TaskExec findLatestStarted(T task); + + TaskExec findLatestEnded(T task); + + List findAll(TaskType type); + + TaskExec save(TaskExec execution) throws InvalidEntityException; + + void saveAndAdd(Long taskId, TaskExec execution) throws InvalidEntityException; + + void delete(Long key); + + void delete(TaskExec execution); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java new file mode 100644 index 0000000..32d23fc --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/UserDAO.java @@ -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.core.persistence.api.dao; + +import java.util.List; +import java.util.Set; +import org.apache.syncope.core.persistence.api.dao.search.OrderByClause; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.ExternalResource; +import org.apache.syncope.core.persistence.api.entity.user.SecurityQuestion; +import org.apache.syncope.core.persistence.api.entity.user.UDerAttr; +import org.apache.syncope.core.persistence.api.entity.user.UPlainAttr; +import org.apache.syncope.core.persistence.api.entity.user.UPlainAttrValue; +import org.apache.syncope.core.persistence.api.entity.user.UVirAttr; +import org.apache.syncope.core.persistence.api.entity.user.User; + +public interface UserDAO extends SubjectDAO { + + User find(Long key); + + User find(String username); + + User findByWorkflowId(String workflowId); + + User findByToken(String token); + + List findBySecurityQuestion(SecurityQuestion securityQuestion); + + List findByDerAttrValue(String schemaName, String value); + + List findByAttrValue(String schemaName, UPlainAttrValue attrValue); + + User findByAttrUniqueValue(String schemaName, UPlainAttrValue attrUniqueValue); + + List findByResource(ExternalResource resource); + + List findAll(Set adminRoles, int page, int itemsPerPage); + + List findAll(Set adminRoles, int page, int itemsPerPage, List orderBy); + + int count(Set adminRoles); + + User save(User user) throws InvalidEntityException; + + void delete(Long key); + + void delete(User user); + + User authFetch(Long key); + + User authFetch(String username); +} http://git-wip-us.apache.org/repos/asf/syncope/blob/d30c8526/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/VirAttrDAO.java ---------------------------------------------------------------------- diff --git a/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/VirAttrDAO.java b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/VirAttrDAO.java new file mode 100644 index 0000000..2c4e1cc --- /dev/null +++ b/syncope620/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/dao/VirAttrDAO.java @@ -0,0 +1,36 @@ +/* + * 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.dao; + +import java.util.List; +import org.apache.syncope.core.persistence.api.attrvalue.validation.InvalidEntityException; +import org.apache.syncope.core.persistence.api.entity.VirAttr; + +public interface VirAttrDAO extends DAO { + + T find(Long key, Class reference); + + List findAll(Class reference); + + T save(T virtualAttribute) throws InvalidEntityException; + + void delete(Long key, Class reference); + + void delete(T virAttr); +}