-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from alvin-reyes/master
Added SINGLETON and PROTOTYPE State
- Loading branch information
Showing
15 changed files
with
284 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package co.aurasphere.botmill.fb; | ||
|
||
import co.aurasphere.botmill.core.BotDefinition; | ||
import co.aurasphere.botmill.fb.autoreply.AutoReply; | ||
|
||
public class FbBotApi { | ||
|
||
private static BotDefinition botDefinition; | ||
public static void setFbBot(BotDefinition botDefinition) { | ||
FbBotApi.botDefinition = botDefinition; | ||
} | ||
|
||
public static void reply(AutoReply reply) { | ||
((FbBot)botDefinition).reply(reply); | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/co/aurasphere/botmill/fb/FbBotConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package co.aurasphere.botmill.fb; | ||
|
||
import co.aurasphere.botmill.core.internal.util.ConfigurationUtils; | ||
|
||
public abstract class FbBotConfiguration { | ||
|
||
/** The Constant FB_BOTMILL_PAGE_TOKEN. */ | ||
private static final String FB_BOTMILL_PAGE_TOKEN = "fb.page.token"; | ||
|
||
/** The Constant FB_BOTMILL_VALIDATION_TOKEN. */ | ||
private static final String FB_BOTMILL_VALIDATION_TOKEN = "fb.validation.token"; | ||
|
||
public FbBotConfiguration() { | ||
this.buildFbBotConfig(); | ||
} | ||
|
||
/** | ||
* Builds the Fb bot config. | ||
* | ||
* @throws BotMillMissingConfigurationException | ||
* the bot mill missing configuration exception | ||
*/ | ||
private void buildFbBotConfig() { | ||
|
||
FbBotMillContext.getInstance().setup( | ||
ConfigurationUtils.getEncryptedConfiguration().getProperty(FB_BOTMILL_PAGE_TOKEN), | ||
ConfigurationUtils.getEncryptedConfiguration().getProperty(FB_BOTMILL_VALIDATION_TOKEN)); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
src/main/java/co/aurasphere/botmill/fb/model/api/messengerprofile/HomeUrl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package co.aurasphere.botmill.fb.model.api.messengerprofile; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
import co.aurasphere.botmill.fb.model.outcoming.template.button.WebViewHeightRatioType; | ||
import co.aurasphere.botmill.fb.model.outcoming.template.button.WebViewShareButton; | ||
|
||
public class HomeUrl implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private String url; | ||
@SerializedName("webview_height_ratio") | ||
private WebViewHeightRatioType webviewHeightRatio; | ||
@SerializedName("webview_share_button") | ||
private WebViewShareButton webviewShareButton; | ||
@SerializedName("in_test") | ||
private boolean inTest; | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
public WebViewHeightRatioType getWebviewHeightRatio() { | ||
return webviewHeightRatio; | ||
} | ||
|
||
public void setWebviewHeightRatio(WebViewHeightRatioType webviewHeightRatio) { | ||
this.webviewHeightRatio = webviewHeightRatio; | ||
} | ||
|
||
public WebViewShareButton getWebviewShareButton() { | ||
return webviewShareButton; | ||
} | ||
|
||
public void setWebviewShareButton(WebViewShareButton webviewShareButton) { | ||
this.webviewShareButton = webviewShareButton; | ||
} | ||
|
||
public boolean isInTest() { | ||
return inTest; | ||
} | ||
|
||
public void setInTest(boolean inTest) { | ||
this.inTest = inTest; | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/co/aurasphere/botmill/fb/model/api/messengerprofile/HomeUrlRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package co.aurasphere.botmill.fb.model.api.messengerprofile; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
public class HomeUrlRequest { | ||
|
||
@SerializedName("home_url") | ||
private HomeUrl homeUrl; | ||
|
||
public HomeUrl getHomeUrl() { | ||
return homeUrl; | ||
} | ||
|
||
public void setHomeUrl(HomeUrl homeUrl) { | ||
this.homeUrl = homeUrl; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.