01: /**
02: * $Id: CMCUserImpl.java,v 1.2 2007/01/26 03:47:49 portalbld Exp $
03: * Copyright 2005 Sun Microsystems, Inc. All
04: * rights reserved. Use of this product is subject
05: * to license terms. Federal Acquisitions:
06: * Commercial Software -- Government Users
07: * Subject to Standard License Terms and
08: * Conditions.
09: *
10: * Sun, Sun Microsystems, the Sun logo, and Sun ONE
11: * are trademarks or registered trademarks of Sun Microsystems,
12: * Inc. in the United States and other countries.
13: */package com.sun.portal.community.mc.impl.am.global;
14:
15: import com.sun.portal.community.mc.CMCException;
16: import com.sun.portal.community.mc.CMCUser;
17: import com.sun.portal.community.mc.CMCPrincipal;
18: import com.sun.portal.community.mc.CMCRolePrincipal;
19: import com.sun.portal.community.mc.ConfigTable.ConfigKey;
20: import com.sun.portal.community.mc.impl.am.CMCUserImplBase;
21: import java.util.Collections;
22: import java.util.Set;
23:
24: /**
25: * AM global community user contributor.
26: */
27: public class CMCUserImpl extends CMCUserImplBase implements CMCUser {
28: // all users are members
29: private static final Set GLOBAL_MEMBERSHIP = Collections
30: .singleton(new ConfigKey(new CMCPrincipal(getStaticType(),
31: GLOBAL_NAME), CMCRolePrincipal.MEMBER_ROLE));
32:
33: public static String getStaticType() {
34: return "am-global";
35: }
36:
37: public String getType() {
38: return getStaticType();
39: }
40:
41: public Set getMembershipByName() throws CMCException {
42: return GLOBAL_MEMBERSHIP;
43: }
44: }
|