001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.security.model;
009:
010: //base classes
011: import javax.servlet.http.HttpServletRequest;
012:
013: //project specific classes
014: import org.jfolder.common.utils.web.ParameterSet;
015: import org.jfolder.security.model.UserHolderContext;
016:
017: //other classes
018:
019: public class SimpleUserHolderContext implements UserHolderContext {
020:
021: private String name = null;
022: private String securityClass = null;
023: private HttpServletRequest request = null;
024: private ParameterSet ps = null;
025: private Object o = null;
026:
027: private boolean namePresent = false;
028: private boolean securityClassPresent = false;
029: private boolean requestPresent = false;
030: private boolean psPresent = false;
031: private boolean oPresent = false;
032:
033: public SimpleUserHolderContext() {
034: }
035:
036: public boolean isNamePresent() {
037: return this .namePresent;
038: }
039:
040: public boolean isSecurityClassPresent() {
041: return this .securityClassPresent;
042: }
043:
044: public boolean isRequestPresent() {
045: return this .requestPresent;
046: }
047:
048: public boolean isParameterSetPresent() {
049: return this .psPresent;
050: }
051:
052: public boolean isObjectPresent() {
053: return this .oPresent;
054: }
055:
056: public void setName(String inName) {
057: this .name = inName;
058: this .namePresent = true;
059: }
060:
061: public void setSecurityClass(String inSecurityClass) {
062: this .securityClass = inSecurityClass;
063: this .securityClassPresent = true;
064: }
065:
066: public void setRequest(HttpServletRequest inRequest) {
067: this .request = inRequest;
068: this .requestPresent = true;
069: }
070:
071: public void setParameterSet(ParameterSet inPs) {
072: this .ps = inPs;
073: this .psPresent = true;
074: }
075:
076: public void setObject(Object inO) {
077: this .o = inO;
078: this .oPresent = true;
079: }
080:
081: public String getName() {
082: return this .name;
083: }
084:
085: public String getSecurityClass() {
086: return this .securityClass;
087: }
088:
089: public HttpServletRequest getRequest() {
090: return this .request;
091: }
092:
093: public ParameterSet getParameterSet() {
094: return this .ps;
095: }
096:
097: public Object getObject() {
098: return this.o;
099: }
100: }
|