AuthenticationService v0.3.0+7-g8a7f190
Public Member Functions | List of all members
Joutsen.Authentication.UserRepository Interface Reference

A repository that provides access to persisted users and offers ways to create, update and delete them. More...

Public Member Functions

Page< UserFind (long applicationId=-1, String roleName=null, int pageNumber=0, int maxResults=int.MaxValue)
 Search for a certain number of users. More...
 
User GetById (long id)
 Fetches an user by its name. More...
 
User GetByName (string username)
 Fetches an user by its unique identifier. More...
 
long Save (User user, string password)
 Persists an user with a password. More...
 
long Save (User user, string password, string salt)
 Persists an user with a password. More...
 
long Save (User user)
 Persists an user. More...
 
bool Delete (long id)
 Deletes a persisted user. More...
 
void Delete (User user)
 Deletes a persisted user. More...
 
User Create ()
 Creates a new instance of an user. More...
 

Detailed Description

A repository that provides access to persisted users and offers ways to create, update and delete them.

Since
0.1.0

Member Function Documentation

◆ Create()

User Joutsen.Authentication.UserRepository.Create ( )

Creates a new instance of an user.

Implemented in Joutsen.Authentication.Persistence.NHibernate.NHibernateUserRepository.

◆ Delete() [1/2]

bool Joutsen.Authentication.UserRepository.Delete ( long  id)

Deletes a persisted user.

Parameters
idthe unique identifier of the user
Returns
true if the user was found and deleted, otherwise false

Implemented in Joutsen.Authentication.Persistence.NHibernate.NHibernateUserRepository.

◆ Delete() [2/2]

void Joutsen.Authentication.UserRepository.Delete ( User  user)

◆ Find()

Page< User > Joutsen.Authentication.UserRepository.Find ( long  applicationId = -1,
String  roleName = null,
int  pageNumber = 0,
int  maxResults = int.MaxValue 
)

Search for a certain number of users.

Parameters
applicationIdthe id of the application the users need to belong to
roleNamethe name of a role that the users need to have
pageNumberidentifies the page of matching users to return
maxResultsthe maximum number of users to return. This also defines the page size.
Returns
the matching users on the defined page

Implemented in Joutsen.Authentication.Persistence.NHibernate.NHibernateUserRepository.

◆ GetById()

User Joutsen.Authentication.UserRepository.GetById ( long  id)

Fetches an user by its name.

Implemented in Joutsen.Authentication.Persistence.NHibernate.NHibernateUserRepository.

◆ GetByName()

User Joutsen.Authentication.UserRepository.GetByName ( string  username)

Fetches an user by its unique identifier.

Implemented in Joutsen.Authentication.Persistence.NHibernate.NHibernateUserRepository.

◆ Save() [1/3]

long Joutsen.Authentication.UserRepository.Save ( User  user)

Persists an user.

Parameters
userthe user to persist
Returns
the unique identifier of the persisted user

Implemented in Joutsen.Authentication.Persistence.NHibernate.NHibernateUserRepository.

◆ Save() [2/3]

long Joutsen.Authentication.UserRepository.Save ( User  user,
string  password 
)

Persists an user with a password.

Parameters
userthe user to persist
passwordthe user's password
Returns
the unique identifier of the persisted user
Since
0.2.0

Implemented in Joutsen.Authentication.Persistence.NHibernate.NHibernateUserRepository.

◆ Save() [3/3]

long Joutsen.Authentication.UserRepository.Save ( User  user,
string  password,
string  salt 
)

Persists an user with a password.

Parameters
userthe user to persist
passwordthe user's password as a hash
saltthe salt that is added to the users password hash
Returns
the unique identifier of the persisted user

Implemented in Joutsen.Authentication.Persistence.NHibernate.NHibernateUserRepository.