public static class SiLAServer.Builder extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
SiLAServer.Builder.BinaryDatabaseProvider |
static interface |
SiLAServer.Builder.ConfigWrapperProvider |
| Modifier and Type | Method and Description |
|---|---|
SiLAServer.Builder |
addFCPAffectedByMetadata(@NonNull String FCPAffectedByMetadata,
String... FQIMetadata)
Very early stage API to specify FCP Affected by Metadata will most likely be changed in the future
|
SiLAServer.Builder |
addFeature(@NonNull FeatureImplementation featureImplementation)
Add a Feature to be exposed
|
SiLAServer.Builder |
addFeature(@NonNull String featureDescription,
@NonNull BindableService featureService)
Add a Feature to be exposed
|
SiLAServer.Builder |
addFeature(@NonNull String featureDescription,
@NonNull ServerServiceDefinition serverServiceFeatureDefinition)
Add a Feature to be exposed
|
SiLAServer.Builder |
addInterceptor(@NonNull ServerInterceptor interceptor)
Add a gRPC
ServerInterceptor to the server |
Map<String,String> |
getFeatureDefinitions() |
IServerConfigWrapper |
getNewServerConfigurationWrapper()
Get a new server configuration wrapper instance
|
static SiLAServer.Builder |
newBuilder(@NonNull ServerInformation serverInformation)
Create builder for a Server
|
SiLAServer.Builder |
removeFCPAffectedByMetadata(@NonNull String FCPAffectedByMetadata,
String... FQIMetadata)
Very early stage API to remove FCP Affected by Metadata will most likely be changed in the future
|
SiLAServer |
start()
Starts and Creates the SiLA Server
|
SiLAServer.Builder |
withBinaryDatabaseInjector()
Add a
BinaryDatabaseInjector to the server so the BinaryDatabase is easily accessible to
feature implementations |
SiLAServer.Builder |
withBinaryTransferSupport()
Enable support for binary transfer
|
SiLAServer.Builder |
withBinaryTransferSupport(boolean binaryTransferSupport)
Enable or disable support for binary transfer
|
SiLAServer.Builder |
withCustomBinaryDatabaseProvider(SiLAServer.Builder.BinaryDatabaseProvider customBinaryDatabaseProvider)
Allows to set a custom binary database instead of the default one.
|
SiLAServer.Builder |
withCustomConfigWrapperProvider(SiLAServer.Builder.ConfigWrapperProvider customConfigWrapperProvider)
Allows to set a custom configuration wrapper instead of the default one
|
SiLAServer.Builder |
withDefaultServerConfiguration(ServerConfiguration defaultServerConfiguration)
Define the default server configuration.
|
SiLAServer.Builder |
withDiscovery(@NonNull boolean isEnabled)
Enables or disables Network Discovery
|
SiLAServer.Builder |
withHost(String host)
Define the host or IP address on which the services will be exclusively served on.
|
SiLAServer.Builder |
withMetadataExtractingInterceptor()
Add a
MetadataExtractingInterceptor to the server |
SiLAServer.Builder |
withName(String name)
Define the server name.
|
SiLAServer.Builder |
withNetworkInterface(@NonNull String interfaceName)
Enables Discovery on a certain interface
|
SiLAServer.Builder |
withoutDiscovery()
Disables Network Discovery
|
SiLAServer.Builder |
withPersistentConfig()
Allows to specify whether the server configuration should be persisted.
|
SiLAServer.Builder |
withPersistentConfig(boolean usePersistentConfig)
Allows to specify whether the server configuration should be persisted.
|
SiLAServer.Builder |
withPersistentConfigFile(Path persistentConfigFile)
Allows to specify the file to save and or load the server configuration
|
SiLAServer.Builder |
withPersistentTLS(@NonNull Path privateKeyFile,
@NonNull Path certificateFile)
Use persistent TLS credentials.
|
SiLAServer.Builder |
withPersistentTLS(@NonNull Path privateKeyFile,
@NonNull Path certificateFile,
String certificatePassword)
Use persistent TLS credentials.
|
SiLAServer.Builder |
withPort(int port)
Define Specific Port for the services (otherwise a default range will be chosen)
|
SiLAServer.Builder |
withTLS(@NonNull X509Certificate certChain,
@NonNull PrivateKey privateKey)
Use TLS certification
|
SiLAServer.Builder |
withUnsafeCommunication(boolean unsafeCommunication)
Deprecated.
Unsafe plain-text communication is forbidden by the SiLA 2 Standard
|
SiLAServer.Builder |
withUUID(UUID uuid)
Define the server UUID.
|
public SiLAServer.Builder withDiscovery(@NonNull @NonNull boolean isEnabled)
isEnabled - true to enable network discoverypublic SiLAServer.Builder withoutDiscovery()
public SiLAServer.Builder withNetworkInterface(@NonNull @NonNull String interfaceName)
interfaceName - Name of network interface to use discoverypublic SiLAServer.Builder withPort(int port)
port - Port on which the server runs.public SiLAServer.Builder withHost(@Nullable String host)
host - host or IP address on which the server runs.public SiLAServer.Builder withName(@Nullable String name)
public SiLAServer.Builder withUUID(@Nullable UUID uuid)
public SiLAServer.Builder withDefaultServerConfiguration(@Nullable ServerConfiguration defaultServerConfiguration)
public SiLAServer.Builder withUnsafeCommunication(boolean unsafeCommunication)
public SiLAServer.Builder withBinaryTransferSupport(boolean binaryTransferSupport)
public SiLAServer.Builder withBinaryDatabaseInjector()
BinaryDatabaseInjector to the server so the BinaryDatabase is easily accessible to
feature implementationspublic SiLAServer.Builder withBinaryTransferSupport()
public SiLAServer.Builder withCustomBinaryDatabaseProvider(@Nullable SiLAServer.Builder.BinaryDatabaseProvider customBinaryDatabaseProvider)
customBinaryDatabaseProvider - The SiLAServer.Builder.BinaryDatabaseProvider to setpublic SiLAServer.Builder addFeature(@NonNull @NonNull String featureDescription, @NonNull @NonNull BindableService featureService)
featureDescription - Feature Description as String Content in XMLfeatureService - Feature Service implemented with gRPCpublic SiLAServer.Builder addFCPAffectedByMetadata(@NonNull @NonNull String FCPAffectedByMetadata, @NonNull String... FQIMetadata)
FCPAffectedByMetadata - The fully qualified feature or command or property identifier affectedFQIMetadata - The fully qualified metadata affecting the feature or command or propertypublic SiLAServer.Builder removeFCPAffectedByMetadata(@NonNull @NonNull String FCPAffectedByMetadata, @NonNull String... FQIMetadata)
FCPAffectedByMetadata - The fully qualified feature or command or property identifier affectedFQIMetadata - The fully qualified metadata affecting the feature or command or propertypublic SiLAServer.Builder addFeature(@NonNull @NonNull FeatureImplementation featureImplementation)
featureImplementation - Exposing both the description and implementationpublic SiLAServer.Builder addFeature(@NonNull @NonNull String featureDescription, @NonNull @NonNull ServerServiceDefinition serverServiceFeatureDefinition)
featureDescription - Feature Description as String Content in XMLserverServiceFeatureDefinition - Server service definition feature implemented with gRPCpublic SiLAServer start() throws IOException
IOExceptionpublic SiLAServer.Builder withTLS(@NonNull @NonNull X509Certificate certChain, @NonNull @NonNull PrivateKey privateKey)
certChain - InputStream certificationprivateKey - InputStream private keypublic SiLAServer.Builder withPersistentTLS(@NonNull @NonNull Path privateKeyFile, @NonNull @NonNull Path certificateFile, @Nullable String certificatePassword)
certificateFile - Path to the private key PEM fileprivateKeyFile - Path to the certificate PEM filecertificatePassword - Password of the certificate if anypublic SiLAServer.Builder withPersistentTLS(@NonNull @NonNull Path privateKeyFile, @NonNull @NonNull Path certificateFile)
certificateFile - Path to the private key PEM fileprivateKeyFile - Path to the certificate PEM filepublic SiLAServer.Builder addInterceptor(@NonNull @NonNull ServerInterceptor interceptor)
ServerInterceptor to the serverinterceptor - The ServerInterceptor to addpublic SiLAServer.Builder withCustomConfigWrapperProvider(@Nullable SiLAServer.Builder.ConfigWrapperProvider customConfigWrapperProvider)
customConfigWrapperProvider - The SiLAServer.Builder.ConfigWrapperProvider to setpublic SiLAServer.Builder withPersistentConfig(boolean usePersistentConfig)
withPersistentConfigFile(Path), the file "server.cfg"
will be used.usePersistentConfig - The booleanpublic SiLAServer.Builder withPersistentConfig()
withPersistentConfigFile(Path), the file "server.cfg"
will be used.public SiLAServer.Builder withPersistentConfigFile(Path persistentConfigFile)
persistentConfigFile - The path to save and or load the server configurationpublic SiLAServer.Builder withMetadataExtractingInterceptor()
MetadataExtractingInterceptor to the serveraddInterceptor(ServerInterceptor) before this method precede the
MetadataExtractingInterceptor in the call handling chain.public static SiLAServer.Builder newBuilder(@NonNull @NonNull ServerInformation serverInformation) throws IOException
serverInformation - Meta server information defined by the server implementerIOExceptionpublic IServerConfigWrapper getNewServerConfigurationWrapper() throws IOException
IOExceptionCopyright © 2022 SiLA Java Developers. All rights reserved.