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
module.exports = function (context, req) { | |
// Yahoo!から送られてくるIDに対応した名前を決めておく。チャットの画面に表示される。 | |
const NAMES = { | |
LBHNLYCPWDV3UTO5HVVBFIXTMA:'たけい' | |
} | |
// API Managementから送られてくるYahoo!のIDをリクエストヘッダから取得します。 | |
var uid = req.headers['x-yahoo-uid']; | |
var json = req.body; |
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
<validate-jwt header-name="Authorization" failed-validation-httpcode="401" failed-validation-error-message="Unauthorized" require-expiration-time="true" require-scheme="Bearer" require-signed-tokens="true" clock-skew="0"> | |
<openid-config url="https://auth.login.yahoo.co.jp/yconnect/v2/.well-known/openid-configuration" /> | |
<issuer-signing-keys> | |
<!-- 先程のYahooの設定画面で取得したシークレットをBase64したもの --> | |
<key>XXXXXX</key> | |
</issuer-signing-keys> | |
<audiences> | |
<!-- 先程のYahooの設定画面で取得したClient ID --> | |
<audience>XXXXXX</audience> | |
</audiences> |
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
<?xml version="1.0" encoding="utf-8" standalone="no"?> | |
<ApplicationManifest xmlns="http://schemas.microsoft.com/2011/01/fabric" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="ChatApplicationType" ApplicationTypeVersion="1.0.0"> | |
<Description>Chat Application</Description> | |
<ServiceManifestImport> | |
<ServiceManifestRef ServiceManifestName="ChatWebPkg" ServiceManifestVersion="1.0.0"/> | |
</ServiceManifestImport> | |
<ServiceManifestImport> | |
<ServiceManifestRef ServiceManifestName="ChatDataPkg" ServiceManifestVersion="1.0.0"/> | |
</ServiceManifestImport> | |
<DefaultServices> |
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
apply plugin: 'java' | |
apply plugin: 'eclipse' | |
sourceSets { | |
main { | |
// ソースのディレクトリを指定します。 | |
java.srcDirs = ['src'] | |
// コンパイルしたクラスの出力先を指定します。 | |
output.classesDir = 'out/classes' | |
resources { |
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
package statefulservice; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import java.util.logging.Logger; | |
import microsoft.servicefabric.data.ReliableStateManager; |
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
apply plugin: 'java' | |
apply plugin: 'eclipse' | |
sourceSets { | |
main { | |
// ソースのディレクトリを指定します。 | |
java.srcDirs = ['src'] | |
// コンパイルしたクラスの出力先を指定します。 | |
output.classesDir = 'out/classes' | |
resources { |
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
package rpcmethods; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.HashMap; | |
import microsoft.servicefabric.services.remoting.Service; | |
// RPCで呼び出されるメソッドを定義したインターフェースです。 | |
public interface ChatRPC extends Service { | |
// メッセージを発言する処理のインターフェースです。 |
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
package rpcmethods; | |
import java.io.Serializable; | |
// チャットのメッセージや、そのメッセージを | |
// 発言したユーザー名などを格納するJava Beanです。 | |
public class ChatMessage implements Serializable{ | |
private static final long serialVersionUID = 1L; | |
private String name; // メッセージを発言したユーザー名 |
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
apply plugin: 'java' | |
apply plugin: 'eclipse' | |
sourceSets { | |
main { | |
// ソースのディレクトリを指定します。 | |
java.srcDirs = ['src'] | |
// コンパイルしたクラスの出力先を指定します。 | |
output.classesDir = 'out/classes' | |
resources { |
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
package statelessservice; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.logging.Logger; | |
import java.util.ArrayList; | |
import java.util.List; | |
import system.fabric.CancellationToken; | |
import system.fabric.description.EndpointResourceDescription; | |
import microsoft.servicefabric.services.communication.runtime.ServiceInstanceListener; |