|
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.helper.ShareService
public class ShareService
ShareService exposes methods to Share and Unshare applications from a Dekoh Desktop to other Dekoh
users. Only shared applications can be accessed.
ShareService.getShareServiceForUser(DesktopUser).
One way to obtain the DesktopUser is by invoking SessionUtil.getLoggedInDesktopUser(request) with a request Object. This request should be part of the Session, in
which user has logged into this Dekoh Desktop.
| Nested Class Summary | |
|---|---|
static class |
ShareService.ShareScope
Defines the Application Share Scope. |
| Method Summary | |
|---|---|
void |
addContactsForApp(String appName,
String[] contactKeys)
Shares this application to more contacts. |
Set |
getSharedContactsForApp(String appName)
Gets the contacts for which the given application appName is shared by this Dekoh User from this
Dekoh Desktop. |
ShareService.ShareScope |
getShareScope(String appName)
Gets ShareScope for the given application. |
static ShareService |
getShareServiceForUser(DesktopUser desktopUser)
Gets the ShareService of given DekohUser. |
ShareInfo |
getSharesFromContacts()
Invoking this Api is same as invoking getSharesFromContacts(false) |
ShareInfo |
getSharesFromContacts(boolean synchronously)
Gets the list of applications shared to this Desktop User from all its contacts. |
ShareInfo |
getSharesFromNonContacts()
Invoking this Api is same as invoking getSharesFromNonContacts(false) |
ShareInfo |
getSharesFromNonContacts(boolean synchronously)
Gets the list of applications shared to this desktopUser from all its Non-contacts. |
void |
removeContactsForApp(String appName,
String[] contactKeys)
Unshares this application from given contacts. |
void |
setAppToAll(String appName)
Shares the application to Public. |
void |
setAppToAllContacts(String appName)
Shares the application to All Contacts. |
void |
setAppToDekohNetwork(String appName)
Shares the application to Dekoh Network. |
void |
setContactsForApp(String appName,
String[] contactKeys)
Shares the application to given contacts. |
void |
shareCollectionToContacts(String appName,
String[] contactKeys)
To share a collection (Application content data), application needs to be shared. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ShareService getShareServiceForUser(DesktopUser desktopUser)
DekohUser. Instance of DesktopUser who is currently logged in can be
obtained by invoking SessionUtil.getLoggedInDesktopUser(request) method.
desktopUser - DekohUser for whom the ShareService is needed. Cannot be null. This needs to be a valid
DekohUser, i.e should be a registered DekohUser with a valid dekohId.
public ShareInfo getSharesFromContacts()
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
getSharesFromContacts(false)
ShareException
CASNotReachableException
UserOfflineException
ForbiddenExceptionShareService.getSharesFromContacts(boolean)
public ShareInfo getSharesFromContacts(boolean synchronously)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
getSharesFromNonContacts(synchronously) for getting shared applications to
this desktopUser from its Non Contacts.
synchronously - whether to fetch the shared application information from central server synchronously. if
true, will fetch this information from central server and returns. otherwise, this will
returned the cached information, which is updated periodically.
ShareInfo instance having information on shared application.
ShareException - If unable to refresh the ShareInformation from central server.
UserOfflineException - If User is logged into Dekoh Desktop in offline mode.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticated Session from central server on this DekohDesktop has
expired. Desktop user should logoff and login again, before trying any other
sharing operation.ShareService.getSharesFromNonContacts(boolean)
public ShareInfo getSharesFromNonContacts()
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
getSharesFromNonContacts(false)
ShareException
CASNotReachableException
UserOfflineException
ForbiddenExceptionShareService.getSharesFromNonContacts(boolean)
public ShareInfo getSharesFromNonContacts(boolean synchronously)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
getSharesFromContacts(synchronously) for getting shared applications to this
desktopUser from its Contacts.
synchronously - Whether to fetch the shared application information from central server synchronously. if
true, will fetch this information from central server and returns. otherwise, this will
returned the cached information, which is updated periodically.
ShareInfo instance having information on shared application from non-Contacts.
ShareException - If unable to refresh the ShareInformation from central server.
UserOfflineException - If User is logged into Dekoh Desktop in offline mode.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticated Session from central server on this DekohDesktop has
expired. Desktop user should logoff and login again, before trying any other
sharing operation.ShareService.getSharesFromContacts(boolean)public ShareService.ShareScope getShareScope(String appName)
ShareService.ShareScope.SHARED_TO_ALL if given Application is shared to Public.
ShareService.ShareScope.SHARED_TO_DEKOH if given Application is shared to Dekoh Network.
ShareService.ShareScope.SHARED_TO_ALL_CONTACTS if given Application is shared to All Contacts.
ShareService.ShareScope.PRIVATE_SHARE if given Application is shared explicitly to some Contacts.
ShareService.ShareScope.NOT_SHARED if given application is not shared.
appName - Application for which ShareScope is information is needed.
ShareService.ShareScope.SHARED_TO_ALL, ShareService.ShareScope.SHARED_TO_DEKOH, ShareService.ShareScope.SHARED_TO_ALL_CONTACTS, ShareService.ShareScope.PRIVATE_SHARE,
ShareService.ShareScope.NOT_SHAREDpublic Set getSharedContactsForApp(String appName)
appName is shared by this Dekoh User from this
Dekoh Desktop.
appName - application name for which the shared contacts information is requested.
public void shareCollectionToContacts(String appName,
String[] contactKeys)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException,
HeuristicShareException
appName - Application which needs to be shared to given contacts.contactKeys - Contacts for whom this application is getting shared.
ShareException - If failed to share given application to all the passed contacts. possible
reasons could be UserOfflineException - If User is logged into Dekoh Desktop in offline mode.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticated Session from central server on this DekohDesktop has
expired. Desktop user should logoff and login again, before trying any other
sharing operation.
HeuristicShareException - If sharing the application fails for some contacts. This exception has list of
contacts for whom the sharing has failed.ShareService.ShareScope
public void addContactsForApp(String appName,
String[] contactKeys)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException,
HeuristicShareException
Public or to Dekoh Network or to All Contacts would throw a ShareException.
appName - Application which needs to be shared to given contacts.contactKeys - Contacts for whom this Application is getting shared.
ShareException - If failed to share given application to all the passed contacts. possible
reasons could be UserOfflineException - If User is logged into Dekoh Desktop in offline mode.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticated Session from central server on this DekohDesktop has
expired. Desktop user should logoff and login again, before trying any other
sharing operation.
HeuristicShareException - If sharing the application fails for some contacts. This exception has list of
contacts for whom the sharing has failed.
public void removeContactsForApp(String appName,
String[] contactKeys)
throws ShareException,
CASNotReachableException,
UserOfflineException,
HeuristicShareException
Public or to Dekoh Network or to All Contacts would throw a ShareException.
appName - Application which needs to be unshared from given contacts.contactKeys - Contacts for whom this Application is getting unshared.
ShareException - If failed to unshare given application to all the passed contacts. possible
reasons could be UserOfflineException - If User is logged into Dekoh Desktop in offline mode.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticated Session from central server on this DekohDesktop has
expired. Desktop user should logoff and login again, before trying any other
sharing operation.
HeuristicShareException - If unsharing the application fails for some contacts. This exception has list of
contacts for whom the unsharing has failed.
public void setContactsForApp(String appName,
String[] contactKeys)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException,
HeuristicShareException
Not shared, share to passed contacts.
Public/DekohNetwork/AllContacts, unshare the application and share only to passed contacts.
private share) then unshare
from earlier contacts, and share to passed contacts.
appName - Application which needs to be shared to given contacts.contactKeys - Contacts to whom this Application needs to be shared.
ShareException - If failed to share given application to all the passed contacts. possible
reasons could be UserOfflineException - If User is logged into Dekoh Desktop in offline mode.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticated Session from central server on this DekohDesktop has
expired. Desktop user should logoff and login again, before trying any other
sharing operation.
HeuristicShareException - If unsharing the application fails for some contacts. This exception has list of
contacts for whom the unsharing has failed.
public void setAppToAllContacts(String appName)
throws ShareException,
CASNotReachableException,
UserOfflineException,
ForbiddenException
Not shared, share to All Contacts.
Public/DekohNetwork/some
contacts explicitly, unshare the application and share to All
Contacts.
appName - Application which needs to be shared to All contacts.
ShareException - If failed to share given application to All Contacts. One of the possible reason
could be that loggedin user is not a valid registered DekohUser. Only DekohUsers
who have registered and got a valid dekohid can share application to All
Contacts.
UserOfflineException - If User is logged into Dekoh Desktop in offline mode.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticated Session from central server on this DekohDesktop has
expired. Desktop user should logoff and login again, before trying any other
sharing operation.
public void setAppToDekohNetwork(String appName)
throws ShareException,
CASNotReachableException,
UserOfflineException
Not shared, share to DekohNetwork.
Public/AllContacts/some contacts explicitly, unshare the application and share to DekohNetwork.
appName - Application which needs to be shared to Dekoh Network.
ShareException - If failed to share given application to Dekoh Network. One of the possible
reason could be that loggedin user is not a valid registered DekohUser. Only
DekohUsers who have registered and got a valid dekohid can share application to
Dekoh Network.
UserOfflineException - If User is logged into Dekoh Desktop in offline mode.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticated Session from central server on this DekohDesktop has
expired. Desktop user should logoff and login again, before trying any other
sharing operation.
public void setAppToAll(String appName)
throws ShareException,
CASNotReachableException,
UserOfflineException
Not shared, share to Public.
DekohNetwork/AllContacts/some contacts explicitly, unshare the application and share to Public.
appName - Application which needs to be shared to Public.
ShareException - If failed to share given application to Public. One of the possible reason could
be that loggedin user is not a valid registered DekohUser. Only DekohUsers who
have registered and got a valid dekohid can share application to Public.
UserOfflineException - If User is logged into Dekoh Desktop in offline mode.
CASNotReachableException - If for any reason, Central server is not reachable.
ForbiddenException - If the authenticated Session from central server on this DekohDesktop has
expired. Desktop user should logoff and login again, before trying any other
sharing operation.
|
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