01: /*
02: * UserAttributesSetHandler.java
03: *
04: * Created on February 9, 2002, 4:07 AM
05: */
06:
07: package com.sun.portal.rproxy.configservlet.server;
08:
09: import java.rmi.RemoteException;
10: import java.util.Set;
11:
12: import com.sun.portal.rproxy.configservlet.Request;
13: import com.sun.portal.rproxy.configservlet.Response;
14:
15: /*
16: * This class (runing at servlet) handles requests to set the users attributes.
17: *
18: * @author Mridul Muralidharan
19: *
20: * @version
21: */
22: public class UserAttributesSetHandler extends
23: UserAttributesServiceHandler {
24:
25: public UserAttributesSetHandler() {
26: }
27:
28: public Response handleRequest(Request request)
29: throws RemoteException {
30:
31: Response resp = null;
32: try {
33: String tokid = request.getSSOTokenId();
34: // As a sideeffect of cache-cleaner thread , this need not be done.
35: // @see UserProfileCache
36: /*
37: * boolean cacheContains = UserProfileCache.contains(tokid);
38: *
39: * if (!cacheContains){ // In the unlikely case of the Profile not
40: * being available in the cache. SSOToken token =
41: * getSSOToken(request); resp = fetchUserAttributes(request,token);
42: * UserProfileCache.addEntry(token , tokid , resp); }
43: */
44: // Now set the attribute
45: Object arr[] = (Object[]) request.getArguments();
46: UserProfileCache.setAttribute(tokid, (String) request
47: .getRequestObject(), (Set) arr[0]);
48: resp = new Response(request.getServiceName(), request
49: .getRequestType(), null);
50: resp.setNormal(true);
51: }
52: // Must later specify the actual exceptions
53: catch (Exception ex) {
54: resp = new Response(request.getServiceName(), request
55: .getRequestType(), null);
56: resp.setNormal(false);
57: }
58: return resp;
59: }
60: }
|