001: /**
002: * $Id: PortletMembershipEvent.java,v 1.6 2005/06/19 05:21:59 mjain Exp $
003: * Copyright 2005 Sun Microsystems, Inc. All
004: * rights reserved. Use of this product is subject
005: * to license terms. Federal Acquisitions:
006: * Commercial Software -- Government Users
007: * Subject to Standard License Terms and
008: * Conditions.
009: *
010: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
011: * are trademarks or registered trademarks of Sun Microsystems,
012: * Inc. in the United States and other countries.
013: */package com.sun.portal.portlet.service.provision;
014:
015: import com.iplanet.sso.SSOToken;
016: import javax.servlet.http.HttpServletRequest;
017:
018: /**
019: * PortletMembershipEvent represents the event
020: * when a member is added or removed from a community.
021: *
022: */
023: public class PortletMembershipEvent {
024:
025: private String _communityPrincipalId;
026: private String _memberId;
027: private String _portletName;
028: private String _portletInstanceName;
029: private SSOToken _ssoToken;
030: private HttpServletRequest _request;
031: private PortletProvisionPreferences _portletProvisionPreferences;
032: private String _role;
033:
034: /**
035: * Constructor for membership event. Instances are created by the provisioning framework.
036: * @param request
037: * @param communityPrincipalId
038: * @param portletName
039: * @param portletInstanceName
040: * @param memberId
041: * @param ssoToken
042: */
043: public PortletMembershipEvent(HttpServletRequest request,
044: String communityPrincipalId, String portletName,
045: String portletInstanceName, String memberId,
046: PortletProvisionPreferences portletProvisionPreferences,
047: String role, SSOToken ssoToken) {
048: _communityPrincipalId = communityPrincipalId;
049: _memberId = memberId;
050: _portletName = portletName;
051: _portletInstanceName = portletInstanceName;
052: _ssoToken = ssoToken;
053: _request = request;
054: _portletProvisionPreferences = portletProvisionPreferences;
055: _role = role;
056: }
057:
058: /**
059: * returns the id of
060: * community to which the member is added/removed.
061: * @return commuinity id.
062: */
063: public String getCommunityPrincipalId() {
064: return _communityPrincipalId;
065: }
066:
067: /**
068: * Returns the member id added or removed.
069: * @return member id
070: */
071: public String getMemberId() {
072: return _memberId;
073: }
074:
075: /**
076: * Returns the portlet name that has registered to listen this event.
077: * @return portlet name
078: */
079: public String getPortletName() {
080: return _portletName;
081: }
082:
083: /**
084: * Returns the unique channel name that represents instance of the portlet.
085: * @return channel name
086: */
087: public String getPortletInstanceName() {
088: return _portletInstanceName;
089: }
090:
091: /**
092: * Returns the SSOToken
093: * @return SSOToken
094: */
095:
096: public SSOToken getSSOToken() {
097: return _ssoToken;
098: }
099:
100: /**
101: * Returns the HttpServletRequest
102: * @return HttpServletRequest
103: */
104: public HttpServletRequest getHttpServletRequest() {
105: return _request;
106: }
107:
108: /** returns read-only properties set for this channel for this role. Returns null if this service is not configured for this role.
109: * set methods on the returned object would throw exception.
110: */
111: public PortletProvisionPreferences getPortletProvisionPreferences() {
112: return _portletProvisionPreferences;
113: }
114:
115: public String getRole() {
116: return _role;
117: }
118:
119: /**
120: *
121: *
122: */
123: public String toString() {
124: StringBuffer buffer = new StringBuffer(30);
125: buffer.append("\n\tCommunityId:" + getCommunityPrincipalId());
126: buffer.append("\n\tPortletName:" + getPortletName());
127: buffer.append("\n\tPortletInstanceName:"
128: + getPortletInstanceName());
129: buffer.append("\n\tSSOToken:" + getSSOToken().toString());
130: buffer.append("\n\tRole:" + getRole());
131: buffer.append("\n\tMemberId:" + getMemberId());
132: buffer.append("\n\tProvisionPref:"
133: + getPortletProvisionPreferences());
134: return buffer.toString();
135: }
136:
137: }
|