Class GlobalKinesisConfiguration
- java.lang.Object
-
- hudson.model.Descriptor<GlobalConfiguration>
-
- jenkins.model.GlobalConfiguration
-
- io.jenkins.plugins.aws.kinesisconsumer.GlobalKinesisConfiguration
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<GlobalConfiguration>
,Saveable
,OnMaster
@Extension @Symbol("aws-kinesis-consumer") public class GlobalKinesisConfiguration extends GlobalConfiguration
Class representing the Global Kinesis configuration- Author:
- Fabio Ponciroli
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Constructor Description GlobalKinesisConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json)
FormValidation
doCheckApplicationName(String value)
Checks applicationName is validFormValidation
doCheckInitialPositionInStream(String value)
Checks AWS Kinesis initial stream position is valid.FormValidation
doCheckLocalEndpoint(String value)
Checks local endpoint URL is valid.FormValidation
doCheckRegion(String value)
Checks AWS region is valid.static GlobalKinesisConfiguration
get()
Get the GlobalKinesisConfigurationString
getApplicationName()
Get the application name from the configuration pageList<KinesisStreamItem>
getKinesisStreamItems()
KinesisStreamItem
getKinesisStreamItemsForStream(String streamName)
String
getLocalEndpoint()
Get the local endpoint to consume from rather than the AWS serviceString
getRegion()
Get the AWS Region to connect to from the configuration pageInteger
getShutdownTimeoutMs()
Get the maximum total time (milliseconds) waiting when shutting down kinesis consumers.boolean
isKinesisConsumerEnabled()
Indicates if the plugin is enabled or notvoid
setApplicationName(String applicationNameString)
Set application name when loading the global configuration page This name identifies the application, which must have a unique name that is scoped to the Amazon account and Region used by the application.void
setKinesisConsumerEnabled(boolean kinesisConsumerEnabled)
Set the enabled/disabled status of the plugin when loading the global configuration pagevoid
setKinesisStreamItems(List<KinesisStreamItem> kinesisStreamItems)
Set KinesisStreamItem values when loading the global configuration pagevoid
setLocalEndpoint(String localEndpoint)
Set an optional endpoint to point to a local kinesis stack rather than the AWS service.void
setRegion(String regionString)
Set AWS Region when loading the global configuration pagevoid
setShutdownTimeoutMs(Integer timeoutMs)
Set the maximum total time (milliseconds) waiting when shutting down kinesis consumers.-
Methods inherited from class jenkins.model.GlobalConfiguration
all, getDescriptor, getGlobalConfigPage
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Method Detail
-
setRegion
@DataBoundSetter public void setRegion(String regionString)
Set AWS Region when loading the global configuration page- Parameters:
regionString
- AWS Region to connect to. This parameter is optional. If set it will override any Region set in the Region Provider Chain.
-
setShutdownTimeoutMs
@DataBoundSetter public void setShutdownTimeoutMs(Integer timeoutMs)
Set the maximum total time (milliseconds) waiting when shutting down kinesis consumers.- Parameters:
timeoutMs
- timeout in milliseconds
-
setApplicationName
@DataBoundSetter public void setApplicationName(String applicationNameString)
Set application name when loading the global configuration page This name identifies the application, which must have a unique name that is scoped to the Amazon account and Region used by the application. This name is used as a name for the control table in Amazon DynamoDB and the namespace for Amazon CloudWatch metrics.- Parameters:
applicationNameString
- the name of this application
-
setKinesisConsumerEnabled
@DataBoundSetter public void setKinesisConsumerEnabled(boolean kinesisConsumerEnabled)
Set the enabled/disabled status of the plugin when loading the global configuration page- Parameters:
kinesisConsumerEnabled
- enabled/disabled status
-
setKinesisStreamItems
@DataBoundSetter public void setKinesisStreamItems(List<KinesisStreamItem> kinesisStreamItems)
Set KinesisStreamItem values when loading the global configuration page- Parameters:
kinesisStreamItems
- KinesisStreamItem to set
-
setLocalEndpoint
@DataBoundSetter public void setLocalEndpoint(String localEndpoint)
Set an optional endpoint to point to a local kinesis stack rather than the AWS service. Useful for development.- Parameters:
localEndpoint
- the local endpoint URL, i.e. http://localhost:4566
-
get
public static GlobalKinesisConfiguration get()
Get the GlobalKinesisConfiguration- Returns:
- the global Kinesis configuration
-
isKinesisConsumerEnabled
public boolean isKinesisConsumerEnabled()
Indicates if the plugin is enabled or not- Returns:
- a boolean indicating the status of the plugin
-
getRegion
public String getRegion()
Get the AWS Region to connect to from the configuration page- Returns:
- AWS Region to connect to
-
getApplicationName
public String getApplicationName()
Get the application name from the configuration page- Returns:
- Application name
-
getShutdownTimeoutMs
public Integer getShutdownTimeoutMs()
Get the maximum total time (milliseconds) waiting when shutting down kinesis consumers.- Returns:
- The timeout (milliseconds)
-
getKinesisStreamItems
public List<KinesisStreamItem> getKinesisStreamItems()
-
getLocalEndpoint
public String getLocalEndpoint()
Get the local endpoint to consume from rather than the AWS service- Returns:
- The local endpoint, or null, when not defined.
-
doCheckLocalEndpoint
public FormValidation doCheckLocalEndpoint(@QueryParameter String value)
Checks local endpoint URL is valid.- Parameters:
value
- the URL.- Returns:
- FormValidation object that indicates ok or error.
-
doCheckRegion
public FormValidation doCheckRegion(@QueryParameter String value)
Checks AWS region is valid.- Parameters:
value
- the region.- Returns:
- FormValidation object that indicates ok or error.
-
doCheckApplicationName
public FormValidation doCheckApplicationName(@QueryParameter String value)
Checks applicationName is valid- Parameters:
value
- the application name- Returns:
- FormValidation object that indicates ok or error.
-
doCheckInitialPositionInStream
public FormValidation doCheckInitialPositionInStream(@QueryParameter String value)
Checks AWS Kinesis initial stream position is valid.- Parameters:
value
- the initial position in the stream. Valid values: LATEST, TRIM_HORIZON- Returns:
- FormValidation object that indicates ok or error.
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json)
- Overrides:
configure
in classGlobalConfiguration
- Parameters:
req
-StaplerRequest
submitted when saving the configuration pagejson
- JSON containing the configuration parameters set- Returns:
- true if the configuration was correctly saved, false otherwise
-
getKinesisStreamItemsForStream
public KinesisStreamItem getKinesisStreamItemsForStream(String streamName)
-
-