001: /**
002: * Copyright (c) 2003-2007, David A. Czarnecki
003: * All rights reserved.
004: *
005: * Redistribution and use in source and binary forms, with or without
006: * modification, are permitted provided that the following conditions are met:
007: *
008: * Redistributions of source code must retain the above copyright notice, this list of conditions and the
009: * following disclaimer.
010: * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
011: * following disclaimer in the documentation and/or other materials provided with the distribution.
012: * Neither the name of "David A. Czarnecki" and "blojsom" nor the names of its contributors may be used to
013: * endorse or promote products derived from this software without specific prior written permission.
014: * Products derived from this software may not be called "blojsom", nor may "blojsom" appear in their name,
015: * without prior written permission of David A. Czarnecki.
016: *
017: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
018: * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
019: * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
020: * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
021: * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
022: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
024: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
025: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
026: * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
027: * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
028: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
029: * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
030: */package org.blojsom.plugin.admin.event;
031:
032: import org.blojsom.blog.Blog;
033: import org.blojsom.blog.User;
034:
035: import javax.servlet.http.HttpServletRequest;
036: import javax.servlet.http.HttpServletResponse;
037: import java.util.Date;
038: import java.util.Map;
039:
040: /**
041: * Process user event contains information about a user with hooks for retrieving the servlet request,
042: * response, and the current plugin execution context.
043: *
044: * @author David Czarnecki
045: * @since blojsom 3.1
046: * @version $Id: ProcessUserEvent.java,v 1.2 2007/01/17 02:35:08 czarneckid Exp $
047: */
048: public class ProcessUserEvent extends UserEvent {
049:
050: protected HttpServletRequest _httpServletRequest;
051: protected HttpServletResponse _httpServletResponse;
052: protected Map _context;
053:
054: /**
055: * Create a new event indicating something happened with a {@link User} in the system.
056: *
057: * @param source Source of the event
058: * @param timestamp Event timestamp
059: * @param user {@link User}
060: * @param blog {@link Blog}
061: * @param httpServletRequest Request
062: * @param httpServletResponse Response
063: * @param context Context
064: */
065: public ProcessUserEvent(Object source, Date timestamp, User user,
066: Blog blog, HttpServletRequest httpServletRequest,
067: HttpServletResponse httpServletResponse, Map context) {
068: super (source, timestamp, user, blog);
069:
070: _httpServletRequest = httpServletRequest;
071: _httpServletResponse = httpServletResponse;
072: _context = context;
073: }
074:
075: /**
076: * Retrieve the servlet request
077: *
078: * @return {@link HttpServletRequest} Request
079: */
080: public HttpServletRequest getHttpServletRequest() {
081: return _httpServletRequest;
082: }
083:
084: /**
085: * Retrieve the servlet response
086: *
087: * @return {@link HttpServletResponse} Response
088: */
089: public HttpServletResponse getHttpServletResponse() {
090: return _httpServletResponse;
091: }
092:
093: /**
094: * Retrieve the plugin execution context
095: *
096: * @return Context map
097: */
098: public Map getContext() {
099: return _context;
100: }
101: }
|