Record Class PulsarSource
java.lang.Object
java.lang.Record
org.springframework.pulsar.function.PulsarSource
- Record Components:
config- the source detailsstopPolicy- the action to take on the source when the server is stoppedupdateOptions- the options to use during an update operation (optional)
- All Implemented Interfaces:
PulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>
public record PulsarSource(org.apache.pulsar.common.io.SourceConfig config, PulsarFunctionOperations.FunctionStopPolicy stopPolicy, @Nullable org.apache.pulsar.common.functions.UpdateOptions updateOptions)
extends Record
implements PulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>
Represents a Pulsar Source backed by a
SourceConfig.- Author:
- Chris Bono
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.pulsar.function.PulsarFunctionOperations
PulsarFunctionOperations.FunctionStopPolicy, PulsarFunctionOperations.FunctionType -
Field Summary
Fields inherited from interface org.springframework.pulsar.function.PulsarFunctionOperations
logger -
Constructor Summary
ConstructorsConstructorDescriptionPulsarSource(org.apache.pulsar.common.io.SourceConfig config, org.apache.pulsar.common.functions.UpdateOptions updateOptions) PulsarSource(org.apache.pulsar.common.io.SourceConfig config, PulsarFunctionOperations.FunctionStopPolicy stopPolicy, org.apache.pulsar.common.functions.UpdateOptions updateOptions) Creates an instance of aPulsarSourcerecord class. -
Method Summary
Modifier and TypeMethodDescriptionarchive()Gets the url or path to the archive that represents the function.org.apache.pulsar.common.io.SourceConfigconfig()Returns the value of theconfigrecord component.voidcreate(org.apache.pulsar.client.admin.PulsarAdmin admin) Creates the function using the file-based create api.voidcreateWithUrl(org.apache.pulsar.client.admin.PulsarAdmin admin) Creates the function using the url-based create api.voiddelete(org.apache.pulsar.client.admin.PulsarAdmin admin) Deletes the function.final booleanIndicates whether some other object is "equal to" this one.org.apache.pulsar.common.io.SourceConfigget(org.apache.pulsar.client.admin.PulsarAdmin admin) Gets the configuration details for an existing function.final inthashCode()Returns a hash code value for this object.name()Gets the name of the function.voidstop(org.apache.pulsar.client.admin.PulsarAdmin admin) Stops the function.Returns the value of thestopPolicyrecord component.final StringtoString()Returns a string representation of this record class.type()Gets the type of function the operations handles.voidupdate(org.apache.pulsar.client.admin.PulsarAdmin admin) Updates the function using the file-based update api.org.apache.pulsar.common.functions.UpdateOptionsReturns the value of theupdateOptionsrecord component.voidupdateWithUrl(org.apache.pulsar.client.admin.PulsarAdmin admin) Updates the function using the url-based update api.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.pulsar.function.PulsarFunctionOperations
functionExists, getIfExists
-
Constructor Details
-
PulsarSource
public PulsarSource(org.apache.pulsar.common.io.SourceConfig config, @Nullable org.apache.pulsar.common.functions.UpdateOptions updateOptions) -
PulsarSource
public PulsarSource(org.apache.pulsar.common.io.SourceConfig config, PulsarFunctionOperations.FunctionStopPolicy stopPolicy, @Nullable org.apache.pulsar.common.functions.UpdateOptions updateOptions) Creates an instance of aPulsarSourcerecord class.- Parameters:
config- the value for theconfigrecord componentstopPolicy- the value for thestopPolicyrecord componentupdateOptions- the value for theupdateOptionsrecord component
-
-
Method Details
-
name
Description copied from interface:PulsarFunctionOperationsGets the name of the function.- Specified by:
namein interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>- Returns:
- the name of the function
-
type
Description copied from interface:PulsarFunctionOperationsGets the type of function the operations handles.- Specified by:
typein interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>- Returns:
- the type of the function
-
archive
Description copied from interface:PulsarFunctionOperationsGets the url or path to the archive that represents the function.- Specified by:
archivein interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>- Returns:
- the url or path to the archive that represents function
-
get
public org.apache.pulsar.common.io.SourceConfig get(org.apache.pulsar.client.admin.PulsarAdmin admin) throws org.apache.pulsar.client.admin.PulsarAdminException Description copied from interface:PulsarFunctionOperationsGets the configuration details for an existing function.- Specified by:
getin interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>- Parameters:
admin- the admin client- Returns:
- the current config of the existing function
- Throws:
org.apache.pulsar.client.admin.PulsarAdminException.NotFoundException- if function does not existorg.apache.pulsar.client.admin.PulsarAdminException- if anything else goes wrong
-
updateWithUrl
public void updateWithUrl(org.apache.pulsar.client.admin.PulsarAdmin admin) throws org.apache.pulsar.client.admin.PulsarAdminException Description copied from interface:PulsarFunctionOperationsUpdates the function using the url-based update api.- Specified by:
updateWithUrlin interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>- Parameters:
admin- the admin client- Throws:
org.apache.pulsar.client.admin.PulsarAdminException- if anything goes wrong
-
update
public void update(org.apache.pulsar.client.admin.PulsarAdmin admin) throws org.apache.pulsar.client.admin.PulsarAdminException Description copied from interface:PulsarFunctionOperationsUpdates the function using the file-based update api.- Specified by:
updatein interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>- Parameters:
admin- the admin client- Throws:
org.apache.pulsar.client.admin.PulsarAdminException- if anything goes wrong
-
createWithUrl
public void createWithUrl(org.apache.pulsar.client.admin.PulsarAdmin admin) throws org.apache.pulsar.client.admin.PulsarAdminException Description copied from interface:PulsarFunctionOperationsCreates the function using the url-based create api.- Specified by:
createWithUrlin interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>- Parameters:
admin- the admin client- Throws:
org.apache.pulsar.client.admin.PulsarAdminException- if anything goes wrong
-
create
public void create(org.apache.pulsar.client.admin.PulsarAdmin admin) throws org.apache.pulsar.client.admin.PulsarAdminException Description copied from interface:PulsarFunctionOperationsCreates the function using the file-based create api.- Specified by:
createin interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>- Parameters:
admin- the admin client- Throws:
org.apache.pulsar.client.admin.PulsarAdminException- if anything goes wrong
-
stop
public void stop(org.apache.pulsar.client.admin.PulsarAdmin admin) Description copied from interface:PulsarFunctionOperationsStops the function.- Specified by:
stopin interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>- Parameters:
admin- the admin client
-
delete
public void delete(org.apache.pulsar.client.admin.PulsarAdmin admin) Description copied from interface:PulsarFunctionOperationsDeletes the function.- Specified by:
deletein interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>- Parameters:
admin- the admin client
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
config
public org.apache.pulsar.common.io.SourceConfig config()Returns the value of theconfigrecord component.- Returns:
- the value of the
configrecord component
-
stopPolicy
Returns the value of thestopPolicyrecord component.- Specified by:
stopPolicyin interfacePulsarFunctionOperations<org.apache.pulsar.common.io.SourceConfig>- Returns:
- the value of the
stopPolicyrecord component
-
updateOptions
@Nullable public org.apache.pulsar.common.functions.UpdateOptions updateOptions()Returns the value of theupdateOptionsrecord component.- Returns:
- the value of the
updateOptionsrecord component
-