|
Dekoh platform API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.pramati.bfly.das.contacts.persistence.ApplicationShareManager
public class ApplicationShareManager
Manager class for sharing/unsharing applications in various modes. ApplicationShareManager.getShareManager() returns an singleton
instance of this class.
| Method Summary | |
|---|---|
Set |
getApplicationsSharedToAllContacts(String accountId)
To get the list of application shared by the DesktopUser with given accountId from this DekohDesktop
to all its contacts. |
Set |
getApplicationsSharedToDekohNetwork(String accountId)
To get the list of application shared by the DesktopUser with given accountId from this DekohDesktop
to entire DekohNetwork |
Set |
getApplicationsSharedToPublic(String accountId)
To get the list of application shared by the DesktopUser with given accountId from this DekohDesktop
to public. |
Set |
getSharedBuddiesForApp(String accountId,
String appName)
API to get the contacts for which the given application 'appName' is shared by user with account Id 'accountId' from this Dekoh Desktop. |
ShareInfo |
getShareIn(String accountId)
|
static ApplicationShareManager |
getShareManager()
|
ShareInfo |
getSharesFromNonContacts(String accountId)
|
void |
intialize()
|
void |
intializeShareOut()
|
boolean |
isSharedToAll(String accountId,
String appName)
API to know whether application 'appName' is shared globally to everyone by user with account Id 'accountId' from this Dekoh desktop. |
boolean |
isSharedToAllContacts(String accountId,
String appName)
API to know whether application 'appName' is shared to all user contacts by user with account Id 'accountId' from this Dekoh Desktop. |
boolean |
isSharedToDekohNetwork(String accountId,
String appName)
API to know whether application 'appName' is shared to every user on DekohNetwork by user with account Id 'accountId' from this Dekoh Desktop. |
void |
refreshShareIn(String authenticatedCookie,
String accountId)
To refresh the list of applications shared to this logged in user from its contacts and non contacts. |
void |
refreshShareOut(String authenticatedCookie,
String accountId)
Api to refresh the shared Application information by logged in users. |
boolean |
registerShareListener(ShareListener shareListener)
For registering a ShareListener, for giving callbacks when Sharing/Unsharing event occurs. |
void |
shareAppToAll(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
API to share an application to Everyone. |
void |
shareAppToAllContacts(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
Api to share an application to all user contacts. |
void |
shareAppToContacts(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName,
String[] contactKeys)
Api to explicitly share an application to some contacts. |
void |
shareAppToDekohNetwork(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
Api to share an application to everyone on DekohNetwork. |
boolean |
unregisterShareListener(ShareListener shareListener)
For unregistering a ShareListener. |
void |
unshareAppFromAll(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
To unshare an application, which is already shared to All. |
void |
unshareAppFromAllContacts(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
To unshare an application, which is already shared to All contacts of the Logged in user. |
void |
unshareAppFromContacts(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName,
String[] contactKeys)
To unshare an application, which is already shared to some Contacts. |
void |
unshareAppFromDekohNetwork(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
To unshare an application, which is already shared to Dekoh Network. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void intialize()
public void intializeShareOut()
public static ApplicationShareManager getShareManager()
public boolean registerShareListener(ShareListener shareListener)
shareListener - ShareListener instance which gets callbacks
when a share/unshare event occurs.
public boolean unregisterShareListener(ShareListener shareListener)
shareListener - ShareListener instance for which no more
callbacks are needed while sharing/unsharing event occurs.
public ShareInfo getShareIn(String accountId)
accountId -
public ShareInfo getSharesFromNonContacts(String accountId)
accountId -
public void refreshShareIn(String authenticatedCookie,
String accountId)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
getShareIn for getting shared applications to the logged in user from its Contacts and @link
#getShareInFromNonContacts(String) getShareInFromNonContacts} for getting shared applications to the logged in
user from its NonContacts.
authenticatedCookie - Authenticated cookie of the logged in user. This is needed for authenticating and
authorizing the logged in user on the central server, before returning the requested
information.accountId - AccountId of the logged in user.
ShareException - If unable to get the ShareInformation from central server.
UserOfflineException - If authenticatedCookie is null. When user is logged in locally because of no
internet connectivity, authenticatedCookie would be set to null. so it is
assumed in this api that, if authenticatedCookie is passed as null, user should
have logged in locally. so cant do any share operations.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticatedCookie is not a valid cookie.ApplicationShareManager.getShareIn(String)
public void refreshShareOut(String authenticatedCookie,
String accountId)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
ApplicationShareManager.isSharedToAll(String,String)
ApplicationShareManager.isSharedToAllContacts(String,String)
ApplicationShareManager.isSharedToDekohNetwork(String,String)
ApplicationShareManager.getSharedBuddiesForApp(String,String)
authenticatedCookie - Authenticated cookie of the logged in user. This is needed for authenticating and
authorizing the logged in user on the central server, before returning the requested
information.accountId - AccountId of the logged in user.
ShareException - If unable to refresh the ShareInformation from central server.
UserOfflineException - If authenticatedCookie is null. When user is logged in locally because of no
internet connectivity, authenticatedCookie would be set to null. so it is
assumed in this api that, if authenticatedCookie is passed as null, user should
have logged in locally. so cant do any share operations.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticatedCookie is not a valid cookie.public Set getApplicationsSharedToPublic(String accountId)
accountId from this DekohDesktop
to public.
accountId - DesktopUsers accountId for whom above information is requested
public Set getApplicationsSharedToAllContacts(String accountId)
accountId from this DekohDesktop
to all its contacts.
accountId - DesktopUsers accountId for whom above information is requested
public Set getApplicationsSharedToDekohNetwork(String accountId)
accountId from this DekohDesktop
to entire DekohNetwork
accountId - DesktopUsers accountId for whom above information is requested
public boolean isSharedToAll(String accountId,
String appName)
refresh needs to be
invoked atleast once before invoking this api.
accountId - LoggedIn user's accountId.appName - Application, for which it is checked whether it is globally shared.
public boolean isSharedToDekohNetwork(String accountId,
String appName)
refresh
needs to be invoked atleast once before invoking this api.
accountId - LoggedIn user's accountId.appName - Application, for which it is checked whether it is shared to entire Dekoh network.
public boolean isSharedToAllContacts(String accountId,
String appName)
refresh needs to be
invoked atleast once before invoking this api.
accountId - LoggedIn user's accountId.appName - Application, for which it is checked whether it is shared to all user contacts.
public Set getSharedBuddiesForApp(String accountId,
String appName)
refresh needs to be
invoked atleast once before invoking this api.
accountId - LoggedIn user's accountId.appName - AppName for which the sharedContacts details is requested.
public void shareAppToAll(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
ShareListener.sharedAppToAll listener callbacks are
triggered.
If This application is already shared by using Other share modes i.e DekohNetwork or AllContacts or ExplicitShare, invoking this api will upgrade the
Application share, so that this application can be accessed by everyone globally.
Also to be noted is that the old Sharing information is not lost. i.e, after invoking this Api, invoking unshareAppFromAll, will result in falling back to the earliest
sharing mode.
For Example:
Suppose an Application 'app1' is shared to some
Contacts and then this Api is invoked. Now unsharing from
all, will make the application still available to old Contacts for which this application is explicitly shared,
unless unshare is invoked explicitly for
those contacts.
Use this api with caution.
accountId - LoggedIn user's AccountId.loggedInUserDekohId - LoggedIn user's Dekoh Id.authenticatedCookie - Authenticated cookie of the logged in user. This is needed for authenticating and
authorizing the logged in user on the central server, before returning the requested
information.appName - Application Name which needs to be shared globally to everyone.
ShareException - If, Sharing fails. One of the Possible reasons could be Invalid Dekoh Desktop
Id.
UserOfflineException - If authenticatedCookie is null. When user is logged in locally because of no
internet connectivity, authenticatedCookie would be set to null. so it is
assumed in this api that, if authenticatedCookie is passed as null, user should
have logged in locally. so cant do any share operations.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticatedCookie is not a valid cookie.
public void shareAppToDekohNetwork(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
ShareListener.sharedAppToDekohNetwork
listener callbacks are triggered.
If this Api is invoked on an Application, which is already shared To All, would result in a ShareException.
If This application is already shared by using modes AllContacts or ExplicitShare, invoking this
api will upgrade the Application share, so that this application can be accessed by everyone on Dekoh Network.
Also to be noted is that the old Sharing information is not lost. i.e, after invoking this Api, invoking unshareAppFromDekohNetwork, will result in falling back
to the earliest sharing mode.
For Example:
Suppose an Application 'app1' is shared to some
Contacts and then this Api is invoked. Now unsharing from Dekoh Network, will make the application still available to old Contacts for which this
application is explicitly shared, unless unshare is invoked explicitly for those contacts.
accountId - LoggedIn user's AccountId.loggedInUserDekohId - LoggedIn user's Dekoh Id.authenticatedCookie - Authenticated cookie of the logged in user. This is needed for authenticating and
authorizing the logged in user on the central server, before returning the requested
information.appName - Application which needs to be shared to everyone on DekohNetwork.
ShareException - If, Sharing fails. One of the Possible reasons could be Invalid Dekoh Desktop
Id, or is Already shared to All. i.e invoking isSharedToAll should return true.
UserOfflineException - If authenticatedCookie is null. When user is logged in locally because of no
internet connectivity, authenticatedCookie would be set to null. so it is
assumed in this api that, if authenticatedCookie is passed as null, user should
have logged in locally. so cant do any share operations.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticatedCookie is not a valid cookie.
public void shareAppToAllContacts(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
ShareListener.sharedAppToAllContacts listener callbacks are triggered.
If this Api is invoked on an Application, which is already shared To All or To DekohNetwork, would result in a
ShareException.
If This application is already shared by using modes ExplicitShare, invoking this api will upgrade the Application share, so that this application can be accessed by
everyone on users Contacts list.
Also to be noted is that the old Sharing information is not lost. i.e, after invoking this Api, invoking unshareAppFromDekohNetwork, will result in falling back
to the earliest sharing mode.
For Example:
Suppose an Application 'app1' is shared to some
Contacts and then this Api is invoked. Now unsharing from All Contacts, will make the application still available to old Contacts for which this
application is explicitly shared, unless unshare is invoked explicitly for those contacts.
accountId - LoggedIn user's AccountId.loggedInUserDekohId - LoggedIn user's Dekoh Id.authenticatedCookie - Authenticated cookie of the logged in user. This is needed for authenticating and
authorizing the logged in user on the central server, before returning the requested
information.appName - Application which needs to be shared to everyone on logged in user contact's list.
ShareException - If, Sharing fails. One of the Possible reasons could be Invalid Dekoh Desktop Id
or is already shared to All or DekohNetwork i.e invoking isSharedToAll or isSharedToDekohNetwork would return
true.
UserOfflineException - If authenticatedCookie is null. When user is logged in locally because of no
internet connectivity, authenticatedCookie would be set to null. so it is
assumed in this api that, if authenticatedCookie is passed as null, user should
have logged in locally. so cant do any share operations.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticatedCookie is not a valid cookie.
public void shareAppToContacts(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName,
String[] contactKeys)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException,
HeuristicShareException
ShareListener.sharedAppToContacts listener callbacks are triggered.
If this Api is invoked on an Application, which is already shared To All or To DekohNetwork or To All Contacts, would result in a ShareException.
accountId - LoggedIn user's AccountId.loggedInUserDekohId - LoggedIn user's Dekoh Id.authenticatedCookie - LoggedIn user's Authenticated Cookie. This cookie is needed to authenticate oneself to
cas, before sharing the application.appName - Application which needs to be shared to given contacts.contactKeys - Contact key of the LoggedIn user's contacts. can be obtained by invoking Contact.getContactKey()
ShareException - If, Sharing fails. One of the Possible reasons could be Invalid Dekoh Desktop Id
or is already shared to All or to DekohNetwork or to All Contact i.e invoking
isSharedToAll or isSharedToDekohNetwork or ApplicationShareManager.isSharedToAllContacts(String,String) would return true.
UserOfflineException - If authenticatedCookie is null. When user is logged in locally because of no
internet connectivity, authenticatedCookie would be set to null. so it is
assumed in this api that, if authenticatedCookie is passed as null, user should
have logged in locally. so cant do any share operations.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticatedCookie is not a valid cookie.
HeuristicShareException - If sharing the application fails for some contacts. This exception has list of
contacts for whom the sharing has failed.
public void unshareAppFromAll(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
isSharedToAll returns false, would trigger a ShareException. After successfully
unsharing the application ShareListener.unsharedAppFromAll
listener callbacks are triggered.
accountId - LoggedIn user's AccountId.loggedInUserDekohId - LoggedIn user's Dekoh Id.authenticatedCookie - LoggedIn user's Authenticated Cookie. This cookie is needed to authenticate oneself to
cas, before sharing the application.appName - Application which needs to be unshared globally from everyone.
ShareException - If, Sharing fails. One of the Possible reasons could be Invalid Dekoh Desktop Id
or if this application is not already shared to All i.e invoking isSharedToAll would return false.
UserOfflineException - If authenticatedCookie is null. When user is logged in locally because of no
internet connectivity, authenticatedCookie would be set to null. so it is
assumed in this api that, if authenticatedCookie is passed as null, user should
have logged in locally. so cant do any share operations.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticatedCookie is not a valid cookie.
public void unshareAppFromDekohNetwork(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
isSharedToDekohNetwork returns false, would trigger a
ShareException. After successfully unsharing the application ShareListener.unsharedAppFromDekohNetwork listener callbacks are triggered.
one point to note here is, if an Application is first shared using shareAppToDekohNetwork, and then upgraded using shareAppToAll, invoking this Api will result in removing old share Information, though the application is still
available to all.
accountId - LoggedIn user's AccountId.loggedInUserDekohId - LoggedIn user's Dekoh Id.authenticatedCookie - LoggedIn user's Authenticated Cookie. This cookie is needed to authenticate oneself to
cas, before sharing the application.appName - Application which needs to be unshared from everyone on DekohNetwork.
ShareException - If, Sharing fails. One of the Possible reasons could be Invalid Dekoh Desktop Id
or if this application is not already shared to Dekoh Network i.e invoking
ApplicationShareManager.isSharedToDekohNetwork(String,String) isSharedToDekohNetwork} would
return false.
UserOfflineException - If authenticatedCookie is null. When user is logged in locally because of no
internet connectivity, authenticatedCookie would be set to null. so it is
assumed in this api that, if authenticatedCookie is passed as null, user should
have logged in locally. so cant do any share operations.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticatedCookie is not a valid cookie.ApplicationShareManager.shareAppToAll(String,String,String,String)
public void unshareAppFromAllContacts(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
isSharedToAllContacts returns false, would
trigger a ShareException. After successfully unsharing the application ShareListener.unsharedAppFromAllContacts listener callbacks
are triggered.
one point to note here is, if an Application is first shared using shareAppToAllContacts, and then upgraded using shareAppToAll
or shareAppToDekohNetwork, invoking this Api will
result in removing old share Information, though the application is still available to all or DekohNetwork.
accountId - LoggedIn user's AccountId.loggedInUserDekohId - LoggedIn user's Dekoh Id.authenticatedCookie - LoggedIn user's Authenticated Cookie. This cookie is needed to authenticate oneself to
cas, before sharing the application.appName - Application which needs to be unshared from All Contacts.
ShareException - If, Sharing fails. One of the Possible reasons could be Invalid Dekoh Desktop Id
or if this application is not already shared to All Contacts i.e invoking isSharedToAllContacts would return
false.
UserOfflineException - If authenticatedCookie is null. When user is logged in locally because of no
internet connectivity, authenticatedCookie would be set to null. so it is
assumed in this api that, if authenticatedCookie is passed as null, user should
have logged in locally. so cant do any share operations.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticatedCookie is not a valid cookie.ApplicationShareManager.shareAppToAll(String,String,String,String),
ApplicationShareManager.shareAppToDekohNetwork(String,String,String,String)
public void unshareAppFromContacts(String accountId,
String loggedInUserDekohId,
String authenticatedCookie,
String appName,
String[] contactKeys)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException,
HeuristicShareException
ShareListener.unsharedAppFromContacts listener
callbacks are triggered.
one point to note here is, if an Application is first shared using shareAppToContacts, and then upgraded using shareAppToAll or
shareAppToDekohNetwork or shareAppToAllContacts, invoking this Api will result in
removing old share Information, though the application is still available to 'all' or 'DekohNetwork' or 'All
Contacts'.
accountId - LoggedIn user's AccountId.loggedInUserDekohId - LoggedIn user's Dekoh Id.authenticatedCookie - LoggedIn user's Authenticated Cookie. This cookie is needed to authenticate oneself to
cas, before sharing the application.appName - Application which needs to be unshared from given contacts.contactKeys - ContactKeys of the contacts for which the sharing needs to be removed.
ShareException - If, Sharing fails. One of the Possible reasons could be Invalid Dekoh Desktop
Id
UserOfflineException - If authenticatedCookie is null. When user is logged in locally because of no
internet connectivity, authenticatedCookie would be set to null. so it is
assumed in this api that, if authenticatedCookie is passed as null, user should
have logged in locally. so cant do any share operations.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticatedCookie is not a valid cookie.
HeuristicShareException - If unsharing the application fails for some contacts. This exception has list of
contacts for whom the unsharing has failed.
|
Dekoh platform API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
© 2009 Pramati Technologies - Dekoh - Portal for Developers