net.ubisoa.core
Class Defaults

java.lang.Object
  extended by net.ubisoa.core.Defaults

public final class Defaults
extends java.lang.Object

A final class where all the default object instances and constants are retrieved.

Author:
Edgardo Avilés-López

Field Summary
static java.lang.String AGENT
          The default content of the Server response header.
static java.lang.String MAX_CONNECTIONS
          Maximum client connections allowed at the same time.
static java.lang.String MAX_THREADS
          Maximum processing threads allowed at the same time.
static java.lang.Boolean USE_LOCAL_FILES
          Wherever to use local files or the ones at http://api.ubisoa.net/.
 
Constructor Summary
Defaults()
           
 
Method Summary
static java.text.SimpleDateFormat dateFormat()
          Retrieves the common SimpleDateFormat instance used in the project.
static java.lang.String getDateString()
          Retrieves the current date in the default SimpleDateFormat.
static java.lang.String getDefaultLeaseDateString()
          Retrieves a date in the near future to be used as default lease-time.
static org.apache.http.client.HttpClient getHttpClient()
          Creates an HttpClient instance that allows concurrent HTTP connections.
static void setServerInfo(ServerResource serverResource)
          Sets the Server response header of the specified ServerResource instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AGENT

public static final java.lang.String AGENT
The default content of the Server response header.

See Also:
Constant Field Values

USE_LOCAL_FILES

public static final java.lang.Boolean USE_LOCAL_FILES
Wherever to use local files or the ones at http://api.ubisoa.net/.


MAX_CONNECTIONS

public static final java.lang.String MAX_CONNECTIONS
Maximum client connections allowed at the same time.

See Also:
Constant Field Values

MAX_THREADS

public static final java.lang.String MAX_THREADS
Maximum processing threads allowed at the same time.

See Also:
Constant Field Values
Constructor Detail

Defaults

public Defaults()
Method Detail

setServerInfo

public static void setServerInfo(ServerResource serverResource)
Sets the Server response header of the specified ServerResource instance.

Parameters:
serverResource - The resource instance where the header will be set.

dateFormat

public static java.text.SimpleDateFormat dateFormat()
Retrieves the common SimpleDateFormat instance used in the project.

Returns:
The common SimpleDateFormat instance in the project.

getHttpClient

public static org.apache.http.client.HttpClient getHttpClient()
Creates an HttpClient instance that allows concurrent HTTP connections.

Returns:
An HttpClient instance with thread-safe connections.

getDefaultLeaseDateString

public static java.lang.String getDefaultLeaseDateString()
Retrieves a date in the near future to be used as default lease-time.

Returns:
A string with the default lease date calculated from now.

getDateString

public static java.lang.String getDateString()
Retrieves the current date in the default SimpleDateFormat.

Returns:
A string with the current date in the project's default format.