Class BitbucketEndpointProvider
java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.api.endpoint.BitbucketEndpointProvider
A provider of 
BitbucketEndpoints- Since:
- 936.4.0
- 
Method SummaryModifier and TypeMethodDescriptionstatic List<BitbucketEndpoint>all()Returns all configured Bitbucket endpoints in the global page.static ListBoxModelPopulates aListBoxModelwith all Bitbucket endpoints in the global page.static <T extends BitbucketEndpoint>
 Collection<T>lookupEndpoint(EndpointType type) Checks to see if the supplied server URL is defined in the global configuration.static <T extends BitbucketEndpoint>
 Optional<T>lookupEndpoint(String serverURL) Checks to see if the supplied server URL is defined in the global configuration.static <T extends BitbucketEndpoint>
 Optional<T>lookupEndpoint(String serverURL, Class<T> clazz) Checks to see if the supplied server URL is defined in the global configuration.static StringlookupEndpointJenkinsRootURL(String serverURL) Deprecated, for removal: This API element is subject to removal in a future version.static BitbucketEndpointregisterEndpoint(String name, String serverURL, BitbucketWebhookConfiguration webhook, UnaryOperator<BitbucketEndpoint> endpointCustomiser) Register a newBitbucketEndpointto the global configuration.static BitbucketEndpointregisterEndpoint(String name, String serverURL, UnaryOperator<BitbucketEndpoint> endpointCustomiser) Register a newBitbucketEndpointto the global configuration.static booleanunregisterEndpoint(String serverURL) Removes aBitbucketEndpointthat matches the given URl from the global configuration.
- 
Method Details- 
allReturns all configured Bitbucket endpoints in the global page.- Returns:
- a list of Bitbucket endpoints.
 
- 
listEndpointsPopulates aListBoxModelwith all Bitbucket endpoints in the global page.- Returns:
- a ListBoxModelwith all the endpoints
 
- 
lookupEndpointpublic static <T extends BitbucketEndpoint> Optional<T> lookupEndpoint(@CheckForNull String serverURL) Checks to see if the supplied server URL is defined in the global configuration.- Parameters:
- serverURL- the server url to check.
- Returns:
- the global configuration for the specified server URL or
         Optional#empty()if not found.
 
- 
lookupEndpointJenkinsRootURL@Deprecated(since="937.0.0", forRemoval=true) @NonNull public static String lookupEndpointJenkinsRootURL(@CheckForNull String serverURL) Deprecated, for removal: This API element is subject to removal in a future version.This value depends on the underlineBitbucketWebhookConfigurationconfigured for the endpoint.Jenkins Server Root URL to be used by the Bitbucket endpoint that matches the given serverURL. The global setting from Jenkins.get().getRootUrl() will be used if this field is null or equals an empty string.- Parameters:
- serverURL- the server url to check.
- Returns:
- the verbatim setting provided by endpoint configuration
 
- 
lookupEndpointpublic static <T extends BitbucketEndpoint> Optional<T> lookupEndpoint(@CheckForNull String serverURL, @NonNull Class<T> clazz) Checks to see if the supplied server URL is defined in the global configuration.- Parameters:
- serverURL- the server url to check.
- clazz- the class to check.
- Returns:
- the global configuration for the specified server URL or
         Optional#empty()if not found.
 
- 
lookupEndpoint@NonNull public static <T extends BitbucketEndpoint> Collection<T> lookupEndpoint(@NonNull EndpointType type) Checks to see if the supplied server URL is defined in the global configuration.- Parameters:
- type- filter of the endpoint to return.
- Returns:
- a collection of endpoints of given type.
 
- 
registerEndpointpublic static BitbucketEndpoint registerEndpoint(@NonNull String name, @NonNull String serverURL, @Nullable UnaryOperator<BitbucketEndpoint> endpointCustomiser) Register a newBitbucketEndpointto the global configuration. The endpoint is created with default values and could be customised by the given endpointCustomiser.The given customiser can also return a different implementation - Parameters:
- name- of the endpoint, alias for label
- serverURL- the bitbucket endpoint URL
- endpointCustomiser- an optional customiser for the created endpoint
- Returns:
- the registered endpoint instance.
 
- 
registerEndpointpublic static BitbucketEndpoint registerEndpoint(@NonNull String name, @NonNull String serverURL, @NonNull BitbucketWebhookConfiguration webhook, @Nullable UnaryOperator<BitbucketEndpoint> endpointCustomiser) Register a newBitbucketEndpointto the global configuration. The endpoint is created with default values and could be customised by the given endpointCustomiser.The given customiser can also return a different implementation - Parameters:
- name- of the endpoint, alias for label
- serverURL- the bitbucket endpoint URL
- webhook- configuration
- endpointCustomiser- an optional customiser for the created endpoint
- Returns:
- the registered endpoint instance.
 
- 
unregisterEndpointRemoves aBitbucketEndpointthat matches the given URl from the global configuration.- Parameters:
- serverURL- the bitbucket endpoint URL
- Returns:
- trueif the endpoint has been removed from the global configuration,- falseotherwise
 
 
- 
BitbucketWebhookConfigurationconfigured for the endpoint.