-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>
- Loading branch information
Showing
28 changed files
with
833 additions
and
526 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
9 changes: 9 additions & 0 deletions
9
packages/cactus-plugin-satp-hermes/src/main/proto/cacti/satp/v02/common/health.proto
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,9 @@ | ||
syntax = "proto3"; | ||
package cacti.satp.v02.common; | ||
import "cacti/satp/v02/common/message.proto"; | ||
|
||
message HealthCheckRequest {} | ||
|
||
service HealthService { | ||
rpc CheckHealth(HealthCheckRequest) returns (Ack); | ||
} |
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
74 changes: 0 additions & 74 deletions
74
packages/cactus-plugin-satp-hermes/src/main/typescript/core/dispatcher.ts
This file was deleted.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
packages/cactus-plugin-satp-hermes/src/main/typescript/core/satp-session.ts
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,33 @@ | ||
import { v4 as uuidv4 } from "uuid"; | ||
import { SessionData } from "../generated/proto/cacti/satp/v02/common/session_pb"; | ||
|
||
|
||
export interface ISATPSessionOptions { | ||
contextID: string; | ||
} | ||
|
||
export class SATPSession { | ||
private static readonly CLASS_NAME = "SATPSession"; | ||
private sessionData: SessionData; | ||
|
||
constructor(ops: ISATPSessionOptions) { | ||
this.sessionData = new SessionData(); | ||
this.sessionData.transferContextId = ops.contextID; | ||
|
||
// TODO algorithm to create session ID from context ID | ||
this.sessionData.id = ops.contextID + "-" + uuidv4(); | ||
|
||
} | ||
|
||
private initializeSessionID(): void { | ||
if (this.sessionData.id === undefined) { | ||
this.sessionData.id = uuidv4() + "-" + this.sessionData.transferContextId; | ||
} else { | ||
throw new Error("Session ID already initialized"); | ||
} | ||
} | ||
|
||
public getSessionData(): SessionData { | ||
return this.sessionData; | ||
} | ||
} |
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
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.