public class ScionService extends Object
The ScionService is intended as singleton. There should usually be only one instance that is shared by all users. However, it may sometimes be desirable to have multiple instances, e.g. for connecting to a different daemon or for better concurrency.
The default instance is of type ScionService. All other ScionService are of type Scion.CloseableService which extends AutoCloseable.
Scion.CloseableService| Modifier and Type | Class and Description |
|---|---|
protected static class |
ScionService.Mode |
| Modifier | Constructor and Description |
|---|---|
protected |
ScionService(String addressOrHost,
ScionService.Mode mode) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static void |
closeDefault() |
long |
getIsdAs(String hostName) |
long |
getLocalIsdAs() |
List<Path> |
getPaths(long dstIsdAs,
InetAddress dstAddress,
int dstPort)
Request paths from the local ISD/AS to the destination.
|
List<Path> |
getPaths(long dstIsdAs,
InetSocketAddress dstScionAddress)
Request paths from the local ISD/AS to the destination.
|
List<Path> |
getPaths(Path path)
Request paths to the same destination as the provided path.
|
Path |
lookupAndGetPath(InetSocketAddress dstAddr,
PathPolicy policy)
Resolves the address to a SCION address, request paths, and selects a path using the policy.
|
Path |
lookupAndGetPath(String hostName,
int port,
PathPolicy policy)
Resolves the address to a SCION address, request paths, and selects a path using the policy.
|
ScionDatagramChannel |
openChannel() |
ScionDatagramChannel |
openChannel(DatagramChannel channel) |
protected ScionService(String addressOrHost, ScionService.Mode mode)
public static void closeDefault()
public void close()
throws IOException
IOExceptionpublic ScionDatagramChannel openChannel() throws IOException
IOExceptionpublic ScionDatagramChannel openChannel(DatagramChannel channel) throws IOException
IOExceptionpublic List<Path> getPaths(long dstIsdAs, InetSocketAddress dstScionAddress)
dstIsdAs - Destination ISD/ASdstScionAddress - Destination IP address. Must belong to a SCION enabled end host.public List<Path> getPaths(Path path)
path - A pathpublic List<Path> getPaths(long dstIsdAs, InetAddress dstAddress, int dstPort)
dstIsdAs - Destination ISD/ASdstAddress - A SCION-enabled Destination IP addressdstPort - Destination portpublic Path lookupAndGetPath(String hostName, int port, PathPolicy policy) throws ScionException
hostName - Destination host nameport - Destination portpolicy - Path policy. 'null' means PathPolicy.DEFAULT.ScionException - if the DNS/TXT lookup did not return a (valid) SCION address.public Path lookupAndGetPath(InetSocketAddress dstAddr, PathPolicy policy) throws ScionException
dstAddr - Destination addresspolicy - Path policy. 'null' means PathPolicy.DEFAULT.ScionException - if the DNS/TXT lookup did not return a (valid) SCION address.public long getLocalIsdAs()
public long getIsdAs(String hostName) throws ScionException
hostName - hostName of the host to resolveScionException - if the DNS/TXT lookup did not return a (valid) SCION address.Copyright © 2024. All rights reserved.