Package org.apache.roller.pojos

Examples of org.apache.roller.pojos.PingTargetData


     * Convenience method for creating a ping target.
     */
    public static PingTargetData setupPingTarget(String name, String url)
            throws Exception {
       
        PingTargetData testPing = new PingTargetData();
        testPing.setName("testCommonPing");
        testPing.setPingUrl("http://localhost/testCommonPing");
       
        // store ping
        PingTargetManager pingMgr = RollerFactory.getRoller().getPingTargetManager();
        pingMgr.savePingTarget(testPing);
       
        // query for it
        PingTargetData ping = pingMgr.getPingTarget(testPing.getId());
       
        if(ping == null)
            throw new RollerException("error setting up ping target");
       
        return ping;
View Full Code Here


     */
    public static void teardownPingTarget(String id) throws Exception {
       
        // query for it
        PingTargetManager pingMgr = RollerFactory.getRoller().getPingTargetManager();
        PingTargetData ping = pingMgr.getPingTarget(id);
       
        // remove the ping
        pingMgr.removePingTarget(ping);
    }
View Full Code Here

     *                         handled, not thrown.
     */
    private void processQueueEntry(PingQueueEntryData pingQueueEntry) throws RollerException {
        if (logger.isDebugEnabled()) logger.debug("Processing ping queue entry: " + pingQueueEntry);

        PingTargetData pingTarget = pingQueueEntry.getPingTarget();
        WebsiteData website = pingQueueEntry.getWebsite();
        boolean pingSucceeded = false;
        if (PingConfig.getLogPingsOnly()) {
            // Just log the ping and pretend it succeeded.
            logger.info("Logging simulated ping for ping queue entry " + pingQueueEntry);
View Full Code Here

            req.setAttribute("model", pageModel);
            if (!hasRequiredRights(rreq, rreq.getWebsite())) {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }

            PingTargetData pingTarget = null;
            String pingTargetId = pingTargetForm.getId();
            if (pingTargetId != null && pingTargetId.length() > 0) {
                pingTarget = pingTargetMgr.getPingTarget(pingTargetForm.getId());
                if (pingTarget == null) throw new RollerException("No such ping target id: " + pingTargetId);
                pingTargetForm.copyTo(pingTarget, req.getLocale());
View Full Code Here

            BasePageModel pageModel = new BasePageModel(getPingTargetEditTitle(), req, res, mapping);
            req.setAttribute("model", pageModel);
            if (!hasRequiredRights(rreq, rreq.getWebsite())) {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }
            PingTargetData pingTarget = select(rreq);
            ((PingTargetForm) form).copyFrom(pingTarget, req.getLocale());
            return forward;
        } catch (Exception e) {
            getLogger().error("ERROR in action", e);
            throw new ServletException(e);
View Full Code Here

            BasePageModel pageModel = new BasePageModel(getPingTargetDeleteOKTitle(), req, res, mapping);
            req.setAttribute("model", pageModel);
            if (!hasRequiredRights(rreq, rreq.getWebsite())) {
                return mapping.findForward(ACCESS_DENIED_PAGE);
            }
            PingTargetData pingTarget = select(rreq);
            ((PingTargetForm) form).copyFrom(pingTarget, req.getLocale());
            return forward;
        } catch (Exception e) {
            getLogger().error("ERROR in action", e);
            throw new ServletException(e);
View Full Code Here

            }
            String pingTargetId = pingTargetForm.getId();
            if (pingTargetId == null || pingTargetId.length() == 0) {
                throw new RollerException("Missing ping target id.");
            }
            PingTargetData ping = pingTargetMgr.getPingTarget(pingTargetId);
            pingTargetMgr.removePingTarget(ping);
            RollerFactory.getRoller().flush();
            return view(mapping, form, req, res);
        } catch (Exception e) {
            getLogger().error("ERROR in action", e);
View Full Code Here

        PingTargetManager pingTargetMgr = RollerFactory.getRoller().getPingTargetManager();
        if (pingTargetId == null || pingTargetId.length() == 0) {
            throw new RollerException("Missing ping target id: " + pingTargetId);
        }

        PingTargetData pingTarget = pingTargetMgr.getPingTarget(pingTargetId);
        if (pingTarget == null) {
            throw new RollerException("No such ping target id: " + pingTargetId);
        }
        return pingTarget;
    }
View Full Code Here

    /*
    * Set a ping target auto enabled to true.
    */
    public ActionForward enableSelected(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        PingTargetData pingTarget = select(rreq);
        try {
            if (!hasRequiredRights(rreq, rreq.getWebsite())) {
                return mapping.findForward("access-denied");
            }
            pingTarget.setAutoEnabled(true);
            RollerFactory.getRoller().flush();

            return view(mapping, form, req, res);
        } catch (Exception e) {
            mLogger.error("ERROR in action", e);
View Full Code Here

    /*
     * Set a pint target auto enabled to false.
     */
    public ActionForward disableSelected(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) throws Exception {
        RollerRequest rreq = RollerRequest.getRollerRequest(req);
        PingTargetData pingTarget = select(rreq);
        try {
            if (!hasRequiredRights(rreq, rreq.getWebsite())) {
                return mapping.findForward("access-denied");
            }
            pingTarget.setAutoEnabled(false);
            RollerFactory.getRoller().flush();

            return view(mapping, form, req, res);
        } catch (Exception e) {
            mLogger.error("ERROR in action", e);
View Full Code Here

TOP

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

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.