|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.panama.mp.privacy.LocationPrivacyManager
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.
Field Summary |
Type | Field |
---|---|
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 |
Type | Method |
---|---|
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 |
public static final java.lang.String DIRECTIVE_NO_POSITION
public static final java.lang.String DIRECTIVE_NO_CACHE
public static final java.lang.String DIRECTIVE_ALLOW_LCP
Method Detail |
public static LocationPrivacyManager getInstance()
public void setDirective(User user, java.lang.String directive) throws PanamaException
User
- the use whose directive is to be setdirective
- one of the three system level directives
DIRECTIV_NO_POSITION, DIRECTIVE_NO_CACHE,
or DIRECTIVE_ALLOW_LCPDIRECTIVE_NO_POSITION
,
DIRECTIVE_NO_CACHE
,
DIRECTIVE_ALLOW_LCP
public java.lang.String getDirective(User user)
user
- the user whose directive is to be obtainedDIRECTIVE_NO_POSITION
,
DIRECTIVE_NO_CACHE
,
DIRECTIVE_ALLOW_LCP
public void grantAuthorization(Service service, User owner, User positionRequester, AuthPeriod period) throws PanamaException
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.service
- The service in which the granting happensowner
- The user who would like to grant the location access right to positionRequesterpositionRequester
- The user who will get the
rightperiod
- The positionRequester can only access to the owner's location information
within the specified periodpublic void grantAuthorization(Service service, User owner, Community positionRequester, AuthPeriod period) throws PanamaException
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.service
- The service in which the granting has effectsowner
- The user who would like to grant the location access right to otherspositionRequester
- The community whose members will
get the rightperiod
- The positionRequester can only access to the owner's location information
within the specified periodpublic void revokeAuthorization(Service service, User owner, User positionRequester) throws PanamaException
service
- The service in which the revoking has effectsowner
- The owner of the location information.positionRequester
- The user whose right to access the owner's location information
is be revokedPanamaException
- public void revokeAuthorization(long authId) throws PanamaException
authId
- The object Id of the authorizationPanamaException
- public void revokeAuthorization(Service service, User owner, Community positionRequester) throws PanamaException
service
- The service in which the revoking has effectsowner
- The owner of the location information.positionRequester
- The community whose members' right to access the owner's location
information is be revokedPanamaException
- public void disableAuthorization(Service service, User owner, User positionRequester) throws PanamaException
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.service
- The service in which the disable operation has effectsowner
- The owner of the location information.positionRequester
- The user whose right to access the owner's location information
is disabledpublic void enableAuthorization(Service service, User owner, User positionRequester) throws PanamaException
service
- The service in which the disable operation has effectsowner
- The owner of the location information.positionRequester
- The user whose right to access the owner's location information
is to be recovered.disableAuthorization(Service
service, User owner, User positionRequester)
public void enableAuthorization(long authId) throws PanamaException
authId
- The object id of the authorization to be recovered.public void disableAuthorization(Service service, User owner, Community positionRequester) throws PanamaException
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.service
- The service in which the disable operation happensowner
- The owner of the location information.positionRequester
- The community whose members' right to access the owner's location
information are disabledpublic void enableAuthorization(Service service, User owner, Community positionRequester) throws PanamaException
service
- The service in which the disable operation happensowner
- The owner of the location information.positionRequester
- The community whose members' rights to access the owner's
location
information are to be recovered.disableAuthorization(Service
service, User owner, Community positionRequester)
public void disableAuthorization(long authId) throws PanamaException
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.authId
- the object Id of the authorization to be disableddisableAuthorization(Service service, User owner, User positionRequester)
,
disableAuthorization(Service service, User owner, Community positionRequester)
public boolean checkAuthorization(Service service, User owner, User positionRequester, java.util.Calendar posTime) throws PanamaException
positionRequester
has right to access the owner
's location information
at posTime
in service
.service
- The service in which the checking occurs.owner
- The owner of the location informationpositionRequester
- The user who tries to access the owner's location informationposTime
- The positioning timepublic ResultSetEnumeration getLocationPrivacyAuth(Service service, User owner, java.lang.String positionRequesterType, java.lang.String status) throws PanamaException
service
, the privacy owner
,
the type
of the positionRequester and the status
of the authorizationservice
- the service to which the requested loation privacy authorization items belongowner
- the user who grants the authorizationpositionRequesterType
- 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 typesstatus
- 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.PanamaException
- if LocationPrivacyAuth can not be foundLocationPrivacyAuth
public ResultSetEnumeration getLocationPrivacyAuth(Service service) throws PanamaException
service
service
- The service to which the grantings belongPanamaException
- if LocationPrivacyAuth can not be foundpublic java.lang.String getDefaultDirective()
DIRECTIVE_NO_POSITION
,
DIRECTIVE_NO_CACHE
,
DIRECTIVE_ALLOW_LCP
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |