-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
350 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
sdmx-dl-api/src/main/java/internal/sdmxdl/web/DefaultSSLFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package internal.sdmxdl.web; | ||
|
||
import lombok.NonNull; | ||
import sdmxdl.web.SSLFactory; | ||
|
||
import javax.net.ssl.HostnameVerifier; | ||
import javax.net.ssl.HttpsURLConnection; | ||
import javax.net.ssl.SSLSocketFactory; | ||
|
||
public enum DefaultSSLFactory implements SSLFactory { | ||
|
||
INSTANCE; | ||
|
||
@Override | ||
public @NonNull SSLSocketFactory getSSLSocketFactory() { | ||
return HttpsURLConnection.getDefaultSSLSocketFactory(); | ||
} | ||
|
||
@Override | ||
public @NonNull HostnameVerifier getHostnameVerifier() { | ||
return HttpsURLConnection.getDefaultHostnameVerifier(); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
sdmx-dl-api/src/main/java/internal/sdmxdl/web/spi/DefaultNetworking.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package internal.sdmxdl.web.spi; | ||
|
||
import lombok.NonNull; | ||
import sdmxdl.web.Network; | ||
import sdmxdl.web.SdmxWebSource; | ||
import sdmxdl.web.spi.Networking; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
public enum DefaultNetworking implements Networking { | ||
|
||
INSTANCE; | ||
|
||
@Override | ||
public @NonNull String getNetworkingId() { | ||
return "DEFAULT"; | ||
} | ||
|
||
@Override | ||
public int getNetworkingRank() { | ||
return UNKNOWN_NETWORKING_RANK; | ||
} | ||
|
||
@Override | ||
public boolean isNetworkingAvailable() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public @NonNull Collection<String> getNetworkingProperties() { | ||
return Collections.emptyList(); | ||
} | ||
|
||
@Override | ||
public @NonNull Network getNetwork(@NonNull SdmxWebSource source) { | ||
return Network.getDefault(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package sdmxdl.web; | ||
|
||
import internal.sdmxdl.web.DefaultSSLFactory; | ||
import lombok.NonNull; | ||
import nbbrd.design.NotThreadSafe; | ||
import nbbrd.design.StaticFactoryMethod; | ||
|
||
import javax.net.ssl.HostnameVerifier; | ||
import javax.net.ssl.SSLSocketFactory; | ||
|
||
@NotThreadSafe | ||
public interface SSLFactory { | ||
|
||
@NonNull SSLSocketFactory getSSLSocketFactory(); | ||
|
||
@NonNull HostnameVerifier getHostnameVerifier(); | ||
|
||
@StaticFactoryMethod | ||
static @NonNull SSLFactory getDefault() { | ||
return DefaultSSLFactory.INSTANCE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package sdmxdl.web.spi; | ||
|
||
import internal.sdmxdl.web.spi.DefaultNetworking; | ||
import lombok.NonNull; | ||
import nbbrd.design.StaticFactoryMethod; | ||
import nbbrd.design.ThreadSafe; | ||
import nbbrd.service.*; | ||
import sdmxdl.web.Network; | ||
import sdmxdl.web.SdmxWebSource; | ||
|
||
import java.util.Collection; | ||
|
||
@ServiceDefinition( | ||
quantifier = Quantifier.SINGLE, | ||
loaderName = "internal.util.NetworkingLoader", | ||
fallback = DefaultNetworking.class | ||
) | ||
@ThreadSafe | ||
public interface Networking { | ||
|
||
@ServiceId | ||
@NonNull String getNetworkingId(); | ||
|
||
@ServiceSorter(reverse = true) | ||
int getNetworkingRank(); | ||
|
||
@ServiceFilter | ||
boolean isNetworkingAvailable(); | ||
|
||
@NonNull Collection<String> getNetworkingProperties(); | ||
|
||
@NonNull Network getNetwork(@NonNull SdmxWebSource source); | ||
|
||
int UNKNOWN_NETWORKING_RANK = -1; | ||
|
||
@StaticFactoryMethod | ||
static @NonNull Networking getDefault() { | ||
return DefaultNetworking.INSTANCE; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.