/* Copyright 2009 Palm, Inc.  All rights reserved. */

var AccountsLoginService = Class.create( {
	
	initialize: function() {
		console.log("---------------- Initialziing accounts login service ------------");
	},
	
	listAccountsByCredentials: function (successCallback, errorCallback, sceneController) {
		return sceneController.serviceRequest(AccountsLoginService.identifier, {
			method: 'listAccountsByCredentials',
			parameters: {},
			onSuccess: successCallback,
			onFailure: errorCallback
		});
	},
	
	authenticate: function (credentialsId, accountId, username, password, smtpPassword, successCallback, errorCallback, sceneController) {
		return sceneController.serviceRequest(AccountsLoginService.identifier, {
			method: 'authenticate',
			parameters: {"credentialsId": credentialsId, "accountId": accountId, "username":username, "password":password, "smtpPassword":smtpPassword},
			onSuccess: successCallback,
			onFailure: errorCallback
		});
	},
		
	
});

AccountsLoginService.identifier = 'palm://com.palm.accounts'; 