|
Copyright © 2008 BEA Systems, Inc. All Rights Reserved | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.bea.netuix.servlets.manager.communities.CommunityUserContext
public final class CommunityUserContext
The CommunityUserContext serves as a cache container and accessor for community
member information (community-specific user information shared across all communities)
for a HttpSession and provides access to community API's out of scope of a
specific CommunityContext object (methods not dealing with the currently authenticated
principal and community creation).
The CommunityUserContext may have at most one
CommunityMember object in scope, if the authenticated principal for the supplied
HttpServletRequest object has a CommunityMember record. If no
user is logged in, or if the user does not have a CommunityMember record,
no CommunityMember object is kept in scope.
CommunityUserContext and CommunityContext objects
can perform caching of CommunityMember and CommunityMembership
objects associated with the authenticated principal (currently logged-in user).
By default, if a HttpSession exists for the request, the caching is scoped at
the session level. If no session exists for the request, the default caching scope is
at the request level. The caching scope for the CommunityUserContext (and all associated
CommunityContext objects) associated with a session or request can be explicitly set
through a call to setCacheScope(). Caching can even be turned off completely, although
this may result in a significant performance penalty.
As long as the
CommunityUserContext and CommunityContext objects are used to
create, update / modify, or remove CommunityMember and CommunityMembership
objects, the cache will remain consistent and correct.
There are a few circumstances which will render the cache incorrect:
CommunityManager and
CommunityMemberManager APIs to create, update or remove
CommunityMember and CommunityMembership
objects for the authenticated principalCommunityMember and CommunityMembership ojects belonging to the
authenticated principal for this session by any means in another sessionCommunityMember and CommunityMembership ojects belonging to the
authenticated principal for this session by any means in another requestinvalidateCache() method can be called to flush the cache when necessary
or caching can be turned off completely. In addition, the
CommunityMemberManager EJB may be used in place of the CommunityContext
and CommunityUserContext objects to get around all caching.
For normal usage, the performance benefits gained by having this information cached
far outweigh problems of a stale cache.
The
overview of community functionality
contains a description of the community framework.
CommunityContext,
CommunityInvitationContext,
CommunityRedirectionHelper,
CommunityInvitationHelper,
ICommunityManager,
ICommunityMemberManager| Field Summary | |
|---|---|
static int |
CACHE_SCOPE_NO_CACHE
Constant value for use with the setCacheScope() method indicating that caching should be not be performed at all. |
static int |
CACHE_SCOPE_REQUEST
Constant value for use with the setCacheScope() method indicating that caching should be scoped at the HttpRequest level. |
static int |
CACHE_SCOPE_SESSION
Constant value for use with the setCacheScope() method indicating that caching should be scoped at the HttpSession level. |
| Method Summary | |
|---|---|
void |
activateMember()
Activates the CommunityMember associated with this
CommunityUserContext globally for all Communities. |
void |
activateMember(CommunityMemberId id)
Activates the specified CommunityMember globally for all Communities. |
void |
activateMembership(CommunityMemberId mId,
CommunityDefinitionId cId)
Activates a CommunityMembership in the specified CommunityDefinition,
making a disabled member able to use the community once again. |
void |
addMembershipCapability(CommunityMemberId mId,
CommunityDefinitionId cId,
MembershipCapability capability)
Adds a capability to the CommunityMembership
specified. |
protected Object |
clone()
Throws CloneNotSupportedException, as cloning of CommunityUserContext objects is not allowed. |
CommunityDefinition |
createCommunity(CommunityDefinition communityDefinition)
Creates a community from a streamed desktop or template as specified by the CommunityDesktop member of the input CommunityDefinition. |
CommunityDefinition |
createCommunityFromTemplate(CommunityDefinitionId communityId,
LocalizationResource templateLocalizationResource,
PortalPath portalPath,
DesktopPath desktopPath,
LocalizationResource desktopLocalizationResource)
Creates a community from a community template. |
CommunityDefinition |
createCommunityTemplate(CommunityDefinition communityDefinition)
Creates a community template from an existing streamed desktop or a template as specified by the CommunityDesktop member of the
input CommunityDefinition. |
CommunityDefinition |
createCommunityTemplate(CommunityDefinitionId communityId,
LocalizationResource templateLocalizationResource,
PortalPath portalPath,
DesktopPath desktopPath,
boolean isGlobal)
Creates a template from an existing community. |
CommunityMember |
createMember(boolean active,
boolean external)
Creates a new CommunityMember for the user associated
with this CommunityUserContext. |
CommunityMember |
createMember(CommunityMember info)
Creates a new CommunityMember based on the contents of
the info parameter. |
CommunityMember |
createMember(String username,
boolean active,
boolean external)
Creates a new CommunityMember for the specified user. |
CommunityMembership |
createMembership(CommunityMemberId mId,
CommunityDefinitionId cId)
Creates a CommunityMembership for the specified CommunityMember
in the specified CommunityDefinition. |
CommunityMembership |
createMembership(CommunityMemberId mId,
Invitation invitation)
Creates a CommunityMembership for the specified CommunityMember
from the specified Invitation. |
void |
deleteCommunity(CommunityDefinitionId communityId,
boolean deleteResources)
Deletes the specified community. |
void |
deleteCommunityWithCascade(CommunityDefinitionId communityId)
Deletes a community and all related non-customized and customized resources. |
void |
disableMember()
Disables the CommunityMember associated with this
CommunityUserContext object globally for all Communities. |
void |
disableMember(CommunityMemberId id)
Disables a CommunityMember globally for all Communities. |
void |
disableMembership(CommunityMemberId mId,
CommunityDefinitionId cId)
Disables a CommunityMembership. |
boolean |
equals(Object o)
|
SortableFilterablePagedResult<String> |
getAllCommunityAssociates(MemberCriteria criteria,
int pageSize)
Retrieves a paginated collection of all WLS user IDs of individuals belonging to the same communities the specified user also belongs to. |
int |
getCacheScope()
Returns the cache scope used for this CommunityUserContext and all
associated CommunityContext objects. |
SortableFilterablePagedResult<CommunityDefinition> |
getCommunitiesPaged(CommunitySearchCriteria searchCriteria,
int pageSize)
Returns a paginated list of CommunityDefinitions hosted in the web application. |
CommunityDefinition |
getCommunity(CommunityDefinitionId communityId)
Retrieves the CommunityDefinition for the specified community. |
CommunityDefinition |
getCommunity(CommunityURI uri)
Retrieves the CommunityDefinition for the specified community. |
CommunityDefinition |
getCommunity(String portalPath,
String desktopPath)
Retrieves the CommunityDefinition for the specified community. |
CommunityContext |
getCommunityContext()
Retrieves the "default" CommunityContext object if it is appropriate. |
CommunityContext |
getCommunityContext(CommunityDefinition community)
Returns the CommunityContext object associated with the specified
CommunityDefinition. |
CommunityContext |
getCommunityContext(CommunityDefinitionId communityId)
Returns the CommunityContext object associated with the specified
CommunityDefinitionId. |
CommunityContext |
getCommunityContext(CommunityMembership membership)
Returns the CommunityContext object associated with the specified
CommunityMembership for the currently authenticated principal. |
CommunityContext |
getCommunityContext(CommunityURI communityUri)
Returns the CommunityContext object associated with the specified community. |
CommunityInvitationHelper |
getCommunityInvitationHelper()
Retrieves the CommunityInvitationHelper object. |
SortableFilterablePagedResult<CommunityMembership> |
getCommunityMemberships(CommunityMembershipCriteria criteria,
int pageSize)
Returns a paginated set of all CommunityMembership objects for the
specified community that meet the specified criteria. |
static CommunityUserContext |
getCommunityUserContext(javax.servlet.http.HttpServletRequest request)
A convenience method for returning the CommunityUserContext object associated
with the specified Request. |
CommunityMember |
getMember()
Retrieves the CommunityMember object populated with information for the
community member currently logged in. |
CommunityMember |
getMember(CommunityMemberId id)
Retrieves a CommunityMember object populated with
information for the CommunityMember specified by member id. |
CommunityMember |
getMember(String userId)
Retrieves a CommunityMember object populated with
information for the CommunityMember specified by user id. |
SortableFilterablePagedResult<CommunityMembership> |
getMemberCommunityMemberships(MemberMembershipCriteria criteria,
int pageSize)
Returns a paginated set of all CommunityMembership objects for a specified
user or the currently authenticated user that meet the specified criteria. |
MemberMembershipCriteria |
getMemberMembershipCriteria()
Returns a MemberMembershipCriteria object for the currently authenticated user. |
CommunityMembership |
getMembership(CommunityMemberId mId,
CommunityDefinitionId cId)
Returns the CommmunityMembership information for a CommunityMember,
if they have a membership in the specified community. |
CommunityMembership |
getMembership(String username,
CommunityDefinitionId cId)
Returns the CommmunityMembership information for a user,
if they have a membership in the specified community. |
MessagingAddress |
getMessagingAddress(CommunityMemberId id,
MessagingAddressType addrType,
String name)
Gets a MessagingAddress of a particular type and name
for the specified CommunityMember. |
MessagingAddress |
getMessagingAddress(MessagingAddressType addrType,
String name)
Gets a MessagingAddress of a particular type and name
for the CommunityMember
associated with this CommunityUserContext. |
Collection<MessagingAddress> |
getMessagingAddresses(CommunityMemberId id,
MessagingAddressType addrType)
Gets all MessagingAddresses of a particular type for the specified
CommunityMember. |
Collection<MessagingAddress> |
getMessagingAddresses(MessagingAddressType addrType)
Gets all MessagingAddresses of a particular type for the
CommunityMember associated with this CommunityUserContext. |
MessagingAddress |
getPrimaryMessagingAddress(CommunityMember member,
MessagingAddressType addrType)
Gets the primary MessagingAddress of a particular type for the CommunityMember
associated with this CommunityUserContext. |
void |
invalidateCache()
Invalidates the internal cache used by the CommunityUserContext object. |
void |
removeMember()
Removes the CommunityMember associated with this
CommunityUserContext globally for all Communities. |
void |
removeMember(CommunityMemberId id)
Removes the specified CommunityMember globally for all Communities. |
void |
removeMembership(CommunityMemberId mId,
CommunityDefinitionId cId)
Deletes a CommunityMembership for a CommunityMember in a specified
CommunityDefinition. |
void |
removeMembershipCapability(CommunityMemberId mId,
CommunityDefinitionId cId,
MembershipCapability capability)
Removes a capability from the CommunityMembership
specified. |
void |
setCacheScope(int newCacheScope)
Sets the cache scope level for the CommunityUserContext. |
void |
setMessagingAddress(MessagingAddress m,
String name)
Sets the value of a MessagingAddress. |
void |
setPrimaryMessagingAddress(MessagingAddress m)
Sets the value of a the primary MessagingAddress. |
String |
toString()
|
CommunityDefinition |
updateCommunity(CommunityDefinitionId communityId,
CommunityDefinition communityDefinition)
Deprecated This method does not invoke CommunityCallback classes registered with the community if the community is activated or deactivated through this call. Use updateCommunity(com.bea.netuix.application.identifier.CommunityDefinitionId, com.bea.netuix.application.definition.CommunityDefinition, boolean)
instead. |
CommunityDefinition |
updateCommunity(CommunityDefinitionId communityId,
CommunityDefinition communityDefinition,
boolean invokeCallbackClass)
Updates the specified community's CommunityDefinition. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int CACHE_SCOPE_SESSION
public static final int CACHE_SCOPE_REQUEST
public static final int CACHE_SCOPE_NO_CACHE
| Method Detail |
|---|
public static CommunityUserContext getCommunityUserContext(javax.servlet.http.HttpServletRequest request)
CommunityUserContext object associated
with the specified Request. The CommunityUserContext is always available, even if no user is
logged in or the user does not have a CommunityMember object.
This method should be called every time a CommunityUserContext is needed, and
the returned value should never be cached or kept as a reference, since the context object
maintains a reference to the request and will be invalid on subsequent requests. This method
is optimized internally to only create a new context object once per request, so there is no
performance benefit to maintaing references to the return value in any case.
request - the HttpServletRequest.
CommunityUserContext object associated with the request.public CommunityContext getCommunityContext()
CommunityContext object if it is appropriate.
This is the CommunityContext appropriate for the Desktop
viewed by the Request associated with this CommunityUserContext.
CommunityContext
object associated with the request, or null if the desktop
associated with the request is not a community desktop.public CommunityContext getCommunityContext(CommunityURI communityUri)
CommunityContext object associated with the specified community.
communityUri - the URI for the community.
CommunityContext object, or null if no
community with the specified URI exists.public CommunityContext getCommunityContext(CommunityDefinition community)
CommunityContext object associated with the specified
CommunityDefinition. This may be useful for obtaining a CommunityContext
if the CommunityDefinition has already been retrieved through a call from a method
returning only CommunityDefintion objects, such as the
getCommunities() method.
community - the community.
CommunityContext object.public CommunityContext getCommunityContext(CommunityDefinitionId communityId)
CommunityContext object associated with the specified
CommunityDefinitionId.
communityId - the community ID.
CommunityContext object.public CommunityContext getCommunityContext(CommunityMembership membership)
CommunityContext object associated with the specified
CommunityMembership for the currently authenticated principal.
This may be useful for obtaining a CommunityContext
if the CommunityMembership has already been retrieved through a call from a method
returning only CommunityMembership objects, such as the
getAllMemberCommunityMemberships() method.
CommunityContext objects can only be obtained for the currently
authenticated principal (user) or, if no authenticated principal exists for the request, the anonymous
user. Since the anonymous user cannot have a membership in a community, this method will
only return a CommunityContext if the specified membership is for the
currently authenticated principal in the request.
membership - the membership to obtain the CommunityContext for. This
membership must be for the authenticated principal in the request;
if the membership is for any other user, this methos will return null.
CommunityContext object, or null if no
appropriate CommunityContext exists.public void setCacheScope(int newCacheScope)
CommunityUserContext, the cache scope level
set by this call is stored in the session so that other requests on the session
will have a CommunityUserContext with the same cache scope.
Specifying a cache scope of CACHE_SCOPE_SESSION will force creation of a
session if one does not already exist for the request.
Specifying a cache scope of CACHE_SCOPE_NO_CACHE will force database
hits for most operations and will therefore result in a very large performance
penalty.
newCacheScope - one of the CACHE_SCOPE_ constants indicating
the cache scope to use for this CommunityUserContext.
IllegalArgumentException - if the specified cache scope is invalid.invalidateCache()public void invalidateCache()
CommunityUserContext object.
The CommunityUserContext and CommunityContext objects
perform caching of CommunityMember and CommunityMembership
objects associated with the authenticated principal (currently logged-in user) in the scope of
the HttpSession. As long as the
CommunityUserContext and CommunityContext objects are used to
create, update / modify, or remove CommunityMember and CommunityMembership
objects, the cache will remain consistent and correct for the scope of the HttpSession.
There are a few circumstances which will render the cache incorrect:
CommunityManager and
CommunityMemberManager APIs to create, update or remove
CommunityMember and CommunityMembership
objects for the authenticated principalCommunityMember and
CommunityMembership ojects belonging to the
authenticated principal for this session by any means in another HttpSessioninvalidateCache() method should be
called, or caching should be turned off.
For normal usage, the performance benefits gained by having this information
cached far outweigh problems of a stale cache, but if the possibility of a stale cache is
unacceptable, the invalidateCache() method may be used to force all cached values to be
flushed and re-obtained as needed, or the CommunityManager and
CommunityMemberManager EJBs may be used in place of the CommunityContext
and CommunityUserContext objects.
public int getCacheScope()
CommunityUserContext and all
associated CommunityContext objects.
public SortableFilterablePagedResult<CommunityDefinition> getCommunitiesPaged(CommunitySearchCriteria searchCriteria,
int pageSize)
throws RemoteException
searchCriteria - criteria to be used to narrow the communities returned by this search.pageSize - the number of communities to return per page
RemoteException
public CommunityDefinition createCommunity(CommunityDefinition communityDefinition)
throws IllegalArgumentException,
ObjectNotFoundException,
NotEntitledException,
MissingDataException,
DuplicateObjectException,
UnsupportedOperationException,
CommunityCallbackException,
RemoteException
CommunityDesktop member of the input CommunityDefinition.
If the template specifies a community an UnSupportedOperationException
is thrown directing the user to use createCommunityFromTemplate.
This is to avoid confusion between what specification to use for the
new community - the one in the input CommunityDefinition
or the one in the community that the template points to.
communityDefinition - a CommunityDefinition
object that holds all information
about the community to be created
except for the CommunityDefinitionId
CommunityDefinition
with CommunityDefinitionId populated
IllegalArgumentException - if input CommunityDefinition has
incorrect information
ObjectNotFoundException - if desktop specified by input
arguments does not exist
NotEntitledException - if current user does not have
permission to create a new community
MissingDataException - if input CommunityDefinition
or the desktop it points to is
missing information
DuplicateObjectException - if desktop matching portal path and
desktop path in CommunityDefinition
already exists
UnsupportedOperationException - see method doc above
CommunityCallbackException - if an error occurs when making a community
callback
RemoteException
public CommunityDefinition createCommunityFromTemplate(CommunityDefinitionId communityId,
LocalizationResource templateLocalizationResource,
PortalPath portalPath,
DesktopPath desktopPath,
LocalizationResource desktopLocalizationResource)
throws ObjectNotFoundException,
IllegalArgumentException,
NotEntitledException,
MissingDataException,
DuplicateObjectException,
CommunityCallbackException,
RemoteException
communityId - CommunityDefinitionId of the community
templatetemplateLocalizationResource - optional LocalizationResource for template. If null
LocalizationResource from template community will
be usedportalPath - portal path for the new desktop to be createddesktopPath - desktop path for the new desktop to be created
* @param desktopLocalizationResource optional LocalizationResource to be
associated with desktop
CommunityDefinition
ObjectNotFoundException - if specified community template does
not exist
IllegalArgumentException - if community specified is not a
community template
NotEntitledException - if current user does not have permission
to create a new community
MissingDataException - if input CommunityDefinition or the
desktop it points to is missing information
DuplicateObjectException - if desktop matching input portal path and desktop
path already exists
CommunityCallbackException - if an error occurs when making a community
callback
RemoteException
public CommunityDefinition createCommunityTemplate(CommunityDefinition communityDefinition)
throws ObjectNotFoundException,
NotEntitledException,
MissingDataException,
DuplicateObjectException,
UnsupportedOperationException,
CommunityCallbackException,
RemoteException
CommunityDesktop member of the
input CommunityDefinition.
communityDefinition - a CommunityDefinition
object that holds all information
about the community template to be
created except for the CommunityDefinitionId
CommunityDefition
template with a populated
CommunityDefinitionId
ObjectNotFoundException - if input desktop or template does
not exist
NotEntitledException - if current user does not have
permission to create a template
MissingDataException - if input CommunityDefinition
or the desktop it points to is
missing information
DuplicateObjectException - if desktop matching input portal
path and desktop path already exists
CommunityCallbackException - if an error occurs when making a community
callback
RemoteException
UnsupportedOperationException
public CommunityDefinition createCommunityTemplate(CommunityDefinitionId communityId,
LocalizationResource templateLocalizationResource,
PortalPath portalPath,
DesktopPath desktopPath,
boolean isGlobal)
throws ObjectNotFoundException,
NotEntitledException,
MissingDataException,
DuplicateObjectException,
CommunityCallbackException,
RemoteException
communityId - CommunityDefinitionId of the community
to use to create a templatetemplateLocalizationResource - optional LocalizationResource for template. If null
LocalizationResource from template community will
be usedportalPath - portal path for the new desktop to be
createddesktopPath - desktop path for the new desktop to be createdisGlobal - true if the template should be marked global
CommunityDefinition with
the isTemplate attribute set to true
ObjectNotFoundException - if a CommunityDefinition matching input
CommunityDefinitionId does not exist
NotEntitledException - if current user does not have permission
to create a community template
MissingDataException - if input CommunityDefinition or the
desktop it points to is missing information
DuplicateObjectException - if desktop matching input portal path and desktop
path already exists
CommunityCallbackException - if an error occurs when making a community
callback
RemoteException
@Deprecated
public CommunityDefinition updateCommunity(CommunityDefinitionId communityId,
CommunityDefinition communityDefinition)
throws ObjectNotFoundException,
NotEntitledException,
IllegalOperationException,
ObjectInUseException,
RemoteException
updateCommunity(com.bea.netuix.application.identifier.CommunityDefinitionId, com.bea.netuix.application.definition.CommunityDefinition, boolean)
instead.
CommunityDefinition.
communityId - CommunityDefinitionId of community to
be updatedcommunityDefinition - community definition with updated
attributes
CommunityDefinition
ObjectNotFoundException - if community to be updated does not exist
NotEntitledException - if current user does not have permission
to update this community
IllegalOperationException - if part of or all of the update is illegal
based on the current state of the community
for e.g. if the update tries to set expirationDate on
or activate a community that is marked as
a template
ObjectInUseException - if the update tries to point the community
to a desktop that is already in use by another
community
RemoteException
public CommunityDefinition updateCommunity(CommunityDefinitionId communityId,
CommunityDefinition communityDefinition,
boolean invokeCallbackClass)
throws ObjectNotFoundException,
NotEntitledException,
IllegalOperationException,
ObjectInUseException,
RemoteException,
CommunityCallbackException
CommunityDefinition.
communityId - CommunityDefinitionId of community to
be updatedcommunityDefinition - community definition with updated
attributesinvokeCallbackClass - if true and the community is activated
or deactivated by this call, invokes the appropriate
methods on the CommunityCallback object associated
with the community, if one exists. If false,
no callback call is made.
CommunityDefinition
ObjectNotFoundException - if community to be updated does not exist
NotEntitledException - if current user does not have permission
to update this community
IllegalOperationException - if part of or all of the update is illegal
based on the current state of the community
for e.g. if the update tries to set expirationDate on
or activate a community that is marked as
a template
ObjectInUseException - if the update tries to point the community
to a desktop that is already in use by another
community
RemoteException
CommunityCallbackException - if an error occurs while making a callback
public CommunityDefinition getCommunity(String portalPath,
String desktopPath)
throws RemoteException
CommunityDefinition for the specified community.
Returns null if the specified community does not exist,
or if the user is not entitled to see the community.
The return for this method is not cached by the CommunityUserContext, although
CommunityDefinition objects are cached at a lower level.
portalPath - the portal path for the community.desktopPath - the desktop path for the community.
CommunityDefinition object for the community specified,
or null if the community does not exist or if the user is not
entitled to see the community.
RemoteException
public CommunityDefinition getCommunity(CommunityURI uri)
throws RemoteException
CommunityDefinition for the specified community.
Returns null if the specified community does not exist,
or if the user is not entitled to see the community.
The return for this method is not cached by the CommunityUserContext, although
CommunityDefinition objects are cached at a lower level.
uri - the URI for the community.
CommunityDefinition object for the community specified,
or null if the community does not exist or if the user is not
entitled to see the community.
RemoteException
public CommunityDefinition getCommunity(CommunityDefinitionId communityId)
throws RemoteException
CommunityDefinition for the specified community.
Returns null if the specified community does not exist,
or if the user is not entitled to see the community.
The return for this method is not cached by the CommunityUserContext, although
CommunityDefinition objects are cached at a lower level.
communityId - the community ID for the community.
CommunityDefinition object for the community specified,
or null if the community does not exist or if the user is not
entitled to see the community.
RemoteException
public void deleteCommunity(CommunityDefinitionId communityId,
boolean deleteResources)
throws ObjectNotFoundException,
NotEntitledException,
RemoteException,
IllegalOperationException,
CommunityCallbackException,
ObjectInUseException
communityId - CommunityDefinitionId of the community
to be deleteddeleteResources - if true deletes resources related to
the community if the community is the only one
using them, if false - deletes the
community only. If this is set to true
and there exist other users of underlying resources,
this method only deletes the community
ObjectNotFoundException - if community to be deleted does not exist
NotEntitledException - if current user does not have permission
to delete this community
IllegalOperationException - if this community is a template
CommunityCallbackException - if an error occurs when making a community
callback
RemoteException
ObjectInUseException
public void deleteCommunityWithCascade(CommunityDefinitionId communityId)
throws ObjectNotFoundException,
NotEntitledException,
IllegalOperationException,
CommunityCallbackException,
RemoteException
communityId - CommunityDefinitionId of the
community to be deleted
ObjectNotFoundException - if community to be deleted does not exist
NotEntitledException - if current user does not have permission
to delete this community
IllegalOperationException - if this community is a template
CommunityCallbackException - if an error occurs when making a community
callback
RemoteExceptionpublic CommunityMember getMember()
CommunityMember object populated with information for the
community member currently logged in. If there is no WLS user currently
logged in, or if the user is not a community member, null is returned.
If caching is enabled for this CommunityUserContext, the return for
this method is cached.
CommunityMember object for the currently-logged-in WLS user,
or null if the user is not a community member or if no user is logged in.
public CommunityMember createMember(boolean active,
boolean external)
throws RemoteException,
DuplicateObjectException,
NotEntitledException
CommunityMember for the user associated
with this CommunityUserContext.
If caching is enabled for this CommunityUserContext, the return for
this method is cached.
active - true if the CommunityMember should be
created with active status.external - the external flag for the new CommunityMember,
which may be useful for tracking purposes in some
situations but is not used in the framework.
CommunityMember object
DuplicateObjectException - if a CommunityMember already exists
for the currently-logged-in user.
NotEntitledException - if no user is currently logged in.
RemoteException
public CommunityMember createMember(String username,
boolean active,
boolean external)
throws RemoteException,
DuplicateObjectException,
NotEntitledException
CommunityMember for the specified user.
If caching is enabled for this CommunityUserContext, the return for
this method is cached.
username - the WLS user name to create a member object for.active - true if the CommunityMember should be
created with active status.external - the external flag for the new CommunityMember,
which may be useful for tracking purposes in some
situations but is not used in the framework.
CommunityMember object
DuplicateObjectException - if a CommunityMember already exists
for the specified user.
NotEntitledException - if no user is currently logged in.
RemoteException
public CommunityMember createMember(CommunityMember info)
throws DuplicateObjectException,
RemoteException,
NotEntitledException
CommunityMember based on the contents of
the info parameter. This can be used to create a member record for a user
other than the currently logged in user.
info - a set of information on which to base the creation of the
new CommunityMember
CommunityMember object populated with values
corresponding to the new CommunityMember
DuplicateObjectException - if a member record already exists for the
WLS user specified in the CommunityMember object.
NotEntitledException - if no user is currently logged in.
RemoteException
public CommunityMember getMember(String userId)
throws RemoteException,
NotEntitledException
CommunityMember object populated with
information for the CommunityMember specified by user id.
This is useful for retrieving a CommunityMember object
for a user other than the one currently logged in.
userId - the WLS user id of the CommunityMember to look up.
CommunityMember object populated with information
for the specified CommunityMember if they exist,
otherwise null
NotEntitledException - If no user is currently logged in.
RemoteException
public CommunityMember getMember(CommunityMemberId id)
throws RemoteException,
NotEntitledException
CommunityMember object populated with
information for the CommunityMember specified by member id.
This is useful for retrieving a CommunityMember object
for a user other than the one currently logged in.
id - the CommunityMemberId of the CommunityMember
to look up.
CommunityMember object populated with information
for the specified CommunityMember if they exist,
otherwise null
NotEntitledException - If no user is currently logged in.
RemoteException
public void disableMember()
throws ObjectNotFoundException,
RemoteException
CommunityMember associated with this
CommunityUserContext object globally for all Communities.
ObjectNotFoundException - if no member record exists for the
currently-logged-in user or if no user is currently logged in.
RemoteException
public void disableMember(CommunityMemberId id)
throws ObjectNotFoundException,
RemoteException,
NotEntitledException
CommunityMember globally for all Communities.
id - the id of the CommunityMember to disable.
NotEntitledException - If no user is currently logged in.
ObjectNotFoundException - if the specified member does not exist in the
database.
RemoteException
public void activateMember()
throws ObjectNotFoundException,
RemoteException
CommunityMember associated with this
CommunityUserContext globally for all Communities.
ObjectNotFoundException - if no member record exists for the
currently-logged-in user or if no user is currently logged in.
RemoteException
public void activateMember(CommunityMemberId id)
throws ObjectNotFoundException,
RemoteException,
NotEntitledException
CommunityMember globally for all Communities.
id - the id of the CommunityMember to activate.
NotEntitledException - If no user is currently logged in.
ObjectNotFoundException - if the specified member does not exist in the
database.
RemoteException
public void removeMember()
throws ObjectNotFoundException,
RemoteException
CommunityMember associated with this
CommunityUserContext globally for all Communities.
ObjectNotFoundException - if no member record exists for the
currently-logged-in user or if no user is currently logged in.
RemoteException
public void removeMember(CommunityMemberId id)
throws ObjectNotFoundException,
RemoteException,
NotEntitledException
CommunityMember globally for all Communities.
id - the id of the CommunityMember to remove.
NotEntitledException - If no user is currently logged in.
ObjectNotFoundException - if the specified member does not exist in the
database.
RemoteException
public CommunityMembership createMembership(CommunityMemberId mId,
CommunityDefinitionId cId)
throws DuplicateObjectException,
NotEntitledException,
RemoteException
CommunityMembership for the specified CommunityMember
in the specified CommunityDefinition. Invitations may contain information
about community capabilities to grant to the new membership, so when an invitation
exists, the other form of this method (which takes an Invitation object) should be used.
mId - the id of the CommunityMember to create a membership for.cId - the id of the CommunityDefinition
CommunityMembership object containing the new membership information.
DuplicateObjectException - if a membership already exists for the specified
member and community.
NotEntitledException - If no user is currently logged in.
RemoteExceptionCommunityContext if creating a membership for the currently logged-in user.
public CommunityMembership createMembership(CommunityMemberId mId,
Invitation invitation)
throws IllegalArgumentException,
DuplicateObjectException,
NotEntitledException,
RemoteException
CommunityMembership for the specified CommunityMember
from the specified Invitation. Invitations may contain information
about community capabilities to grant to the new membership, so when an invitation
exists, it should be used.
mId - the id of the CommunityMember to create a membership for.invitation - the inviation to use when creating a membership.
CommunityMembership object containing the new membership information.
IllegalArgumentException - if the invitation does not have "sent" status
or if the invitation is not for the specified member.
DuplicateObjectException - if a membership already exists for the specified
member and community.
NotEntitledException - If no user is currently logged in.
RemoteExceptionCommunityContext if creating a membership for the currently logged-in user.
public void removeMembership(CommunityMemberId mId,
CommunityDefinitionId cId)
throws NotEntitledException,
ObjectNotFoundException,
RemoteException
CommunityMembership for a CommunityMember in a specified
CommunityDefinition.
mId - the id of the CommunityMembercId - the id of the CommunityDefinition
RemoteException
NotEntitledException - If no user is currently logged in.
ObjectNotFoundException - if no membership for the specified community and member
exists.CommunityContext if deleting a membership for the currently logged-in user.
public void disableMembership(CommunityMemberId mId,
CommunityDefinitionId cId)
throws NotEntitledException,
ObjectNotFoundException,
RemoteException
CommunityMembership.
mId - the id of the CommunityMembercId - the id of the CommunityDefinition
RemoteException
NotEntitledException - If no user is currently logged in.
ObjectNotFoundException - if no membership for the specified community
and member exists.CommunityContext if disabling a membership for the currently logged-in user.
public void activateMembership(CommunityMemberId mId,
CommunityDefinitionId cId)
throws NotEntitledException,
RemoteException,
ObjectNotFoundException
CommunityMembership in the specified CommunityDefinition,
making a disabled member able to use the community once again.
mId - the id of the CommunityMembercId - the id of the CommunityDefinition
RemoteException
NotEntitledException - If no user is currently logged in.
ObjectNotFoundException - if no membership for the specified community
and member exists.CommunityContext if activating a membership for the currently logged-in user.
public CommunityMembership getMembership(CommunityMemberId mId,
CommunityDefinitionId cId)
throws NotEntitledException,
RemoteException
CommmunityMembership information for a CommunityMember,
if they have a membership in the specified community.
mId - the id of the CommunityMembercId - the id of the CommunityDefinition
CommunityMembership object populated with membership information
for the specified CommunityMember, if it exists, otherwise null.
RemoteException
NotEntitledException - If no user is currently logged in.CommunityContext if getting the membership information for the
currently logged-in user.
public CommunityMembership getMembership(String username,
CommunityDefinitionId cId)
throws NotEntitledException,
RemoteException
CommmunityMembership information for a user,
if they have a membership in the specified community.
username - the WLS username of the usercId - the id of the CommunityDefinition
CommunityMembership object populated with membership information
for the specified user, if it exists, otherwise null.
RemoteException
NotEntitledException - If no user is currently logged in.CommunityContext if getting the membership information for the
currently logged-in user.
public MemberMembershipCriteria getMemberMembershipCriteria()
throws NotEntitledException
getMemberCommunityMemberships() method.
NotEntitledException - if no user is logged in.MemberMembershipCriteria,
getMemberCommunityMemberships(MemberMembershipCriteria,int)
public SortableFilterablePagedResult<CommunityMembership> getMemberCommunityMemberships(MemberMembershipCriteria criteria,
int pageSize)
throws RemoteException,
NotEntitledException
CommunityMembership objects for a specified
user or the currently authenticated user that meet the specified criteria.
If the returned SortableFilterablePagedResult is re-filtered using the reFilter()
method, the filter specified is used in addition to the original filter criteria
specified in the MemberMembershipCriteria object. If the filter criteria
specified in the reFilter() method conflicts with a criteria specified in the original
MemberMembershipCriteria object, the newly specified filter criteria is used in
place of the original MemberMembershipCriteria for that field only; all other
field criteria specified in the MemberMembershipCriteria object will still be
used as filter criteria.
The returned PagedResult is sortable by "USERNAME", "MEMBER_IS_ACTIVE", "MEMBER_IS_EXTERNAL",
"MEMBERSHIP_IS_ACTIVE", "LAST_ACCESS_DATE" and "JOIN_DATE".
The returned PagedResult is filterable by "USERNAME", using these filter methods:
criteria - the criteria CommunityMemberships must match to be returned.
If null, a MemberMembershipCriteria object is created
specifying the currently authenticated user. Also see the
getMemberMembershipCriteria() method to get a
MemberMembershipCriteria object for the currently authenticated user.pageSize - the number of membership objects to return per result page.
RemoteException
NotEntitledException - if no user is logged in.MemberMembershipCriteria
public SortableFilterablePagedResult<CommunityMembership> getCommunityMemberships(CommunityMembershipCriteria criteria,
int pageSize)
throws RemoteException,
NotEntitledException
CommunityMembership objects for the
specified community that meet the specified criteria.
If the returned SortableFilterablePagedResult is re-filtered using the reFilter()
method, the filter specified is used in addition to the original filter criteria
specified in the CommunityMembershipCriteria object. If the filter criteria
specified in the reFilter() method conflicts with a criteria specified in the original
CommunityMembershipCriteria object, the newly specified filter criteria is used in
place of the original CommunityMembershipCriteria for that field only; all other
field criteria specified in the CommunityMembershipCriteria object will still be
used as filter criteria.
The returned PagedResult is sortable by "USERNAME", "MEMBER_IS_ACTIVE", "MEMBER_IS_EXTERNAL",
"MEMBERSHIP_IS_ACTIVE", "LAST_ACCESS_DATE" and "JOIN_DATE".
The returned PagedResult is filterable by "USERNAME", using these filter methods:
criteria - the criteria CommunityMemberships must match to be returned.pageSize - the number of membership objects to return per result page.
RemoteException
NotEntitledException - if no user is logged in.CommunityContext.getCommunityMembershipCriteria(),
CommunityMembershipCriteria
public SortableFilterablePagedResult<String> getAllCommunityAssociates(MemberCriteria criteria,
int pageSize)
throws RemoteException,
NotEntitledException
criteria - the specification of the user to do the search for. If
null, the currently authenticated user is used.pageSize - the number of usernames to return per result page.
String WLS user IDs which is the
merged community membership list for all communities the specified
user belongs to. A WLS user ID will only
be included once, even if the user has a membership in multiple communities
to which the specified user also belongs.
RemoteException
NotEntitledException - if no user is logged in or the currently authenticated
user has no member record (and cannot therefore be a member of any community).
public void addMembershipCapability(CommunityMemberId mId,
CommunityDefinitionId cId,
MembershipCapability capability)
throws RemoteException,
NotEntitledException,
IllegalArgumentException,
ObjectNotFoundException
CommunityMembership
specified.
mId - the id of the CommunityMember whose membership is to be modified.cId - the id of the Community for the membership.capability - the capability to add to the membership
RemoteException
NotEntitledException - if no user is logged in.
IllegalArgumentException - if the capability specified is not valid.
ObjectNotFoundException - if the specified community membership does not exist.
public void removeMembershipCapability(CommunityMemberId mId,
CommunityDefinitionId cId,
MembershipCapability capability)
throws RemoteException,
NotEntitledException,
IllegalArgumentException,
ObjectNotFoundException
CommunityMembership
specified.
mId - the id of the CommunityMember whose membership is to be modified.cId - the id of the Community for the membership.capability - the capability to remove from the membership
RemoteException
NotEntitledException - if no user is logged in.
IllegalArgumentException - if the capability specified is not valid.
ObjectNotFoundException - if the specified community membership does not exist.
public MessagingAddress getMessagingAddress(MessagingAddressType addrType,
String name)
throws RemoteException
MessagingAddress of a particular type and name
for the CommunityMember
associated with this CommunityUserContext.
addrType - the type of MessagingAddressname - the name of the MessagingAddress mapping to use
MessagingAddress of the specified type if it exists, otherwise null.
Null is also returned if there is no CommunityMember associated with
this CommunityUserContext.
RemoteException
public MessagingAddress getMessagingAddress(CommunityMemberId id,
MessagingAddressType addrType,
String name)
throws NotEntitledException,
RemoteException
MessagingAddress of a particular type and name
for the specified CommunityMember.
id - the id of the CommunityMemberaddrType - the type of MessagingAddressname - the name of the MessagingAddress mapping to use
MessagingAddress of the specified type, if it exists, otherwise null.
Null is also returned if the specified member does not exist.
NotEntitledException - if no user is logged in.
RemoteException
public MessagingAddress getPrimaryMessagingAddress(CommunityMember member,
MessagingAddressType addrType)
throws RemoteException
MessagingAddress of a particular type for the CommunityMember
associated with this CommunityUserContext.
addrType - the type of MessagingAddress
MessagingAddress of the specified type if it exists, otherwise null.
Null is also returned if there is no CommunityMember associated with
this CommunityUserContext.
RemoteException
public Collection<MessagingAddress> getMessagingAddresses(MessagingAddressType addrType)
throws RemoteException
MessagingAddresses of a particular type for the
CommunityMember associated with this CommunityUserContext.
addrType - the type of MessagingAddress. If this parameter is less than zero,
MessagingAddresses of all types will be returned.
Collection of MessagingAddress objects of the specified type
for the user associated with this CommunityUserContext, if they exist,
otherwise an empty Collection. An empty collection is also returned
if there is no CommunityMember associated with this CommunityUserContext
RemoteException
public Collection<MessagingAddress> getMessagingAddresses(CommunityMemberId id,
MessagingAddressType addrType)
throws NotEntitledException,
RemoteException
MessagingAddresses of a particular type for the specified
CommunityMember.
id - the id of the CommunityMemberaddrType - the type of MessagingAddress. If this parameter is less than zero,
MessagingAddresses of all types will be returned.
Collection of MessagingAddress objects of the specified type
for the specified CommunityMember, if they exist, otherwise an empty
Collection.
NotEntitledException - if no user is logged in.
RemoteException
public void setMessagingAddress(MessagingAddress m,
String name)
throws PropertyValidationException,
NotEntitledException,
RemoteException
MessagingAddress.
m - a MessagingAddress populated with update values.name - the MessagingAddress mapping used to specify the
MessagingAddress to update.
PropertyValidationException - if the format of the MessagingAddress
is not allowed by the mapped User Profile property.
NotEntitledException - if no user is logged in.
RemoteException
public void setPrimaryMessagingAddress(MessagingAddress m)
throws PropertyValidationException,
NotEntitledException,
RemoteException
MessagingAddress.
m - a MessagingAddress populated with update values.
PropertyValidationException - if the format of the MessagingAddress
is not allowed by the mapped primary User Profile property.
NotEntitledException - if no user is logged in.
RemoteExceptionpublic CommunityInvitationHelper getCommunityInvitationHelper()
public String toString()
toString in class Objectpublic boolean equals(Object o)
equals in class Object
protected final Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException
|
Copyright © 2008 BEA Systems, Inc. All Rights Reserved | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||