Back to project page wolPi.
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.
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); } }