Dekoh platform API

com.pramati.bfly.das.contacts.helper
Class DekohNetworkRequestHelper

java.lang.Object
  extended by com.pramati.bfly.das.contacts.helper.DekohNetworkRequestHelper

public class DekohNetworkRequestHelper
extends Object

Helper for knowing remote requests information.

Since:
21 Aug, 2007

Constructor Summary
DekohNetworkRequestHelper()
           
 
Method Summary
static Contact getIncomingUser(HttpServletRequest request, Set allAllowedContacts)
          Filter out from the aliases returned by getIncomingUserAliases and return the most appropriate match from the supplied allAllowedContacts.
static Set getIncomingUserAliases(HttpServletRequest request)
          Gets list of contacts representing all the aliases of the incoming remote request user.
static List getOnlineDasIds(DesktopUser desktopUser, String buddyDekohId, String applicationName)
          To get the list of online dekoh desktop ids, from which application applicationName is shared by user buddyDekohId to this Deskoh desktop user.
static String getOwner(HttpServletRequest request)
          Gets the Dekoh user name of the owner of the dekoh installation that is being accessed by the RemoteUser.
static HttpURLConnection getRemoteUrlConnection(DesktopUser desktopUser, String requesteeAlias, String remoteDasId, String targetFile)
          To get Connection For a remote request url.
static HttpURLConnection getRemoteUrlConnection(HttpServletRequest request, String requesteeAlias, String remoteDasId, String targetFile)
          same as invoking getRemoteUrlConnection(SessionUtil.getLoggedInDesktopUser(request), requesteeAlias, remoteDasId, targetFile)
static boolean isRemoteRequest(HttpServletRequest request)
          To know whether a incoming requests is a RemoteRequest or a LocalRequest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DekohNetworkRequestHelper

public DekohNetworkRequestHelper()
Method Detail

isRemoteRequest

public static boolean isRemoteRequest(HttpServletRequest request)
To know whether a incoming requests is a RemoteRequest or a LocalRequest.

A Buddy/Invitee accessing shared content is example of a RemoteRequest. A owner adding more content to Dekoh is example of a LocalRequest.

Parameters:
request -
Returns:
true if the specified request is a RemoteRequest. else returns false.

getOwner

public static String getOwner(HttpServletRequest request)
Gets the Dekoh user name of the owner of the dekoh installation that is being accessed by the RemoteUser.

Parameters:
request -
Returns:
Name of the owner whose Desktop is being Accessed remotely. would return null, if invoked on a LocalRequest.

getIncomingUserAliases

public static Set getIncomingUserAliases(HttpServletRequest request)
Gets list of contacts representing all the aliases of the incoming remote request user.

A Dekoh user can maintain multiple user accounts, if that user has linked all his accounts.

For example existing dekoh users may share content to email addresses : Jekyll@example.com,and Hyde@example.com. Both these email address belong to same individual. This person later signs up for a Dekoh account and links both email address. In this scenario all three identities are same. Accessing Dekoh installations with any of the identities should show content that is shared to any of the aliases.

Parameters:
request -
Returns:

getIncomingUser

public static Contact getIncomingUser(HttpServletRequest request,
                                      Set allAllowedContacts)
Filter out from the aliases returned by getIncomingUserAliases and return the most appropriate match from the supplied allAllowedContacts.

UseCase : Imagine that this user shares a photo collection named "test" to Jekyll@example.com, and another@example.com

Consider incoming user is Dekoh user- U1, who has known aliases (only to Dekoh network) Jekyll@example.com and Hyde@example.com. When U1 logs into Dekoh as Hyde@example.com to access the shared photo collection, the photo application would want to determine from the the incoming remote request which of the user contacts is accessing this shared content. By invoking this api with Jekyll@example.com, another@example.com as allAllowedContacts, the caller can obtain Jekyll@example.com as the preferred alias for incoming remote user.

Parameters:
request -
allAllowedContacts -
Returns:

getRemoteUrlConnection

public static HttpURLConnection getRemoteUrlConnection(HttpServletRequest request,
                                                       String requesteeAlias,
                                                       String remoteDasId,
                                                       String targetFile)
                                                throws IOException
same as invoking getRemoteUrlConnection(SessionUtil.getLoggedInDesktopUser(request), requesteeAlias, remoteDasId, targetFile)

Parameters:
request -
requesteeAlias -
remoteDasId -
targetFile -
Returns:
Throws:
IOException

getRemoteUrlConnection

public static HttpURLConnection getRemoteUrlConnection(DesktopUser desktopUser,
                                                       String requesteeAlias,
                                                       String remoteDasId,
                                                       String targetFile)
                                                throws IOException
To get Connection For a remote request url. Users invoking this Api, should ensure that Central server is reachable, and a Desktop user is a valid authenticated user for getting proper target url connection.

requesteeAlias and remoteDasId can be obtained from ApplicationShares

getResponseCode on returned Connection Object can result in an error code, if the loggedIn user doesnt have access to given url or no such url exists on target Dekoh desktop.

Parameters:
desktopUser - an Authenticate DesktopUser.
requesteeAlias - DekohId of the target dekoh, to which url connection is requested.
remoteDasId - Dekoh Desktop id of the requesteeAlias from which the targetFile needs to be retrieved.
targetFile -
Returns:
HttpURLConnection Object
Throws:
IOException

getOnlineDasIds

public static List getOnlineDasIds(DesktopUser desktopUser,
                                   String buddyDekohId,
                                   String applicationName)
                            throws ShareException
To get the list of online dekoh desktop ids, from which application applicationName is shared by user buddyDekohId to this Deskoh desktop user.

If application name is null, this api would return list of dekoh desktops, from which any application has been shared by

Parameters:
desktopUser -
buddyDekohId -
applicationName -
Returns:
Throws:
ShareException

Dekoh platform API

© 2009 Pramati Technologies - Dekoh - Portal for Developers