Class BitbucketEndpointConfiguration

    • Constructor Detail

      • BitbucketEndpointConfiguration

        public BitbucketEndpointConfiguration()
        Constructor.
    • Method Detail

      • readResolveServerUrl

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        @NonNull
        public String readResolveServerUrl​(@CheckForNull
                                           String bitbucketServerUrl)
        Called from a readResolve() method only to convert the old bitbucketServerUrl field into the new serverUrl field. When called from ACL.SYSTEM this will update the configuration with the missing definitions of resolved URLs.
        Parameters:
        bitbucketServerUrl - the value of the old url field.
        Returns:
        the value of the new url field.
      • isEndpointSelectable

        public boolean isEndpointSelectable()
        Returns true if and only if there is more than one configured endpoint.
        Returns:
        true if and only if there is more than one configured endpoint.
      • setEndpoints

        public void setEndpoints​(@CheckForNull
                                 List<? extends AbstractBitbucketEndpoint> endpoints)
        Sets the list of endpoints.
        Parameters:
        endpoints - the list of endpoints.
      • addEndpoint

        public boolean addEndpoint​(@NonNull
                                   AbstractBitbucketEndpoint endpoint)
        Adds an endpoint.
        Parameters:
        endpoint - the endpoint to add.
        Returns:
        true if the list of endpoints was modified
      • updateEndpoint

        public void updateEndpoint​(@NonNull
                                   AbstractBitbucketEndpoint endpoint)
        Updates an existing endpoint (or adds if missing).
        Parameters:
        endpoint - the endpoint to update.
      • removeEndpoint

        public boolean removeEndpoint​(@NonNull
                                      AbstractBitbucketEndpoint endpoint)
        Removes an endpoint.
        Parameters:
        endpoint - the endpoint to remove.
        Returns:
        true if the list of endpoints was modified
      • removeEndpoint

        public boolean removeEndpoint​(@CheckForNull
                                      String serverUrl)
        Removes an endpoint.
        Parameters:
        serverUrl - the server URL to remove.
        Returns:
        true if the list of endpoints was modified
      • findEndpoint

        @CheckForNull
        public AbstractBitbucketEndpoint findEndpoint​(@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 null if not defined.
      • findEndpoint

        public Optional<AbstractBitbucketEndpoint> findEndpoint​(@CheckForNull
                                                                String serverUrl,
                                                                Class<? extends AbstractBitbucketEndpoint> 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 null if not defined.
      • normalizeServerUrl

        @NonNull
        public static String normalizeServerUrl​(@CheckForNull
                                                String serverUrl)
        Fix a serverUrl.
        Parameters:
        serverUrl - the server URL.
        Returns:
        the normalized server URL.