com.atlassian.greenhopper.service.api.remote
Interface RemoteLinkConversationService

All Superinterfaces:
GreenHopperCache
All Known Implementing Classes:
RemoteLinkConversationServiceImpl

public interface RemoteLinkConversationService
extends GreenHopperCache

Manages conversation during the remote link creation process.

A conversation associates a token, a user and a status.

The user send a page creation to Confluence request with a JIRA Agile entity to link and a token that identifies the conversation created thanks to startConversation(User). Then Confluences calls our link creation REST endpoints with the token so that we can redeem the stored conversation and create the link on behalf of the user who has initiated the page creation request.

Since:
6.4

Nested Class Summary
static class RemoteLinkConversationService.CreationConversation
          Represents the "conversation" after a creation request.
 
Method Summary
 ServiceOutcome<RemoteLinkConversationService.CreationConversation> getConversation(java.lang.String token)
          Returns the conversation associated with the given token.
 ServiceOutcome<RemoteLinkConversationService.CreationConversation> redeemConversation(java.lang.String token)
          Reddeems the conversation associated with the given token.
 ServiceOutcome<RemoteLinkConversationService.CreationConversation> startConversation(com.atlassian.crowd.embedded.api.User user)
          Starts a new conversation for the logged in user, passes it in the RemoteLinkConversationService.CreationConversation.Status.PENDING state and returns the conversation token.
 
Methods inherited from interface com.atlassian.greenhopper.manager.GreenHopperCache
flushCache
 

Method Detail

startConversation

ServiceOutcome<RemoteLinkConversationService.CreationConversation> startConversation(com.atlassian.crowd.embedded.api.User user)
Starts a new conversation for the logged in user, passes it in the RemoteLinkConversationService.CreationConversation.Status.PENDING state and returns the conversation token.

The conversation is stored for a duration defined by the implementation.

Parameters:
user - the user to start the conversation for
Returns:
the token

redeemConversation

ServiceOutcome<RemoteLinkConversationService.CreationConversation> redeemConversation(java.lang.String token)
Reddeems the conversation associated with the given token.

After calling this method, the conversation is still available in the cache but not redeemable so that we can list the conversations to detect the redeemed ones.

Parameters:
token - the token of the previously created conversation
Returns:
the conversation

getConversation

ServiceOutcome<RemoteLinkConversationService.CreationConversation> getConversation(java.lang.String token)
Returns the conversation associated with the given token. If the token does not match any existing conversation the returned ServiceOutcome will not be valid.

Parameters:
token - the token of the previously created conversation
Returns:
the conversation


Copyright © 2007-2014 Atlassian. All Rights Reserved.