Oracle Application Server Wireless Java API Reference
B10400-01

oracle.panama.mp.privacy
Class CommunityManager

java.lang.Object
  |
  +--oracle.panama.mp.privacy.CommunityManager

public class CommunityManager
extends java.lang.Object

The community manager handles community related operations, such as creating community, deleting community, retrieving community.

Author:
jiwu

Method Summary
 Community createCommunity(User creator, java.lang.String cmtyName, java.lang.String cmtyType, User[] members)
          Creates a new community
 void deleteCommunity(User deleter, Community cmty)
          Deletes a community.
 void deleteCommunity(User deleter, java.lang.String cmtyName)
          Deletes a community.
 ResultSetEnumeration getCommunities()
          Get all the communities in the system.
 Community getCommunity(long commId)
          Get the community by community Id
 Community getCommunity(User creator, java.lang.String commName)
          Get the community in the system, created by the creator and with the name of commName.
 ResultSetEnumeration getCreatedCommunities(User creator)
          Get all of the communities in the system created by the creator
 ResultSetEnumeration getCreatedCommunities(User creator, java.lang.String type)
          Get the communities in the system created by the creator, with the type of type
static CommunityManager getInstance()
          The singleton thread-safe getter.
 ResultSetEnumeration getVisibleCommunities(User user, java.lang.String cmtyType)
          Get the communities in the system that are visible to the user and with the type of type

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

getInstance

public static CommunityManager getInstance()
The singleton thread-safe getter.
Returns:
the LocationMarkController singleton interface.

createCommunity

public Community createCommunity(User creator,
                                 java.lang.String cmtyName,
                                 java.lang.String cmtyType,
User[] members)
                          throws PanamaException
Creates a new community
Parameters:
creator - The creator of the new community
cmtyName - The name of the new community
cmtyType - The type of the new community The type can be one of the three values defined in the Community interface: CMTY_PRIVATE,CMTY_SHARED,CMTY_SYSTEM
Returns:
the created community
Throws:
If - the same creator already has a community with the same name, a LocationPrivacyException is thrown. If other errors happen, a PanamaException is thrown.
PanamaException
See Also:
Community, LocationPrivacyException

deleteCommunity

public void deleteCommunity(User deleter,
Community cmty)
                     throws PanamaException
Deletes a community. The deleter must have the right to delete the community, otherwise a LocationPrivacyException will be thrown.
Parameters:
deleter - The user who wants to delete the community
cmty - The community to be deleted
Throws:
If - the deleter does not have enough right, a LocationPrivacyException is thrown, If other errors occur, a PanamaException is thrown
PanamaException

deleteCommunity

public void deleteCommunity(User deleter,
                            java.lang.String cmtyName)
                     throws PanamaException
Deletes a community. The deleter must be the creator of the community. A user and the name of a community uniquely identify a community. The method tries to find a community which is created by deleter and has the name of cmtyName and delete it. If the community does not exist, a PanamaException is thrown.
Parameters:
deleter - The user who wants to delete the community
cmtyName - The name of the community to be deleted
PanamaException

getCommunities

public ResultSetEnumeration getCommunities()
Get all the communities in the system.
Returns:
a ResultSetEnumeration consist of the retrieved communities

getCreatedCommunities

public ResultSetEnumeration getCreatedCommunities(User creator,
                                                  java.lang.String type)
Get the communities in the system created by the creator, with the type of type
Parameters:
creator - the user who creates the communities
type - the type of the communities to be retrieved The type can be one of the three values defined in Community interface: CMTY_PRIVATE,CMTY_SHARED,CMTY_SYSTEM
Returns:
a ResultSetEnumeration consist of the retrieved communities
See Also:
Community

getCreatedCommunities

public ResultSetEnumeration getCreatedCommunities(User creator)
Get all of the communities in the system created by the creator
Parameters:
creator - the user who creates the communities
Returns:
a ResultSetEnumeration consist of the retrieved communities

getVisibleCommunities

public ResultSetEnumeration getVisibleCommunities(User user,
                                                  java.lang.String cmtyType)
Get the communities in the system that are visible to the user and with the type of type
Returns:
a ResultSetEnumeration consist of the retrieved communities
See Also:
Community

getCommunity

public Community getCommunity(User creator,
                              java.lang.String commName)
Get the community in the system, created by the creator and with the name of commName. Creator and community name uniquely identify a community
Parameters:
creator - the user who creates the community
Returns:
the retrieved community

getCommunity

public Community getCommunity(long commId)
Get the community by community Id
Parameters:
commId - Community object Id
Returns:
the retrieved community

Oracle Application Server Wireless Java API Reference
B10400-01

Copyright © 2003 Oracle Corporation. All Rights Reserved.