Oracle Application Server Wireless Java API Reference
B10400-01

oracle.panama.model
Interface Community

All Superinterfaces:
ModelObject, XMLObject

public interface Community
extends ModelObject

A Community is a collection of users. A ccommunity can be used as a unit for privacy granting, i.e. instead of granting the right to the community members one by one, the community can be granted the right The Community interface provides methods to retrieve information about the community object, add/remove members to/from the community, and set community attributes.


Field Summary
static java.lang.String CMTY_PRIVATE
          The private community type Every user can create her own private community.
static java.lang.String CMTY_SHARED
          The shared community type The community and its member list are visible to all the community members.
static java.lang.String CMTY_SYSTEM
          The system community type The system community can only be created by the system administrator.
static java.lang.String TYPENAME
          The constant class type identifier.

 

Fields inherited from interface oracle.panama.model.ModelObject
TYPEID

 

Method Summary
 void addMember(User requester, User newMember)
          Add a member to the community.
 void addMember(User requester, User[] newMembers)
          Add multiple new members to the community.
 ResultSetEnumeration getAllMembers()
          Get all the members in the community
 java.lang.String getCommunityType()
          Get the type of the community
 User getCreator()
          Get the creator of the community
 java.lang.String getName()
          get the name of the community
 ResultSetEnumeration getVisibleMembers(User requester)
          get all the members that the requester has the right to see
 boolean isCreator(User user)
          check whether the user is the creator of the community
 boolean isMember(User user)
          check whether the user is a member of this community
 void removeAllMembers(User requester)
          remove all members from the community.
 void removeMember(User requester, User member)
          remove a member from the community.
 void removeMember(User requester, User[] members)
          remove multiple members from the community.
 void setName(User requester, java.lang.String newName)
          Set the name of the community.
 boolean visibleTo(User user)
          check whether the community is visible to the user A private community is only visible to its creator.

 

Methods inherited from interface oracle.panama.model.ModelObject
delete, getCreatedDate, getId, getLastModifiedDate, getTypeId, getTypeName, isSystem, setName, setSystem, undoAll

 

Methods inherited from interface oracle.panama.model.XMLObject
setXML, toXML

 

Field Detail

TYPENAME

public static final java.lang.String TYPENAME
The constant class type identifier.
See Also:
Constant Field Values

CMTY_PRIVATE

public static final java.lang.String CMTY_PRIVATE
The private community type Every user can create her own private community. The private community and its member list is only visible to the user who creates the community-the creator.s
See Also:
Constant Field Values

CMTY_SHARED

public static final java.lang.String CMTY_SHARED
The shared community type The community and its member list are visible to all the community members. Each member can remove herself from the community. Only the community creator has the right to add new members to the communiyt. Only the community creator can delete the community.
See Also:
Constant Field Values

CMTY_SYSTEM

public static final java.lang.String CMTY_SYSTEM
The system community type The system community can only be created by the system administrator. A system community is visible to all the users in the system. But the member list is only visible to the system administrator.
See Also:
Constant Field Values
Method Detail

getCommunityType

public java.lang.String getCommunityType()
Get the type of the community

getAllMembers

public ResultSetEnumeration getAllMembers()
Get all the members in the community

getCreator

public User getCreator()
Get the creator of the community

getName

public java.lang.String getName()
get the name of the community
Specified by:
getName in interface ModelObject
Returns:
String the name of the object

isMember

public boolean isMember(User user)
check whether the user is a member of this community

isCreator

public boolean isCreator(User user)
check whether the user is the creator of the community

getVisibleMembers

public ResultSetEnumeration getVisibleMembers(User requester)
get all the members that the requester has the right to see
Parameters:
requester - The user who would like to get the members that are visible to her
Returns:
if the requester does not have the right to see the members in the community, null is returned If the requester has the right to see the member list of the community, a ResultSetEnumeration object is returned. If the requester has the right to see the member list of the community and the community does not have any member, a empty resultsetenumeration is returned. For privacy community, the creator is able to see all the members. All the other users can not see the member list. For shared community, the members in the community are able to see all the members in the community. Other users can not. For system community, the members are only visible to the system adminitrator.

addMember

public void addMember(User requester,
User newMember)
               throws PanamaException
Add a member to the community. The requester should have the right to add the newMember to the community, otherwise a LocationPrivacyException is thrown. For private and shared community, only the community creator has the right to add a new member to the community. For system community, the system administrator has the right to add a new member to the community.
Parameters:
requester - The user who requests to add a member
newMember - The user who will be added
Throws:
If - the requester does not have enough right, a LocationPrivacyException is thrown. If other errors occur, a PanamaException is thrown
PanamaException
See Also:
LocationPrivacyException

addMember

public void addMember(User requester,
User[] newMembers)
               throws PanamaException
Add multiple new members to the community. The requester should have the right to add members to the community, otherwise a LocationPrivacyException is thrown For private and shared community, only the community creator has the right to add new members to the community. For system community, the system administrator has the right to add new members to the community.
Parameters:
requester - The user who requests to add members
newMembers - An array of users who will be added to the community
Throws:
If - the requester does not have enough right, a LocationPrivacyException is thrown. If other errors occur, a PanamaException is thrown
PanamaException
See Also:
LocationPrivacyException

removeMember

public void removeMember(User requester,
User member)
                  throws PanamaException
remove a member from the community. The requester should have the right to remove the member from the community, otherwise a LocationPrivacyException is thrown For private community, only the community creator has the right to remove a member from the community. For system community, the system administrator has the right to remove a member from the community. For shared community, the creator has the right to remove a member from the community and each member has right to remove herself from the community.
Parameters:
requester - The user who requests to remove a member
member - The user who will be removed from the community
Throws:
If - the requester does not have enough right, a LocationPrivacyException is thrown. If other errors occur, a PanamaException is thrown
PanamaException
See Also:
LocationPrivacyException

removeMember

public void removeMember(User requester,
User[] members)
                  throws PanamaException
remove multiple members from the community. The requester should have the right to remove members from the community, otherwise a LocationPrivacyException is thrown For private community, only the community creator has the right to remove members from the community. For system community, the system administrator has the right to remove members from the community. For shared community, the creator has the right to remove members from the community and each member has right to remove herself from the community.
Parameters:
requester - The user who requests to remove members
Throws:
If - the requester does not have enough right, a LocationPrivacyException is thrown. If other errors occur, a PanamaException is thrown
PanamaException
See Also:
LocationPrivacyException

removeAllMembers

public void removeAllMembers(User requester)
                      throws PanamaException
remove all members from the community. The requester should have the right to remove all members from the community, otherwise a LocationPrivacyException is thrown For private and shared community, only the community creator has the right to remove all members from the community. For system community, the system administrator has the right to remove all members from the community.
Parameters:
requester - The user who requests to remove members
Throws:
If - the requester does not have enough right, a LocationPrivacyException is thrown. If other errors occur, a PanamaException is thrown
PanamaException
See Also:
LocationPrivacyException

setName

public void setName(User requester,
                    java.lang.String newName)
             throws PanamaException
Set the name of the community. The requester must be the creator of the community. otherwise a LocationPrivacyException is thrown
Parameters:
requester - The user who requests to set the community name
newName - The new name that will be set for the community
Throws:
If - the requester does not have enough right, a LocationPrivacyException is thrown. If other errors occur, a PanamaException is thrown
PanamaException
See Also:
LocationPrivacyException

visibleTo

public boolean visibleTo(User user)
                  throws PanamaException
check whether the community is visible to the user A private community is only visible to its creator. A shared community is visible to its creator and its member. A system community is visible to all users.
Returns:
if the community is visible to the user, the method returns true. Otherwise, returns false
PanamaException

Oracle Application Server Wireless Java API Reference
B10400-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.