001: /**
002: * $Id: ClientAwareAppContext.java,v 1.4 2005/07/15 00:17:25 rakeshn Exp $
003: * Copyright 2002 Sun Microsystems, Inc. Allrights reserved. Use of
004: * this product is subjectto license terms. Federal Acquisitions:
005: * Commercial Software -- Government Users Subject to Standard License
006: * Terms and Conditions.
007: *
008: * Sun, Sun Microsystems, the Sun logo, and Sun ONE are trademarks or
009: * registered trademarks of Sun Microsystems,Inc. in the United States
010: * and other countries.
011: */package com.sun.ssoadapter.config;
012:
013: import java.util.Hashtable;
014: import java.util.Set;
015: import java.util.Map;
016: import java.util.Properties;
017:
018: import java.io.File;
019: import java.io.IOException;
020: import java.io.FileNotFoundException;
021: import java.util.MissingResourceException;
022:
023: import com.sun.ssoadapter.SSOAdapterSession;
024:
025: /**
026: * Copied from hana_ws/ps/desktop/src/com/sun/portal/
027: * desktop/context/DesktopAppContext.java
028: *
029: * <p>
030: * This object encapsulates the session-less objects - ClientContext,
031: * DebugContext, SessionAppContext & ServiceAppContext.
032: */
033:
034: public interface ClientAwareAppContext {
035: /**
036: *
037: * @param sl
038: * @throws com.sun.ssoadapter.config.SAALException
039: */
040: public void init(SessionListener sl) throws SAALException;
041:
042: //
043: // service
044: //
045:
046: /**
047: * Gets the server-specific (global) attribute.
048: * @param service A list of properties required by the backend service.
049: * Ex: DSAME requires a name of the service to get/set any attributes
050: * in the Global/Organization scope. The name of the service is
051: * referenced by the keyword "serviceName". The Map should
052: * contain atleast this property to work with DSAME.
053: *
054: * @param clientType The client-type specific attribute to retireve
055: * @param attrName The attribute name.
056: * @return The attribute value in String format. If property is
057: * not found, return null.
058: * @exception IOException If the value could not be retrieved from the
059: * data store.
060: * @exception
061: * MissingResourceException If any of the properties required by the
062: * backend service were missing the the service MAP
063: */
064:
065: public String getStringAttribute(Map service, String clientType,
066: String attrName) throws IOException,
067: MissingResourceException;
068:
069: /**
070: * Gets the server-specific (global) attribute.
071: * @param service A list of properties required by the backend service.
072: * Ex: DSAME requires a name of the service to get/set any attributes
073: * in the Global/Organization scope. The name of the service is
074: * referenced by the keyword "serviceName". The Map should
075: * contain atleast this property to work with DSAME.
076: *
077: * @param attrName The attribute name. (The client type is assumed to be
078: * "default").
079: * @return The attribute value in String format. If property is
080: * not found, return null.
081: * @exception IOException If the value could not be retrieved from the
082: * data store.
083: * @exception
084: * MissingResourceException If any of the properties required by the
085: * backend service were missing the the service MAP
086: */
087:
088: public String getStringAttribute(Map service, String attrName)
089: throws IOException, MissingResourceException;
090:
091: /**
092: * Gets the server-specific (global) attribute.
093: * @param service A list of properties required by the backend service.
094: * Ex: DSAME requires a name of the service to get/set any attributes
095: * in the Global/Organization scope. The name of the service is
096: * referenced by the keyword "serviceName". The Map should
097: * contain atleast this property to work with DSAME.
098: * @param clientType The client-type specific attribute to retireve
099: * @param attributeName The attribute name.
100: *
101: * @return The attribute value as Set. If property is
102: * not found, return null.
103: * @exception IOException If the value could not be retrieved from the
104: * data store.
105: * @exception
106: * MissingResourceException If any of the properties required by the
107: * backend service were missing the the service MAP
108: */
109: public Set getAttribute(Map service, String clientType,
110: String attributeName) throws IOException,
111: MissingResourceException;
112:
113: /**
114: * Gets the server-specific (global) attribute.
115: * @return The attribute value as Set. If property is
116: * not found, return null.
117: * @param attributeName
118: * @param service A list of properties required by the backend service.
119: * Ex: DSAME requires a name of the service to get/set any attributes
120: * in the Global/Organization scope. The name of the service is
121: * referenced by the keyword "serviceName". The Map should
122: * contain atleast this property to work with DSAME.
123: * @exception IOException If the value could not be retrieved from the
124: * data store.
125: * @exception MissingResourceException If any of the properties required by the
126: * backend service were missing the the service MAP
127: */
128: public Set getAttribute(Map service, String attributeName)
129: throws IOException, MissingResourceException;
130:
131: //
132: // config
133: //
134:
135: //
136: // session
137: //
138: /**
139: *
140: * @param session
141: */
142: public void addSessionListener(SSOAdapterSession session);
143:
144: /**
145: * Validate the session referenced by the Request
146: * @param session
147: * @return
148: */
149:
150: public boolean validateSession(SSOAdapterSession session);
151:
152: /**
153: * Get the session id corresponding to the session referenced by Request
154: * @param session SSOAdapterSession
155: * @return The Session ID associated with the Request. null if session is
156: * invalid
157: */
158:
159: public String getSessionID(SSOAdapterSession session);
160:
161: /*
162: * Check to see if uid is an authorized authless uid
163: */
164: /**
165: *
166: * @param uid
167: * @return
168: */
169: public boolean isAuthorizedAuthlessUID(String uid);
170:
171: //
172: // servlet request
173: //
174:
175: //
176: // client
177: //
178:
179: /**
180: * This method is used when a session is not yet created/valid.
181: * @param session The SSOAdapterSession
182: * @return The clientType string
183: */
184: public String getClientType(SSOAdapterSession session);
185: }
|