Class Consumer.InstanceBuilder

java.lang.Object
com.atlassian.oauth.Consumer.InstanceBuilder
Enclosing class:
Consumer

public static final class Consumer.InstanceBuilder extends Object
Builder allowing the optional attributes of the Consumer object under construction to be set and construction of the final Consumer instance. By default a newly created Consumer will have 3LO enabled unless threeLOAllowed(boolean) with 'false' value is called.
  • Constructor Details

    • InstanceBuilder

      public InstanceBuilder(String key)
  • Method Details

    • name

      public Consumer.InstanceBuilder name(String name)
      Sets the name attribute of the Consumer object under construction and returns this builder to allow other attributes to be set
      Parameters:
      name - value to be used as the name attribute of the Consumer being constructed
      Returns:
      this builder
    • signatureMethod

      public Consumer.InstanceBuilder signatureMethod(Consumer.SignatureMethod signatureMethod)
      Sets the signatureMethod attribute of the Consumer object under construction and returns this builder to allow other attributes to be set
      Parameters:
      signatureMethod - SignatureMethod to be used when signing requests as this consumer
      Returns:
      this builder
    • publicKey

      public Consumer.InstanceBuilder publicKey(PublicKey publicKey)
      Sets the publicKey attribute of the Consumer object under construction and returns this builder to allow other attributes to be set
      Parameters:
      publicKey - RSA PublicKey to be used as the publicKey attribute of the Consumer being constructed
      Returns:
      this builder
    • description

      public Consumer.InstanceBuilder description(String description)
      Sets the description of the consumer as it would be displayed to the user and returns this builder to allow other attributes to be set
      Parameters:
      description - the description of the consumer as it would be displayed to the user
      Returns:
      this builder
    • callback

      public Consumer.InstanceBuilder callback(URI callback)
      Sets the default callback URL used after a request token has been authorized and returns this builder to allow other attributes to be set
      Parameters:
      callback - the default callback URI used after a request token has been authorized
      Returns:
      this builder
    • threeLOAllowed

      public Consumer.InstanceBuilder threeLOAllowed(boolean threeLOAllowed)
      Sets whether to allow 3LO requests from consumers this builder to allow other attributes to be set
      Parameters:
      threeLOAllowed - whether 3LO requests from the consumer are allowed
      Returns:
      this builder
    • twoLOAllowed

      public Consumer.InstanceBuilder twoLOAllowed(boolean twoLOAllowed)
      Sets whether to allow 2LO requests from consumers this builder to allow other attributes to be set
      Parameters:
      twoLOAllowed - whether 2LO requests from the consumer are allowed
      Returns:
      this builder
    • executingTwoLOUser

      public Consumer.InstanceBuilder executingTwoLOUser(String executeAsUser)
      Sets the username for 2LO requests to be executed as this builder to allow other attributes to be set
      Parameters:
      executeAsUser - the username for 2LO requests to be executed as
      Returns:
      this builder
    • twoLOImpersonationAllowed

      public Consumer.InstanceBuilder twoLOImpersonationAllowed(boolean twoLOImpersonationAllowed)
      Sets whether to allow 2LO requests to impersonate *any* user on the system Normally this option would be on only for requests from fully-trusted consumers. this builder to allow other attributes to be set
      Parameters:
      twoLOImpersonationAllowed - whether to allow 2LO requests to impersonate any user on the system
      Returns:
      this builder
    • build

      public Consumer build()
      Constructs and returns the finalConsumer instance.
      Returns:
      the final Consumer instance