Package b4j.core

Interface Session

All Superinterfaces:
IConfigurable
All Known Implementing Classes:
AbstractApacheHttpClientSession, AbstractAtlassianHttpClientSession, AbstractHttpSession, AbstractPlainHttpSession, BugzillaHttpSession, BugzillaRpcSession, JiraRpcSession

public interface Session
extends IConfigurable
Represents a Bugzilla session. All interactions are performed through implementations of this interface. Bugzilla sessions could be based on HTTP or MYSQL protocols or any other mean of connection. This is transparent to the application using such a session.

Bugzilla latest version 3 announced an XML-RPC Webservice interface. However, all functions seems to be marked unstable and/or experimental. So no session implementation for that protocol will be delivered yet. The author regards that service as highly welcome as it will support the B4J features in best way.

This interface can be extended in later versions to support GUI-styled interfaces. Future additions might include addBug(), editBug(), listAccounts().

Author:
Ralph Schuster
  • Method Summary

    Modifier and Type Method Description
    void close()
    Closes the previously established Bugzilla session.
    void dump()
    Debug information into log.
    java.io.InputStream getAttachment​(Attachment attachment)
    Returns an input stream that will contain the attachment's content.
    java.lang.String getBugzillaVersion()
    Returns the bugzilla version this session object is connected to.
    Issue getIssue​(java.lang.String id)
    Returns the given issue
    java.lang.String getMaximumBugzillaVersion()
    Returns the maximum Bugzilla version this session class supports.
    java.lang.String getMinimumBugzillaVersion()
    Returns the minimum Bugzilla version this session class supports.
    boolean isLoggedIn()
    Returns true when session is connected to Bugzilla.
    boolean open()
    Opens the session with configured Bugzilla instance.
    java.lang.Iterable<Issue> searchBugs​(SearchData searchData, SearchResultCountCallback callback)
    Performs a search for Bugzilla bugs.

    Methods inherited from interface rs.baselib.configuration.IConfigurable

    configure
  • Method Details

    • isLoggedIn

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

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

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

      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

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

      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
      Since:
      1.3
    • dump

      void dump()
      Debug information into log.
    • getMinimumBugzillaVersion

      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

      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

      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