org.exoplatform.social.client.api
Class SocialClientContext

java.lang.Object
  extended by org.exoplatform.social.client.api.SocialClientContext

public class SocialClientContext
extends Object

The client context to hold states of: host, port, portalContainerName, restContextName and rest version and auth schema.

Since:
May 19, 2011
Author:
hoatle (hoatlevan at gmail dot com)

Nested Class Summary
 class SocialClientContext.Context
          Keeping the HttpRequest and HttpResponse for Social RestService
static class SocialClientContext.SupportedVersion
          The enum for supported Social Rest APIs versions.
 
Field Summary
static List<String> supportedVersionList
           
 
Constructor Summary
SocialClientContext()
           
 
Method Summary
 SocialClientContext.Context getCurrentContext()
          Gets current request and response context.
static String getHost()
          Gets host of the portal container to access services.
static String getPassword()
          Gets the password for basic authentication
static int getPort()
          Gets port of the portal container to access services.
static String getPortalContainerName()
          Gets portal container name of the portal container.
static String getProtocol()
          Gets protocol of the portal container to access services.
static String getRestContextName()
          Gets the rest context name of the portal container.
static String getRestVersion()
          Gets the eXo Social Rest version.
static String getUsername()
          Gets the user name for basic authentication.
static boolean isDeveloping()
          Checks to know if this lib is running on development mode to log more info.
 void setCurrentContext(SocialClientContext.Context currentContext)
          Sets current request and response context.
static void setHost(String newHost)
          Sets host of the portal container to access services.
static void setIsDeveloping(boolean isDevelopingMode)
          Sets this lib to run on developing mode or not.
static void setPassword(String newPassword)
          Sets the password for basic authentication.
static void setPort(int newPort)
          Sets port of the portal container to access services.
static void setPortalContainerName(String newPortalContainerName)
          Sets the portal container name of the portal container.
static void setProtocol(String protocol)
          Sets protocol of the portal container to access services.
static void setRestContextName(String newRestContextName)
          Sets the rest context name of the portal container.
static void setRestVersion(String newRestVersion)
          Sets the eXo Social Rest version.
static void setUsername(String newUsername)
          Sets the user name for basic authentication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

supportedVersionList

public static List<String> supportedVersionList
Constructor Detail

SocialClientContext

public SocialClientContext()
Method Detail

getHost

public static String getHost()
Gets host of the portal container to access services.

Returns:
the host

setHost

public static void setHost(String newHost)
Sets host of the portal container to access services.

Parameters:
newHost - the host

getPort

public static int getPort()
Gets port of the portal container to access services.

Returns:
the port

setPort

public static void setPort(int newPort)
Sets port of the portal container to access services.

Parameters:
newPort - the port

getPortalContainerName

public static String getPortalContainerName()
Gets portal container name of the portal container. For example: socialdemo, portal, intranet...

Returns:
the portal container name

setPortalContainerName

public static void setPortalContainerName(String newPortalContainerName)
Sets the portal container name of the portal container.

Parameters:
newPortalContainerName - the portal container name

getRestContextName

public static String getRestContextName()
Gets the rest context name of the portal container.

Returns:
the rest context name

setRestContextName

public static void setRestContextName(String newRestContextName)
Sets the rest context name of the portal container.

Parameters:
newRestContextName - the rest context name

getRestVersion

public static String getRestVersion()
Gets the eXo Social Rest version.

Returns:
the eXo Social Rest version

setRestVersion

public static void setRestVersion(String newRestVersion)
                           throws UnsupportedRestVersionException
Sets the eXo Social Rest version.

Parameters:
newRestVersion - the eXo Social Rest version
Throws:
UnsupportedRestVersionException

getUsername

public static String getUsername()
Gets the user name for basic authentication.

Returns:
the user name

setUsername

public static void setUsername(String newUsername)
Sets the user name for basic authentication.

Parameters:
newUsername - the user name

getPassword

public static String getPassword()
Gets the password for basic authentication

Returns:
the password

setPassword

public static void setPassword(String newPassword)
Sets the password for basic authentication.

Parameters:
newPassword - the password

getProtocol

public static String getProtocol()
Gets protocol of the portal container to access services.

Returns:

setProtocol

public static void setProtocol(String protocol)
Sets protocol of the portal container to access services.

Parameters:
protocol -

getCurrentContext

public SocialClientContext.Context getCurrentContext()
Gets current request and response context.

Returns:
current context

isDeveloping

public static boolean isDeveloping()
Checks to know if this lib is running on development mode to log more info.

Returns:
a boolean value

setIsDeveloping

public static void setIsDeveloping(boolean isDevelopingMode)
Sets this lib to run on developing mode or not.

Parameters:
isDevelopingMode - a boolean value

setCurrentContext

public void setCurrentContext(SocialClientContext.Context currentContext)
Sets current request and response context.

Parameters:
currentContext - the current context


Copyright © 2011 eXo Platform. All Rights Reserved.