Class BugzillaRpcSession

java.lang.Object
b4j.core.session.AbstractHttpSession
b4j.core.session.BugzillaRpcSession
All Implemented Interfaces:
Session, IConfigurable

public class BugzillaRpcSession
extends AbstractHttpSession
Accesses Bugzilla via REST.

Please read carefully documentation at Bugzilla::WebService:Bug interface in order to understand what parameters are valid for searching (e.g. "classification" is not allowed as of 4.4).

Since:
2.0
Author:
ralph
  • Field Details

  • Constructor Details

  • Method Details

    • configure

      public void configure​(org.apache.commons.configuration.Configuration config) throws org.apache.commons.configuration.ConfigurationException
      Configuration allows:
      <bugzilla-home>URL</bugzilla-home> - the Bugzilla base URL
      <proxy-host> - HTTP proxy (optional)
      <ProxyAuthorization> - HTTP proxy authentication (optional)
      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class AbstractHttpSession
      Parameters:
      config - - configuration object
      Throws:
      org.apache.commons.configuration.ConfigurationException - - when configuration fails
    • getBaseUrl

      public java.net.URL getBaseUrl()
      Returns the baseUrl.
      Returns:
      the baseUrl
    • setBaseUrl

      public void setBaseUrl​(java.net.URL baseUrl)
      Sets the baseUrl.
      Parameters:
      baseUrl - the baseUrl to set
    • isLoggedIn

      public boolean isLoggedIn()
      Returns true when session is connected to Bugzilla.
      Returns:
      true if session was successfully established, false otherwise
    • open

      public boolean open()
      Opens the session with configured Bugzilla instance.
      Returns:
      true when session could be established successfully, false otherwise
    • createClient

      protected BugzillaClient createClient()
      Creates the BugzillaClient.
      Returns:
      the client created
    • close

      public void close()
      Closes the previously established Bugzilla session.
    • searchBugs

      public java.lang.Iterable<Issue> searchBugs​(SearchData searchData, SearchResultCountCallback callback)
      Performs a search for Bugzilla bugs. This method returns an iterable over all bug records found. Implementations should not perform a query for all actual record data here as callers might not want to retrieve this data. Instead the iterator's next() method of the Iterable should retrieve these details.
      Parameters:
      searchData - - all search parameters
      callback - - a callback object that will retrieve the number of bugs found for this search
      Returns:
      iterable on all bugs fulfilling the criteria expressed by search parameters.
    • getIssue

      public Issue getIssue​(java.lang.String id)
      Returns the given issue
      Parameters:
      id - id of issue
      Returns:
      issue
    • getAttachment

      public java.io.InputStream getAttachment​(Attachment attachment) throws java.io.IOException
      Returns an input stream that will contain the attachment's content. A caller is responsible to close the stream again.
      Parameters:
      attachment - attachment to retrieve.
      Returns:
      the input stream for the attachment itself
      Throws:
      java.io.IOException - when the IO stream cannot be created
    • getMinimumBugzillaVersion

      public java.lang.String getMinimumBugzillaVersion()
      Returns the minimum Bugzilla version this session class supports. Can return null if no lower limits must be enforced.
      Returns:
      minimum version of supported Bugzilla software.
    • getMaximumBugzillaVersion

      public java.lang.String getMaximumBugzillaVersion()
      Returns the maximum Bugzilla version this session class supports. Can return null if no upper limits must be enforced.
      Returns:
      maximum version of supported Bugzilla software.
    • getBugzillaVersion

      public java.lang.String getBugzillaVersion()
      Returns the bugzilla version this session object is connected to. Can return null if version is unknown.
      Returns:
      version number or null if unknown or not connected
    • getClient

      protected BugzillaClient getClient()
      Returns the client.
      Returns:
      the client
      Since:
      2.0.3
    • getServerInfo

      protected ServerInfo getServerInfo()
      Returns the serverInfo.
      Returns:
      the serverInfo
      Since:
      2.0.3