| com.sun.portal.community.mc.CMCUser
All known Subclasses: com.sun.portal.community.mc.impl.am.org.CMCUserImpl, com.sun.portal.community.mc.impl.am.global.CMCUserImpl, com.sun.portal.community.mc.impl.jdo.CMCUserImpl, com.sun.portal.community.mc.impl.am.role.CMCUserImpl, com.sun.portal.community.mc.impl.am.frole.CMCUserImpl, com.sun.portal.community.mc.test.impl.file.dynamic.CMCUserImpl, com.sun.portal.community.mc.impl.am.CMCUserImplBase,
CMCUser | public interface CMCUser (Code) | | Describes the relationship between a user and communities.
Clients obtain instances of CommunityUser objects
through a CommunityFactory factory object.
CommunityUser objects operate from the
perspective of the user.
For example, the client has a user ID, and they want
to ask questions about the user's relationship
with communities.
Contrast this with a CommunityNode
object. CommunityNode objects operate from the
perspective of a given community. For example,
the client has community principal, and they want to ask
questions and perform operations
on that given community node identified by the community
principal.
Community user implementations are not expected to be thread-safe; the same
CommunityUser object should not be used by
multiple threads concurrently.
The lifecycle of a community user is under control of the client application.
The lifecycle usage pattern depends on the type of application, but must
be determined with the knowledge that any particular community user cannot be
assumed to be thread safe. For example, a single-threaded, single-user
application can safely use the same community user object for the lifetime
of the application. A web application should obtain a new community user
object for each request (in other words, each thread).
Persistent changes affected through this interface commit immediately.
|
Method Summary | |
public Set | getAvailable() Get the all communities accessible to the user. | public ConfigTable | getDPDocuments(ConfigTable lastReadTimes) Get the Display Profile documents for the community user, for all member communities,
for all roles that the user has within these communities.
The values in the returned ConfigTable object
are byte[] objects. | public ConfigTable | getDPDocuments(ConfigTable lastReadTimes, Set membership) | public Set | getMembership() Get the community membership for the community user,
for all possible roles.
Calling this method is equivalent to calling
getMembership(null) . | public Set | getMembership(Set rolePrincipals) Get the community user's membership for the given set of roles.
Calling this method with a null rolePrincipals parameter is equivalent
to calling getMembership() (no argument).
Parameters: rolePrincipals - A Set of RolePrincipals , the roles to check for membership. throws: com.sun.portal.community.mc.CommunityException - If there was a problem getting the membership communities for thecommunity user. | public Set | getMembershipByName() Get the community membership for the community user,
for all possible roles. | public Set | getMembershipByName(Set rolePrincipals) Get the community user's membership for the given set of roles. | public Set | getMembershipByRole() Get the community membership for the community user,
for all possible roles. | public Set | getMembershipByRole(Set rolePrincipals) Get the community user's membership for the given set of roles. | public long | getRoleCreationTime(CMCPrincipal cp, CMCRolePrincipal rolePrincipal) Returns the time when a user was assigned to a role in community.
throws: com.sun.portal.community.mc.CommunityException - if there was a problem determining if this setDPDocuments() operation is supported in this community. | public String | getUserId() Get the user ID of the community user. | public boolean | hasRole(CMCPrincipal communityPrincipal, CMCRolePrincipal rolePrincipal) Does this community user have the given role in the given community?
Parameters: communityPrincipal - A CommunityPrincipal object, the community principal to check. Parameters: rolePrincipal - A RolePrincipal object, the role to check. throws: com.sun.portal.community.mc.CommunityException - If there was a problem checking if this community user has the role. | public void | init(Properties properties, String userId) Initialize this CommunityUser object.
CommunityUser objects must be initialized before they are used. |
getAvailable | public Set getAvailable() throws CMCException(Code) | | Get the all communities accessible to the user.
A Set of CommunityPrincipal objects, the communities that this communityuser may join. throws: com.sun.portal.community.mc.CommunityException - If a problem occured getting the communities that this community usermay join. |
getDPDocuments | public ConfigTable getDPDocuments(ConfigTable lastReadTimes) throws CMCException(Code) | | Get the Display Profile documents for the community user, for all member communities,
for all roles that the user has within these communities.
The values in the returned ConfigTable object
are byte[] objects. The byte[]
is a UTF-8 encoded character stream.
Parameters: lastReadTimes - A ConfigTable of Long objects describing the time that the client lastread the DP documents for the user.
The community user implementation uses the last read times to optimize it's access to the persistent store. It must notreturn DP documents that have not been modified since thelast read time specified.
If the client wants to retrieve DP document irrespectiveof the time it was last read, it should pass an emptyConfigTable in place of this parameter. throws: com.sun.portal.community.mc.CommunityException - If there was a problem getting the DP documents for the user. A ConfigTable containing byte[] objects, the DP documents for the user. |
getMembership | public Set getMembership() throws CMCException(Code) | | Get the community membership for the community user,
for all possible roles.
Calling this method is equivalent to calling
getMembership(null) . This method simply combines
the result of getMembershipByName() and
getMembershipByRole() .
A Set of ConfigKey objects, the community principal - role tuples indicating the user's role in their member communities. throws: com.sun.portal.community.mc.CommunityException - If a problem occured getting the membership. See Also: CMCUser.getMembership(Set) See Also: CMCUser.getMembershipByName() See Also: CMCUser.getMembershipByRole() |
getMembership | public Set getMembership(Set rolePrincipals) throws CMCException(Code) | | Get the community user's membership for the given set of roles.
Calling this method with a null rolePrincipals parameter is equivalent
to calling getMembership() (no argument).
Parameters: rolePrincipals - A Set of RolePrincipals , the roles to check for membership. throws: com.sun.portal.community.mc.CommunityException - If there was a problem getting the membership communities for thecommunity user. A Set of ConfigKey objects,the community principal - role tuples indicating the user's role in their member communities. See Also: CMCUser.getMembership() See Also: CMCUser.getMembershipByName(Set) See Also: CMCUser.getMembershipByRole(Set) |
getMembershipByName | public Set getMembershipByName() throws CMCException(Code) | | Get the community membership for the community user,
for all possible roles. This method only returns the user's
user roles, not the user's community roles.
Calling this method is equivalent to calling
getMembershipByName(null) .
A Set of ConfigKey objects, the community principal - role tuples indicating the user's role in their member communities. throws: com.sun.portal.community.mc.CommunityException - If a problem occured getting the membership. See Also: CMCUser.getMembershipByName(Set) |
getMembershipByName | public Set getMembershipByName(Set rolePrincipals) throws CMCException(Code) | | Get the community user's membership for the given set of roles. This
method only returns the user roles, and not community roles.
Calling this method with a null rolePrincipals parameter is equivalent
to calling getMembershipByName() (no argument).
Parameters: rolePrincipals - A Set of RolePrincipals , the roles to check for membership. throws: com.sun.portal.community.mc.CommunityException - If there was a problem getting the membership. A Set of ConfigKey objects,the community principal - role tuples indicating the user's role in their member communities. See Also: CMCUser.getMembershipByName() |
getMembershipByRole | public Set getMembershipByRole() throws CMCException(Code) | | Get the community membership for the community user,
for all possible roles. This method only returns the
user's community roles, not the user's user roles.
Calling this method is equivalent to calling
getMembershipByRole(null) .
A Set of ConfigKey objects, the community principal - role tuples indicating the user's role in their member communities. throws: com.sun.portal.community.mc.CommunityException - If a problem occured getting the membership. See Also: CMCUser.getMembershipByRole(Set) |
getMembershipByRole | public Set getMembershipByRole(Set rolePrincipals) throws CMCException(Code) | | Get the community user's membership for the given set of roles. This
method only returns the community roles, and not user roles.
Calling this method with a null rolePrincipals parameter is equivalent
to calling getMembershipByRole() (no argument).
Parameters: rolePrincipals - A Set of RolePrincipals , the roles to check for membership. throws: com.sun.portal.community.mc.CommunityException - If there was a problem getting the membership. A Set of ConfigKey objects,the community principal - role tuples indicating the user's role in their member communities. See Also: CMCUser.getMembershipByName() |
getRoleCreationTime | public long getRoleCreationTime(CMCPrincipal cp, CMCRolePrincipal rolePrincipal) throws CMCException(Code) | | Returns the time when a user was assigned to a role in community.
throws: com.sun.portal.community.mc.CommunityException - if there was a problem determining if this setDPDocuments() operation is supported in this community. time in milliseconds when a user was assigned to a role in community. Returns -1 if the time is unknownuser is not in the role or time is unknown |
getUserId | public String getUserId()(Code) | | Get the user ID of the community user.
A String , the community user ID. |
hasRole | public boolean hasRole(CMCPrincipal communityPrincipal, CMCRolePrincipal rolePrincipal) throws CMCException(Code) | | Does this community user have the given role in the given community?
Parameters: communityPrincipal - A CommunityPrincipal object, the community principal to check. Parameters: rolePrincipal - A RolePrincipal object, the role to check. throws: com.sun.portal.community.mc.CommunityException - If there was a problem checking if this community user has the role. A boolean indicating if this community user has the given role in the given community. |
init | public void init(Properties properties, String userId) throws CMCException(Code) | | Initialize this CommunityUser object.
CommunityUser objects must be initialized before they are used.
This method is called either directly or indirectly
by the CommunityFactory
object before it returns CommunityUser instances.
Clients should not call this method directly.
The properties required are community user implementation
dependent.
Parameters: properties - Properties used by the community user implementation to initialize the object instance. The exact properties used are community user implementation dependent. throws: com.sun.portal.community.mc.CommunityException - If there was a problem initializing this community user. Parameters: userId - A String , the user ID of the community user. |
|
|