Return-Path: Delivered-To: apmail-maven-continuum-commits-archive@www.apache.org Received: (qmail 23965 invoked from network); 26 Dec 2006 23:44:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Dec 2006 23:44:17 -0000 Received: (qmail 49751 invoked by uid 500); 26 Dec 2006 21:57:44 -0000 Delivered-To: apmail-maven-continuum-commits-archive@maven.apache.org Received: (qmail 49728 invoked by uid 500); 26 Dec 2006 21:57:43 -0000 Mailing-List: contact continuum-commits-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: continuum-dev@maven.apache.org Delivered-To: mailing list continuum-commits@maven.apache.org Received: (qmail 49715 invoked by uid 99); 26 Dec 2006 21:57:43 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Dec 2006 13:57:43 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Dec 2006 13:57:36 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 9542F1A981A; Tue, 26 Dec 2006 13:56:43 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r490384 - /maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/RefactoredContinuumStore.java Date: Tue, 26 Dec 2006 21:56:43 -0000 To: continuum-commits@maven.apache.org From: rinku@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061226215643.9542F1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rinku Date: Tue Dec 26 13:56:41 2006 New Revision: 490384 URL: http://svn.apache.org/viewvc?view=rev&rev=490384 Log: o just a proof of concept for review. Added: maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/RefactoredContinuumStore.java (with props) Added: maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/RefactoredContinuumStore.java URL: http://svn.apache.org/viewvc/maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/RefactoredContinuumStore.java?view=auto&rev=490384 ============================================================================== --- maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/RefactoredContinuumStore.java (added) +++ maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/RefactoredContinuumStore.java Tue Dec 26 13:56:41 2006 @@ -0,0 +1,112 @@ +package org.apache.maven.continuum.store; + +/* + * Copyright 2004-2005 The Apache Software Foundation. + * + * 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. + */ + +import org.apache.maven.continuum.key.GroupProjectKey; +import org.apache.maven.continuum.model.project.Profile; +import org.apache.maven.continuum.model.project.Project; +import org.apache.maven.continuum.model.project.ProjectGroup; +import org.apache.maven.continuum.model.project.Schedule; + +/** + * Defines the contract consisting of operations that can be performed on + * system's entities. + *

+ * TODO: Add operations for {@link Schedule}, {@link Profile} etc. + * + * @author Rahul Thakur + * @version $Id$ + * @since 1.1 + */ +public interface RefactoredContinuumStore +{ + + /** + * Looks up the underlying store and returns a {@link Project} instance that + * matches the key specified by the passed in {@link GroupProjectKey}. + * + * @param key Composite key that identifies the target project under a + * group. + * @return {@link Project} instance that matches the specified key. + * @throws ContinuumObjectNotFoundException if the instance could not be + * looked up. + */ + public Project lookupProject( GroupProjectKey key ) + throws ContinuumObjectNotFoundException, ContinuumStoreException; + + /** + * Looks up the underlying store and returns a {@link Project} instance that + * matches the key specified by the passed in {@link GroupProjectKey}. + *

+ * The key is the {@link ProjectGroup}'s key that is obtained from + * {@link GroupProjectKey#getGroupKey()}. + * + * @param key Composite key that identifies the target project group. + * @return {@link ProjectGroup} instance that matches the specified key. + * @throws ContinuumObjectNotFoundException if the instance could not be + * looked up. + */ + public ProjectGroup lookupProjectGroup( GroupProjectKey key ) + throws ContinuumObjectNotFoundException, ContinuumStoreException; + + /** + * Persists the passed in {@link Project} instance to the underlying store. + *

+ * If the entity instance already exists in the database it is updated, else + * a new instance is created and an store-generated identifier assigned to + * it. + * + * @param project {@link Project} instance to be created/saved. + * @return updated {@link Project} instance. + * @throws ContinuumStoreException if there was an error saving the entity. + */ + public Project saveProject( Project project ) throws ContinuumStoreException; + + /** + * Persists the passed in {@link ProjectGroup} instance to the underlying + * store. + *

+ * If the entity instance already exists in the database it is updated, else + * a new instance is created and an store-generated identifier assigned to + * it. + * + * @param project {@link ProjectGroup} instance to be created/saved. + * @return updated {@link ProjectGroup} instance. + * @throws ContinuumStoreException if there was an error saving the entity. + */ + public ProjectGroup saveProjectGroup( ProjectGroup projectGroup ) throws ContinuumStoreException; + + /** + * Removes the passed {@link Project} instance from the underlying store. + * + * @param project {@link Project} instance to remove. + * @throws ContinuumStoreException if there was an error removing the + * entity. + */ + public void deleteProject( Project project ) throws ContinuumStoreException; + + /** + * Removes the passed {@link ProjectGroup} instance from the underlying + * store. + * + * @param project {@link ProjectGroup} instance to remove. + * @throws ContinuumStoreException if there was an error removing the + * entity. + */ + public void deleteProjectGroup( ProjectGroup project ) throws ContinuumStoreException; + +} Propchange: maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/RefactoredContinuumStore.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: maven/continuum/branches/key-based-refactor/continuum-api/src/main/java/org/apache/maven/continuum/store/RefactoredContinuumStore.java ------------------------------------------------------------------------------ svn:keywords = "Author Date Id Revision"