Package org.apache.roller.pojos

Examples of org.apache.roller.pojos.AutoPingData


        PingTargetData pingTarget = null;
        while(pingTargets.hasNext()) {
            pingTarget = (PingTargetData) pingTargets.next();
           
            if(pingTarget.isAutoEnabled()) {
                AutoPingData autoPing = new AutoPingData(null, pingTarget, newWeblog);
                autoPingMgr.saveAutoPing(autoPing);
            }
        }
    }
View Full Code Here


            throws Exception {
       
        AutoPingManager mgr = RollerFactory.getRoller().getAutopingManager();
       
        // store auto ping
        AutoPingData autoPing = new AutoPingData(null, ping, weblog);
        mgr.saveAutoPing(autoPing);
       
        // query for it
        autoPing = mgr.getAutoPing(autoPing.getId());
       
        if(autoPing == null)
            throw new RollerException("error setting up auto ping");
       
        return autoPing;
View Full Code Here

     */
    public static void teardownAutoPing(String id) throws Exception {
       
        // query for it
        AutoPingManager mgr = RollerFactory.getRoller().getAutopingManager();
        AutoPingData autoPing = mgr.getAutoPing(id);
       
        // remove the auto ping
        mgr.removeAutoPing(autoPing);
    }
View Full Code Here

     * Test basic persistence operations ... Create, Update, Delete
     */
    public void testAutoPingCRUD() throws Exception {
       
        AutoPingManager mgr = RollerFactory.getRoller().getAutopingManager();
        AutoPingData autoPing = null;
       
        // create ping target to use for tests
        PingTargetData pingTarget = TestUtils.setupPingTarget("fooPing", "http://foo/null");
        PingTargetData pingTarget2 = TestUtils.setupPingTarget("blahPing", "http://blah/null");
        TestUtils.endSession(true);
       
        // create 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.getAutoPing(id);
        assertNotNull(autoPing);
        assertEquals(pingTarget, autoPing.getPingTarget());
       
        // update autoPing
        autoPing.setPingTarget(pingTarget2);
        mgr.saveAutoPing(autoPing);
        TestUtils.endSession(true);
       
        // make sure autoPing was updated
        autoPing = null;
        autoPing = mgr.getAutoPing(id);
        assertNotNull(autoPing);
        assertEquals(pingTarget2, autoPing.getPingTarget());
       
        // delete autoPing
        mgr.removeAutoPing(autoPing);
        TestUtils.endSession(true);
       
View Full Code Here

     * Test special ping target removal methods ... by weblog/target, collection, all
     */
    public void testPingTargetRemovals() throws Exception {
       
        AutoPingManager mgr = RollerFactory.getRoller().getAutopingManager();
        AutoPingData testAutoPing = null;
       
        // create ping target to use for tests
        PingTargetData pingTarget = TestUtils.setupPingTarget("fooPing", "http://foo/null");
        PingTargetData pingTarget2 = TestUtils.setupPingTarget("blahPing", "http://blah/null");
        PingTargetData pingTarget3 = TestUtils.setupPingTarget("gahPing", "http://gah/null");
       
        // create auto pings for test
        AutoPingData autoPing = TestUtils.setupAutoPing(pingTarget, testWeblog);
        AutoPingData autoPing2 = TestUtils.setupAutoPing(pingTarget2, testWeblog);
        AutoPingData autoPing3 = TestUtils.setupAutoPing(pingTarget3, testWeblog);
        TestUtils.endSession(true);
       
        // remove by weblog/target
        mgr.removeAutoPing(pingTarget, testWeblog);
        TestUtils.endSession(true);
View Full Code Here

     * Test lookup mechanisms ... id, ping target, weblog
     */
    public void testAutoPingLookups() throws Exception {
       
        AutoPingManager mgr = RollerFactory.getRoller().getAutopingManager();
        AutoPingData autoPing = null;
       
        // create autoPing target to use for tests
        PingTargetData pingTarget = TestUtils.setupPingTarget("fooPing", "http://foo/null");
        TestUtils.endSession(true);
       
        // create autoPing
        autoPing = new AutoPingData(null, pingTarget, testWeblog);
        mgr.saveAutoPing(autoPing);
        String id = autoPing.getId();
        TestUtils.endSession(true);
       
        // lookup by id
        autoPing = null;
        autoPing = mgr.getAutoPing(id);
        assertNotNull(autoPing);
        assertEquals(pingTarget, autoPing.getPingTarget());
       
        // lookup by ping target
        List autoPings = mgr.getAutoPingsByTarget(pingTarget);
        assertNotNull(autoPings);
        assertEquals(1, autoPings.size());
View Full Code Here

            throws Exception {
       
        AutoPingManager mgr = RollerFactory.getRoller().getAutopingManager();
       
        // store auto ping
        AutoPingData autoPing = new AutoPingData(null, ping, weblog);
        mgr.saveAutoPing(autoPing);
       
        // query for it
        autoPing = mgr.getAutoPing(autoPing.getId());
       
        if(autoPing == null)
            throw new RollerException("error setting up auto ping");
       
        return autoPing;
View Full Code Here

     */
    public static void teardownAutoPing(String id) throws Exception {
       
        // query for it
        AutoPingManager mgr = RollerFactory.getRoller().getAutopingManager();
        AutoPingData autoPing = mgr.getAutoPing(id);
       
        // remove the auto ping
        mgr.removeAutoPing(autoPing);
    }
View Full Code Here

        PingTargetData pingTarget = null;
        while(pingTargets.hasNext()) {
            pingTarget = (PingTargetData) pingTargets.next();
           
            if(pingTarget.isAutoEnabled()) {
                AutoPingData autoPing = new AutoPingData(null, pingTarget, newWeblog);
                autoPingMgr.saveAutoPing(autoPing);
            }
        }
    }
View Full Code Here

       
        // TODO: new manager method for addQueueEntries(list)?
        PingQueueManager pingQueueMgr = RollerFactory.getRoller().getPingQueueManager();
        List applicableAutopings = getApplicableAutoPings(changedWeblogEntry);
        for (Iterator i = applicableAutopings.iterator(); i.hasNext(); ) {
            AutoPingData autoPing = (AutoPingData) i.next();
            pingQueueMgr.addQueueEntry(autoPing);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.roller.pojos.AutoPingData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.