Package com.atlassian.oauth
Class Consumer.InstanceBuilder
java.lang.Object
com.atlassian.oauth.Consumer.InstanceBuilder
- Enclosing class:
Consumer
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs and returns the finalConsumerinstance.Sets the default callback URL used after a request token has been authorized and returnsthisbuilder to allow other attributes to be setdescription(String description) Sets the description of the consumer as it would be displayed to the user and returnsthisbuilder to allow other attributes to be setexecutingTwoLOUser(String executeAsUser) Sets the username for 2LO requests to be executed asthisbuilder to allow other attributes to be setSets thenameattribute of theConsumerobject under construction and returnsthisbuilder to allow other attributes to be setSets thepublicKeyattribute of theConsumerobject under construction and returnsthisbuilder to allow other attributes to be setsignatureMethod(Consumer.SignatureMethod signatureMethod) Sets thesignatureMethodattribute of theConsumerobject under construction and returnsthisbuilder to allow other attributes to be setthreeLOAllowed(boolean threeLOAllowed) Sets whether to allow 3LO requests from consumersthisbuilder to allow other attributes to be settwoLOAllowed(boolean twoLOAllowed) Sets whether to allow 2LO requests from consumersthisbuilder to allow other attributes to be settwoLOImpersonationAllowed(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.
-
Constructor Details
-
InstanceBuilder
-
-
Method Details
-
name
Sets thenameattribute of theConsumerobject under construction and returnsthisbuilder to allow other attributes to be set- Parameters:
name- value to be used as thenameattribute of theConsumerbeing constructed- Returns:
thisbuilder
-
signatureMethod
Sets thesignatureMethodattribute of theConsumerobject under construction and returnsthisbuilder to allow other attributes to be set- Parameters:
signatureMethod-SignatureMethodto be used when signing requests as this consumer- Returns:
thisbuilder
-
publicKey
Sets thepublicKeyattribute of theConsumerobject under construction and returnsthisbuilder to allow other attributes to be set- Parameters:
publicKey- RSAPublicKeyto be used as thepublicKeyattribute of theConsumerbeing constructed- Returns:
thisbuilder
-
description
Sets the description of the consumer as it would be displayed to the user and returnsthisbuilder to allow other attributes to be set- Parameters:
description- the description of the consumer as it would be displayed to the user- Returns:
thisbuilder
-
callback
Sets the default callback URL used after a request token has been authorized and returnsthisbuilder to allow other attributes to be set- Parameters:
callback- the default callback URI used after a request token has been authorized- Returns:
thisbuilder
-
threeLOAllowed
Sets whether to allow 3LO requests from consumersthisbuilder to allow other attributes to be set- Parameters:
threeLOAllowed- whether 3LO requests from the consumer are allowed- Returns:
thisbuilder
-
twoLOAllowed
Sets whether to allow 2LO requests from consumersthisbuilder to allow other attributes to be set- Parameters:
twoLOAllowed- whether 2LO requests from the consumer are allowed- Returns:
thisbuilder
-
executingTwoLOUser
Sets the username for 2LO requests to be executed asthisbuilder to allow other attributes to be set- Parameters:
executeAsUser- the username for 2LO requests to be executed as- Returns:
thisbuilder
-
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.thisbuilder to allow other attributes to be set- Parameters:
twoLOImpersonationAllowed- whether to allow 2LO requests to impersonate any user on the system- Returns:
thisbuilder
-
build
Constructs and returns the finalConsumerinstance.- Returns:
- the final
Consumerinstance
-