You are here

connect

public static RepositorySession connect(String url, String username, String password[, Map<String][, Serializable> parameters]) - authenticate and bind with a repository. Creates a new instance of a RepositorySession representing the repository specified in the URL parameter. Initializes all information and services associated with the repository for the specified user. This methods uses the default session configuration.

connect

public static RepositorySession connect(String url, String username, String password) - Creates and authenticates a session represented by the URL using the given user identifier and password. This method will use Basic HTTP authentication to authorize the user.

Parameters

String url
Base URL associated with the repository. In the form http://hostname:port/SkyVault
String username
A string representing the username of the user to be connected.
String password
A string representing the password associated with the specified user.

Returns

Returns a RepositorySession instance.

Exception

Throws an SkyVaultSessionException if the operation cannot be carried out.

Example


    try {

        RepositorySession session = RepositorySession.connect(url, username, password);

        if (session) {
 				
 				// do session work
					
				} else {

					Log.d(TAG, "No Session available!");

				}

		} catch (AlfrescoSessionException e) {
				Log.e(TAG, "Failed to connect: " + e.toString());
		}        

      

connect

public static RepositorySession connect(String url, String username, String password, Map<String, Serializable> parameters) Authenticate and bind with a repository. Initializes all information and services associated with the repository for the specified user. Passes session parameters via a Map.

Parameters

String url
Base URL associated with the repository. In the form http://hostname:port/SkyVault
String username
A string representing the username of the user to be connected.
String password
A string representing the password associated with the specified user.
Map<String, Serializable> parameters
Any session parameters that are required.

Returns

Returns a RepositorySession instance.

Exception

Throws an SkyVaultSessionException if the operation cannot be carried out.

Example


    try {

        RepositorySession session = RepositorySession.connect(url, username, password, parameters);

        if (session) {
 				
 				// do session work
					
				} else {

					Log.d(TAG, "No Session available!");

				}

		} catch (AlfrescoSessionException e) {
				Log.e(TAG, "Failed to connect: " + e.toString());
		}