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.event.Event;
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: * AuthorizationEvent
042: *
043: * @author David Czarnecki
044: * @version $Id: AuthorizationEvent.java,v 1.2 2007/01/17 02:35:08 czarneckid Exp $
045: * @since blojsom 3.0
046: */
047: public class AuthorizationEvent extends Event {
048:
049: protected HttpServletRequest _httpServletRequest;
050: protected HttpServletResponse _httpServletResponse;
051: protected Blog _blog;
052: protected Map _context;
053: protected Integer _blogUserID;
054:
055: /**
056: * An event related to authorization for a given blog
057: *
058: * @param source Source of the event
059: * @param timestamp Event timestamp
060: * @param httpServletRequest Request
061: * @param httpServletResponse Response
062: * @param blog {@link Blog}
063: * @param context Context for the given operation
064: * @param blogUserID Authorized user ID for the authorization event
065: */
066: public AuthorizationEvent(Object source, Date timestamp,
067: HttpServletRequest httpServletRequest,
068: HttpServletResponse httpServletResponse, Blog blog,
069: Map context, Integer blogUserID) {
070: super (source, timestamp);
071: _httpServletRequest = httpServletRequest;
072: _httpServletResponse = httpServletResponse;
073: _blog = blog;
074: _context = context;
075: _blogUserID = blogUserID;
076: }
077:
078: /**
079: * Retrieve the request
080: *
081: * @return Request
082: */
083: public HttpServletRequest getHttpServletRequest() {
084: return _httpServletRequest;
085: }
086:
087: /**
088: * Retrieve the response
089: *
090: * @return Response
091: */
092: public HttpServletResponse getHttpServletResponse() {
093: return _httpServletResponse;
094: }
095:
096: /**
097: * Retrieve the {@link Blog}
098: *
099: * @return {@link Blog}
100: */
101: public Blog getBlog() {
102: return _blog;
103: }
104:
105: /**
106: * Retrieve the context
107: *
108: * @return Context
109: */
110: public Map getContext() {
111: return _context;
112: }
113:
114: /**
115: * Retrieve the authorized user ID
116: *
117: * @return Authorized user ID
118: */
119: public Integer getBlogUserID() {
120: return _blogUserID;
121: }
122: }
|