com.toremote.gateway.connection
Class AbstractUserList

java.lang.Object
  extended by com.toremote.gateway.connection.AbstractUserList
All Implemented Interfaces:
UserListInterface

public abstract class AbstractUserList
extends java.lang.Object
implements UserListInterface


Field Summary
protected  User[] users
           
 
Constructor Summary
AbstractUserList()
           
 
Method Summary
abstract  boolean add(User c)
          add user, call persistent to save
abstract  boolean delete(java.lang.String id)
          delete user, , call persistent to save
 User getUserByName(java.lang.String name)
           
 User getUserByName(java.lang.String name, java.lang.String password)
           
 boolean hasUsers()
           
 void importADUser(java.lang.String user, java.lang.String password, java.lang.String domain, java.lang.String server, java.lang.String ou)
           
abstract  boolean persistent()
          save changes to disk
 java.lang.String toJsonTable()
           
abstract  boolean update(User c)
          update user, call persistent to save
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.toremote.gateway.connection.UserListInterface
onLogin, update
 

Field Detail

users

protected User[] users
Constructor Detail

AbstractUserList

public AbstractUserList()
Method Detail

toJsonTable

public java.lang.String toJsonTable()

getUserByName

public User getUserByName(java.lang.String name)
Specified by:
getUserByName in interface UserListInterface
Returns:
null if not found or no user

getUserByName

public User getUserByName(java.lang.String name,
                          java.lang.String password)
Specified by:
getUserByName in interface UserListInterface
Returns:
null if user name or password doesn't match

hasUsers

public boolean hasUsers()
Specified by:
hasUsers in interface UserListInterface
Returns:
true if there are users. return false if you don't have users. Only server list is given to user

delete

public abstract boolean delete(java.lang.String id)
                        throws java.io.IOException
delete user, , call persistent to save

Parameters:
id -
Returns:
true if succeeded
Throws:
java.io.IOException

add

public abstract boolean add(User c)
                     throws java.io.IOException
add user, call persistent to save

Parameters:
c -
Returns:
true if succeeded
Throws:
java.io.IOException

update

public abstract boolean update(User c)
                        throws java.io.IOException
update user, call persistent to save

Parameters:
c -
Returns:
true if succeeded
Throws:
java.io.IOException

persistent

public abstract boolean persistent()
                            throws java.io.IOException
save changes to disk

Returns:
true if succeeded
Throws:
java.io.IOException

importADUser

public void importADUser(java.lang.String user,
                         java.lang.String password,
                         java.lang.String domain,
                         java.lang.String server,
                         java.lang.String ou)
                  throws javax.naming.NamingException
Throws:
javax.naming.NamingException