01: /**
02: * Copyright 2002 Sun Microsystems, Inc. All
03: * rights reserved. Use of this product is subject
04: * to license terms. Federal Acquisitions:
05: * Commercial Software -- Government Users
06: * Subject to Standard License Terms and
07: * Conditions.
08: *
09: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
10: * are trademarks or registered trademarks of Sun Microsystems,
11: * Inc. in the United States and other countries.
12: *
13: * @ Author Francis Sujai
14: */package com.sun.portal.proxylet.admin.model;
15:
16: // JDK classes
17:
18: import com.iplanet.am.console.service.model.SMDataModelImpl;
19: import com.iplanet.sso.SSOException;
20: import com.sun.identity.sm.SMSException;
21: import com.sun.identity.sm.ServiceSchemaManager;
22: import com.sun.portal.proxylet.admin.ProxyletAdminModelManager;
23:
24: import javax.servlet.http.HttpServletRequest;
25: import java.util.Map;
26: import java.util.Set;
27: import java.util.HashSet;
28:
29: public class ProxyletAdminServiceModelImpl extends SMDataModelImpl
30: implements ProxyletAdminServiceModel {
31:
32: public ProxyletAdminServiceModelImpl(HttpServletRequest req,
33: String rbName, Map map, String svcName,
34: boolean processTemplate) {
35: super (req, rbName, map, svcName, processTemplate);
36: }
37:
38: public int getProxyletAttrIndex(String attributeName) {
39: String aName = "";
40: int rulesIndex = -1;
41: int dynSize = getSize(DYNAMIC_TYPE);
42: for (int i = 0; i < dynSize; i++) {
43: setCurrentRow(DYNAMIC_TYPE, i);
44: aName = getAttrName();
45: if (aName.equals(attributeName)) {
46: rulesIndex = i;
47: break;
48: }
49: }
50: return rulesIndex;
51: }
52:
53: public Set getProxyletAttrValue(String attributeName) {
54: Set value = new HashSet();
55: int attributeIndex = getProxyletAttrIndex(attributeName);
56: if (attributeIndex != -1) {
57: setCurrentRow(DYNAMIC_TYPE, attributeIndex);
58: value = getAttrValues();
59: }
60: return value;
61: }
62:
63: public int getProxyletRulesIndex() {
64: return getProxyletAttrIndex("sunPortalProxyletRules");
65: }
66:
67: public Set getProxyletRules() {
68: return getProxyletAttrValue("sunPortalProxyletRules");
69: }
70:
71: public void process() {
72: try {
73: super .process();
74: } catch (Exception ex) {
75: }
76: }
77:
78: public void store(int viewType, Map newMap) {
79: try {
80: super .store(viewType, newMap);
81: } catch (Exception ex) {
82: }
83: }
84:
85: }
|