Compare commits

..

No commits in common. "70c1f10ada16e999957d3a8b4a12aee819a56526" and "c0b171d89ba0387a6d168e5dc2d20672b9cfceca" have entirely different histories.

18 changed files with 17 additions and 87 deletions

View file

@ -36,22 +36,5 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
</classpath> </classpath>

View file

@ -20,15 +20,4 @@
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures> </natures>
<filteredResources>
<filter>
<id>1718972143313</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription> </projectDescription>

View file

@ -4,7 +4,7 @@
<groupId>eu.m724</groupId> <groupId>eu.m724</groupId>
<artifactId>wtapi</artifactId> <artifactId>wtapi</artifactId>
<version>0.6</version> <version>0.6-SNAPSHOT</version>
<properties> <properties>
<maven.compiler.source>17</maven.compiler.source> <maven.compiler.source>17</maven.compiler.source>
@ -60,7 +60,7 @@
<scm> <scm>
<developerConnection>scm:git:git@git.724.rocks:Minecon724/wtapi.git</developerConnection> <developerConnection>scm:git:git@git.724.rocks:Minecon724/wtapi.git</developerConnection>
<tag>wtapi-0.6</tag> <tag>wtapi-0.5</tag>
</scm> </scm>
</project> </project>

View file

@ -1,29 +0,0 @@
package eu.m724.wtapi.provider;
import eu.m724.wtapi.provider.exception.NoSuchProviderException;
import eu.m724.wtapi.provider.thunder.ThunderProvider;
import eu.m724.wtapi.provider.thunder.impl.blitzortung.BlitzortungProvider;
import eu.m724.wtapi.provider.weather.WeatherProvider;
import eu.m724.wtapi.provider.weather.impl.openweathermap.OpenWeatherMapProvider;
public class Providers {
public static ThunderProvider getThunderProvider(String name, String apiKey) throws NoSuchProviderException {
switch (name.toLowerCase()) {
case "blitzortung":
return new BlitzortungProvider();
}
throw new NoSuchProviderException();
}
public static WeatherProvider getWeatherProvider(String name, String apiKey) throws NoSuchProviderException {
switch (name.toLowerCase()) {
case "openweathermap":
return new OpenWeatherMapProvider(apiKey);
}
throw new NoSuchProviderException();
}
}

View file

@ -1,4 +1,4 @@
package eu.m724.wtapi.provider.weather; package eu.m724.wtapi.provider;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;

View file

@ -1,10 +0,0 @@
package eu.m724.wtapi.provider.exception;
/**
* thrown when there's no known provider with that name
*/
public class NoSuchProviderException extends Exception {
private static final long serialVersionUID = -2740598348303023762L;
}

View file

@ -1,4 +1,4 @@
package eu.m724.wtapi.provider.weather.impl.openweathermap; package eu.m724.wtapi.provider.impl.openweathermap;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive; import com.google.gson.JsonPrimitive;

View file

@ -1,4 +1,4 @@
package eu.m724.wtapi.provider.weather.impl.openweathermap; package eu.m724.wtapi.provider.impl.openweathermap;
import java.net.ProxySelector; import java.net.ProxySelector;
import java.net.URI; import java.net.URI;
@ -15,11 +15,11 @@ import com.google.gson.JsonParser;
import eu.m724.wtapi.object.Coordinates; import eu.m724.wtapi.object.Coordinates;
import eu.m724.wtapi.object.Weather; import eu.m724.wtapi.object.Weather;
import eu.m724.wtapi.provider.WeatherProvider;
import eu.m724.wtapi.provider.exception.AuthorizationException; import eu.m724.wtapi.provider.exception.AuthorizationException;
import eu.m724.wtapi.provider.exception.ProviderException; import eu.m724.wtapi.provider.exception.ProviderException;
import eu.m724.wtapi.provider.exception.QuotaExceededException; import eu.m724.wtapi.provider.exception.QuotaExceededException;
import eu.m724.wtapi.provider.exception.ServerProviderException; import eu.m724.wtapi.provider.exception.ServerProviderException;
import eu.m724.wtapi.provider.weather.WeatherProvider;
public class OpenWeatherMapProvider extends WeatherProvider { public class OpenWeatherMapProvider extends WeatherProvider {
private String apiKey; private String apiKey;

View file

@ -1,4 +1,4 @@
package eu.m724.wtapi.provider.thunder; package eu.m724.wtapi.thunder;
import java.util.function.Consumer; import java.util.function.Consumer;

View file

@ -1,4 +1,4 @@
package eu.m724.wtapi.provider.thunder.impl.blitzortung; package eu.m724.wtapi.thunder.impl.blitzortung;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
@ -6,7 +6,7 @@ import java.util.function.Consumer;
import eu.m724.wtapi.object.Coordinates; import eu.m724.wtapi.object.Coordinates;
import eu.m724.wtapi.provider.exception.ProviderException; import eu.m724.wtapi.provider.exception.ProviderException;
import eu.m724.wtapi.provider.thunder.ThunderProvider; import eu.m724.wtapi.thunder.ThunderProvider;
public class BlitzortungProvider extends ThunderProvider { public class BlitzortungProvider extends ThunderProvider {
BlitzortungWebsocketClient websocketClient = new BlitzortungWebsocketClient(this); BlitzortungWebsocketClient websocketClient = new BlitzortungWebsocketClient(this);

View file

@ -1,4 +1,4 @@
package eu.m724.wtapi.provider.thunder.impl.blitzortung; package eu.m724.wtapi.thunder.impl.blitzortung;
import java.net.URI; import java.net.URI;
import java.util.ArrayList; import java.util.ArrayList;

View file

@ -1,4 +1,4 @@
package eu.m724.wtapi.provider.thunder.impl.blitzortung; package eu.m724.wtapi.thunder.impl.blitzortung;
import eu.m724.wtapi.object.Coordinates; import eu.m724.wtapi.object.Coordinates;

View file

@ -5,8 +5,7 @@ import java.util.ArrayList;
import org.junit.Test; import org.junit.Test;
import eu.m724.wtapi.object.Coordinates; import eu.m724.wtapi.object.Coordinates;
import eu.m724.wtapi.provider.thunder.ThunderProvider; import eu.m724.wtapi.thunder.impl.blitzortung.BlitzortungProvider;
import eu.m724.wtapi.provider.thunder.impl.blitzortung.BlitzortungProvider;
public class BlitzortungTest { public class BlitzortungTest {
@Test @Test

View file

@ -6,8 +6,7 @@ import java.util.function.Consumer;
import eu.m724.wtapi.object.Coordinates; import eu.m724.wtapi.object.Coordinates;
import eu.m724.wtapi.provider.exception.ProviderException; import eu.m724.wtapi.provider.exception.ProviderException;
import eu.m724.wtapi.provider.thunder.ThunderProvider; import eu.m724.wtapi.thunder.impl.blitzortung.TimedStrike;
import eu.m724.wtapi.provider.thunder.impl.blitzortung.TimedStrike;
public class MockThunderProvider extends ThunderProvider { public class MockThunderProvider extends ThunderProvider {
ArrayList<Consumer<Coordinates>> strikeHandlers = new ArrayList<>(); ArrayList<Consumer<Coordinates>> strikeHandlers = new ArrayList<>();

View file

@ -5,7 +5,6 @@ import java.util.ArrayList;
import org.junit.Test; import org.junit.Test;
import eu.m724.wtapi.object.Coordinates; import eu.m724.wtapi.object.Coordinates;
import eu.m724.wtapi.provider.thunder.ThunderProvider;
public class ThunderProviderTest { public class ThunderProviderTest {
@Test @Test

View file

@ -3,10 +3,10 @@ package eu.m724.wtapi.weather;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import eu.m724.wtapi.object.Coordinates; import eu.m724.wtapi.object.Coordinates;
import eu.m724.wtapi.object.Weather; import eu.m724.wtapi.object.Weather;
import eu.m724.wtapi.provider.WeatherProvider;
import eu.m724.wtapi.provider.exception.ProviderException; import eu.m724.wtapi.provider.exception.ProviderException;
import eu.m724.wtapi.provider.exception.QuotaExceededException; import eu.m724.wtapi.provider.exception.QuotaExceededException;
import eu.m724.wtapi.provider.exception.ServerProviderException; import eu.m724.wtapi.provider.exception.ServerProviderException;
import eu.m724.wtapi.provider.weather.WeatherProvider;
public class MockWeatherProvider extends WeatherProvider { public class MockWeatherProvider extends WeatherProvider {
private boolean faulty; private boolean faulty;

View file

@ -9,8 +9,8 @@ import org.junit.Test;
import eu.m724.wtapi.object.Coordinates; import eu.m724.wtapi.object.Coordinates;
import eu.m724.wtapi.object.Weather; import eu.m724.wtapi.object.Weather;
import eu.m724.wtapi.provider.weather.WeatherProvider; import eu.m724.wtapi.provider.WeatherProvider;
import eu.m724.wtapi.provider.weather.impl.openweathermap.OpenWeatherMapProvider; import eu.m724.wtapi.provider.impl.openweathermap.OpenWeatherMapProvider;
public class OpenWeatherMapTest { public class OpenWeatherMapTest {
@Test @Test

View file

@ -12,9 +12,9 @@ import org.junit.Test;
import eu.m724.wtapi.object.Coordinates; import eu.m724.wtapi.object.Coordinates;
import eu.m724.wtapi.object.Weather; import eu.m724.wtapi.object.Weather;
import eu.m724.wtapi.provider.WeatherProvider;
import eu.m724.wtapi.provider.exception.ProviderException; import eu.m724.wtapi.provider.exception.ProviderException;
import eu.m724.wtapi.provider.exception.QuotaExceededException; import eu.m724.wtapi.provider.exception.QuotaExceededException;
import eu.m724.wtapi.provider.weather.WeatherProvider;
public class ProviderTest { public class ProviderTest {
@Test @Test