roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agillil...@apache.org
Subject svn commit: r395366 - in /incubator/roller/branches/roller-newbackend: src/org/roller/business/hibernate/ src/org/roller/model/ src/org/roller/presentation/weblog/actions/ tests/org/roller/ tests/org/roller/business/
Date Wed, 19 Apr 2006 19:32:43 GMT
Author: agilliland
Date: Wed Apr 19 12:32:41 2006
New Revision: 395366

URL: http://svn.apache.org/viewcvs?rev=395366&view=rev
Log:
manager method name refactorings for AutoPingManager.

storeXXX() -> saveXXX()
retrieveXXX() -> getXXX()
createXXX() -> addXXX() (or is removed)


Modified:
    incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateAutoPingManagerImpl.java
    incubator/roller/branches/roller-newbackend/src/org/roller/model/AutoPingManager.java
    incubator/roller/branches/roller-newbackend/src/org/roller/presentation/weblog/actions/PingSetupAction.java
    incubator/roller/branches/roller-newbackend/tests/org/roller/TestUtils.java
    incubator/roller/branches/roller-newbackend/tests/org/roller/business/PingsTest.java

Modified: incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateAutoPingManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateAutoPingManagerImpl.java?rev=395366&r1=395365&r2=395366&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateAutoPingManagerImpl.java
(original)
+++ incubator/roller/branches/roller-newbackend/src/org/roller/business/hibernate/HibernateAutoPingManagerImpl.java
Wed Apr 19 12:32:41 2006
@@ -46,18 +46,12 @@
     }
     
     
-    public AutoPingData createAutoPing(PingTargetData pingTarget, WebsiteData website) 
-            throws RollerException {
-        return new AutoPingData(null, pingTarget, website);
-    }
-    
-    
-    public AutoPingData retrieveAutoPing(String id) throws RollerException {
+    public AutoPingData getAutoPing(String id) throws RollerException {
         return (AutoPingData) strategy.load(id, AutoPingData.class);
     }
     
     
-    public void storeAutoPing(AutoPingData autoPing) throws RollerException {
+    public void saveAutoPing(AutoPingData autoPing) throws RollerException {
         strategy.store(autoPing);
     }
     

Modified: incubator/roller/branches/roller-newbackend/src/org/roller/model/AutoPingManager.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/model/AutoPingManager.java?rev=395366&r1=395365&r2=395366&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/src/org/roller/model/AutoPingManager.java
(original)
+++ incubator/roller/branches/roller-newbackend/src/org/roller/model/AutoPingManager.java
Wed Apr 19 12:32:41 2006
@@ -8,7 +8,6 @@
 
 package org.roller.model;
 
-import java.io.Serializable;
 import java.util.Collection;
 import java.util.List;
 import org.roller.RollerException;
@@ -21,19 +20,7 @@
 /**
  * Manages autoping storage/retrieval, queries and queue.
  */
-public interface AutoPingManager extends Serializable {
-    
-    
-    /**
-     * Create an auto ping configuration specifying that the given ping target is to be pinged
when the given website
-     * changes.
-     * @param pingTarget target to ping
-     * @param website website whose changes should trigger the ping
-     * @return new auto ping configuration
-     * @throws RollerException
-     */
-    public AutoPingData createAutoPing(PingTargetData pingTarget, WebsiteData website)
-            throws RollerException;
+public interface AutoPingManager {
     
     
     /**
@@ -42,7 +29,8 @@
      * @param autoPing the auto ping configuration
      * @throws RollerException
      */
-    public void storeAutoPing(AutoPingData autoPing) throws RollerException;
+    public void saveAutoPing(AutoPingData autoPing) throws RollerException;
+    
     
     /**
      * Remove the auto ping configuration with given id.
@@ -88,7 +76,7 @@
      * @return the auto ping configuration with specified id or null if not found
      * @throws RollerException
      */
-    public AutoPingData retrieveAutoPing(String id) throws RollerException;
+    public AutoPingData getAutoPing(String id) throws RollerException;
     
     
     /**

Modified: incubator/roller/branches/roller-newbackend/src/org/roller/presentation/weblog/actions/PingSetupAction.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/src/org/roller/presentation/weblog/actions/PingSetupAction.java?rev=395366&r1=395365&r2=395366&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/src/org/roller/presentation/weblog/actions/PingSetupAction.java
(original)
+++ incubator/roller/branches/roller-newbackend/src/org/roller/presentation/weblog/actions/PingSetupAction.java
Wed Apr 19 12:32:41 2006
@@ -181,9 +181,8 @@
             {
                 return mapping.findForward("access-denied");
             }
-            AutoPingData autoPing = autoPingMgr.createAutoPing(pingTarget, 
-                    rreq.getWebsite());
-            autoPingMgr.storeAutoPing(autoPing);
+            AutoPingData autoPing = new AutoPingData(null, pingTarget, rreq.getWebsite());
+            autoPingMgr.saveAutoPing(autoPing);
             RollerFactory.getRoller().flush();
 
             return view(mapping, form, req, res);

Modified: incubator/roller/branches/roller-newbackend/tests/org/roller/TestUtils.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/tests/org/roller/TestUtils.java?rev=395366&r1=395365&r2=395366&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/tests/org/roller/TestUtils.java (original)
+++ incubator/roller/branches/roller-newbackend/tests/org/roller/TestUtils.java Wed Apr 19
12:32:41 2006
@@ -275,11 +275,11 @@
         AutoPingManager mgr = RollerFactory.getRoller().getAutopingManager();
         
         // store auto ping
-        AutoPingData autoPing = mgr.createAutoPing(ping, weblog);
-        mgr.storeAutoPing(autoPing);
+        AutoPingData autoPing = new AutoPingData(null, ping, weblog);
+        mgr.saveAutoPing(autoPing);
         
         // query for it
-        autoPing = mgr.retrieveAutoPing(autoPing.getId());
+        autoPing = mgr.getAutoPing(autoPing.getId());
         
         if(autoPing == null)
             throw new RollerException("error setting up auto ping");
@@ -295,7 +295,7 @@
         
         // query for it
         AutoPingManager mgr = RollerFactory.getRoller().getAutopingManager();
-        AutoPingData autoPing = mgr.retrieveAutoPing(id);
+        AutoPingData autoPing = mgr.getAutoPing(id);
         
         // remove the auto ping
         mgr.removeAutoPing(autoPing);

Modified: incubator/roller/branches/roller-newbackend/tests/org/roller/business/PingsTest.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller-newbackend/tests/org/roller/business/PingsTest.java?rev=395366&r1=395365&r2=395366&view=diff
==============================================================================
--- incubator/roller/branches/roller-newbackend/tests/org/roller/business/PingsTest.java (original)
+++ incubator/roller/branches/roller-newbackend/tests/org/roller/business/PingsTest.java Wed
Apr 19 12:32:41 2006
@@ -229,25 +229,25 @@
         TestUtils.endSession(true);
         
         // create autoPing
-        autoPing = mgr.createAutoPing(pingTarget, testWeblog);
-        mgr.storeAutoPing(autoPing);
+        autoPing = new AutoPingData(null, pingTarget, testWeblog);
+        mgr.saveAutoPing(autoPing);
         String id = autoPing.getId();
         TestUtils.endSession(true);
         
         // make sure autoPing was stored
         autoPing = null;
-        autoPing = mgr.retrieveAutoPing(id);
+        autoPing = mgr.getAutoPing(id);
         assertNotNull(autoPing);
         assertEquals(pingTarget, autoPing.getPingTarget());
         
         // update autoPing
         autoPing.setPingTarget(pingTarget2);
-        mgr.storeAutoPing(autoPing);
+        mgr.saveAutoPing(autoPing);
         TestUtils.endSession(true);
         
         // make sure autoPing was updated
         autoPing = null;
-        autoPing = mgr.retrieveAutoPing(id);
+        autoPing = mgr.getAutoPing(id);
         assertNotNull(autoPing);
         assertEquals(pingTarget2, autoPing.getPingTarget());
         
@@ -257,7 +257,7 @@
         
         // make sure common autoPing was deleted
         autoPing = null;
-        autoPing = mgr.retrieveAutoPing(id);
+        autoPing = mgr.getAutoPing(id);
         assertNull(autoPing);
         
         // teardown test ping target
@@ -292,7 +292,7 @@
         
         // make sure remove succeeded
         testAutoPing = null;
-        testAutoPing = mgr.retrieveAutoPing(autoPing.getId());
+        testAutoPing = mgr.getAutoPing(autoPing.getId());
         assertNull(testAutoPing);
         
         // remove a collection
@@ -342,14 +342,14 @@
         TestUtils.endSession(true);
         
         // create autoPing
-        autoPing = mgr.createAutoPing(pingTarget, testWeblog);
-        mgr.storeAutoPing(autoPing);
+        autoPing = new AutoPingData(null, pingTarget, testWeblog);
+        mgr.saveAutoPing(autoPing);
         String id = autoPing.getId();
         TestUtils.endSession(true);
         
         // lookup by id
         autoPing = null;
-        autoPing = mgr.retrieveAutoPing(id);
+        autoPing = mgr.getAutoPing(id);
         assertNotNull(autoPing);
         assertEquals(pingTarget, autoPing.getPingTarget());
         



Mime
View raw message