public class Connection extends Object implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static interface |
Connection.ConnectionListener
Connection Listener interface
|
| Constructor and Description |
|---|
Connection(@NonNull Server server,
@NonNull AutoCloseable closeable)
Constructor
|
Connection(@NonNull Server server,
@NonNull io.grpc.ManagedChannel managedChannel)
Create a new SiLA Connection
|
| Modifier and Type | Method and Description |
|---|---|
void |
attachAndTriggerListener(@NonNull Connection.ConnectionListener connectionListener) |
void |
close() |
com.google.protobuf.Descriptors.ServiceDescriptor |
getFeatureService(@NonNull String fullyQualifiedFeatureId)
Get a feature service
|
void |
loadFeaturesFromServer(Server server)
Convert and validate the server features into
Descriptors.FileDescriptor and save them in fileDescriptorMap and featureMap |
public Connection(@NonNull
@NonNull Server server,
@NonNull
@NonNull io.grpc.ManagedChannel managedChannel)
throws MalformedSiLAFeature
server - Server DescriptionmanagedChannel - gRPC Channel to ServerMalformedSiLAFeature - if one of the features is invalidpublic Connection(@NonNull
@NonNull Server server,
@NonNull
@NonNull AutoCloseable closeable)
throws MalformedSiLAFeature
server - the servercloseable - the cleanup method to call when closing the connectionMalformedSiLAFeaturepublic void loadFeaturesFromServer(Server server) throws MalformedSiLAFeature
Descriptors.FileDescriptor and save them in fileDescriptorMap and featureMapserver - the serverMalformedSiLAFeature - if a feature is malformedpublic void attachAndTriggerListener(@NonNull
@NonNull Connection.ConnectionListener connectionListener)
connectionListener - Listeners to changes in the connectionpublic com.google.protobuf.Descriptors.ServiceDescriptor getFeatureService(@NonNull
@NonNull String fullyQualifiedFeatureId)
throws KeyException
fullyQualifiedFeatureId - The fully qualified feature identifierKeyException - when no identifier does not match any featurepublic void close()
close in interface AutoCloseableCopyright © 2024 SiLA Java Developers. All rights reserved.