1 /* 2 * Copyright 2002-2006 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.springframework.webflow.conversation; 17 18 /** 19 * A service for managing conversations. This interface is the entry point into 20 * the conversation subsystem. 21 * 22 * @author Keith Donald 23 */ 24 public interface ConversationManager { 25 26 /** 27 * Begin a new conversation. 28 * @param conversationParameters descriptive conversation parameters 29 * @return a service interface allowing access to the conversation context 30 * @throws ConversationException an exception occured 31 */ 32 public Conversation beginConversation(ConversationParameters conversationParameters) throws ConversationException; 33 34 /** 35 * Get the conversation with the provided id. 36 * @param id the conversation id 37 * @return the conversation 38 * @throws NoSuchConversationException the id provided was invalid 39 */ 40 public Conversation getConversation(ConversationId id) throws ConversationException; 41 42 /** 43 * Parse the string-encoded conversationId into its object form. 44 * Essentially, the reverse of {@link ConversationId#toString()}. 45 * @param encodedId the encoded id 46 * @return the parsed conversation id 47 * @throws ConversationException an exception occured parsing the id 48 */ 49 public ConversationId parseConversationId(String encodedId) throws ConversationException; 50 }