-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
330 additions
and
90 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
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
86 changes: 86 additions & 0 deletions
86
.../manager/src/main/java/com/rtm516/mcxboxbroadcast/manager/models/MongoStorageManager.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,86 @@ | ||
package com.rtm516.mcxboxbroadcast.manager.models; | ||
|
||
import com.rtm516.mcxboxbroadcast.core.storage.StorageManager; | ||
|
||
import java.io.IOException; | ||
|
||
public class MongoStorageManager implements StorageManager { | ||
private final BotContainer botContainer; | ||
|
||
private String currentSessionResponse; | ||
|
||
public MongoStorageManager(BotContainer botContainer) { | ||
this.botContainer = botContainer; | ||
this.currentSessionResponse = ""; | ||
} | ||
|
||
@Override | ||
public String cache() throws IOException { | ||
return botContainer.bot().authCache(); | ||
} | ||
|
||
@Override | ||
public void cache(String data) throws IOException { | ||
botContainer.bot().authCache(data); | ||
botContainer.save(); | ||
} | ||
|
||
@Override | ||
public String subSessions() throws IOException { | ||
// Not needed for this implementation | ||
return ""; | ||
} | ||
|
||
@Override | ||
public void subSessions(String data) throws IOException { | ||
// Not needed for this implementation | ||
} | ||
|
||
@Override | ||
public String lastSessionResponse() throws IOException { | ||
// Not needed for this implementation | ||
return ""; | ||
} | ||
|
||
@Override | ||
public void lastSessionResponse(String data) throws IOException { | ||
// Not needed for this implementation | ||
} | ||
|
||
@Override | ||
public String currentSessionResponse() throws IOException { | ||
return currentSessionResponse; | ||
} | ||
|
||
@Override | ||
public void currentSessionResponse(String data) throws IOException { | ||
currentSessionResponse = data; | ||
} | ||
|
||
@Override | ||
public StorageManager subSession(String id) { | ||
// Not needed for this implementation | ||
return null; | ||
} | ||
|
||
@Override | ||
public void cleanup() throws IOException { | ||
// Not needed for this implementation | ||
} | ||
|
||
@Override | ||
public String liveToken() throws IOException { | ||
// Not needed for this implementation | ||
return ""; | ||
} | ||
|
||
@Override | ||
public void liveToken(String data) throws IOException { | ||
// No longer for this implementation | ||
} | ||
|
||
@Override | ||
public void xboxToken(String data) throws IOException { | ||
// No longer for this implementation | ||
} | ||
} |
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.