Class ServiceRemoteInclusion
java.lang.Object
eu.cloudnetservice.driver.service.ServiceRemoteInclusion
- All Implemented Interfaces:
DefaultedDocPropertyHolder,DocPropertyHolder,Cloneable
public final class ServiceRemoteInclusion
extends Object
implements DefaultedDocPropertyHolder, Cloneable
An inclusion which can be added to a service and will download a file from the specified url to the given
destination. This can be anything for example a plugin or configuration file.
- Since:
- 4.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder for a service remote inclusion.Nested classes/interfaces inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
DefaultedDocPropertyHolder.Mutable<S extends DocPropertyHolder.Mutable<S>> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Stringprivate final Stringstatic final DocProperty<Map<String, String>> A property which can be added to a service inclusion to set the http headers to send when making the download http request.static final Stringstatic final Stringprivate final Documentprivate final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Constructs a new builder instance for a service remote inclusion.builder(@NonNull ServiceRemoteInclusion inclusion) Constructs a new builder for a service remote inclusion which has the properties of the given inclusion already set.The caching strategy that is used when downloading the inclusion.clone()The target file name of the inclusion download.booleaninthashCode()Get the underlying document that all read and write operations are delegated to.toString()url()Get the url to download the remote inclusion from.Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface eu.cloudnetservice.driver.document.property.DefaultedDocPropertyHolder
propertyAbsent, propertyPresent, readProperty, readPropertyOrDefault, readPropertyOrGet, readPropertyOrThrow, readPropertyOrThrow
-
Field Details
-
NO_CACHE_STRATEGY
- See Also:
-
KEEP_UNTIL_RESTART_STRATEGY
- See Also:
-
HEADERS
A property which can be added to a service inclusion to set the http headers to send when making the download http request. All key-value pairs of the given document will be set as headers in the request. -
url
-
destination
-
cacheStrategy
-
properties
-
-
Constructor Details
-
ServiceRemoteInclusion
private ServiceRemoteInclusion(@NonNull @NonNull String url, @NonNull @NonNull String destination, @NonNull @NonNull String cacheStrategy, @NonNull @NonNull Document properties) Constructs a new service remote inclusion instance.- Parameters:
url- the url to download the associated file from.destination- the destination inside the service directory to copy the downloaded file to.cacheStrategy- the cache strategy to use when downloading files from the remote.properties- the properties of the remote inclusion, these can for example contain the http headers to send.- Throws:
NullPointerException- if one of the given parameters is null.
-
-
Method Details
-
builder
Constructs a new builder instance for a service remote inclusion.- Returns:
- a new service remote inclusion builder.
-
builder
@NonNull public static @NonNull ServiceRemoteInclusion.Builder builder(@NonNull @NonNull ServiceRemoteInclusion inclusion) Constructs a new builder for a service remote inclusion which has the properties of the given inclusion already set.When calling build directly after constructing a builder using this method, it will result in a service remote inclusion which is equal but not the same as the given one.
- Parameters:
inclusion- the inclusion to copy the properties of.- Returns:
- a new service remote inclusion builder with the properties of the given one already set.
- Throws:
NullPointerException- if the given inclusion is null.
-
url
-
destination
-
cacheStrategy
-
propertyHolder
Get the underlying document that all read and write operations are delegated to.- Specified by:
propertyHolderin interfaceDocPropertyHolder- Returns:
- the underlying document.
-
toString
-
clone
-
equals
-
hashCode
-