oracle.panama.mp.privacy
Class LocationPrivacyManager

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

public class LocationPrivacyManager
extends java.lang.Object

LocationPrivacyManager handles location privacy related operations, such as grant location access authorization, revoke the authorization, disable/enable the authorization, set/get privacy directive to the system, check whether a user has right to position another user. All the privacy operations can be done using the methods in this class. The class also provides a variety of ways to retrieve the LocationPrivacyAuth object which keeps the information of a privacy authorization item.

Since:
iAS Wireless Edition Release 2.0

Field Summary
TypeField
static java.lang.String DIRECTIVE_ALLOW_LCP
          This directive whichs allows system to position users who set this directive, and to store the position results in cache
static java.lang.String DIRECTIVE_NO_CACHE
          This directive allows the system to do positioning, but forbids the system to store the position result into cache
static java.lang.String DIRECTIVE_NO_POSITION
          This directive forbids the system to position on users who set the directive
 
Method Summary
TypeMethod
 boolean checkAuthorization(Service service, User owner, User positionRequester, java.util.Calendar posTime)
          Check whether the positionRequester has right to access the owner's location information at posTime in service.
 void disableAuthorization(long authId)
          This method is used for temporarily disabling the granted authorization It is different from revoking in that the disabled granting can be recovered later on by calling enable method, while the revoke can not be recovered without performing a new grant operation.
 void disableAuthorization(Service service, User owner, Community positionRequester)
          This method is used for temporarily disabling the granted authorization It is different from revoking in that the disabled granting can be recovered later on by calling enable method, while the revoke can not be recovered without performing a new grant operation.
 void disableAuthorization(Service service, User owner, User positionRequester)
          This method is used for temporarily disabling the granted authorization It is different from revoking in that the disabled granting can be recovered later on by calling enable method, while the revoke operation can not be recovered without performing a new grant operation.
 void enableAuthorization(long authId)
          This method is used for recovering a temporarily disabled authorization.
 void enableAuthorization(Service service, User owner, Community positionRequester)
          This method is used for recovering a temporarily disabled authorization.
 void enableAuthorization(Service service, User owner, User positionRequester)
          This method is used for recovering a temporarily disabled authorization.
 java.lang.String getDefaultDirective()
          Get the default directive if a user has not set his own directive to the system
 java.lang.String getDirective(User user)
          Get the user's system level location privacy directive.
static LocationPrivacyManager getInstance()
          The singleton thread-safe getter.
 ResultSetEnumeration getLocationPrivacyAuth(Service service)
          Get all the granting items in the service
 ResultSetEnumeration getLocationPrivacyAuth(Service service, User owner, java.lang.String positionRequesterType, java.lang.String status)
          Find LocationPrivacyAuth by service, the privacy owner, the type of the positionRequester and the status of the authorization
 void grantAuthorization(Service service, User owner, Community positionRequester, AuthPeriod period)
          This method is used for owner to grant positionRequester in the application(service) the right to access the owner 's location information within the period specified by period If the same owner has granted the same positionRequester the right in the same service, this new grant will replace the old granting.
 void grantAuthorization(Service service, User owner, User positionRequester, AuthPeriod period)
          This method is used for owner to grant positionRequester in the application(service) the right to access the owner 's location information within the period specified by period If the same owner has granted the same positionRequester the right in the same service, this new grant will replace the old granting.
 void revokeAuthorization(long authId)
          This method is used for revoking granted authorization by the object Id of the authorization.
 void revokeAuthorization(Service service, User owner, Community positionRequester)
          This method is used for revoking granted authorization.
 void revokeAuthorization(Service service, User owner, User positionRequester)
          This method is used for revoking granted authorization.
 void setDirective(User user, java.lang.String directive)
          set the user's location privacy directive.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIRECTIVE_NO_POSITION

public static final java.lang.String DIRECTIVE_NO_POSITION
This directive forbids the system to position on users who set the directive

DIRECTIVE_NO_CACHE

public static final java.lang.String DIRECTIVE_NO_CACHE
This directive allows the system to do positioning, but forbids the system to store the position result into cache

DIRECTIVE_ALLOW_LCP

public static final java.lang.String DIRECTIVE_ALLOW_LCP
This directive whichs allows system to position users who set this directive, and to store the position results in cache
Method Detail

getInstance

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

setDirective

public void setDirective(User user,
                         java.lang.String directive)
                  throws PanamaException
set the user's location privacy directive. A user's location privacy directive is a system level directive, which applies in all the applications.
Parameters:
User - the use whose directive is to be set
directive - one of the three system level directives DIRECTIV_NO_POSITION, DIRECTIVE_NO_CACHE, or DIRECTIVE_ALLOW_LCP
See Also:
DIRECTIVE_NO_POSITION, DIRECTIVE_NO_CACHE, DIRECTIVE_ALLOW_LCP

getDirective

public java.lang.String getDirective(User user)
Get the user's system level location privacy directive. If the user has not set the directive, the system default directive is returned.
Parameters:
user - the user whose directive is to be obtained
Returns:
directive one of the three system level directives DIRECTIV_NO_POSITION, DIRECTIVE_NO_CACHE, or DIRECTIVE_ALLOW_LCP
See Also:
DIRECTIVE_NO_POSITION, DIRECTIVE_NO_CACHE, DIRECTIVE_ALLOW_LCP

grantAuthorization

public void grantAuthorization(Service service,
                               User owner,
                               User positionRequester,
                               AuthPeriod period)
                        throws PanamaException
This method is used for owner to grant positionRequester in the application(service) the right to access the owner 's location information within the period specified by period If the same owner has granted the same positionRequester the right in the same service, this new grant will replace the old granting.
Parameters:
service - The service in which the granting happens
owner - The user who would like to grant the location access right to positionRequester
positionRequester - The user who will get the right
period - The positionRequester can only access to the owner's location information within the specified period

grantAuthorization

public void grantAuthorization(Service service,
                               User owner,
                               Community positionRequester,
                               AuthPeriod period)
                        throws PanamaException
This method is used for owner to grant positionRequester in the application(service) the right to access the owner 's location information within the period specified by period If the same owner has granted the same positionRequester the right in the same service, this new grant will replace the old granting.
Parameters:
service - The service in which the granting has effects
owner - The user who would like to grant the location access right to others
positionRequester - The community whose members will get the right
period - The positionRequester can only access to the owner's location information within the specified period

revokeAuthorization

public void revokeAuthorization(Service service,
                                User owner,
                                User positionRequester)
                         throws PanamaException
This method is used for revoking granted authorization. If no authorization meets the criteria, the method does nothing and simply returns
Parameters:
service - The service in which the revoking has effects
owner - The owner of the location information.
positionRequester - The user whose right to access the owner's location information is be revoked
Throws:
PanamaException -  

revokeAuthorization

public void revokeAuthorization(long authId)
                         throws PanamaException
This method is used for revoking granted authorization by the object Id of the authorization. If no such authorization exists, the method does nothing and simply returns
Parameters:
authId - The object Id of the authorization
Throws:
PanamaException -  

revokeAuthorization

public void revokeAuthorization(Service service,
                                User owner,
                                Community positionRequester)
                         throws PanamaException
This method is used for revoking granted authorization. If no authorization meets the criteria, the method does nothing and simply returns
Parameters:
service - The service in which the revoking has effects
owner - The owner of the location information.
positionRequester - The community whose members' right to access the owner's location information is be revoked
Throws:
PanamaException -  

disableAuthorization

public void disableAuthorization(Service service,
                                 User owner,
                                 User positionRequester)
                          throws PanamaException
This method is used for temporarily disabling the granted authorization It is different from revoking in that the disabled granting can be recovered later on by calling enable method, while the revoke operation can not be recovered without performing a new grant operation. As a single user, the positionRequester will be forbidden to access the owner's location information in the period when the positionRequester is previously granted the right. If no authorization meets the criteria, a PanamaException is thrown.
Parameters:
service - The service in which the disable operation has effects
owner - The owner of the location information.
positionRequester - The user whose right to access the owner's location information is disabled

enableAuthorization

public void enableAuthorization(Service service,
                                User owner,
                                User positionRequester)
                         throws PanamaException
This method is used for recovering a temporarily disabled authorization. If no authorization meets the criteria, a PanamaException is thrown.
Parameters:
service - The service in which the disable operation has effects
owner - The owner of the location information.
positionRequester - The user whose right to access the owner's location information is to be recovered.
See Also:
disableAuthorization(Service service, User owner, User positionRequester)

enableAuthorization

public void enableAuthorization(long authId)
                         throws PanamaException
This method is used for recovering a temporarily disabled authorization. If no authorization meets the criteria, a PanamaException is thrown.
Parameters:
authId - The object id of the authorization to be recovered.

disableAuthorization

public void disableAuthorization(Service service,
                                 User owner,
                                 Community positionRequester)
                          throws PanamaException
This method is used for temporarily disabling the granted authorization It is different from revoking in that the disabled granting can be recovered later on by calling enable method, while the revoke can not be recovered without performing a new grant operation. Note that the disable operation on a community has different effect from disable operation on a single user. After this disable operation, the disabled granting is treated as nonexist. If no authorization meets the criteria, a PanamaException is thrown.
Parameters:
service - The service in which the disable operation happens
owner - The owner of the location information.
positionRequester - The community whose members' right to access the owner's location information are disabled

enableAuthorization

public void enableAuthorization(Service service,
                                User owner,
                                Community positionRequester)
                         throws PanamaException
This method is used for recovering a temporarily disabled authorization.
Parameters:
service - The service in which the disable operation happens
owner - The owner of the location information.
positionRequester - The community whose members' rights to access the owner's location information are to be recovered.
See Also:
disableAuthorization(Service service, User owner, Community positionRequester)

disableAuthorization

public void disableAuthorization(long authId)
                          throws PanamaException
This method is used for temporarily disabling the granted authorization It is different from revoking in that the disabled granting can be recovered later on by calling enable method, while the revoke can not be recovered without performing a new grant operation. Depending on whether the positionerRequester in this authorization is a single user or a community, the disable operation has slightly differnt effect.
Parameters:
authId - the object Id of the authorization to be disabled
See Also:
disableAuthorization(Service service, User owner, User positionRequester), disableAuthorization(Service service, User owner, Community positionRequester)

checkAuthorization

public boolean checkAuthorization(Service service,
                                  User owner,
                                  User positionRequester,
                                  java.util.Calendar posTime)
                           throws PanamaException
Check whether the positionRequester has right to access the owner's location information at posTime in service.
Parameters:
service - The service in which the checking occurs.
owner - The owner of the location information
positionRequester - The user who tries to access the owner's location information
posTime - The positioning time
Returns:
if the positionRequester has right, true is returned. Otherwise, false is returned

getLocationPrivacyAuth

public ResultSetEnumeration getLocationPrivacyAuth(Service service,
                                                   User owner,
                                                   java.lang.String positionRequesterType,
                                                   java.lang.String status)
                                            throws PanamaException
Find LocationPrivacyAuth by service, the privacy owner, the type of the positionRequester and the status of the authorization
Parameters:
service - the service to which the requested loation privacy authorization items belong
owner - the user who grants the authorization
positionRequesterType - the type of the positionRequester. If it is set, the value is either User.typeName or Community.TypeName. If this parameter is null, return both types
status - the status of the authorization. If the status parameter is null, return all the authorizations that meet the other criteria no matter what status the authorization has.
Returns:
a ResultSetEnumeration object of LocationPrivacyAuth objects
Throws:
PanamaException - if LocationPrivacyAuth can not be found
See Also:
LocationPrivacyAuth

getLocationPrivacyAuth

public ResultSetEnumeration getLocationPrivacyAuth(Service service)
                                            throws PanamaException
Get all the granting items in the service
Parameters:
service - The service to which the grantings belong
Returns:
A ResultSetEnumeration which contains the retrieved granting items.
Throws:
PanamaException - if LocationPrivacyAuth can not be found

getDefaultDirective

public java.lang.String getDefaultDirective()
Get the default directive if a user has not set his own directive to the system
Returns:
depending on the system setting, returns one of the three values of DIRECTIVE_NO_POSITION,DIRECTIVE_NO_CACHE,DIRECTIVE_ALLOW_LCP
See Also:
DIRECTIVE_NO_POSITION, DIRECTIVE_NO_CACHE, DIRECTIVE_ALLOW_LCP