From a5d33af2e60d47549fbe5889256c6210565ffc79 Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Sat, 26 Nov 2005 09:20:37 +0000 Subject: [PATCH] Remove classes. --- .../domain/service/CreatableManager.java | 38 -------------- .../domain/service/CreatableManagerImpl.java | 36 ------------- .../acegisecurity/domain/service/Manager.java | 35 ------------- .../domain/service/ManagerImpl.java | 37 ------------- .../domain/service/UpdatableManager.java | 51 ------------------ .../domain/service/UpdatableManagerImpl.java | 52 ------------------- 6 files changed, 249 deletions(-) delete mode 100644 domain/src/main/java/org/acegisecurity/domain/service/CreatableManager.java delete mode 100644 domain/src/main/java/org/acegisecurity/domain/service/CreatableManagerImpl.java delete mode 100644 domain/src/main/java/org/acegisecurity/domain/service/Manager.java delete mode 100644 domain/src/main/java/org/acegisecurity/domain/service/ManagerImpl.java delete mode 100644 domain/src/main/java/org/acegisecurity/domain/service/UpdatableManager.java delete mode 100644 domain/src/main/java/org/acegisecurity/domain/service/UpdatableManagerImpl.java diff --git a/domain/src/main/java/org/acegisecurity/domain/service/CreatableManager.java b/domain/src/main/java/org/acegisecurity/domain/service/CreatableManager.java deleted file mode 100644 index be4fb1dd8f..0000000000 --- a/domain/src/main/java/org/acegisecurity/domain/service/CreatableManager.java +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright 2004, 2005 Acegi Technology Pty Limited - * - * Licensed 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.acegisecurity.domain.service; - -import org.acegisecurity.domain.PersistableEntity; - -/** - * Adds a creation method to the ImmutableManager. - * - * @author Ben Alex - * @version $Id$ - */ -public interface CreatableManager extends ImmutableManager { - //~ Methods ================================================================ - - /** - * Create a new object, with the current {@link - * PersistableEntity#getInternalId()} value being ignored. - * - * @param value (without the identity property initialized) - * - * @return the value created (with the identity property initialised) - */ - public E create(E value); -} diff --git a/domain/src/main/java/org/acegisecurity/domain/service/CreatableManagerImpl.java b/domain/src/main/java/org/acegisecurity/domain/service/CreatableManagerImpl.java deleted file mode 100644 index 1b816e2104..0000000000 --- a/domain/src/main/java/org/acegisecurity/domain/service/CreatableManagerImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -/* Copyright 2004, 2005 Acegi Technology Pty Limited - * - * Licensed 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.acegisecurity.domain.service; - -import org.acegisecurity.domain.PersistableEntity; - -import org.springframework.util.Assert; - -/** - * Base {@link CreatableManager} implementation. - * - * @author Ben Alex - * @version $Id$ - */ -public class CreatableManagerImpl extends ImmutableManagerImpl implements CreatableManager { - public E create(E value) { - Assert.notNull(value); - if (logger.isDebugEnabled()) { - logger.debug("Creating: " + value); - } - return dao.create(value); - } -} diff --git a/domain/src/main/java/org/acegisecurity/domain/service/Manager.java b/domain/src/main/java/org/acegisecurity/domain/service/Manager.java deleted file mode 100644 index 65b2552a94..0000000000 --- a/domain/src/main/java/org/acegisecurity/domain/service/Manager.java +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2004, 2005 Acegi Technology Pty Limited - * - * Licensed 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.acegisecurity.domain.service; - -import org.acegisecurity.domain.PersistableEntity; - -/** - * Adds a deletion method to UpdatableManager, thus providing CRUD - * use case support. - * - * @author Ben Alex - * @version $Id$ - */ -public interface Manager extends UpdatableManager { - //~ Methods ================================================================ - /** - * Delete an object. - * - * @param value the value to delete - */ - public void delete(E value); -} diff --git a/domain/src/main/java/org/acegisecurity/domain/service/ManagerImpl.java b/domain/src/main/java/org/acegisecurity/domain/service/ManagerImpl.java deleted file mode 100644 index e043a3b540..0000000000 --- a/domain/src/main/java/org/acegisecurity/domain/service/ManagerImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 2004, 2005 Acegi Technology Pty Limited - * - * Licensed 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.acegisecurity.domain.service; - -import org.acegisecurity.domain.PersistableEntity; - -import org.springframework.util.Assert; - -/** - * Base {@link Manager} implementation. - * - * @author Ben Alex - * @version $Id$ - */ -public class ManagerImpl extends UpdatableManagerImpl implements Manager { - public void delete(E value) { - Assert.notNull(value); - if (logger.isDebugEnabled()) { - logger.debug("Deleting: " + value); - } - dao.delete(value); - } - -} diff --git a/domain/src/main/java/org/acegisecurity/domain/service/UpdatableManager.java b/domain/src/main/java/org/acegisecurity/domain/service/UpdatableManager.java deleted file mode 100644 index 15d832df01..0000000000 --- a/domain/src/main/java/org/acegisecurity/domain/service/UpdatableManager.java +++ /dev/null @@ -1,51 +0,0 @@ -/* Copyright 2004, 2005 Acegi Technology Pty Limited - * - * Licensed 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.acegisecurity.domain.service; - -import org.acegisecurity.domain.PersistableEntity; - -/** - * Adds update (but no delete) methods to the CreatableManager. - * - * @author Ben Alex - * @version $Id$ - */ -public interface UpdatableManager extends CreatableManager { - //~ Methods ================================================================ - - /** - * Saves an existing object to the persistence layer, or creates a new - * object in the persistence layer. Implementations typically rely on - * {@link PersistableEntity#getInternalId()} being non-null - * to differentiate between persistence instances previous saved and those - * requiring initial creation. - * - * @param value to save or update - * - * @return the saved or updated (as appropriate) value - */ - public E createOrUpdate(E value); - - /** - * Update an object. - * - * @param value to update, with the PersistableEntity having a - * non-null identifier - * - * @return the updated value - */ - public E update(E value); -} diff --git a/domain/src/main/java/org/acegisecurity/domain/service/UpdatableManagerImpl.java b/domain/src/main/java/org/acegisecurity/domain/service/UpdatableManagerImpl.java deleted file mode 100644 index 18f4a5cdb7..0000000000 --- a/domain/src/main/java/org/acegisecurity/domain/service/UpdatableManagerImpl.java +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2004, 2005 Acegi Technology Pty Limited - * - * Licensed 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.acegisecurity.domain.service; - -import org.acegisecurity.domain.PersistableEntity; - -import org.springframework.util.Assert; - -/** - * Base {@link UpdatableManager} implementation. - * - * @author Ben Alex - * @version $Id$ - */ -public class UpdatableManagerImpl extends CreatableManagerImpl implements UpdatableManager { - - public E update(E value) { - Assert.notNull(value); - if (logger.isDebugEnabled()) { - logger.debug("Updating: " + value); - } - return dao.update(value); - } - - /** - * Delegates to the appropriate services layer method (not the DAO). - */ - public E createOrUpdate(E value) { - Assert.notNull(value); - if (logger.isDebugEnabled()) { - logger.debug("CreatingOrUpdating: " + value); - } - if (value.getInternalId() == null) { - return create(value); - } else { - return update(value); - } - } -}