Android Open Source - wolPi S Q Lite Settings Provider






From Project

Back to project page wolPi.

License

The source code is released under:

Apache License

If you think the Android project wolPi listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.matthesrieke.wolpi.dao;
//from   w ww.jav a2 s.com
import java.util.ArrayList;
import java.util.List;

import de.matthesrieke.wolpi.settings.HostConfiguration;
import de.matthesrieke.wolpi.settings.SSHConnection;
import de.matthesrieke.wolpi.settings.SettingsProvider;
import de.matthesrieke.wolpi.settings.WolSettings;

/**
 * SQLite impl of a {@link SettingsProvider}.
 * 
 * @author matthes rieke
 *
 */
public class SQLiteSettingsProvider implements SettingsProvider {

  private List<HostConfiguration> hosts = new ArrayList<HostConfiguration>();
  
  public SQLiteSettingsProvider() {
    hosts.add(new HostConfiguration(new SSHConnection("test.org", 22, "pi", "pw"),
        new WolSettings("test:s:2")));
  }
  
  @Override
  public List<HostConfiguration> getHosts() {
    return this.hosts;
  }

  @Override
  public HostConfiguration getHostForId(String value) {
    for (HostConfiguration hc : hosts) {
      if (hc.getId().equals(value)) {
        return hc;
      }
    }
    return null;
  }

  @Override
  public synchronized void reloadConfiguration() {
    // TODO Auto-generated method stub
  }

  @Override
  public synchronized void saveConfiguration() {
    // TODO Auto-generated method stub
    hosts.size();
  }

  @Override
  public synchronized void addHost(HostConfiguration host) {
    this.hosts.add(host);
  }

  @Override
  public synchronized void deleteHost(HostConfiguration host) {
    this.hosts.remove(host);
  }

}




Java Source Code List

de.matthesrieke.wolpi.CommandResult.java
de.matthesrieke.wolpi.Interactor.java
de.matthesrieke.wolpi.SysoutInteractor.java
de.matthesrieke.wolpi.UserInfoImpl.java
de.matthesrieke.wolpi.WolPiException.java
de.matthesrieke.wolpi.WolPi.java
de.matthesrieke.wolpi.dao.SQLiteSettingsProvider.java
de.matthesrieke.wolpi.settings.HostConfiguration.java
de.matthesrieke.wolpi.settings.SSHConnection.java
de.matthesrieke.wolpi.settings.SettingsProvider.java
de.matthesrieke.wolpi.settings.WolSettings.java
de.matthesrieke.wolpi.ui.ConfirmationDialog.java
de.matthesrieke.wolpi.ui.HostListActivity.java
de.matthesrieke.wolpi.ui.HostManagementActivity.java
de.matthesrieke.wolpi.ui.MainActivity.java
de.matthesrieke.wolpi.ui.TextViewInteractor.java
de.matthesrieke.wolpi.util.AndroidServiceLoader.java