diff --git a/Generator/generator-botbuilder-java/generators/app/templates/app.java b/Generator/generator-botbuilder-java/generators/app/templates/app.java index 46f2ade6..65584b46 100644 --- a/Generator/generator-botbuilder-java/generators/app/templates/app.java +++ b/Generator/generator-botbuilder-java/generators/app/templates/app.java @@ -109,4 +109,4 @@ public class App { } } -} \ No newline at end of file +} diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/AuthenticationConstants.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/AuthenticationConstants.java index 96f19a3d..b8769b30 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/AuthenticationConstants.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/AuthenticationConstants.java @@ -18,9 +18,9 @@ public final class AuthenticationConstants { public static final String ServiceUrlClaim = "serviceurl"; public static final String VersionClaim = "ver"; public static final String AppIdClaim = "appid"; - /// - /// OAuth Url used to get a token from OAuthApiClient - /// + /** + * OAuth Url used to get a token from OAuthApiClient + */ public static final String OAuthUrl = "https://api.botframework.com"; diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/MicrosoftAppCredentials.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/MicrosoftAppCredentials.java index 6fdfc9b6..6c427cc8 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/MicrosoftAppCredentials.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/MicrosoftAppCredentials.java @@ -95,10 +95,10 @@ public class MicrosoftAppCredentials implements ServiceClientCredentials { return this.GetTokenAsync(false); } - /// - /// Apply the credentials to the HTTP request. - /// - /// The HTTP request.Cancellation token. + /** + * Apply the credentials to the HTTP request. + * @param request The HTTP request. + */ public CompletableFuture ProcessHttpRequestAsync(boolean applyCredentials, String httpVerb, String url) throws InvalidParameterException, IOException, URISyntaxException { return ProcessHttpRequestAsync(applyCredentials, httpVerb, url, null); } diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OAuthClient.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OAuthClient.java index e733cf38..10c85ce5 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OAuthClient.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OAuthClient.java @@ -32,9 +32,9 @@ import static java.net.HttpURLConnection.HTTP_OK; import static java.util.concurrent.CompletableFuture.completedFuture; import static java.util.stream.Collectors.joining; -/// -/// Service client to handle requests to the botframework api service. -/// +/** + * Service client to handle requests to the botframework api service. + */ public class OAuthClient extends ServiceClient { private final ConnectorClientImpl client; private final String uri; @@ -58,15 +58,13 @@ public class OAuthClient extends ServiceClient { this.mapper = new ObjectMapper(); } - /// -/// Get User Token for given user and connection. -/// -/// -/// -/// -/// -/// -/// + /** + * Get User Token for given user and connection. + * @param userId + * @param connectionName + * @param magicCode + * @return + */ public CompletableFuture GetUserTokenAsync(String userId, String connectionName, String magicCode) throws IOException, URISyntaxException, ExecutionException, InterruptedException { return GetUserTokenAsync(userId, connectionName, magicCode, null); } @@ -129,13 +127,12 @@ public class OAuthClient extends ServiceClient { } } - /// - /// Signs Out the User for the given ConnectionName. - /// - /// - /// - /// - /// + /** + * Signs Out the User for the given ConnectionName. + * @param userId + * @param connectionName + * @return + */ public CompletableFuture SignOutUserAsync(String userId, String connectionName) throws URISyntaxException, IOException { if (StringUtils.isEmpty(userId)) { throw new IllegalArgumentException("userId"); @@ -168,13 +165,12 @@ public class OAuthClient extends ServiceClient { } - /// - /// Gets the Link to be sent to the user for signin into the given ConnectionName - /// - /// - /// - /// - /// + /** + * Gets the Link to be sent to the user for signin into the given ConnectionName + * @param activity + * @param connectionName + * @return + */ public CompletableFuture GetSignInLinkAsync(Activity activity, String connectionName) throws IOException, URISyntaxException { if (StringUtils.isEmpty(connectionName)) { throw new IllegalArgumentException("connectionName"); @@ -220,11 +216,11 @@ public class OAuthClient extends ServiceClient { return completedFuture(null); } - /// - /// Send a dummy OAuth card when the bot is being used on the emulator for testing without fetching a real token. - /// - /// - /// + /** + * Send a dummy OAuth card when the bot is being used on the emulator for testing without fetching a real token. + * @param emulateOAuthCards + * @return + */ public CompletableFuture SendEmulateOAuthCardsAsync(Boolean emulateOAuthCards) throws URISyntaxException, IOException { // Construct URL diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OAuthResponse.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OAuthResponse.java index edb25be3..7b589f57 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OAuthResponse.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OAuthResponse.java @@ -8,10 +8,12 @@ import org.joda.time.DateTime; import java.util.HashMap; -/// -/// Member variables to this class follow the RFC Naming conventions -/// "properties" house any "extra" properties that aren't used at the moment. -/// +/** + * + * Member variables to this class follow the RFC Naming conventions + * "properties" house any "extra" properties that aren't used at the moment. + * + */ public class OAuthResponse { diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OpenIdMetadataKey.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OpenIdMetadataKey.java index 29af6527..94982d5d 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OpenIdMetadataKey.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/OpenIdMetadataKey.java @@ -9,4 +9,4 @@ import java.util.List; class OpenIdMetadataKey { RSAPublicKey key; List endorsements; -} \ No newline at end of file +} diff --git a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/ResponseFuture.java b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/ResponseFuture.java index 217ea993..61baa17c 100644 --- a/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/ResponseFuture.java +++ b/libraries/bot-connector/src/main/java/com/microsoft/bot/connector/authentication/ResponseFuture.java @@ -21,4 +21,4 @@ public class ResponseFuture implements Callback { @Override public void onResponse(Call call, Response response) throws IOException { future.complete(response); } -} \ No newline at end of file +} diff --git a/libraries/bot-connector/src/test/java/com/microsoft/bot/connector/BotConnectorTestBase.java b/libraries/bot-connector/src/test/java/com/microsoft/bot/connector/BotConnectorTestBase.java index b7e58403..bc8e41aa 100644 --- a/libraries/bot-connector/src/test/java/com/microsoft/bot/connector/BotConnectorTestBase.java +++ b/libraries/bot-connector/src/test/java/com/microsoft/bot/connector/BotConnectorTestBase.java @@ -28,4 +28,4 @@ public class BotConnectorTestBase extends TestBase { @Override protected void cleanUpResources() { } -} \ No newline at end of file +} diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ActivityImpl.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ActivityImpl.java index 78f95023..6d72633c 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ActivityImpl.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ActivityImpl.java @@ -18,30 +18,30 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; -/// -/// An Activity is the basic communication type for the Bot Framework 3.0 protocol -/// -/// -/// The Activity class contains all properties that individual, more specific activities -/// could contain. It is a superset type. -/// +/** + * An Activity is the basic communication type for the Bot Framework 3.0 protocol + * + * The Activity class contains all properties that individual, more specific activities + * could contain. It is a superset type. + * + */ public class ActivityImpl extends Activity { - /// - /// Content-type for an Activity - /// + /** + * Content-type for an Activity + */ public final String ContentType = "application/vnd.microsoft.activity"; private static final ObjectMapper mapper = new ObjectMapper(); void CustomInit() { } - /// - /// Take a message and create a reply message for it with the routing information - /// set up to correctly route a reply to the source message - /// - /// text you want to reply with - /// language of your reply - /// message set up to route back to the sender + /** + * Take a message and create a reply message for it with the routing information + * set up to correctly route a reply to the source message + * @param text text you want to reply with + * @param locale language of your reply + * @return message set up to route back to the sender + */ public ActivityImpl CreateReply() { return CreateReply(null, null); } @@ -74,14 +74,14 @@ public class ActivityImpl extends Activity { return reply; } - /// -/// Create a trace activity based of this activity -/// -/// Name of the operation -/// value of the operation -/// valueType if helpful to identify the value schema (default is value.GetType().Name) -/// descritive label of context. (Default is calling function name) -/// + /** + * Create a trace activity based of this activity + * @param name Name of the operation + * @param value value of the operation + * @param valueType valueType if helpful to identify the value schema (default is value.GetType().Name) + * @param label descritive label of context. (Default is calling function name) + * @return + */ public TraceActivity CreateTrace(String name) { return CreateTrace(name, null, null, null); } @@ -120,13 +120,13 @@ public class ActivityImpl extends Activity { return reply; } - /// - /// Create an instance of the TraceActivity - /// - /// Name of the operation - /// value of the operation - /// valueType if helpful to identify the value schema (default is value.GetType().Name) - /// descritive label of context. (Default is calling function name) + /** + * Create an instance of the TraceActivity + * @param name Name of the operation + * @param value value of the operation + * @param valueType valueType if helpful to identify the value schema (default is value.GetType().Name) + * @param label descritive label of context. (Default is calling function name) + */ public static TraceActivity CreateTraceActivity(String name, String valueType) { return CreateTraceActivity(name, valueType, null, null); } @@ -147,15 +147,15 @@ public class ActivityImpl extends Activity { } - /// - /// Extension data for overflow of properties - /// + /** + * Extension data for overflow of properties + */ // [JsonExtensionData(ReadData = true, WriteData = true)] //public JObject Properties { get; set; } = new JObject(); - /// - /// Create an instance of the Activity class with IMessageActivity masking - /// + /** + * Create an instance of the Activity class with MessageActivity masking + */ public static MessageActivity CreateMessageActivity() { MessageActivity reply = new MessageActivity(); reply.withType(ActivityTypes.TRACE); @@ -165,18 +165,18 @@ public class ActivityImpl extends Activity { return reply; } - /// - /// Create an instance of the Activity class with IContactRelationUpdateActivity masking - /// + /** + * Create an instance of the Activity class with IContactRelationUpdateActivity masking + */ public static ContactRelationUpdateActivity CreateContactRelationUpdateActivity() { ContactRelationUpdateActivity reply = new ContactRelationUpdateActivity(); reply.withType(ActivityTypes.CONTACT_RELATION_UPDATE); return reply; } - /// - /// Create an instance of the Activity class with IConversationUpdateActivity masking - /// + /** + * Create an instance of the Activity class with IConversationUpdateActivity masking + */ public static ConversationUpdateActivity CreateConversationUpdateActivity() { ConversationUpdateActivity reply = new ConversationUpdateActivity(); reply.withType(ActivityTypes.CONVERSATION_UPDATE); @@ -185,37 +185,37 @@ public class ActivityImpl extends Activity { return reply; } - /// - /// Create an instance of the Activity class with ITypingActivity masking - /// + /** + * Create an instance of the Activity class with ITypingActivity masking + */ //public static TypingActivity CreateTypingActivity() { return new Activity(ActivityTypes.Typing); } - /// - /// Create an instance of the Activity class with IActivity masking - /// + /** + * Create an instance of the Activity class with Activity masking + */ public static Activity CreatePingActivity() { return new Activity().withType(ActivityTypes.PING); } - /// - /// Create an instance of the Activity class with IEndOfConversationActivity masking - /// + /** + * Create an instance of the Activity class with IEndOfConversationActivity masking + */ //public static IEndOfConversationActivity CreateEndOfConversationActivity() { return new Activity(ActivityTypes.EndOfConversation); } - /// - /// Create an instance of the Activity class with an IEventActivity masking - /// + /** + * Create an instance of the Activity class with an IEventActivity masking + */ //public static IEventActivity CreateEventActivity() { return new Activity(ActivityTypes.Event); } - /// - /// Create an instance of the Activity class with IInvokeActivity masking - /// + /** + * Create an instance of the Activity class with IInvokeActivity masking + */ //public static IInvokeActivity CreateInvokeActivity() { return new Activity(ActivityTypes.Invoke); } - /// - /// True if the Activity is of the specified activity type - /// + /** + * True if the Activity is of the specified activity type + */ protected boolean IsActivity(String activityType) { /* * NOTE: While it is possible to come up with a fancy looking "one-liner" to solve @@ -360,86 +360,86 @@ public class ActivityImpl extends Activity { return this; } - /// - /// Return an IMessageActivity mask if this is a message activity - /// + /** + * Return an MessageActivity mask if this is a message activity + */ public MessageActivity AsMessageActivity() { return IsActivity(ActivityTypes.MESSAGE.toString()) ? (MessageActivity) (Activity) this : null; } - /// - /// Return an IContactRelationUpdateActivity mask if this is a contact relation update activity - /// + /** + * Return an ContactRelationUpdateActivity mask if this is a contact relation update activity + */ public ContactRelationUpdateActivity AsContactRelationUpdateActivity() { return IsActivity(ActivityTypes.CONTACT_RELATION_UPDATE.toString()) ? (ContactRelationUpdateActivity) (Activity) this : null; } - /// - /// Return an IInstallationUpdateActivity mask if this is a installation update activity - /// + /** + * Return an InstallationUpdateActivity mask if this is a installation update activity + */ //public InstallationUpdateActivity AsInstallationUpdateActivity() { return IsActivity(ActivityTypes.INSTALLATION_UPDATE.toString()) ? this : null; } - /// - /// Return an IConversationUpdateActivity mask if this is a conversation update activity - /// + /** + * Return an ConversationUpdateActivity mask if this is a conversation update activity + */ //public ConversationUpdateActivity AsConversationUpdateActivity() { return IsActivity(ActivityTypes.ConversationUpdate) ? this : null; } - /// - /// Return an ITypingActivity mask if this is a typing activity - /// + /** + * Return an TypingActivity mask if this is a typing activity + */ // public TypingActivity AsTypingActivity() { return IsActivity(ActivityTypes.TYPING.toString()) ? (TypingActivity)(Activity)this : null; } - /// - /// Return an IEndOfConversationActivity mask if this is an end of conversation activity - /// + /** + * Return an IEndOfConversationActivity mask if this is an end of conversation activity + */ //public IEndOfConversationActivity AsEndOfConversationActivity() { return IsActivity(ActivityTypes.EndOfConversation) ? this : null; } - /// - /// Return an IEventActivity mask if this is an event activity - /// + /** + * Return an IEventActivity mask if this is an event activity + */ //public IEventActivity AsEventActivity() { return IsActivity(ActivityTypes.Event) ? this : null; } - /// - /// Return an IInvokeActivity mask if this is an invoke activity - /// + /** + * Return an IInvokeActivity mask if this is an invoke activity + */ //public IInvokeActivity AsInvokeActivity() { return IsActivity(ActivityTypes.Invoke) ? this : null; } - /// - /// Return an IMessageUpdateAcitvity if this is a MessageUpdate activity - /// - /// + /** + * Return an IMessageUpdateAcitvity if this is a MessageUpdate activity + * @return + */ //public IMessageUpdateActivity AsMessageUpdateActivity() { return IsActivity(ActivityTypes.MessageUpdate) ? this : null; } - /// - /// Return an IMessageDeleteActivity if this is a MessageDelete activity - /// - /// + /** + * Return an IMessageDeleteActivity if this is a MessageDelete activity + * @return + */ //public IMessageDeleteActivity AsMessageDeleteActivity() { return IsActivity(ActivityTypes.MessageDelete) ? this : null; } - /// - /// Return an IMessageReactionActivity if this is a MessageReaction activity - /// - /// + /** + * Return an IMessageReactionActivity if this is a MessageReaction activity + * @return + */ //public IMessageReactionActivity AsMessageReactionActivity() { return IsActivity(ActivityTypes.MessageReaction) ? this : null; } - /// - /// Return an ISuggestionActivity if this is a Suggestion activity - /// - /// + /** + * Return an ISuggestionActivity if this is a Suggestion activity + * @return + */ //public ISuggestionActivity AsSuggestionActivity() { return IsActivity(ActivityTypes.Suggestion) ? this : null; } - /// - /// Return an ITraceActivity if this is a Trace activity - /// - /// + /** + * Return an ITraceActivity if this is a Trace activity + * @return + */ //public ITraceActivity AsTraceActivity() { return IsActivity(ActivityTypes.Trace) ? this : null; } - /// - /// Checks if this (message) activity has content. - /// - /// Returns true, if this message has any content to send. False otherwise. + /** + * Checks if this (message) activity has content. + * @return Returns true, if this message has any content to send. False otherwise. + */ public boolean HasContent() { if (!StringUtils.isBlank(this.text())) return true; @@ -465,11 +465,11 @@ public class ActivityImpl extends Activity { return null; } - /// - /// Resolves the mentions from the entities of this (message) activity. - /// - /// The array of mentions or an empty array, if none found. - /// TODO: Need to see how mentions are formated in the message + /** + * Resolves the mentions from the entities of this (message) activity. + * @return The array of mentions or an empty array, if none found. + * TODO: Need to see how mentions are formated in the message + */ public ArrayList GetMentions() { ArrayList list = null; // (ArrayList) this.entities().stream() @@ -479,12 +479,12 @@ public class ActivityImpl extends Activity { return list; } - /// - /// Get channeldata as typed structure - /// - /// - /// type to use - /// typed Object or default(TypeT) + /** + * Get channeldata as typed structure + * @param activity + * @param TypeT type to use + * @return typed Object or default(TypeT) + */ public TypeT GetChannelData(Class classType) throws JsonProcessingException { if (this.channelData() == null) return null; @@ -496,15 +496,14 @@ public class ActivityImpl extends Activity { return mapper.treeToValue((TreeNode) node, classType); } - /// - /// Get channeldata as typed structure - /// - /// - /// type to use - /// The resulting instance, if possible - /// - /// true if value of was coerceable to , false otherwise. - /// + /** + * Get channeldata as typed structure + * @param activity + * @param TypeT type to use + * @param instance The resulting instance, if possible + * @return + * {@code true} if value of {@linkalso Activity.ChannelData} was coerceable to {@code TypeT}, {@code false} otherwise. + */ public ResultPair TryGetChannelData(Class clsType) { TypeT instance = null; diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ContactRelationUpdateActivity.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ContactRelationUpdateActivity.java index 9dac7aa4..c06848e6 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ContactRelationUpdateActivity.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/ContactRelationUpdateActivity.java @@ -3,9 +3,9 @@ package com.microsoft.bot.schema; import com.microsoft.bot.schema.models.Activity; public class ContactRelationUpdateActivity extends Activity { - /// - /// add|remove - /// + /** + * add|remove + */ private String _action; public String getAction() { @@ -15,4 +15,4 @@ public class ContactRelationUpdateActivity extends Activity { public void setAction(String action) { this._action = action; } -} \ No newline at end of file +} diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/EntityImpl.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/EntityImpl.java index 18d64f73..5b248abc 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/EntityImpl.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/EntityImpl.java @@ -18,32 +18,32 @@ import java.util.Map; public class EntityImpl extends Entity { private ObjectMapper objectMapper = new ObjectMapper(); - /// - /// Initializes a new instance of the Entity class. - /// + /** + * Initializes a new instance of the Entity class. + */ public EntityImpl() { CustomInit(); } - /// - /// Initializes a new instance of the Entity class. - /// - /// Entity Type (typically from schema.org - /// types) + /** + * Initializes a new instance of the Entity class. + * @param type Entity Type (typically from schema.org + * types) + */ public EntityImpl(String type) { this.type = type; CustomInit(); } - /// - /// An initialization method that performs custom operations like setting defaults - /// + /** + * An initialization method that performs custom operations like setting defaults + */ void CustomInit() { } - /// - /// Gets or sets entity Type (typically from schema.org types) - /// + /** + * Gets or sets entity Type (typically from schema.org types) + */ public String type; @@ -66,15 +66,23 @@ public class EntityImpl extends Entity { } - /// + /** + */ - /// Retrieve internal payload. + /** + * Retrieve internal payload. + */ - /// + /** + */ - /// + /** + * @param T + */ - /// + /** + * @return + */ public T GetAs(Class type) { @@ -102,11 +110,11 @@ public class EntityImpl extends Entity { } - /// - /// Set internal payload. - /// - /// - /// + /** + * Set internal payload. + * @param T + * @param obj + */ public boolean SetAs(T obj) { // Serialize diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/TokenExchangeState.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/TokenExchangeState.java index e50a7349..53282efc 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/TokenExchangeState.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/TokenExchangeState.java @@ -3,14 +3,14 @@ package com.microsoft.bot.schema; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.bot.schema.models.ConversationReference; -/// -/// State object passed to the bot token service. -/// +/** + * State object passed to the bot token service. + */ public class TokenExchangeState { - /// - /// The connection name that was used - /// + /** + * The connection name that was used + */ @JsonProperty(value = "connectionName") private String connectionName; public String connectionName() { @@ -21,9 +21,9 @@ public class TokenExchangeState return this; } - /// - /// A reference to the conversation - /// + /** + * A reference to the conversation + */ @JsonProperty(value = "conversation") private ConversationReference conversation; public ConversationReference conversation() { @@ -34,9 +34,9 @@ public class TokenExchangeState return this; } - /// - /// The URL of the bot messaging endpoint - /// + /** + * The URL of the bot messaging endpoint + */ @JsonProperty("botUrl") private String botUrl; public String botUrl() { @@ -47,9 +47,9 @@ public class TokenExchangeState return this; } - /// - /// The bot's registered application ID - /// + /** + * The bot's registered application ID + */ @JsonProperty("msAppId") String msAppId; public String msAppId() { diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/TraceActivity.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/TraceActivity.java index 46049da5..14e0e40b 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/TraceActivity.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/TraceActivity.java @@ -3,13 +3,13 @@ package com.microsoft.bot.schema; import com.microsoft.bot.schema.models.Activity; import com.microsoft.bot.schema.models.ConversationReference; -/// -/// An activity by which a bot can log internal information into a logged conversation transcript -/// +/** + * An activity by which a bot can log internal information into a logged conversation transcript + */ public class TraceActivity extends ActivityImpl { - /// - /// Name of the trace activity - /// + /** + * Name of the trace activity + */ private String _name; public String getName() { @@ -20,9 +20,9 @@ public class TraceActivity extends ActivityImpl { _name = name; } - /// - /// Descriptive label for the trace - /// + /** + * Descriptive label for the trace + */ private String _label; public String getLabel() { @@ -33,9 +33,9 @@ public class TraceActivity extends ActivityImpl { this._label = label; } - /// - /// Unique string which identifies the format of the value object - /// + /** + * Unique string which identifies the format of the value object + */ private String _value_type; public String getValueType() { @@ -46,9 +46,9 @@ public class TraceActivity extends ActivityImpl { _value_type = value_type; } - /// - /// Open-ended value - /// + /** + * Open-ended value + */ private Object _value; Object getValue() { @@ -59,9 +59,9 @@ public class TraceActivity extends ActivityImpl { _value = value; } - /// - /// Reference to another conversation or activity - /// + /** + * Reference to another conversation or activity + */ private ConversationReference _relates_to; ConversationReference getRelatesTo() { diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationReferenceHelper.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationReferenceHelper.java index 145e9235..3d1e0c76 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationReferenceHelper.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationReferenceHelper.java @@ -9,9 +9,9 @@ public class ConversationReferenceHelper { public ConversationReferenceHelper(ConversationReference reference) { this.reference = reference; } - /// - /// Creates from conversation reference as it is posted to bot. - /// + /** + * Creates {@link Activity} from conversation reference as it is posted to bot. + */ public ActivityImpl GetPostToBotMessage() { return (ActivityImpl) new ActivityImpl() @@ -31,9 +31,9 @@ public class ConversationReferenceHelper { .withName(reference.user().name())); } - /// - /// Creates from conversation reference that can be posted to user as reply. - /// + /** + * Creates {@link Activity} from conversation reference that can be posted to user as reply. + */ public ActivityImpl GetPostToUserMessage() { Activity msg = this.GetPostToBotMessage(); diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationUpdateActivity.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationUpdateActivity.java index 5c8d5c6a..09847729 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationUpdateActivity.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/ConversationUpdateActivity.java @@ -5,9 +5,9 @@ package com.microsoft.bot.schema.models; import java.util.List; public class ConversationUpdateActivity extends MessageActivity { - /// - /// Members added to the conversation - /// + /** + * Members added to the conversation + */ private List membersAdded; @Override @@ -20,9 +20,9 @@ public class ConversationUpdateActivity extends MessageActivity { return this; } - /// - /// Members removed from the conversation - /// + /** + * Members removed from the conversation + */ private List membersRemoved; public List membersRemoved() { return this.membersRemoved; @@ -34,9 +34,9 @@ public class ConversationUpdateActivity extends MessageActivity { return this; } - /// - /// The conversation's updated topic name - /// + /** + * The conversation's updated topic name + */ private String topicName; @Override public String topicName() { @@ -49,10 +49,10 @@ public class ConversationUpdateActivity extends MessageActivity { } - /// - /// True if prior history of the channel is disclosed - /// Note: Boolean (class) is used, may be null - /// + /** + * True if prior history of the channel is disclosed + * Note: Boolean (class) is used, may be null + */ private Boolean historyDisclosed; public Boolean historyDisclosed() { return this.historyDisclosed; diff --git a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MessageActivity.java b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MessageActivity.java index 52e214ec..eed35b8a 100644 --- a/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MessageActivity.java +++ b/libraries/botbuilder-schema/src/main/java/com/microsoft/bot/schema/models/MessageActivity.java @@ -10,14 +10,14 @@ import java.time.OffsetDateTime; import java.util.ArrayList; import java.util.List; - /// - /// A message in a conversation - /// + /** + * A message in a conversation + */ public class MessageActivity extends ActivityImpl { - /// - /// The language code of the Text field - /// + /** + * The language code of the Text field + */ private String locale; public String getLocale() { return this.locale; @@ -27,9 +27,9 @@ public class MessageActivity extends ActivityImpl } - /// - /// Content for the message - /// + /** + * Content for the message + */ private String text; public void setText(String text){ this.text = text; @@ -39,9 +39,9 @@ public class MessageActivity extends ActivityImpl return this.text; } - /// - /// Speak tag (SSML markup for text to speech) - /// + /** + * Speak tag (SSML markup for text to speech) + */ private String speak; public void setSpeak(String speak){ this.speak = speak; @@ -50,9 +50,9 @@ public class MessageActivity extends ActivityImpl return this.speak; } - /// - /// Indicates whether the bot is accepting, expecting, or ignoring input - /// + /** + * Indicates whether the bot is accepting, expecting, or ignoring input + */ private String inputHint; public String getInputHint(){ return this.inputHint; @@ -61,9 +61,9 @@ public class MessageActivity extends ActivityImpl this.inputHint = inputHint; } - /// - /// Text to display if the channel cannot render cards - /// + /** + * Text to display if the channel cannot render cards + */ private String summary; public String getSummary(){ return this.summary; @@ -72,9 +72,9 @@ public class MessageActivity extends ActivityImpl this.summary = summary; } - /// - /// Format of text fields [plain|markdown] Default:markdown - /// + /** + * Format of text fields [plain|markdown] Default:markdown + */ private String textFormat; public String getTextFormat() { @@ -84,9 +84,9 @@ public class MessageActivity extends ActivityImpl this.textFormat = textFormat; } - /// - /// Hint for how to deal with multiple attachments: [list|carousel] Default:list - /// + /** + * Hint for how to deal with multiple attachments: [list|carousel] Default:list + */ private String attachmentLayout; public String getAttachmentLayout() { return this.attachmentLayout; @@ -95,9 +95,9 @@ public class MessageActivity extends ActivityImpl this.attachmentLayout = attachmentLayout; } - /// - /// Attachments - /// + /** + * Attachments + */ private List attachments; public List getAttachments() { return this.attachments; @@ -106,9 +106,9 @@ public class MessageActivity extends ActivityImpl this.attachments = attachments; } - /// - /// SuggestedActions are used to express actions for interacting with a card like keyboards/quickReplies - /// + /** + * SuggestedActions are used to express actions for interacting with a card like keyboards/quickReplies + */ private SuggestedActions suggestedActions; public SuggestedActions getSuggestedActions() { return this.suggestedActions; @@ -118,10 +118,10 @@ public class MessageActivity extends ActivityImpl } - /// - /// Importance of the activity - /// Valid values are "low", "normal", and "high". Default value is "normal." - /// + /** + * Importance of the activity + * Valid values are "low", "normal", and "high". Default value is "normal." + */ private String importance; public String getImportance() { return this.importance; @@ -130,12 +130,12 @@ public class MessageActivity extends ActivityImpl this.importance = importance; } - /// - /// Hint to describe how this activity should be delivered. - /// null or "default" = default delivery - /// "notification" = notification semantics - /// See DeliveryModes for current constants - /// + /** + * Hint to describe how this activity should be delivered. + * null or "default" = default delivery + * "notification" = notification semantics + * See DeliveryModes for current constants + */ private String deliveryMode; public String getDeliveryMode() { return this.deliveryMode; @@ -144,9 +144,9 @@ public class MessageActivity extends ActivityImpl this.deliveryMode = deliveryMode; } - /// - /// DateTime to expire the activity as ISO 8601 encoded datetime - /// + /** + * DateTime to expire the activity as ISO 8601 encoded datetime + */ private OffsetDateTime expiration; public OffsetDateTime getExpiration() { return this.expiration; @@ -155,17 +155,17 @@ public class MessageActivity extends ActivityImpl this.expiration = expiration; } - /// - /// Get mentions - /// + /** + * Get mentions + */ private ArrayList mentions; public ArrayList GetMentions() { return this.mentions; } - /// - /// Value provided with CardAction - /// + /** + * Value provided with CardAction + */ private Object value; public Object getValue() { return this.value; @@ -175,9 +175,9 @@ public class MessageActivity extends ActivityImpl } - /// - /// Create an instance of the Activity class with IConversationUpdateActivity masking - /// + /** + * Create an instance of the Activity class with IConversationUpdateActivity masking + */ public static ConversationUpdateActivity CreateConversationUpdateActivity() { ConversationUpdateActivity conversationActivity = new ConversationUpdateActivity(); diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/AnonymousReceiveMiddleware.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/AnonymousReceiveMiddleware.java index 9fc869e6..bf5abcc4 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/AnonymousReceiveMiddleware.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/AnonymousReceiveMiddleware.java @@ -2,19 +2,19 @@ package com.microsoft.bot.builder; import java.util.concurrent.CompletableFuture; -/// -/// Helper class for defining middleware by using a delegate or anonymous method. -/// +/** + * Helper class for defining middleware by using a delegate or anonymous method. + */ public class AnonymousReceiveMiddleware implements Middleware { private MiddlewareCall _toCall; - /// - /// Creates a middleware object that uses the provided method as its - /// process request handler. - /// - /// The method to use as the middleware's process - /// request handler. + /** + * Creates a middleware object that uses the provided method as its + * process request handler. + * @param anonymousMethod The method to use as the middleware's process + * request handler. + */ public AnonymousReceiveMiddleware(MiddlewareCall anonymousMethod) { if (anonymousMethod == null) @@ -23,13 +23,13 @@ public class AnonymousReceiveMiddleware implements Middleware _toCall = anonymousMethod; } - /// - /// Uses the method provided in the to - /// process an incoming activity. - /// - /// The context object for this turn. - /// The delegate to call to continue the bot middleware pipeline. - /// A task that represents the work queued to execute. + /** + * Uses the method provided in the {@link AnonymousReceiveMiddleware} to + * process an incoming activity. + * @param context The context object for this turn. + * @param next The delegate to call to continue the bot middleware pipeline. + * @return A task that represents the work queued to execute. + */ public CompletableFuture OnTurn(TurnContext context, NextDelegate next) throws Exception { return _toCall.requestHandler(context, next); } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotAdapter.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotAdapter.java index db3b33a1..53b093a7 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotAdapter.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotAdapter.java @@ -17,114 +17,113 @@ import java.util.function.Function; import static com.ea.async.Async.await; import static java.util.concurrent.CompletableFuture.completedFuture; -/// -/// Represents a bot adapter that can connect a bot to a service endpoint. -/// This class is abstract. -/// -/// The bot adapter encapsulates authentication processes and sends -/// activities to and receives activities from the Bot Connector Service. When your -/// bot receives an activity, the adapter creates a context object, passes it to your -/// bot's application logic, and sends responses back to the user's channel. -/// Use to add objects -/// to your adapter’s middleware collection. The adapter processes and directs -/// incoming activities in through the bot middleware pipeline to your bot’s logic -/// and then back out again. As each activity flows in and out of the bot, each piece -/// of middleware can inspect or act upon the activity, both before and after the bot -/// logic runs. -/// -/// -/// -/// -/// +/** + * Represents a bot adapter that can connect a bot to a service endpoint. + * This class is abstract. + * The bot adapter encapsulates authentication processes and sends + * activities to and receives activities from the Bot Connector Service. When your + * bot receives an activity, the adapter creates a context object, passes it to your + * bot's application logic, and sends responses back to the user's channel. + *

Use {@link Use(Middleware)} to add {@link Middleware} objects + * to your adapter’s middleware collection. The adapter processes and directs + * incoming activities in through the bot middleware pipeline to your bot’s logic + * and then back out again. As each activity flows in and out of the bot, each piece + * of middleware can inspect or act upon the activity, both before and after the bot + * logic runs.

+ * + * {@linkalso TurnContext} + * {@linkalso Activity} + * {@linkalso Bot} + * {@linkalso Middleware} + */ public abstract class BotAdapter { - /// - /// The collection of middleware in the adapter's pipeline. - /// + /** + * The collection of middleware in the adapter's pipeline. + */ protected final MiddlewareSet _middlewareSet = new MiddlewareSet(); - /// - /// Creates a default adapter. - /// + /** + * Creates a default adapter. + */ public BotAdapter() { super(); } - /// - /// Adds middleware to the adapter's pipeline. - /// - /// The middleware to add. - /// The updated adapter object. - /// Middleware is added to the adapter at initialization time. - /// For each turn, the adapter calls middleware in the order in which you added it. - /// + /** + * Adds middleware to the adapter's pipeline. + * @param middleware The middleware to add. + * @return The updated adapter object. + * Middleware is added to the adapter at initialization time. + * For each turn, the adapter calls middleware in the order in which you added it. + * + */ public BotAdapter Use(Middleware middleware) { _middlewareSet.Use(middleware); return this; } - /// - /// When overridden in a derived class, sends activities to the conversation. - /// - /// The context object for the turn. - /// The activities to send. - /// A task that represents the work queued to execute. - /// If the activities are successfully sent, the task result contains - /// an array of objects containing the IDs that - /// the receiving channel assigned to the activities. - /// + /** + * When overridden in a derived class, sends activities to the conversation. + * @param context The context object for the turn. + * @param activities The activities to send. + * @return A task that represents the work queued to execute. + * If the activities are successfully sent, the task result contains + * an array of {@link ResourceResponse} objects containing the IDs that + * the receiving channel assigned to the activities. + * {@linkalso TurnContext.OnSendActivities(SendActivitiesHandler)} + */ public abstract CompletableFuture SendActivities(TurnContext context, Activity[] activities) throws InterruptedException ; - /// - /// When overridden in a derived class, replaces an existing activity in the - /// conversation. - /// - /// The context object for the turn. - /// New replacement activity. - /// A task that represents the work queued to execute. - /// If the activity is successfully sent, the task result contains - /// a object containing the ID that the receiving - /// channel assigned to the activity. - /// Before calling this, set the ID of the replacement activity to the ID - /// of the activity to replace. - /// + /** + * When overridden in a derived class, replaces an existing activity in the + * conversation. + * @param context The context object for the turn. + * @param activity New replacement activity. + * @return A task that represents the work queued to execute. + * If the activity is successfully sent, the task result contains + * a {@link ResourceResponse} object containing the ID that the receiving + * channel assigned to the activity. + *

Before calling this, set the ID of the replacement activity to the ID + * of the activity to replace.

+ * {@linkalso TurnContext.OnUpdateActivity(UpdateActivityHandler)} + */ public abstract CompletableFuture UpdateActivity(TurnContext context, Activity activity); - /// - /// When overridden in a derived class, deletes an existing activity in the - /// conversation. - /// - /// The context object for the turn. - /// Conversation reference for the activity to delete. - /// A task that represents the work queued to execute. - /// The of the conversation - /// reference identifies the activity to delete. - /// + /** + * When overridden in a derived class, deletes an existing activity in the + * conversation. + * @param context The context object for the turn. + * @param reference Conversation reference for the activity to delete. + * @return A task that represents the work queued to execute. + * The {@link ConversationReference.ActivityId} of the conversation + * reference identifies the activity to delete. + * {@linkalso TurnContext.OnDeleteActivity(DeleteActivityHandler)} + */ public abstract CompletableFuture DeleteActivity(TurnContext context, ConversationReference reference) throws ExecutionException, InterruptedException; - /// - /// Starts activity processing for the current bot turn. - /// - /// The turn's context object. - /// A callback method to run at the end of the pipeline. - /// A cancellation token for the task. - /// A task that represents the work queued to execute. - /// - /// is null. - /// The adapter calls middleware in the order in which you added it. - /// The adapter passes in the context object for the turn and a next delegate, - /// and the middleware calls the delegate to pass control to the next middleware - /// in the pipeline. Once control reaches the end of the pipeline, the adapter calls - /// the method. If a middleware component doesn’t call - /// the next delegate, the adapter does not call any of the subsequent middleware’s - /// - /// methods or the callback method, and the pipeline short circuits. - /// When the turn is initiated by a user activity (reactive messaging), the - /// callback method will be a reference to the bot's - /// method. When the turn is - /// initiated by a call to - /// (proactive messaging), the callback method is the callback method that was provided in the call. - /// + /** + * Starts activity processing for the current bot turn. + * @param context The turn's context object. + * @param callback A callback method to run at the end of the pipeline. + * @return A task that represents the work queued to execute. + * @throws NullPointerException + * {@code context} is null. + * The adapter calls middleware in the order in which you added it. + * The adapter passes in the context object for the turn and a next delegate, + * and the middleware calls the delegate to pass control to the next middleware + * in the pipeline. Once control reaches the end of the pipeline, the adapter calls + * the {@code callback} method. If a middleware component doesn’t call + * the next delegate, the adapter does not call any of the subsequent middleware’s + * {@link Middleware.OnTurn(TurnContext, MiddlewareSet.NextDelegate)} + * methods or the callback method, and the pipeline short circuits. + *

When the turn is initiated by a user activity (reactive messaging), the + * callback method will be a reference to the bot's + * {@link Bot.OnTurn(TurnContext)} method. When the turn is + * initiated by a call to {@link ContinueConversation(ConversationReference, Func{TurnContext, Task})} + * (proactive messaging), the callback method is the callback method that was provided in the call.

+ * + */ protected CompletableFuture RunPipeline(TurnContext context, Function callback) throws Exception { BotAssert.ContextNotNull(context); @@ -142,32 +141,32 @@ public abstract class BotAdapter { } - /// - /// Creates a conversation on the specified channel. - /// - /// The ID of the channel. - /// A method to call when the new conversation is available. - /// A task that represents the work queued to execute. - /// - /// No base implementation is provided. + /** + * Creates a conversation on the specified channel. + * @param channelId The ID of the channel. + * @param callback A method to call when the new conversation is available. + * @return A task that represents the work queued to execute. + * @throws UnsupportedOperationException + * No base implementation is provided. + */ public CompletableFuture CreateConversation(String channelId, Function callback) { throw new UnsupportedOperationException("Adapter does not support CreateConversation with this arguments"); } - /// - /// Sends a proactive message to a conversation. - /// - /// The application ID of the bot. This paramter is ignored in - /// single tenant the Adpters (Console, Test, etc) but is critical to the BotFrameworkAdapter - /// which is multi-tenant aware. - /// A reference to the conversation to continue. - /// The method to call for the resulting bot turn. - /// A task that represents the work queued to execute. - /// Call this method to proactively send a message to a conversation. - /// Most channels require a user to initaiate a conversation with a bot - /// before the bot can send activities to the user. - /// + /** + * Sends a proactive message to a conversation. + * @param botId The application ID of the bot. This paramter is ignored in + * single tenant the Adpters (Console, Test, etc) but is critical to the BotFrameworkAdapter + * which is multi-tenant aware. + * @param reference A reference to the conversation to continue. + * @param callback The method to call for the resulting bot turn. + * @return A task that represents the work queued to execute. + * Call this method to proactively send a message to a conversation. + * Most channels require a user to initaiate a conversation with a bot + * before the bot can send activities to the user. + * {@linkalso RunPipeline(TurnContext, Func{TurnContext, Task})} + */ public CompletableFuture ContinueConversation(String botId, ConversationReference reference, Function callback) throws Exception { ConversationReferenceHelper conv = new ConversationReferenceHelper(reference); diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotAssert.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotAssert.java index cb35b9e5..3643c0f1 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotAssert.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotAssert.java @@ -8,89 +8,89 @@ import com.microsoft.bot.schema.models.ConversationReference; import java.util.ArrayList; -/// -/// Provides methods for debugging Bot Builder code. -/// +/** + * Provides methods for debugging Bot Builder code. + */ public class BotAssert { - /// - /// Checks that an activity object is not null. - /// - /// The activity object. - /// - /// is null. + /** + * Checks that an activity object is not {@code null}. + * @param activity The activity object. + * @throws NullPointerException + * {@code activity} is {@code null}. + */ public static void ActivityNotNull(ActivityImpl activity) { if (activity == null) throw new IllegalArgumentException ("Activity"); } - /// - /// Checks that an activity object is not null. - /// - /// The activity object. - /// - /// is null. + /** + * Checks that an activity object is not {@code null}. + * @param activity The activity object. + * @throws NullPointerException + * {@code activity} is {@code null}. + */ public static void ActivityNotNull(Activity activity) { if (activity == null) throw new IllegalArgumentException ("Activity"); } - /// - /// Checks that a context object is not null. - /// - /// The context object. - /// - /// is null. + /** + * Checks that a context object is not {@code null}. + * @param context The context object. + * @throws NullPointerException + * {@code context} is {@code null}. + */ public static void ContextNotNull(TurnContext context) { if (context == null) throw new IllegalArgumentException ("TurnContext"); } - /// - /// Checks that a conversation reference object is not null. - /// - /// The conversation reference object. - /// - /// is null. + /** + * Checks that a conversation reference object is not {@code null}. + * @param reference The conversation reference object. + * @throws NullPointerException + * {@code reference} is {@code null}. + */ public static void ConversationReferenceNotNull(ConversationReference reference) { if (reference == null) throw new IllegalArgumentException ("ConversationReference"); } - /// - /// Checks that an activity collection is not null. - /// - /// The activities. - /// - /// is null. + /** + * Checks that an activity collection is not {@code null}. + * @param activities The activities. + * @throws NullPointerException + * {@code activities} is {@code null}. + */ public static void ActivityListNotNull(ArrayList activities) { if (activities == null) throw new NullPointerException("List"); } - /// - /// Checks that a middleware object is not null. - /// - /// The middleware object. - /// - /// is null. + /** + * Checks that a middleware object is not {@code null}. + * @param middleware The middleware object. + * @throws NullPointerException + * {@code middleware} is {@code null}. + */ public static void MiddlewareNotNull(Middleware middleware) { if (middleware == null) throw new NullPointerException("Middleware"); } - /// - /// Checks that a middleware collection is not null. - /// - /// The middleware. - /// - /// is null. + /** + * Checks that a middleware collection is not {@code null}. + * @param middleware The middleware. + * @throws NullPointerException + * {@code middleware} is {@code null}. + */ public static void MiddlewareNotNull(ArrayList middleware) { if (middleware == null) diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotFrameworkAdapter.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotFrameworkAdapter.java index 321e6176..779366ec 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotFrameworkAdapter.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotFrameworkAdapter.java @@ -25,24 +25,24 @@ import java.util.function.Function; import static com.ea.async.Async.await; import static java.util.concurrent.CompletableFuture.completedFuture; -/// -/// A bot adapter that can connect a bot to a service endpoint. -/// -/// The bot adapter encapsulates authentication processes and sends -/// activities to and receives activities from the Bot Connector Service. When your -/// bot receives an activity, the adapter creates a context object, passes it to your -/// bot's application logic, and sends responses back to the user's channel. -/// Use to add objects -/// to your adapter’s middleware collection. The adapter processes and directs -/// incoming activities in through the bot middleware pipeline to your bot’s logic -/// and then back out again. As each activity flows in and out of the bot, each piece -/// of middleware can inspect or act upon the activity, both before and after the bot -/// logic runs. -/// -/// -/// -/// -/// +/** + * A bot adapter that can connect a bot to a service endpoint. + * The bot adapter encapsulates authentication processes and sends + * activities to and receives activities from the Bot Connector Service. When your + * bot receives an activity, the adapter creates a context object, passes it to your + * bot's application logic, and sends responses back to the user's channel. + *

Use {@link Use(Middleware)} to add {@link Middleware} objects + * to your adapter’s middleware collection. The adapter processes and directs + * incoming activities in through the bot middleware pipeline to your bot’s logic + * and then back out again. As each activity flows in and out of the bot, each piece + * of middleware can inspect or act upon the activity, both before and after the bot + * logic runs.

+ * + * {@linkalso TurnContext} + * {@linkalso Activity} + * {@linkalso Bot} + * {@linkalso Middleware} + */ public class BotFrameworkAdapter extends BotAdapter { private final CredentialProvider _credentialProvider; @@ -52,20 +52,20 @@ public class BotFrameworkAdapter extends BotAdapter { private final String InvokeReponseKey = "BotFrameworkAdapter.InvokeResponse"; private boolean isEmulatingOAuthCards = false; - /// - /// Initializes a new instance of the class, - /// using a credential provider. - /// - /// The credential provider. - /// Retry strategy for retrying HTTP operations. - /// The HTTP client. - /// The middleware to initially add to the adapter. - /// - /// is null. - /// Use a object to add multiple middleware - /// components in the conustructor. Use the method to - /// add additional middleware to the adapter after construction. - /// + /** + * Initializes a new instance of the {@link BotFrameworkAdapter} class, + * using a credential provider. + * @param credentialProvider The credential provider. + * @param connectorClientRetryStrategy Retry strategy for retrying HTTP operations. + * @param httpClient The HTTP client. + * @param middleware The middleware to initially add to the adapter. + * @throws IllegalArgumentException + * {@code credentialProvider} is {@code null}. + * Use a {@link MiddlewareSet} object to add multiple middleware + * components in the conustructor. Use the {@link Use(Middleware)} method to + * add additional middleware to the adapter after construction. + * + */ public BotFrameworkAdapter(CredentialProvider credentialProvider) { this(credentialProvider, null, null, null); } @@ -90,32 +90,32 @@ public class BotFrameworkAdapter extends BotAdapter { } } - /// - /// Sends a proactive message from the bot to a conversation. - /// - /// The application ID of the bot. This is the appId returned by Portal registration, and is - /// generally found in the "MicrosoftAppId" parameter in appSettings.json. - /// A reference to the conversation to continue. - /// The method to call for the resulting bot turn. - /// A task that represents the work queued to execute. - /// - /// , , or - /// is null. - /// Call this method to proactively send a message to a conversation. - /// Most channels require a user to initaiate a conversation with a bot - /// before the bot can send activities to the user. - /// This method registers the following.services().for the turn. - /// (key = "BotIdentity"), a claims identity for the bot. - /// , the channel connector client to use this turn. - /// - /// - /// This overload differers from the Node implementation by requiring the BotId to be - /// passed in. The .Net code allows multiple bots to be hosted in a single adapter which - /// isn't something supported by Node. - /// - /// - /// - /// + /** + * Sends a proactive message from the bot to a conversation. + * @param botAppId The application ID of the bot. This is the appId returned by Portal registration, and is + * generally found in the "MicrosoftAppId" parameter in appSettings.json. + * @param reference A reference to the conversation to continue. + * @param callback The method to call for the resulting bot turn. + * @return A task that represents the work queued to execute. + * @throws IllegalArgumentException + * {@code botAppId}, {@code reference}, or + * {@code callback} is {@code null}. + * Call this method to proactively send a message to a conversation. + * Most channels require a user to initaiate a conversation with a bot + * before the bot can send activities to the user. + *

This method registers the following.services().for the turn. + * {@link ConnectorClient}, the channel connector client to use this turn. + *

+ *

+ * This overload differers from the Node implementation by requiring the BotId to be + * passed in. The .Net code allows multiple bots to be hosted in a single adapter which + * isn't something supported by Node. + *

+ * + * {@linkalso ProcessActivity(String, Activity, Func{TurnContext, Task})} + * {@linkalso BotAdapter.RunPipeline(TurnContext, Func{TurnContext, Task}} + */ @Override public CompletableFuture ContinueConversation(String botAppId, ConversationReference reference, Function callback) throws Exception { if (StringUtils.isEmpty(botAppId)) @@ -143,19 +143,19 @@ public class BotFrameworkAdapter extends BotAdapter { return completedFuture(null); } - /// - /// Initializes a new instance of the class, - /// using an application ID and secret. - /// - /// The application ID of the bot. - /// The application secret for the bot. - /// Retry policy for retrying HTTP operations. - /// The HTTP client. - /// The middleware to initially add to the adapter. - /// Use a object to add multiple middleware - /// components in the conustructor. Use the method to - /// add additional middleware to the adapter after construction. - /// + /** + * Initializes a new instance of the {@link BotFrameworkAdapter} class, + * using an application ID and secret. + * @param appId The application ID of the bot. + * @param appPassword The application secret for the bot. + * @param connectorClientRetryStrategy Retry policy for retrying HTTP operations. + * @param httpClient The HTTP client. + * @param middleware The middleware to initially add to the adapter. + * Use a {@link MiddlewareSet} object to add multiple middleware + * components in the conustructor. Use the {@link Use(Middleware)} method to + * add additional middleware to the adapter after construction. + * + */ public BotFrameworkAdapter(String appId, String appPassword) { this(appId, appPassword, null, null, null); } @@ -172,42 +172,42 @@ public class BotFrameworkAdapter extends BotAdapter { this(new SimpleCredentialProvider(appId, appPassword), connectorClientRetryStrategy, httpClient, middleware); } - /// - /// Adds middleware to the adapter's pipeline. - /// - /// The middleware to add. - /// The updated adapter object. - /// Middleware is added to the adapter at initialization time. - /// For each turn, the adapter calls middleware in the order in which you added it. - /// + /** + * Adds middleware to the adapter's pipeline. + * @param middleware The middleware to add. + * @return The updated adapter object. + * Middleware is added to the adapter at initialization time. + * For each turn, the adapter calls middleware in the order in which you added it. + * + */ public BotFrameworkAdapter Use(Middleware middleware) { super._middlewareSet.Use(middleware); return this; } - /// - /// Creates a turn context and runs the middleware pipeline for an incoming activity. - /// - /// The HTTP authentication header of the request. - /// The incoming activity. - /// The code to run at the end of the adapter's middleware - /// pipeline. - /// A task that represents the work queued to execute. If the activity type - /// was 'Invoke' and the corresponding key (channelId + activityId) was found - /// then an InvokeResponse is returned, otherwise null is returned. - /// - /// is null. - /// - /// authentication failed. - /// Call this method to reactively send a message to a conversation. - /// This method registers the following.services().for the turn. - /// (key = "BotIdentity"), a claims identity for the bot. - /// , the channel connector client to use this turn. - /// - /// - /// - /// + /** + * Creates a turn context and runs the middleware pipeline for an incoming activity. + * @param authHeader The HTTP authentication header of the request. + * @param activity The incoming activity. + * @param callback The code to run at the end of the adapter's middleware + * pipeline. + * @return A task that represents the work queued to execute. If the activity type + * was 'Invoke' and the corresponding key (channelId + activityId) was found + * then an InvokeResponse is returned, otherwise null is returned. + * @throws IllegalArgumentException + * {@code activity} is {@code null}. + * @throws UnauthorizedAccessException + * authentication failed. + * Call this method to reactively send a message to a conversation. + *

This method registers the following.services().for the turn. + * {@link ConnectorClient}, the channel connector client to use this turn. + *

+ * + * {@linkalso ContinueConversation(String, ConversationReference, Func{TurnContext, Task})} + * {@linkalso BotAdapter.RunPipeline(TurnContext, Func{TurnContext, Task})} + */ public CompletableFuture ProcessActivity(String authHeader, ActivityImpl activity, Function callback) throws Exception { BotAssert.ActivityNotNull(activity); @@ -247,16 +247,16 @@ public class BotFrameworkAdapter extends BotAdapter { } } - /// - /// Sends activities to the conversation. - /// - /// The context object for the turn. - /// The activities to send. - /// A task that represents the work queued to execute. - /// If the activities are successfully sent, the task result contains - /// an array of objects containing the IDs that - /// the receiving channel assigned to the activities. - /// + /** + * Sends activities to the conversation. + * @param context The context object for the turn. + * @param activities The activities to send. + * @return A task that represents the work queued to execute. + * If the activities are successfully sent, the task result contains + * an array of {@link ResourceResponse} objects containing the IDs that + * the receiving channel assigned to the activities. + * {@linkalso TurnContext.OnSendActivities(SendActivitiesHandler)} + */ public CompletableFuture SendActivities(TurnContext context, Activity[] activities) throws InterruptedException { if (context == null) { throw new IllegalArgumentException("context"); @@ -323,18 +323,18 @@ public class BotFrameworkAdapter extends BotAdapter { return completedFuture(responses); } - /// - /// Replaces an existing activity in the conversation. - /// - /// The context object for the turn. - /// New replacement activity. - /// A task that represents the work queued to execute. - /// If the activity is successfully sent, the task result contains - /// a object containing the ID that the receiving - /// channel assigned to the activity. - /// Before calling this, set the ID of the replacement activity to the ID - /// of the activity to replace. - /// + /** + * Replaces an existing activity in the conversation. + * @param context The context object for the turn. + * @param activity New replacement activity. + * @return A task that represents the work queued to execute. + * If the activity is successfully sent, the task result contains + * a {@link ResourceResponse} object containing the ID that the receiving + * channel assigned to the activity. + *

Before calling this, set the ID of the replacement activity to the ID + * of the activity to replace.

+ * {@linkalso TurnContext.OnUpdateActivity(UpdateActivityHandler)} + */ @Override public CompletableFuture UpdateActivity(TurnContext context, Activity activity) { ConnectorClient connectorClient = context.getServices().Get("ConnectorClient"); @@ -343,15 +343,15 @@ public class BotFrameworkAdapter extends BotAdapter { return completedFuture(null); } - /// - /// Deletes an existing activity in the conversation. - /// - /// The context object for the turn. - /// Conversation reference for the activity to delete. - /// A task that represents the work queued to execute. - /// The of the conversation - /// reference identifies the activity to delete. - /// + /** + * Deletes an existing activity in the conversation. + * @param context The context object for the turn. + * @param reference Conversation reference for the activity to delete. + * @return A task that represents the work queued to execute. + * The {@link ConversationReference.ActivityId} of the conversation + * reference identifies the activity to delete. + * {@linkalso TurnContext.OnDeleteActivity(DeleteActivityHandler)} + */ public CompletableFuture DeleteActivity(TurnContext context, ConversationReference reference) { return CompletableFuture.supplyAsync(() -> { ConnectorClientImpl connectorClient = context.getServices().Get("ConnectorClient"); @@ -368,12 +368,12 @@ public class BotFrameworkAdapter extends BotAdapter { }); } - /// - /// Deletes a member from the current conversation - /// - /// The context object for the turn. - /// ID of the member to delete from the conversation - /// + /** + * Deletes a member from the current conversation + * @param context The context object for the turn. + * @param memberId ID of the member to delete from the conversation + * @return + */ public CompletableFuture DeleteConversationMember(TurnContextImpl context, String memberId) { if (context.getActivity().conversation() == null) throw new IllegalArgumentException("BotFrameworkAdapter.deleteConversationMember(): missing conversation"); @@ -390,12 +390,12 @@ public class BotFrameworkAdapter extends BotAdapter { return completedFuture(null); } - /// - /// Lists the members of a given activity. - /// - /// The context object for the turn. - /// (Optional) Activity ID to enumerate. If not specified the current activities ID will be used. - /// List of Members of the activity + /** + * Lists the members of a given activity. + * @param context The context object for the turn. + * @param activityId (Optional) Activity ID to enumerate. If not specified the current activities ID will be used. + * @return List of Members of the activity + */ public CompletableFuture> GetActivityMembers(TurnContextImpl context) { return GetActivityMembers(context, null); } @@ -420,11 +420,11 @@ public class BotFrameworkAdapter extends BotAdapter { return completedFuture(null); } - /// - /// Lists the members of the current conversation. - /// - /// The context object for the turn. - /// List of Members of the current conversation + /** + * Lists the members of the current conversation. + * @param context The context object for the turn. + * @return List of Members of the current conversation + */ public CompletableFuture> GetConversationMembers(TurnContextImpl context) { if (context.getActivity().conversation() == null) throw new IllegalArgumentException("BotFrameworkAdapter.GetActivityMembers(): missing conversation"); @@ -440,22 +440,22 @@ public class BotFrameworkAdapter extends BotAdapter { return completedFuture(null); } - /// - /// Lists the Conversations in which this bot has participated for a given channel server. The - /// channel server returns results in pages and each page will include a `continuationToken` - /// that can be used to fetch the next page of results from the server. - /// - /// The URL of the channel server to query. This can be retrieved - /// from `context.activity.serviceUrl`. - /// The credentials needed for the Bot to connect to the.services(). - /// (Optional) token used to fetch the next page of results - /// from the channel server. This should be left as `null` to retrieve the first page - /// of results. - /// List of Members of the current conversation - /// - /// This overload may be called from outside the context of a conversation, as only the - /// Bot's ServiceUrl and credentials are required. - /// + /** + * Lists the Conversations in which this bot has participated for a given channel server. The + * channel server returns results in pages and each page will include a `continuationToken` + * that can be used to fetch the next page of results from the server. + * @param serviceUrl The URL of the channel server to query. This can be retrieved + * from `context.activity.serviceUrl`. + * @param credentials The credentials needed for the Bot to connect to the.services(). + * @param continuationToken (Optional) token used to fetch the next page of results + * from the channel server. This should be left as `null` to retrieve the first page + * of results. + * @return List of Members of the current conversation + * + * This overload may be called from outside the context of a conversation, as only the + * Bot's ServiceUrl and credentials are required. + * + */ public CompletableFuture GetConversations(String serviceUrl, MicrosoftAppCredentials credentials) throws MalformedURLException, URISyntaxException { return GetConversations(serviceUrl, credentials, null); } @@ -473,21 +473,21 @@ public class BotFrameworkAdapter extends BotAdapter { return completedFuture(null); } - /// - /// Lists the Conversations in which this bot has participated for a given channel server. The - /// channel server returns results in pages and each page will include a `continuationToken` - /// that can be used to fetch the next page of results from the server. - /// - /// The context object for the turn. - /// (Optional) token used to fetch the next page of results - /// from the channel server. This should be left as `null` to retrieve the first page - /// of results. - /// List of Members of the current conversation - /// - /// This overload may be called during standard Activity processing, at which point the Bot's - /// service URL and credentials that are part of the current activity processing pipeline - /// will be used. - /// + /** + * Lists the Conversations in which this bot has participated for a given channel server. The + * channel server returns results in pages and each page will include a `continuationToken` + * that can be used to fetch the next page of results from the server. + * @param context The context object for the turn. + * @param continuationToken (Optional) token used to fetch the next page of results + * from the channel server. This should be left as `null` to retrieve the first page + * of results. + * @return List of Members of the current conversation + * + * This overload may be called during standard Activity processing, at which point the Bot's + * service URL and credentials that are part of the current activity processing pipeline + * will be used. + * + */ public CompletableFuture GetConversations(TurnContextImpl context) { return GetConversations(context, null); } @@ -500,12 +500,13 @@ public class BotFrameworkAdapter extends BotAdapter { } - /// Attempts to retrieve the token for a user that's in a login flow. - /// - /// Context for the current turn of conversation with the user. - /// Name of the auth connection to use. - /// (Optional) Optional user entered code to validate. - /// Token Response + /** + * Attempts to retrieve the token for a user that's in a login flow. + * @param context Context for the current turn of conversation with the user. + * @param connectionName Name of the auth connection to use. + * @param magicCode (Optional) Optional user entered code to validate. + * @return Token Response + */ public CompletableFuture GetUserToken(TurnContextImpl context, String connectionName, String magicCode) { BotAssert.ContextNotNull(context); if (context.getActivity().from() == null || StringUtils.isEmpty(context.getActivity().from().id())) @@ -519,12 +520,12 @@ public class BotFrameworkAdapter extends BotAdapter { return completedFuture(null); } - /// - /// Get the raw signin link to be sent to the user for signin for a connection name. - /// - /// Context for the current turn of conversation with the user. - /// Name of the auth connection to use. - /// + /** + * Get the raw signin link to be sent to the user for signin for a connection name. + * @param context Context for the current turn of conversation with the user. + * @param connectionName Name of the auth connection to use. + * @return + */ public CompletableFuture GetOauthSignInLink(TurnContextImpl context, String connectionName) { BotAssert.ContextNotNull(context); if (StringUtils.isEmpty(connectionName)) @@ -535,12 +536,12 @@ public class BotFrameworkAdapter extends BotAdapter { return completedFuture(null); } - /// - /// Signs the user out with the token server. - /// - /// Context for the current turn of conversation with the user. - /// Name of the auth connection to use. - /// + /** + * Signs the user out with the token server. + * @param context Context for the current turn of conversation with the user. + * @param connectionName Name of the auth connection to use. + * @return + */ public CompletableFuture SignOutUser(TurnContextImpl context, String connectionName) { BotAssert.ContextNotNull(context); if (StringUtils.isEmpty(connectionName)) @@ -551,26 +552,26 @@ public class BotFrameworkAdapter extends BotAdapter { return completedFuture(null); } - /// - /// Creates a conversation on the specified channel. - /// - /// The ID for the channel. - /// The channel's service URL endpoint. - /// The application credentials for the bot. - /// The conversation information to use to - /// create the conversation. - /// The method to call for the resulting bot turn. - /// A task that represents the work queued to execute. - /// To start a conversation, your bot must know its account information - /// and the user's account information on that channel. - /// Most channels only support initiating a direct message (non-group) conversation. - /// The adapter attempts to create a new conversation on the channel, and - /// then sends a conversationUpdate activity through its middleware pipeline - /// to the method. - /// If the conversation is established with the - /// specified users, the ID of the activity's - /// will contain the ID of the new conversation. - /// + /** + * Creates a conversation on the specified channel. + * @param channelId The ID for the channel. + * @param serviceUrl The channel's service URL endpoint. + * @param credentials The application credentials for the bot. + * @param conversationParameters The conversation information to use to + * create the conversation. + * @param callback The method to call for the resulting bot turn. + * @return A task that represents the work queued to execute. + * To start a conversation, your bot must know its account information + * and the user's account information on that channel. + * Most channels only support initiating a direct message (non-group) conversation. + *

The adapter attempts to create a new conversation on the channel, and + * then sends a {@code conversationUpdate} activity through its middleware pipeline + * to the {@code callback} method.

+ *

If the conversation is established with the + * specified users, the ID of the activity's {@link Activity.Conversation} + * will contain the ID of the new conversation.

+ * + */ public CompletableFuture CreateConversation(String channelId, String serviceUrl, MicrosoftAppCredentials credentials, ConversationParameters conversationParameters, Function callback) throws Exception { // Validate serviceUrl - can throw @@ -651,13 +652,13 @@ public class BotFrameworkAdapter extends BotAdapter { return new OAuthClient(client, AuthenticationConstants.OAuthUrl); } - /// - /// Creates the connector client asynchronous. - /// - /// The service URL. - /// The claims identity. - /// ConnectorClient instance. - /// ClaimsIdemtity cannot be null. Pass Anonymous ClaimsIdentity if authentication is turned off. + /** + * Creates the connector client asynchronous. + * @param serviceUrl The service URL. + * @param claimsIdentity The claims identity. + * @return ConnectorClient instance. + * @throws UnsupportedOperationException ClaimsIdemtity cannot be null. Pass Anonymous ClaimsIdentity if authentication is turned off. + */ private CompletableFuture CreateConnectorClientAsync(String serviceUrl, ClaimsIdentity claimsIdentity) { return CompletableFuture.supplyAsync(() -> { @@ -720,12 +721,12 @@ public class BotFrameworkAdapter extends BotAdapter { } - /// - /// Creates the connector client. - /// - /// The service URL. - /// The application credentials for the bot. - /// Connector client instance. + /** + * Creates the connector client. + * @param serviceUrl The service URL. + * @param appCredentials The application credentials for the bot. + * @return Connector client instance. + */ private ConnectorClient CreateConnectorClient(String serviceUrl) throws MalformedURLException, URISyntaxException { return CreateConnectorClient(serviceUrl, null); } @@ -749,12 +750,12 @@ public class BotFrameworkAdapter extends BotAdapter { } - /// - /// Gets the application credentials. App Credentials are cached so as to ensure we are not refreshing - /// token everytime. - /// - /// The application identifier (AAD Id for the bot). - /// App credentials. + /** + * Gets the application credentials. App Credentials are cached so as to ensure we are not refreshing + * token everytime. + * @param appId The application identifier (AAD Id for the bot). + * @return App credentials. + */ private CompletableFuture GetAppCredentialsAsync(String appId) { CompletableFuture result = CompletableFuture.supplyAsync(() -> { if (appId == null) { diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotState.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotState.java index ba3a66e4..fdcac760 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotState.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/BotState.java @@ -15,11 +15,11 @@ import java.util.stream.StreamSupport; import static com.ea.async.Async.await; import static java.util.concurrent.CompletableFuture.completedFuture; -/// -/// Abstract Base class which manages details of automatic loading and saving of bot state. -/// -/// The type of the bot state object. -//public class BotState : IMiddleware +/** + * Abstract Base class which manages details of automatic loading and saving of bot state. + * @param TState The type of the bot state object. + */ +//public class BotState : Middleware // where TState : class, new() public class BotState implements Middleware { @@ -30,12 +30,12 @@ public class BotState implements Middleware private final String propertyName; private final Supplier ctor; - /// - /// Creates a new middleware object. - /// - /// The name to use to load or save the state object. - /// The storage provider to use. - /// The state persistance options to use. + /** + * Creates a new {@link BotState{TState}} middleware object. + * @param name The name to use to load or save the state object. + * @param storage The storage provider to use. + * @param settings The state persistance options to use. + */ public BotState(Storage storage, String propertyName, Function keyDelegate, Supplier ctor) { this(storage, propertyName, keyDelegate, ctor, null); } @@ -63,15 +63,15 @@ public class BotState implements Middleware } - /// - /// Processess an incoming activity. - /// - /// The context object for this turn. - /// The delegate to call to continue the bot middleware pipeline. - /// A task that represents the work queued to execute. - /// This middleware loads the state object on the leading edge of the middleware pipeline - /// and persists the state object on the trailing edge. - /// + /** + * Processess an incoming activity. + * @param context The context object for this turn. + * @param next The delegate to call to continue the bot middleware pipeline. + * @return A task that represents the work queued to execute. + * This middleware loads the state object on the leading edge of the middleware pipeline + * and persists the state object on the trailing edge. + * + */ public CompletableFuture OnTurn(TurnContext context, NextDelegate next) throws Exception { await(ReadToContextService(context)); await(next.next()); @@ -116,11 +116,11 @@ public class BotState implements Middleware return completedFuture(await(Write(context, state))); } - /// - /// Reads state from storage. - /// - /// The type of the bot state object. - /// The context object for this turn. + /** + * Reads state from storage. + * @param TState The type of the bot state object. + * @param context The context object for this turn. + */ public CompletableFuture Read(TurnContext context) throws JsonProcessingException { String key = this.keyDelegate.apply(context); Map items = await( storage.Read(new String[] { key })); @@ -136,11 +136,11 @@ public class BotState implements Middleware return completedFuture(state); } - /// - /// Writes state to storage. - /// - /// The context object for this turn. - /// The state object. + /** + * Writes state to storage. + * @param context The context object for this turn. + * @param state The state object. + */ public CompletableFuture Write(TurnContext context, TState state) throws Exception { HashMap changes = new HashMap(); //List> changes = new ArrayList>(); diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/CatchExceptionMiddleware.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/CatchExceptionMiddleware.java index 863550f9..caca1803 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/CatchExceptionMiddleware.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/CatchExceptionMiddleware.java @@ -7,17 +7,16 @@ import java.util.concurrent.CompletableFuture; import static com.ea.async.Async.await; import static java.util.concurrent.CompletableFuture.completedFuture; -/// -/// This piece of middleware can be added to allow you to handle exceptions when they are thrown -/// within your bot's code or middleware further down the pipeline. Using this handler you might -/// send an appropriate message to the user to let them know that something has gone wrong. -/// You can specify the type of exception the middleware should catch and this middleware can be added -/// multiple times to allow you to handle different exception types in different ways. -/// -/// -/// The type of the exception that you want to catch. This can be 'Exception' to -/// catch all or a specific type of exception -/// +/** + * This piece of middleware can be added to allow you to handle exceptions when they are thrown + * within your bot's code or middleware further down the pipeline. Using this handler you might + * send an appropriate message to the user to let them know that something has gone wrong. + * You can specify the type of exception the middleware should catch and this middleware can be added + * multiple times to allow you to handle different exception types in different ways. + * @param T + * The type of the exception that you want to catch. This can be 'Exception' to + * catch all or a specific type of exception + */ public class CatchExceptionMiddleware implements Middleware { private final CallOnException _handler; private final Class _exceptionType; diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/ConversationState.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/ConversationState.java index 2cebdf25..67234b10 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/ConversationState.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/ConversationState.java @@ -4,15 +4,15 @@ import com.microsoft.bot.builder.TurnContext; import java.util.function.Supplier; -/// -/// Handles persistence of a conversation state object using the conversation ID as part of the key. -/// -/// The type of the conversation state object. +/** + * Handles persistence of a conversation state object using the conversation ID as part of the key. + * @param TState The type of the conversation state object. + */ public class ConversationState extends BotState { - /// - /// The key to use to read and write this conversation state object to storage. - /// + /** + * The key to use to read and write this conversation state object to storage. + */ // // Note: Hard coded to maintain compatibility with C# // "ConversationState:{typeof(ConversationState).Namespace}.{typeof(ConversationState).Name}" @@ -20,11 +20,11 @@ public class ConversationState extends BotState return String.format("ConversationState:Microsoft.Bot.Builder.Core.Extensions.ConversationState`1"); } - /// - /// Creates a new object. - /// - /// The storage provider to use. - /// The state persistance options to use. + /** + * Creates a new {@link ConversationState{TState}} object. + * @param storage The storage provider to use. + * @param settings The state persistance options to use. + */ public ConversationState(Storage storage, Supplier ctor) { this(storage, null, ctor); } @@ -38,11 +38,11 @@ public class ConversationState extends BotState settings); } - /// - /// Gets the conversation state object from turn context. - /// - /// The context object for this turn. - /// The coversation state object. + /** + * Gets the conversation state object from turn context. + * @param context The context object for this turn. + * @return The coversation state object. + */ public static TState Get(TurnContext context) throws IllegalArgumentException { return context.getServices().Get(PropertyName()); } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/DeleteActivityHandler.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/DeleteActivityHandler.java index 48064812..c55767b2 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/DeleteActivityHandler.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/DeleteActivityHandler.java @@ -5,23 +5,23 @@ import com.microsoft.bot.schema.models.ConversationReference; import java.util.concurrent.Callable; import java.util.concurrent.CompletableFuture; -/// -/// A method that can participate in delete activity events for the current turn. -/// -/// The context object for the turn. -/// The conversation containing the activity. -/// The delegate to call to continue event processing. -/// A task that represents the work queued to execute. -/// A handler calls the delegate to pass control to -/// the next registered handler. If a handler doesn’t call the next delegate, -/// the adapter does not call any of the subsequent handlers and does not delete the -///activity. -/// The conversation reference's -/// indicates the activity in the conversation to replace. -/// -/// -/// -/// +/** + * A method that can participate in delete activity events for the current turn. + * @param context The context object for the turn. + * @param reference The conversation containing the activity. + * @param next The delegate to call to continue event processing. + * @return A task that represents the work queued to execute. + * A handler calls the {@code next} delegate to pass control to + * the next registered handler. If a handler doesn’t call the next delegate, + * the adapter does not call any of the subsequent handlers and does not delete the + *activity. + *

The conversation reference's {@link ConversationReference.ActivityId} + * indicates the activity in the conversation to replace.

+ * + * {@linkalso BotAdapter} + * {@linkalso SendActivitiesHandler} + * {@linkalso UpdateActivityHandler} + */ @FunctionalInterface public interface DeleteActivityHandler { CompletableFuture handle(TurnContext context, ConversationReference reference, Callable next); diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/InvokeResponse.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/InvokeResponse.java index 4fbbf187..accec9cf 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/InvokeResponse.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/InvokeResponse.java @@ -1,16 +1,16 @@ package com.microsoft.bot.builder; -/// -/// Tuple class containing an HTTP Status Code and a JSON Serializable -/// object. The HTTP Status code is, in the invoke activity scenario, what will -/// be set in the resulting POST. The Body of the resulting POST will be -/// the JSON Serialized content from the Body property. -/// +/** + * Tuple class containing an HTTP Status Code and a JSON Serializable + * object. The HTTP Status code is, in the invoke activity scenario, what will + * be set in the resulting POST. The Body of the resulting POST will be + * the JSON Serialized content from the Body property. + */ public class InvokeResponse { - /// - /// The POST that is generated in response to the incoming Invoke Activity - /// will have the HTTP Status code specificied by this field. - /// + /** + * The POST that is generated in response to the incoming Invoke Activity + * will have the HTTP Status code specificied by this field. + */ private int _status; public int getStatus() { @@ -21,10 +21,10 @@ public class InvokeResponse { this._status = status; } - /// - /// The POST that is generated in response to the incoming Invoke Activity - /// will have a body generated by JSON serializing the object in the Body field. - /// + /** + * The POST that is generated in response to the incoming Invoke Activity + * will have a body generated by JSON serializing the object in the Body field. + */ private Object _body; public Object getBody() { diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/Middleware.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/Middleware.java index ca401da7..34ec8483 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/Middleware.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/Middleware.java @@ -4,54 +4,54 @@ package com.microsoft.bot.builder; import java.util.concurrent.CompletableFuture; -/// -/// Represents middleware that can operate on incoming activities. -/// -/// A passes incoming activities from the user's -/// channel to the middleware's -/// method. -/// You can add middleware objects to your adapter’s middleware collection. The -/// adapter processes and directs incoming activities in through the bot middleware -/// pipeline to your bot’s logic and then back out again. As each activity flows in -/// and out of the bot, each piece of middleware can inspect or act upon the activity, -/// both before and after the bot logic runs. -/// For each activity, the adapter calls middleware in the order in which you -/// added it. -/// -/// -/// This defines middleware that sends "before" and "after" messages -/// before and after the adapter calls the bot's -/// method. -/// -/// public class SampleMiddleware : IMiddleware -/// { -/// public async Task OnTurn(ITurnContext context, MiddlewareSet.NextDelegate next) -/// { -/// context.SendActivity("before"); -/// await next().ConfigureAwait(false); -/// context.SendActivity("after"); -/// } -/// } -/// -/// -/// +/** + * Represents middleware that can operate on incoming activities. + * A {@link BotAdapter} passes incoming activities from the user's + * channel to the middleware's {@link OnTurn(TurnContext, NextDelegate)} + * method. + *

You can add middleware objects to your adapter’s middleware collection. The + * adapter processes and directs incoming activities in through the bot middleware + * pipeline to your bot’s logic and then back out again. As each activity flows in + * and out of the bot, each piece of middleware can inspect or act upon the activity, + * both before and after the bot logic runs.

+ *

For each activity, the adapter calls middleware in the order in which you + * added it.

+ * + * + * This defines middleware that sends "before" and "after" messages + * before and after the adapter calls the bot's + * {@link Bot.OnTurn(TurnContext)} method. + * + * public class SampleMiddleware : Middleware + * { + * public async Task OnTurn(TurnContext context, MiddlewareSet.NextDelegate next) + * { + * context.SendActivity("before"); + * await next().ConfigureAwait(false); + * context.SendActivity("after"); + * } + * } + * + * + * {@linkalso Bot} + */ public interface Middleware { - /// - /// Processess an incoming activity. - /// - /// The context object for this turn. - /// The delegate to call to continue the bot middleware pipeline. - /// A task that represents the work queued to execute. - /// Middleware calls the delegate to pass control to - /// the next middleware in the pipeline. If middleware doesn’t call the next delegate, - /// the adapter does not call any of the subsequent middleware’s request handlers or the - /// bot’s receive handler, and the pipeline short circuits. - /// The provides information about the - /// incoming activity, and other data needed to process the activity. - /// - /// - /// + /** + * Processess an incoming activity. + * @param context The context object for this turn. + * @param next The delegate to call to continue the bot middleware pipeline. + * @return A task that represents the work queued to execute. + * Middleware calls the {@code next} delegate to pass control to + * the next middleware in the pipeline. If middleware doesn’t call the next delegate, + * the adapter does not call any of the subsequent middleware’s request handlers or the + * bot’s receive handler, and the pipeline short circuits. + *

The {@code context} provides information about the + * incoming activity, and other data needed to process the activity.

+ * + * {@linkalso TurnContext} + * {@linkalso Bot.Schema.Activity} + */ CompletableFuture OnTurn(TurnContext context, NextDelegate next) throws Exception; } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/MiddlewareSet.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/MiddlewareSet.java index 1c4940f2..35938d07 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/MiddlewareSet.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/MiddlewareSet.java @@ -52,11 +52,11 @@ public class MiddlewareSet implements Middleware return null; } - /// - /// Intended to be called from Bot, this method performs exactly the same as the - /// standard ReceiveActivity, except that it runs a user-defined delegate returns - /// if all Middleware in the receive pipeline was run. - /// + /** + * Intended to be called from Bot, this method performs exactly the same as the + * standard ReceiveActivity, except that it runs a user-defined delegate returns + * if all Middleware in the receive pipeline was run. + */ public CompletableFuture ReceiveActivityWithStatus(TurnContext context, Function callback) throws Exception { return ReceiveActivityInternal(context, callback); diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/SendActivitiesHandler.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/SendActivitiesHandler.java index f146f0d8..133f9e1f 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/SendActivitiesHandler.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/SendActivitiesHandler.java @@ -12,4 +12,4 @@ import java.util.concurrent.CompletableFuture; public interface SendActivitiesHandler { CompletableFuture handle(TurnContext context, List activities, Callable> next); } -// public delegate CompletableFuture SendActivitiesHandler(ITurnContext context, List activities, Func> next); +// public delegate CompletableFuture SendActivitiesHandler(TurnContext context, List activities, Func> next); diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StateTurnContextExtensions.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StateTurnContextExtensions.java index b7827d1f..7d49fe56 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StateTurnContextExtensions.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StateTurnContextExtensions.java @@ -4,28 +4,28 @@ import com.microsoft.bot.builder.ConversationState; import com.microsoft.bot.builder.TurnContext; import com.microsoft.bot.builder.UserState; -/// -/// Provides helper methods for getting state objects from the turn context. -/// +/** + * Provides helper methods for getting state objects from the turn context. + */ public class StateTurnContextExtensions { - /// - /// Gets a conversation state object from the turn context. - /// - /// The type of the state object to get. - /// The context object for this turn. - /// The state object. + /** + * Gets a conversation state object from the turn context. + * @param TState The type of the state object to get. + * @param context The context object for this turn. + * @return The state object. + */ public static TState GetConversationState(TurnContext context) throws IllegalArgumentException { return ConversationState.Get(context); } - /// - /// Gets a user state object from the turn context. - /// - /// The type of the state object to get. - /// The context object for this turn. - /// The state object. + /** + * Gets a user state object from the turn context. + * @param TState The type of the state object to get. + * @param context The context object for this turn. + * @return The state object. + */ public static TState GetUserState(TurnContext context) throws IllegalArgumentException { return UserState.Get(context); } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/Storage.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/Storage.java index c96b6724..c1b8df39 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/Storage.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/Storage.java @@ -11,23 +11,23 @@ import java.util.concurrent.CompletableFuture; public interface Storage { - /// - /// Read StoreItems from storage - /// - /// keys of the storeItems to read - /// StoreItem dictionary + /** + * Read StoreItems from storage + * @param keys keys of the storeItems to read + * @return StoreItem dictionary + */ CompletableFuture> Read(String... keys) throws JsonProcessingException; - /// - /// Write StoreItems to storage - /// - /// + /** + * Write StoreItems to storage + * @param changes + */ CompletableFuture Write(Map changes) throws Exception; - /// - /// Delete StoreItems from storage - /// - /// keys of the storeItems to delete + /** + * Delete StoreItems from storage + * @param keys keys of the storeItems to delete + */ CompletableFuture Delete(String... keys); } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StorageExtensions.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StorageExtensions.java index 0737c9f2..b29bc642 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StorageExtensions.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StorageExtensions.java @@ -12,13 +12,13 @@ import static com.ea.async.Async.await; public class StorageExtensions { - /// - /// Storage extension to Read as strong typed StoreItem objects - /// - /// - /// - /// - /// + /** + * Storage extension to Read as strong typed StoreItem objects + * @param StoreItemT + * @param storage + * @param keys + * @return + */ @SuppressWarnings("unchecked") public static CompletableFuture> Read(Storage storage, String... keys) throws JsonProcessingException { Map storeItems = await(storage.Read(keys)); diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StoreItem.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StoreItem.java index d72f124b..14a4b24b 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StoreItem.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/StoreItem.java @@ -2,9 +2,9 @@ package com.microsoft.bot.builder; public interface StoreItem { - /// - /// eTag for concurrency - /// + /** + * eTag for concurrency + */ String geteTag(); void seteTag(String eTag); diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContext.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContext.java index 7a0b2095..d6f2e742 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContext.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContext.java @@ -2,21 +2,21 @@ // Licensed under the MIT License. package com.microsoft.bot.builder; -/// -/// A method that can participate in send activity events for the current turn. -/// -/// The context object for the turn. -/// The activities to send. -/// The delegate to call to continue event processing. -/// A task that represents the work queued to execute. -/// A handler calls the delegate to pass control to -/// the next registered handler. If a handler doesn’t call the next delegate, -/// the adapter does not call any of the subsequent handlers and does not send the -/// . -/// -/// -/// -/// +/** + * A method that can participate in send activity events for the current turn. + * @param context The context object for the turn. + * @param activities The activities to send. + * @param next The delegate to call to continue event processing. + * @return A task that represents the work queued to execute. + * A handler calls the {@code next} delegate to pass control to + * the next registered handler. If a handler doesn’t call the next delegate, + * the adapter does not call any of the subsequent handlers and does not send the + * {@code activities}. + * + * {@linkalso BotAdapter} + * {@linkalso UpdateActivityHandler} + * {@linkalso DeleteActivityHandler} + */ import com.microsoft.bot.schema.ActivityImpl; import com.microsoft.bot.schema.models.Activity; @@ -25,147 +25,147 @@ import com.microsoft.bot.schema.models.ResourceResponse; import java.util.concurrent.CompletableFuture; -//public delegate Task DeleteActivityHandler(ITurnContext context, ConversationReference reference, Func next); +//public delegate Task DeleteActivityHandler(TurnContext context, ConversationReference reference, Func next); -/// -/// Provides context for a turn of a bot. -/// -/// Context provides information needed to process an incoming activity. -/// The context object is created by a and persists for the -/// length of the turn. -/// -/// +/** + * Provides context for a turn of a bot. + * Context provides information needed to process an incoming activity. + * The context object is created by a {@link BotAdapter} and persists for the + * length of the turn. + * {@linkalso Bot} + * {@linkalso Middleware} + */ public interface TurnContext { - /// - /// Gets the bot adapter that created this context object. - /// + /** + * Gets the bot adapter that created this context object. + */ BotAdapter getAdapter(); - /// - /// Gets the services registered on this context object. - /// + /** + * Gets the services registered on this context object. + */ TurnContextServiceCollection getServices(); - /// - /// Incoming request - /// + /** + * Incoming request + */ Activity getActivity(); - /// - /// Indicates whether at least one response was sent for the current turn. - /// - /// true if at least one response was sent for the current turn. + /** + * Indicates whether at least one response was sent for the current turn. + * @return {@code true} if at least one response was sent for the current turn. + */ boolean getResponded(); void setResponded(boolean responded); - /// - /// Sends a message activity to the sender of the incoming activity. - /// - /// The text of the message to send. - /// Optional, text to be spoken by your bot on a speech-enabled - /// channel. - /// Optional, indicates whether your bot is accepting, - /// expecting, or ignoring user input after the message is delivered to the client. - /// One of: "acceptingInput", "ignoringInput", or "expectingInput". - /// Default is "acceptingInput". - /// A task that represents the work queued to execute. - /// If the activity is successfully sent, the task result contains - /// a object containing the ID that the receiving - /// channel assigned to the activity. - /// See the channel's documentation for limits imposed upon the contents of - /// . - /// To control various characteristics of your bot's speech such as voice, - /// rate, volume, pronunciation, and pitch, specify in - /// Speech Synthesis Markup Language (SSML) format. - /// + /** + * Sends a message activity to the sender of the incoming activity. + * @param textReplyToSend The text of the message to send. + * @param speak Optional, text to be spoken by your bot on a speech-enabled + * channel. + * @param inputHint Optional, indicates whether your bot is accepting, + * expecting, or ignoring user input after the message is delivered to the client. + * One of: "acceptingInput", "ignoringInput", or "expectingInput". + * Default is "acceptingInput". + * @return A task that represents the work queued to execute. + * If the activity is successfully sent, the task result contains + * a {@link ResourceResponse} object containing the ID that the receiving + * channel assigned to the activity. + *

See the channel's documentation for limits imposed upon the contents of + * {@code textReplyToSend}.

+ *

To control various characteristics of your bot's speech such as voice, + * rate, volume, pronunciation, and pitch, specify {@code speak} in + * Speech Synthesis Markup Language (SSML) format.

+ * + */ CompletableFuture SendActivity(String textReplyToSend) throws Exception; CompletableFuture SendActivity(String textReplyToSend, String speak) throws Exception; //CompletableFuture SendActivity(String textReplyToSend, String speak = null, String inputHint = InputHints.AcceptingInput); CompletableFuture SendActivity(String textReplyToSend, String speak, String inputHint) throws Exception; - /// - /// Sends an activity to the sender of the incoming activity. - /// - /// The activity to send. - /// A task that represents the work queued to execute. - /// If the activity is successfully sent, the task result contains - /// a object containing the ID that the receiving - /// channel assigned to the activity. + /** + * Sends an activity to the sender of the incoming activity. + * @param activity The activity to send. + * @return A task that represents the work queued to execute. + * If the activity is successfully sent, the task result contains + * a {@link ResourceResponse} object containing the ID that the receiving + * channel assigned to the activity. + */ CompletableFuture SendActivity(Activity activity) throws Exception; - /// - /// Sends a set of activities to the sender of the incoming activity. - /// - /// The activities to send. - /// A task that represents the work queued to execute. - /// If the activities are successfully sent, the task result contains - /// an array of objects containing the IDs that - /// the receiving channel assigned to the activities. + /** + * Sends a set of activities to the sender of the incoming activity. + * @param activities The activities to send. + * @return A task that represents the work queued to execute. + * If the activities are successfully sent, the task result contains + * an array of {@link ResourceResponse} objects containing the IDs that + * the receiving channel assigned to the activities. + */ CompletableFuture SendActivities(Activity[] activities) throws Exception; - /// - /// Replaces an existing activity. - /// - /// New replacement activity. - /// A task that represents the work queued to execute. - /// If the activity is successfully sent, the task result contains - /// a object containing the ID that the receiving - /// channel assigned to the activity. - /// Before calling this, set the ID of the replacement activity to the ID - /// of the activity to replace. + /** + * Replaces an existing activity. + * @param activity New replacement activity. + * @return A task that represents the work queued to execute. + * If the activity is successfully sent, the task result contains + * a {@link ResourceResponse} object containing the ID that the receiving + * channel assigned to the activity. + *

Before calling this, set the ID of the replacement activity to the ID + * of the activity to replace.

+ */ ResourceResponse UpdateActivity(Activity activity) throws Exception; - /// - /// Deletes an existing activity. - /// - /// The ID of the activity to delete. - /// A task that represents the work queued to execute. + /** + * Deletes an existing activity. + * @param activityId The ID of the activity to delete. + * @return A task that represents the work queued to execute. + */ CompletableFuture DeleteActivity(String activityId) throws Exception; - /// - /// Deletes an existing activity. - /// - /// The conversation containing the activity to delete. - /// A task that represents the work queued to execute. - /// The conversation reference's - /// indicates the activity in the conversation to delete. + /** + * Deletes an existing activity. + * @param conversationReference The conversation containing the activity to delete. + * @return A task that represents the work queued to execute. + * The conversation reference's {@link ConversationReference.ActivityId} + * indicates the activity in the conversation to delete. + */ CompletableFuture DeleteActivity(ConversationReference conversationReference) throws Exception; - /// - /// Adds a response handler for send activity operations. - /// - /// The handler to add to the context object. - /// The updated context object. - /// When the context's - /// or methods are called, - /// the adapter calls the registered handlers in the order in which they were - /// added to the context object. - /// + /** + * Adds a response handler for send activity operations. + * @param handler The handler to add to the context object. + * @return The updated context object. + * When the context's {@link SendActivity(Activity)} + * or {@link SendActivities(Activity[])} methods are called, + * the adapter calls the registered handlers in the order in which they were + * added to the context object. + * + */ TurnContext OnSendActivities(SendActivitiesHandler handler); - /// - /// Adds a response handler for update activity operations. - /// - /// The handler to add to the context object. - /// The updated context object. - /// When the context's is called, - /// the adapter calls the registered handlers in the order in which they were - /// added to the context object. - /// + /** + * Adds a response handler for update activity operations. + * @param handler The handler to add to the context object. + * @return The updated context object. + * When the context's {@link UpdateActivity(Activity)} is called, + * the adapter calls the registered handlers in the order in which they were + * added to the context object. + * + */ TurnContext OnUpdateActivity(UpdateActivityHandler handler); - /// - /// Adds a response handler for delete activity operations. - /// - /// The handler to add to the context object. - /// The updated context object. - /// is null. - /// When the context's is called, - /// the adapter calls the registered handlers in the order in which they were - /// added to the context object. - /// + /** + * Adds a response handler for delete activity operations. + * @param handler The handler to add to the context object. + * @return The updated context object. + * @throws NullPointerException {@code handler} is {@code null}. + * When the context's {@link DeleteActivity(String)} is called, + * the adapter calls the registered handlers in the order in which they were + * added to the context object. + * + */ TurnContext OnDeleteActivity(DeleteActivityHandler handler); } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextImpl.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextImpl.java index 7afc7453..0a3293f7 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextImpl.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextImpl.java @@ -20,14 +20,14 @@ import static com.microsoft.bot.schema.models.ActivityTypes.TRACE; import static java.util.concurrent.CompletableFuture.completedFuture; import static java.util.stream.Collectors.toList; -/// -/// Provides context for a turn of a bot. -/// -/// Context provides information needed to process an incoming activity. -/// The context object is created by a and persists for the -/// length of the turn. -/// -/// +/** + * Provides context for a turn of a bot. + * Context provides information needed to process an incoming activity. + * The context object is created by a {@link BotAdapter} and persists for the + * length of the turn. + * {@linkalso Bot} + * {@linkalso Middleware} + */ public class TurnContextImpl implements TurnContext, AutoCloseable { private final BotAdapter adapter; private final ActivityImpl activity; @@ -39,15 +39,15 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { private final TurnContextServiceCollection turnServices; - /// - /// Creates a context object. - /// - /// The adapter creating the context. - /// The incoming activity for the turn; - /// or null for a turn for a proactive message. - /// or - /// is null. - /// For use by bot adapter implementations only. + /** + * Creates a context object. + * @param adapter The adapter creating the context. + * @param activity The incoming activity for the turn; + * or {@code null} for a turn for a proactive message. + * @throws IllegalArgumentException {@code activity} or + * {@code adapter} is {@code null}. + * For use by bot adapter implementations only. + */ public TurnContextImpl(BotAdapter adapter, ActivityImpl activity) { if (adapter == null) throw new IllegalArgumentException("adapter"); @@ -61,17 +61,17 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { - /// - /// Adds a response handler for send activity operations. - /// - /// The handler to add to the context object. - /// The updated context object. - /// is null. - /// When the context's - /// or methods are called, - /// the adapter calls the registered handlers in the order in which they were - /// added to the context object. - /// + /** + * Adds a response handler for send activity operations. + * @param handler The handler to add to the context object. + * @return The updated context object. + * @throws IllegalArgumentException {@code handler} is {@code null}. + * When the context's {@link SendActivity(Activity)} + * or {@link SendActivities(Activity[])} methods are called, + * the adapter calls the registered handlers in the order in which they were + * added to the context object. + * + */ public TurnContextImpl OnSendActivities(SendActivitiesHandler handler) { if (handler == null) throw new IllegalArgumentException("handler"); @@ -80,16 +80,16 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { return this; } - /// - /// Adds a response handler for update activity operations. - /// - /// The handler to add to the context object. - /// The updated context object. - /// is null. - /// When the context's is called, - /// the adapter calls the registered handlers in the order in which they were - /// added to the context object. - /// + /** + * Adds a response handler for update activity operations. + * @param handler The handler to add to the context object. + * @return The updated context object. + * @throws IllegalArgumentException {@code handler} is {@code null}. + * When the context's {@link UpdateActivity(Activity)} is called, + * the adapter calls the registered handlers in the order in which they were + * added to the context object. + * + */ public TurnContextImpl OnUpdateActivity(UpdateActivityHandler handler) { if (handler == null) throw new IllegalArgumentException("handler"); @@ -98,16 +98,16 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { return this; } - /// - /// Adds a response handler for delete activity operations. - /// - /// The handler to add to the context object. - /// The updated context object. - /// is null. - /// When the context's is called, - /// the adapter calls the registered handlers in the order in which they were - /// added to the context object. - /// + /** + * Adds a response handler for delete activity operations. + * @param handler The handler to add to the context object. + * @return The updated context object. + * @throws IllegalArgumentException {@code handler} is {@code null}. + * When the context's {@link DeleteActivity(string)} is called, + * the adapter calls the registered handlers in the order in which they were + * added to the context object. + * + */ public TurnContextImpl OnDeleteActivity(DeleteActivityHandler handler) { if (handler == null) throw new IllegalArgumentException("handler"); @@ -116,34 +116,34 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { return this; } - /// - /// Gets the bot adapter that created this context object. - /// + /** + * Gets the bot adapter that created this context object. + */ public BotAdapter getAdapter() { return this.adapter; } - /// - /// Gets the services registered on this context object. - /// + /** + * Gets the services registered on this context object. + */ public TurnContextServiceCollection getServices() { return this.turnServices; } - /// - /// Gets the activity associated with this turn; or null when processing - /// a proactive message. - /// + /** + * Gets the activity associated with this turn; or {@code null} when processing + * a proactive message. + */ @Override public Activity getActivity() { return this.activity; } - /// - /// Indicates whether at least one response was sent for the current turn. - /// - /// true if at least one response was sent for the current turn. - /// You attempted to set the value to false. + /** + * Indicates whether at least one response was sent for the current turn. + * @return {@code true} if at least one response was sent for the current turn. + * @throws IllegalArgumentException You attempted to set the value to {@code false}. + */ public boolean getResponded() { return this.responded; } @@ -155,28 +155,28 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { this.responded = true; } -/// -/// Sends a message activity to the sender of the incoming activity. -/// -/// The text of the message to send. -/// Optional, text to be spoken by your bot on a speech-enabled -/// channel. -/// Optional, indicates whether your bot is accepting, -/// expecting, or ignoring user input after the message is delivered to the client. -/// One of: "acceptingInput", "ignoringInput", or "expectingInput". -/// Default is null. -/// A task that represents the work queued to execute. -/// -/// is null or whitespace. -/// If the activity is successfully sent, the task result contains -/// a object containing the ID that the receiving -/// channel assigned to the activity. -/// See the channel's documentation for limits imposed upon the contents of -/// . -/// To control various characteristics of your bot's speech such as voice, -/// rate, volume, pronunciation, and pitch, specify in -/// Speech Synthesis Markup Language (SSML) format. -/// +/** + * Sends a message activity to the sender of the incoming activity. + * @param textReplyToSend The text of the message to send. + * @param speak Optional, text to be spoken by your bot on a speech-enabled + * channel. + * @param inputHint Optional, indicates whether your bot is accepting, + * expecting, or ignoring user input after the message is delivered to the client. + * One of: "acceptingInput", "ignoringInput", or "expectingInput". + * Default is null. + * @return A task that represents the work queued to execute. + * @throws IllegalArgumentException + * {@code textReplyToSend} is {@code null} or whitespace. + * If the activity is successfully sent, the task result contains + * a {@link ResourceResponse} object containing the ID that the receiving + * channel assigned to the activity. + *

See the channel's documentation for limits imposed upon the contents of + * {@code textReplyToSend}.

+ *

To control various characteristics of your bot's speech such as voice, + * rate, volume, pronunciation, and pitch, specify {@code speak} in + * Speech Synthesis Markup Language (SSML) format.

+ * + */ @Override public CompletableFuture SendActivity(String textReplyToSend) throws Exception { return SendActivity(textReplyToSend, null, null); @@ -202,15 +202,15 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { return completedFuture(await(SendActivity(activityToSend))); } - /// - /// Sends an activity to the sender of the incoming activity. - /// - /// The activity to send. - /// A task that represents the work queued to execute. - /// is null. - /// If the activity is successfully sent, the task result contains - /// a object containing the ID that the receiving - /// channel assigned to the activity. + /** + * Sends an activity to the sender of the incoming activity. + * @param activity The activity to send. + * @return A task that represents the work queued to execute. + * @throws IllegalArgumentException {@code activity} is {@code null}. + * If the activity is successfully sent, the task result contains + * a {@link ResourceResponse} object containing the ID that the receiving + * channel assigned to the activity. + */ @Override public CompletableFuture SendActivity(Activity activity) throws Exception { if (activity == null) @@ -237,14 +237,14 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { } - /// - /// Sends a set of activities to the sender of the incoming activity. - /// - /// The activities to send. - /// A task that represents the work queued to execute. - /// If the activities are successfully sent, the task result contains - /// an array of objects containing the IDs that - /// the receiving channel assigned to the activities. + /** + * Sends a set of activities to the sender of the incoming activity. + * @param activities The activities to send. + * @return A task that represents the work queued to execute. + * If the activities are successfully sent, the task result contains + * an array of {@link ResourceResponse} objects containing the IDs that + * the receiving channel assigned to the activities. + */ @Override public CompletableFuture SendActivities(Activity[] activities) throws Exception { // Bind the relevant Conversation Reference properties, such as URLs and @@ -296,20 +296,20 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { return completedFuture(await(SendActivitiesInternal(act_list, onSendActivities.iterator(), ActuallySendStuff))); } - /// - /// Replaces an existing activity. - /// - /// New replacement activity. - /// A task that represents the work queued to execute. - /// - /// The HTTP operation failed and the response contained additional information. - /// - /// One or more exceptions occurred during the operation. - /// If the activity is successfully sent, the task result contains - /// a object containing the ID that the receiving - /// channel assigned to the activity. - /// Before calling this, set the ID of the replacement activity to the ID - /// of the activity to replace. + /** + * Replaces an existing activity. + * @param activity New replacement activity. + * @return A task that represents the work queued to execute. + * @throws Microsoft.Bot.Schema.ErrorResponseException + * The HTTP operation failed and the response contained additional information. + * @throws System.AggregateException + * One or more exceptions occurred during the operation. + * If the activity is successfully sent, the task result contains + * a {@link ResourceResponse} object containing the ID that the receiving + * channel assigned to the activity. + *

Before calling this, set the ID of the replacement activity to the ID + * of the activity to replace.

+ */ @Override public ResourceResponse UpdateActivity(Activity activity) throws Exception { @@ -322,13 +322,13 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { return await(UpdateActivityInternal(activity, onUpdateActivity.iterator(), ActuallyUpdateStuff)); } - /// - /// Deletes an existing activity. - /// - /// The ID of the activity to delete. - /// A task that represents the work queued to execute. - /// - /// The HTTP operation failed and the response contained additional information. + /** + * Deletes an existing activity. + * @param activityId The ID of the activity to delete. + * @return A task that represents the work queued to execute. + * @throws Microsoft.Bot.Schema.ErrorResponseException + * The HTTP operation failed and the response contained additional information. + */ public CompletableFuture DeleteActivity(String activityId) throws Exception { if (StringUtils.isWhitespace(activityId) || activityId == null) throw new IllegalArgumentException("activityId"); @@ -345,15 +345,15 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { return completedFuture(null); } - /// - /// Deletes an existing activity. - /// - /// The conversation containing the activity to delete. - /// A task that represents the work queued to execute. - /// - /// The HTTP operation failed and the response contained additional information. - /// The conversation reference's - /// indicates the activity in the conversation to delete. + /** + * Deletes an existing activity. + * @param conversationReference The conversation containing the activity to delete. + * @return A task that represents the work queued to execute. + * @throws Microsoft.Bot.Schema.ErrorResponseException + * The HTTP operation failed and the response contained additional information. + * The conversation reference's {@link ConversationReference.ActivityId} + * indicates the activity in the conversation to delete. + */ public CompletableFuture DeleteActivity(ConversationReference conversationReference) throws Exception { if (conversationReference == null) throw new IllegalArgumentException("conversationReference"); @@ -415,18 +415,24 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { // return null; // } // - // // Default to "No more Middleware after this". + // /** + // */ Default to "No more Middleware after this". + // */ // async Task next() // { - // // Remove the first item from the list of middleware to call, - // // so that the next call just has the remaining items to worry about. + // /** + // */ Remove the first item from the list of middleware to call, + // */ so that the next call just has the remaining items to worry about. + // */ // IEnumerable remaining = updateHandlers.Skip(1); // var result = await UpdateActivityInternal(activity, remaining, callAtBottom).ConfigureAwait(false); // activity.Id = result.Id; // return result; // } // - // // Grab the current middleware, which is the 1st element in the array, and execute it + // /** + // */ Grab the current middleware, which is the 1st element in the array, and execute it + // */ // UpdateActivityHandler toCall = updateHandlers.First(); // return await toCall(this, activity, next); // } @@ -494,13 +500,13 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { return completedFuture(null); } - /// - /// Creates a conversation reference from an activity. - /// - /// The activity. - /// A conversation reference for the conversation that contains the activity. - /// - /// is null. + /** + * Creates a conversation reference from an activity. + * @param activity The activity. + * @return A conversation reference for the conversation that contains the activity. + * @throws IllegalArgumentException + * {@code activity} is {@code null}. + */ public static ConversationReference GetConversationReference(Activity activity) { BotAssert.ActivityNotNull(activity); @@ -515,21 +521,21 @@ public class TurnContextImpl implements TurnContext, AutoCloseable { return r; } - /// - /// Updates an activity with the delivery information from an existing - /// conversation reference. - /// - /// The activity to update. - /// The conversation reference. - /// (Optional) true to treat the activity as an - /// incoming activity, where the bot is the recipient; otherwaire false. - /// Default is false, and the activity will show the bot as the sender. - /// Call on an incoming - /// activity to get a conversation reference that you can then use to update an - /// outgoing activity with the correct delivery information. - /// The and - /// methods do this for you. - /// + /** + * Updates an activity with the delivery information from an existing + * conversation reference. + * @param activity The activity to update. + * @param reference The conversation reference. + * @param isIncoming (Optional) {@code true} to treat the activity as an + * incoming activity, where the bot is the recipient; otherwaire {@code false}. + * Default is {@code false}, and the activity will show the bot as the sender. + * Call {@link GetConversationReference(Activity)} on an incoming + * activity to get a conversation reference that you can then use to update an + * outgoing activity with the correct delivery information. + *

The {@link SendActivity(Activity)} and {@link SendActivities(Activity[])} + * methods do this for you.

+ * + */ public static Activity ApplyConversationReference(Activity activity, ConversationReference reference) { return ApplyConversationReference(activity, reference, false); } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextServiceCollection.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextServiceCollection.java index a690c503..6c75869a 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextServiceCollection.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextServiceCollection.java @@ -2,28 +2,28 @@ package com.microsoft.bot.builder; import java.util.Map; -/// -/// Represents a set of collection of services associated with the . -/// -/// -/// TODO: add more details on what kind of services can/should be stored here, by whom and what the lifetime semantics are, etc. -/// +/** + * Represents a set of collection of services associated with the {@link TurnContext}. + * + * TODO: add more details on what kind of services can/should be stored here, by whom and what the lifetime semantics are, etc. + * + */ public interface TurnContextServiceCollection extends Iterable>, AutoCloseable { - /// - /// Add a service with a specified key. - /// - /// The type of service to be added. - /// The key to store the service under. - /// The service to add. - /// Thrown when a service is already registered with the specified + /** + * Add a service with a specified key. + * @param TService The type of service to be added. + * @param key The key to store the service under. + * @param service The service to add. + * @throws IllegalArgumentException Thrown when a service is already registered with the specified {@code key} + */ void Add(String key, TService service) throws IllegalArgumentException; - /// - /// Get a service by its key. - /// - /// The type of service to be retrieved. - /// The key of the service to get. - /// The service stored under the specified key. + /** + * Get a service by its key. + * @param TService The type of service to be retrieved. + * @param key The key of the service to get. + * @return The service stored under the specified key. + */ TService Get(String key) throws IllegalArgumentException; } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextServiceCollectionImpl.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextServiceCollectionImpl.java index d94625cf..acd1afa9 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextServiceCollectionImpl.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/TurnContextServiceCollectionImpl.java @@ -22,11 +22,11 @@ public final class TurnContextServiceCollectionImpl implements TurnContextServic // TODO: log that we didn't find the requested service return (TService) service; } - /// - /// Get a service by type using its full type name as the key. - /// - /// The type of service to be retrieved. - /// The service stored under the specified key. + /** + * Get a service by type using its full type name as the key. + * @param TService The type of service to be retrieved. + * @return The service stored under the specified key. + */ public TService Get(Class type) throws IllegalArgumentException { return this.Get(type.getName()); } @@ -40,11 +40,11 @@ public final class TurnContextServiceCollectionImpl implements TurnContextServic throw new IllegalArgumentException (String.format("Key %s already exists", key)); _services.put(key, service); } - /// - /// Add a service using its full type name as the key. - /// - /// The type of service to be added. - /// The service to add. + /** + * Add a service using its full type name as the key. + * @param TService The type of service to be added. + * @param service The service to add. + */ public void Add(TService service, Class type) throws IllegalArgumentException { Add(type.getName(), service); diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/UpdateActivityHandler.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/UpdateActivityHandler.java index 45df1099..5a668e17 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/UpdateActivityHandler.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/UpdateActivityHandler.java @@ -7,27 +7,27 @@ import com.microsoft.bot.schema.models.ResourceResponse; import java.util.concurrent.Callable; import java.util.concurrent.CompletableFuture; -/// -/// A method that can participate in update activity events for the current turn. -/// -/// The context object for the turn. -/// The replacement activity. -/// The delegate to call to continue event processing. -/// A task that represents the work queued to execute. -/// A handler calls the delegate to pass control to -/// the next registered handler. If a handler doesn’t call the next delegate, -/// the adapter does not call any of the subsequent handlers and does not update the -/// activity. -/// The activity's indicates the activity in the -/// conversation to replace. -/// -/// -/// -/// +/** + * A method that can participate in update activity events for the current turn. + * @param context The context object for the turn. + * @param activity The replacement activity. + * @param next The delegate to call to continue event processing. + * @return A task that represents the work queued to execute. + * A handler calls the {@code next} delegate to pass control to + * the next registered handler. If a handler doesn’t call the next delegate, + * the adapter does not call any of the subsequent handlers and does not update the + * activity. + *

The activity's {@link Activity.Id} indicates the activity in the + * conversation to replace.

+ * + * {@linkalso BotAdapter} + * {@linkalso SendActivitiesHandler} + * {@linkalso DeleteActivityHandler} + */ -// public delegate Task UpdateActivityHandler(ITurnContext context, Activity activity, Func> next); +// public delegate Task UpdateActivityHandler(TurnContext context, Activity activity, Func> next); @FunctionalInterface public interface UpdateActivityHandler { CompletableFuture handle(TurnContext context, Activity activity, Callable> next); diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/UserState.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/UserState.java index e09f1436..659128aa 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/UserState.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/UserState.java @@ -7,26 +7,26 @@ import com.microsoft.bot.builder.TurnContext; import java.util.function.Supplier; -/// -/// Handles persistence of a user state object using the user ID as part of the key. -/// -/// The type of the user state object. +/** + * Handles persistence of a user state object using the user ID as part of the key. + * @param TState The type of the user state object. + */ public class UserState extends BotState { - /// - /// The key to use to read and write this conversation state object to storage. - /// + /** + * The key to use to read and write this conversation state object to storage. + */ // Note: Hard coded to maintain compatibility with C# // "UserState:{typeof(UserState).Namespace}.{typeof(UserState).Name}" public static String PropertyName() { return String.format("UserState:Microsoft.Bot.Builder.Core.Extensions.UserState`1"); } - /// - /// Creates a new object. - /// - /// The storage provider to use. - /// The state persistance options to use. + /** + * Creates a new {@link UserState{TState}} object. + * @param storage The storage provider to use. + * @param settings The state persistance options to use. + */ public UserState(Storage storage, Supplier ctor) { this(storage, ctor, null); } @@ -39,11 +39,11 @@ public class UserState extends BotState settings); } - /// - /// Gets the user state object from turn context. - /// - /// The context object for this turn. - /// The user state object. + /** + * Gets the user state object from turn context. + * @param context The context object for this turn. + * @return The user state object. + */ public static TState Get(TurnContext context) throws IllegalArgumentException { return context.getServices().Get(PropertyName()); } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/adapters/TestAdapter.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/adapters/TestAdapter.java index a0645349..58b86f7e 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/adapters/TestAdapter.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/adapters/TestAdapter.java @@ -170,12 +170,12 @@ public class TestAdapter extends BotAdapter { return completedFuture(null); } - /// - /// NOTE: this resets the queue, it doesn't actually maintain multiple converstion queues - /// - /// - /// - /// + /** + * NOTE: this resets the queue, it doesn't actually maintain multiple converstion queues + * @param channelId + * @param callback + * @return + */ //@Override public CompletableFuture CreateConversation(String channelId,Function callback) { this.activeQueue().clear(); @@ -186,10 +186,10 @@ public class TestAdapter extends BotAdapter { return callback.apply(context); } - /// - /// Called by TestFlow to check next reply - /// - /// + /** + * Called by TestFlow to check next reply + * @return + */ public Activity GetNextReply() { synchronized (this.botReplies) { if(this.botReplies.size()>0) { @@ -199,11 +199,11 @@ public class TestAdapter extends BotAdapter { return null; } - /// - /// Called by TestFlow to get appropriate activity for conversationReference of testbot - /// - /// - /// + /** + * Called by TestFlow to get appropriate activity for conversationReference of testbot + * @param text + * @return + */ public Activity MakeActivity() { return MakeActivity(null); } @@ -223,11 +223,11 @@ public class TestAdapter extends BotAdapter { } - /// - /// Called by TestFlow to send text to the bot - /// - /// - /// + /** + * Called by TestFlow to send text to the bot + * @param userSays + * @return + */ public CompletableFuture SendTextToBot(String userSays,Function callback) throws Exception { return this.ProcessActivity(this.MakeActivity(userSays),callback); } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/Dialog.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/Dialog.java index 06fb24b2..8f706f83 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/Dialog.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/Dialog.java @@ -9,20 +9,20 @@ import com.microsoft.bot.builder.TurnContext; import java.util.HashMap; import java.util.concurrent.CompletableFuture; -/// -/// Base class for controls -/// +/** + * Base class for controls + */ public abstract class Dialog { - /// - /// Starts the dialog. Depending on the dialog, its possible for the dialog to finish - /// immediately so it's advised to check the completion Object returned by `begin()` and ensure - /// that the dialog is still active before continuing. - /// - /// Context for the current turn of the conversation with the user. - /// A state Object that the dialog will use to persist its current state. This should be an empty Object which the dialog will populate. The bot should persist this with its other conversation state for as long as the dialog is still active. - /// (Optional) additional options supported by the dialog. - /// DialogCompletion result + /** + * Starts the dialog. Depending on the dialog, its possible for the dialog to finish + * immediately so it's advised to check the completion Object returned by `begin()` and ensure + * that the dialog is still active before continuing. + * @param context Context for the current turn of the conversation with the user. + * @param state A state Object that the dialog will use to persist its current state. This should be an empty Object which the dialog will populate. The bot should persist this with its other conversation state for as long as the dialog is still active. + * @param options (Optional) additional options supported by the dialog. + * @return DialogCompletion result + */ public CompletableFuture Begin(TurnContext context, HashMap state) { return Begin(context, state, null); @@ -63,15 +63,15 @@ public abstract class Dialog return result; } - /// - /// Passes a users reply to the dialog for further processing.The bot should keep calling - /// 'continue()' for future turns until the dialog returns a completion Object with - /// 'isCompleted == true'. To cancel or interrupt the prompt simply delete the `state` Object - /// being persisted. - /// - /// Context for the current turn of the conversation with the user. - /// A state Object that was previously initialized by a call to [begin()](#begin). - /// DialogCompletion result + /** + * Passes a users reply to the dialog for further processing.The bot should keep calling + * 'continue()' for future turns until the dialog returns a completion Object with + * 'isCompleted == true'. To cancel or interrupt the prompt simply delete the `state` Object + * being persisted. + * @param context Context for the current turn of the conversation with the user. + * @param state A state Object that was previously initialized by a call to [begin()](#begin). + * @return DialogCompletion result + */ public CompletableFuture Continue(TurnContext context, HashMap state) { BotAssert.ContextNotNull(context); diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogCompletion.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogCompletion.java index e5d4339b..d5cc31ac 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogCompletion.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogCompletion.java @@ -5,17 +5,17 @@ package com.microsoft.bot.builder.dialogs; import java.util.HashMap; -/// -/// Result returned to the caller of one of the various stack manipulation methods and used to -/// return the result from a final call to `DialogContext.end()` to the bots logic. -/// +/** + * Result returned to the caller of one of the various stack manipulation methods and used to + * return the result from a final call to `DialogContext.end()` to the bots logic. + */ public class DialogCompletion { - /// - /// If 'true' the dialog is still active. - /// + /** + * If 'true' the dialog is still active. + */ boolean _isActive; public void setIsActive(boolean isActive) { this._isActive = isActive; @@ -24,9 +24,9 @@ public class DialogCompletion return this._isActive; } - /// - /// If 'true' the dialog just completed and the final [result](#result) can be retrieved. - /// + /** + * If 'true' the dialog just completed and the final [result](#result) can be retrieved. + */ boolean _isCompleted; public void setIsCompleted(boolean isCompleted) { @@ -37,15 +37,13 @@ public class DialogCompletion return this._isCompleted; } - /// - /// Result returned by a dialog that was just ended.This will only be populated in certain - /// cases: - /// - /// - The bot calls `dc.begin()` to start a new dialog and the dialog ends immediately. - /// - The bot calls `dc.continue()` and a dialog that was active ends. - /// - /// In all cases where it's populated, [active](#active) will be `false`. - /// + /** + * Result returned by a dialog that was just ended.This will only be populated in certain + * cases: + * - The bot calls `dc.begin()` to start a new dialog and the dialog ends immediately. + * - The bot calls `dc.continue()` and a dialog that was active ends. + * In all cases where it's populated, [active](#active) will be `false`. + */ HashMap _result; public HashMap getResult() { return _result; diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContainer.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContainer.java index a0a2369d..c7618129 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContainer.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContainer.java @@ -47,4 +47,4 @@ public class DialogContainer implements IDialogContinue } } } -*/ \ No newline at end of file +*/ diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContext.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContext.java index 45208ce4..0c791981 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContext.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/DialogContext.java @@ -33,16 +33,16 @@ package com.microsoft.bot.builder.dialogs; // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -/// -/// Encapsulates a method that represents the code to execute after a result is available. -/// -/// -/// The result is often a message from the user. -/// -/// The type of the result. -/// The dialog context. -/// The result. -/// A task that represents the code that will resume after the result is available. +/** + * Encapsulates a method that represents the code to execute after a result is available. + * + * The result is often a message from the user. + * + * @param T The type of the result. + * @param context The dialog context. + * @param result The result. + * @return A task that represents the code that will resume after the result is available. + */ /* public interface ResumeAfter @@ -51,44 +51,44 @@ public interface ResumeAfter } public delegate Task ResumeAfter(IDialogContext context, IAwaitable result); - - -/// -/// Encapsulate a method that represents the code to start a dialog. -/// -/// The dialog context. -/// A task that represents the start code for a dialog. -public delegate Task StartAsync(IDialogContext context); */ +/** + * Encapsulate a method that represents the code to start a dialog. + * @param context The dialog context. + * @return A task that represents the start code for a dialog. + */ +//public delegate Task StartAsync(IDialogContext context); -/// -/// The context for the execution of a dialog's conversational process. -/// + + +/** + * The context for the execution of a dialog's conversational process. + */ // DAVETA: TODO // public interface DialogContext extends public interface DialogContext { } -/// -/// Helper methods. -/// +/** + * Helper methods. + */ /* public static partial class Extensions -{ - /// - /// Post a message to be sent to the user, using previous messages to establish a conversation context. - /// - /// - /// If the locale parameter is not set, locale of the incoming message will be used for reply. - /// - /// Communication channel to use. - /// The message text. - /// The locale of the text. - /// The cancellation token. - /// A task that represents the post operation. - public static async Task PostAsync(this IBotToUser botToUser, string text, string locale = null, CancellationToken cancellationToken = default(CancellationToken)) +{*/ + /** + * Post a message to be sent to the user, using previous messages to establish a conversation context. + * + * If the locale parameter is not set, locale of the incoming message will be used for reply. + * + * @param botToUser Communication channel to use. + * @param text The message text. + * @param locale The locale of the text. + * @return A task that represents the post operation. + */ +/* + public static async Task PostAsync(this BotToUser botToUser, string text, string locale = null) { var message = botToUser.MakeMessage(); message.Text = text; @@ -98,24 +98,24 @@ public static partial class Extensions message.Locale = locale; } - await botToUser.PostAsync(message, cancellationToken); + await botToUser.PostAsync(message); } +*/ - /// - /// Post a message and optional SSML to be sent to the user, using previous messages to establish a conversation context. - /// - /// - /// If the locale parameter is not set, locale of the incoming message will be used for reply. - /// - /// Communication channel to use. - /// The message text. - /// The SSML markup for text to speech. - /// The options for the message. - /// The locale of the text. - /// The cancellation token. - /// A task that represents the post operation. - public static async Task SayAsync(this IBotToUser botToUser, string text, string speak = null, MessageOptions options = null, string locale = null, CancellationToken cancellationToken = default(CancellationToken)) + /** + * Post a message and optional SSML to be sent to the user, using previous messages to establish a conversation context. + * + * If the locale parameter is not set, locale of the incoming message will be used for reply. + * + * @param botToUser Communication channel to use. + * @param text The message text. + * @param speak The SSML markup for text to speech. + * @param options The options for the message. + * @param locale The locale of the text. + * @return A task that represents the post operation. + */ + /* public static async Task SayAsync(this BotToUser botToUser, string text, string speak = null, MessageOptions options = null, string locale = null) { var message = botToUser.MakeMessage(); @@ -136,32 +136,32 @@ public static partial class Extensions message.Entities = options.Entities; } - await botToUser.PostAsync(message, cancellationToken); - } + await botToUser.PostAsync(message); + }*/ - /// - /// Suspend the current dialog until the user has sent a message to the bot. - /// - /// The dialog stack. - /// The method to resume when the message has been received. - public static void Wait(this IDialogStack stack, ResumeAfter resume) + /** + * Suspend the current dialog until the user has sent a message to the bot. + * @param stack The dialog stack. + * @param resume The method to resume when the message has been received. + */ +/* + public static void Wait(this IDialogStack stack, ResumeAfter resume) { - stack.Wait(resume); + stack.Wait(resume); } +*/ - /// - /// Call a child dialog, add it to the top of the stack and post the message to the child dialog. - /// - /// The type of result expected from the child dialog. - /// The dialog stack. - /// The child dialog. - /// The method to resume when the child dialog has completed. - /// The message that will be posted to child dialog. - /// A cancellation token. - /// A task representing the Forward operation. - public static async Task Forward(this IDialogStack stack, IDialog child, ResumeAfter resume, IMessageActivity message, CancellationToken token = default(CancellationToken)) + /** + * Call a child dialog, add it to the top of the stack and post the message to the child dialog. + * @param R The type of result expected from the child dialog. + * @param stack The dialog stack. + * @param child The child dialog. + * @param resume The method to resume when the child dialog has completed. + * @param message The message that will be posted to child dialog. + * @return A task representing the Forward operation. + */ +/* public static async Task Forward(this IDialogStack stack, IDialog child, ResumeAfter resume, MessageActivity message) { - await stack.Forward(child, resume, message, token); + await stack.Forward(child, resume, message, token); } -} -*/ \ No newline at end of file +}*/ diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/IDialog.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/IDialog.java index 099229a0..f4c3872a 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/IDialog.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/IDialog.java @@ -1,19 +1,19 @@ package com.microsoft.bot.builder.dialogs; // TODO: daveta remove this - not sure where this came from -/// -/// Interface for all Dialog objects that can be added to a `DialogSet`. The dialog should generally -/// be a singleton and added to a dialog set using `DialogSet.add()` at which point it will be -/// assigned a unique ID. -/// +/** + * Interface for all Dialog objects that can be added to a `DialogSet`. The dialog should generally + * be a singleton and added to a dialog set using `DialogSet.add()` at which point it will be + * assigned a unique ID. + */ public interface IDialog { - /// - /// Method called when a new dialog has been pushed onto the stack and is being activated. - /// - /// The dialog context for the current turn of conversation. - /// (Optional) arguments that were passed to the dialog during `begin()` call that started the instance. + /** + * Method called when a new dialog has been pushed onto the stack and is being activated. + * @param dc The dialog context for the current turn of conversation. + * @param dialogArgs (Optional) arguments that were passed to the dialog during `begin()` call that started the instance. + */ //CompleteableFuture DialogBegin(DialogContext dc, IDictionary dialogArgs = null); //CompleteableFuture DialogBegin(DialogContext dc, HashMap dialogArgs); //CompleteableFuture DialogBegin(DialogContext dc); -} \ No newline at end of file +} diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/IDialogContinue.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/IDialogContinue.java index 516e4d04..1fb250aa 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/IDialogContinue.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/IDialogContinue.java @@ -5,17 +5,17 @@ package com.microsoft.bot.builder.dialogs; import java.util.concurrent.CompletableFuture; -/// -/// Interface Dialog objects that can be continued. -/// +/** + * Interface Dialog objects that can be continued. + */ public interface IDialogContinue extends IDialog { - /// - /// Method called when an instance of the dialog is the "current" dialog and the - /// user replies with a new activity. The dialog will generally continue to receive the users - /// replies until it calls either `DialogSet.end()` or `DialogSet.begin()`. - /// If this method is NOT implemented then the dialog will automatically be ended when the user replies. - /// - /// The dialog context for the current turn of conversation. + /** + * Method called when an instance of the dialog is the "current" dialog and the + * user replies with a new activity. The dialog will generally continue to receive the users + * replies until it calls either `DialogSet.end()` or `DialogSet.begin()`. + * If this method is NOT implemented then the dialog will automatically be ended when the user replies. + * @param dc The dialog context for the current turn of conversation. + */ CompletableFuture DialogContinue(DialogContext dc); } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/MessageOptions.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/MessageOptions.java index 313bc9fe..3a452da1 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/MessageOptions.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/dialogs/MessageOptions.java @@ -3,9 +3,9 @@ package com.microsoft.bot.builder.dialogs; import com.microsoft.bot.schema.models.AttachmentLayoutTypes; import com.microsoft.bot.schema.models.TextFormatTypes; -/// -/// Optional message properties that can be sent -/// +/** + * Optional message properties that can be sent {@link Extensions.SayAsync(BotToUser, String MessageOptions,)} + */ public class MessageOptions { public MessageOptions() @@ -16,14 +16,14 @@ public class MessageOptions // this.Entities = new ArrayList(); } - /// - /// Indicates whether the bot is accepting, expecting, or ignoring input - /// + /** + * Indicates whether the bot is accepting, expecting, or ignoring input + */ //public string InputHint { get; set; } - /// - /// Format of text fields [plain|markdown] Default:markdown - /// + /** + * Format of text fields [plain|markdown] Default:markdown + */ String textFormat; public String getTextFormat() { return this.textFormat; @@ -34,9 +34,9 @@ public class MessageOptions - /// - /// Hint for how to deal with multiple attachments: [list|carousel] Default:list - /// + /** + * Hint for how to deal with multiple attachments: [list|carousel] Default:list + */ String attachmentLayout; public String getAttachmentLayout() { return this.attachmentLayout; @@ -45,13 +45,13 @@ public class MessageOptions this.attachmentLayout = attachmentLayout; } - /// - /// Attachments - /// + /** + * Attachments + */ //public IList Attachments { get; set; } - /// - /// Collection of Entity objects, each of which contains metadata about this activity. Each Entity object is typed. - /// + /** + * Collection of Entity objects, each of which contains metadata about this activity. Each Entity object is typed. + */ //public IList Entities { get; set; } } diff --git a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/prompts/Choice.java b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/prompts/Choice.java index 54fbe703..02496f0b 100644 --- a/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/prompts/Choice.java +++ b/libraries/botbuilder/src/main/java/com/microsoft/bot/builder/prompts/Choice.java @@ -4,9 +4,9 @@ import java.util.ArrayList; public class Choice { - /// - /// Value to return when selected. - /// + /** + * Value to return when selected. + */ String _value; public void setValue(String value) { this._value = value; @@ -15,9 +15,9 @@ public class Choice return this._value; } - /// - /// (Optional) action to use when rendering the choice as a suggested action. - /// + /** + * (Optional) action to use when rendering the choice as a suggested action. + */ CardAction _action; public CardAction getAction() { return this._action; @@ -26,9 +26,9 @@ public class Choice this._action = action; } - /// - /// (Optional) list of synonyms to recognize in addition to the value. - /// + /** + * (Optional) list of synonyms to recognize in addition to the value. + */ ArrayList _synonyms; public ArrayList getSynonyms() { return _synonyms; diff --git a/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/DictionaryStorage.java b/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/DictionaryStorage.java index 053e7cd7..bae9f241 100644 --- a/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/DictionaryStorage.java +++ b/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/DictionaryStorage.java @@ -13,9 +13,9 @@ import java.util.concurrent.CompletableFuture; import static java.util.concurrent.CompletableFuture.completedFuture; -/// -/// Models IStorage around a dictionary -/// +/** + * Models IStorage around a dictionary + */ public class DictionaryStorage implements Storage { private static ObjectMapper objectMapper; diff --git a/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/MemoryStorage.java b/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/MemoryStorage.java index 47d08cde..40ca5811 100644 --- a/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/MemoryStorage.java +++ b/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/MemoryStorage.java @@ -2,9 +2,9 @@ package com.microsoft.bot.builder; import com.microsoft.bot.builder.DictionaryStorage; -/// -/// RamStorage stores data in volative dictionary -/// +/** + * RamStorage stores data in volative dictionary + */ public class MemoryStorage extends DictionaryStorage { public MemoryStorage() { diff --git a/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/TurnContextTests.java b/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/TurnContextTests.java index 5bf7f36e..839f33b3 100644 --- a/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/TurnContextTests.java +++ b/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/TurnContextTests.java @@ -129,7 +129,7 @@ public class TurnContextTests { var message1 = TestMessage.Message("message1"); var message2 = TestMessage.Message("message2"); - var response = await c.SendActivities(new IActivity[] { message1, message2 } ); + var response = await c.SendActivities(new Activity[] { message1, message2 } ); Assert.IsTrue(c.Responded); Assert.IsTrue(response.Length == 2); @@ -138,13 +138,13 @@ public class TurnContextTests { } [TestMethod] - public async Task SendAndSetRespondedUsingIMessageActivity() + public async Task SendAndSetRespondedUsingMessageActivity() { SimpleAdapter a = new SimpleAdapter(); TurnContext c = new TurnContext(a, new Activity()); Assert.IsFalse(c.Responded); - IMessageActivity msg = TestMessage.Message().AsMessageActivity(); + MessageActivity msg = TestMessage.Message().AsMessageActivity(); await c.SendActivity(msg); Assert.IsTrue(c.Responded); } @@ -163,7 +163,7 @@ public class TurnContextTests { // Just to sanity check everything, send a Message and verify the // responded flag IS set. - IMessageActivity msg = TestMessage.Message().AsMessageActivity(); + MessageActivity msg = TestMessage.Message().AsMessageActivity(); await c.SendActivity(msg); Assert.IsTrue(c.Responded); } @@ -478,7 +478,7 @@ public class TurnContextTests { } } - public async Task MyBotLogic(ITurnContext context) + public async Task MyBotLogic(TurnContext context) { switch (context.Activity.AsMessageActivity().Text) { diff --git a/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/adapters/TestFlow.java b/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/adapters/TestFlow.java index d8966812..9b61713a 100644 --- a/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/adapters/TestFlow.java +++ b/libraries/botbuilder/src/test/java/com/microsoft/bot/builder/adapters/TestFlow.java @@ -40,19 +40,19 @@ public class TestFlow { this.adapter = flow.adapter; } - /// - /// Start the execution of the test flow - /// - /// + /** + * Start the execution of the test flow + * @return + */ public CompletableFuture StartTest() throws ExecutionException, InterruptedException { return (CompletableFuture) this.testTask; } - /// - /// Send a message from the user to the bot - /// - /// - /// + /** + * Send a message from the user to the bot + * @param userSays + * @return + */ // public TestFlow Send(String userSays) throws IllegalArgumentException { // if (userSays == null) // throw new IllegalArgumentException("You have to pass a userSays parameter"); @@ -60,9 +60,13 @@ public class TestFlow { // System.out.print(String.format("USER SAYS: %s", userSays)); // System.out.flush(); // -// // Function +// /** +// */ Function +// */ // return new TestFlow(this.testTask.thenCompose(task -> supplyAsync(() ->{ -// // task.Wait(); +// /** +// */ task.Wait(); +// */ // // try { // this.adapter.SendTextToBot(userSays, this.callback); @@ -92,11 +96,11 @@ public class TestFlow { })), this); } - /// - /// Send an activity from the user to the bot - /// - /// - /// + /** + * Send an activity from the user to the bot + * @param userActivity + * @return + */ public TestFlow Send(Activity userActivity) { if (userActivity == null) throw new IllegalArgumentException("You have to pass an Activity"); @@ -114,11 +118,11 @@ public class TestFlow { })), this); } - /// - /// Delay for time period - /// - /// - /// + /** + * Delay for time period + * @param ms + * @return + */ public TestFlow Delay(int ms) { return new TestFlow(this.testTask.thenCompose(task -> supplyAsync(() ->{ @@ -135,13 +139,13 @@ public class TestFlow { })), this); } - /// - /// Assert that reply is expected text - /// - /// - /// - /// - /// + /** + * Assert that reply is expected text + * @param expected + * @param description + * @param timeout + * @return + */ public TestFlow AssertReply(String expected) { return this.AssertReply(expected, null, 3000); } @@ -154,13 +158,13 @@ public class TestFlow { return this.AssertReply(this.adapter.MakeActivity(expected), description, timeout); } - /// - /// Assert that the reply is expected activity - /// - /// - /// - /// - /// + /** + * Assert that the reply is expected activity + * @param expected + * @param description + * @param timeout + * @return + */ public TestFlow AssertReply(Activity expected) { String description = Thread.currentThread().getStackTrace()[1].getMethodName(); return AssertReply(expected, description, 3000); @@ -184,13 +188,13 @@ public class TestFlow { }, description, timeout); } - /// - /// Assert that the reply matches a custom validation routine - /// - /// - /// - /// - /// + /** + * Assert that the reply matches a custom validation routine + * @param validateActivity + * @param description + * @param timeout + * @return + */ public TestFlow AssertReply(Function validateActivity) { String description = Thread.currentThread().getStackTrace()[1].getMethodName(); return AssertReply(validateActivity, description, 3000); @@ -330,14 +334,14 @@ public class TestFlow { return this; } - /// - /// Say() -> shortcut for .Send(user).AssertReply(Expected) - /// - /// - /// - /// - /// - /// + /** + * Say() -> shortcut for .Send(user).AssertReply(Expected) + * @param userSays + * @param expected + * @param description + * @param timeout + * @return + */ public TestFlow Test(String userSays, String expected) { return Test(userSays, expected, null, 3000); } @@ -352,14 +356,14 @@ public class TestFlow { .AssertReply(expected, description, timeout); } - /// - /// Test() -> shortcut for .Send(user).AssertReply(Expected) - /// - /// - /// - /// - /// - /// + /** + * Test() -> shortcut for .Send(user).AssertReply(Expected) + * @param userSays + * @param expected + * @param description + * @param timeout + * @return + */ public TestFlow Test(String userSays, Activity expected) { return Test(userSays, expected, null, 3000); } @@ -374,14 +378,14 @@ public class TestFlow { .AssertReply(expected, description, timeout); } - /// - /// Say() -> shortcut for .Send(user).AssertReply(Expected) - /// - /// - /// - /// - /// - /// + /** + * Say() -> shortcut for .Send(user).AssertReply(Expected) + * @param userSays + * @param expected + * @param description + * @param timeout + * @return + */ public TestFlow Test(String userSays, Function expected) { return Test(userSays, expected, null, 3000); } @@ -396,13 +400,13 @@ public class TestFlow { .AssertReply(expected, description, timeout); } - /// - /// Assert that reply is one of the candidate responses - /// - /// - /// - /// - /// + /** + * Assert that reply is one of the candidate responses + * @param candidates + * @param description + * @param timeout + * @return + */ public TestFlow AssertReplyOneOf(String[] candidates) { return AssertReplyOneOf(candidates, null, 3000); }