summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf
diff options
context:
space:
mode:
authorLo, WEI-TING(wl849v) <wl849v@att.com>2018-05-23 12:06:51 -0400
committerLo, WEI-TING(wl849v) <wl849v@att.com>2018-05-23 12:06:51 -0400
commit99758f6f552f9b4560a28657e6712251bfb0243e (patch)
tree4fdbf920063edcbc9b49eab2ccef0531413960c4 /ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf
parent754514a83ad7fdd81eaf393ef7c6bfcb64e4c9fe (diff)
pom version upgrade
Issue-ID: PORTAL-210 upgrade pom to 2.5.5 Change-Id: I94c36cba54bd528596c5ad4f672474ea45c4aba5 Signed-off-by: Lo, WEI-TING(wl849v) <wl849v@att.com>
Diffstat (limited to 'ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf')
-rw-r--r--ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java41
1 files changed, 26 insertions, 15 deletions
diff --git a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java
index 7d2e51ff..93f52dd3 100644
--- a/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java
+++ b/ecomp-sdk/epsdk-music/src/main/java/org/onap/portalapp/music/conf/MusicSessionRepositoryHandler.java
@@ -55,39 +55,50 @@ public class MusicSessionRepositoryHandler {
public Session get(String id) {
- if(!musicCache){
+ if(musicCache){
+ // todo need to add the clean up for "sessions" map if musicCache is enabled
+ return this.sessions.get(id);
+ }else{
try {
Session session = MusicService.getMetaAttribute(id);
return session;
} catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, "get failed with id " + id, e);
+ return null;
}
}
- return this.sessions.get(id);
}
public void remove(String id) {
- sessions.remove(id);
- try {
- MusicService.removeSession(id);
- } catch (MusicLockingException e) {
- logger.error(EELFLoggerDelegate.errorLogger, "removeSession locking failed with id " + id, e);
- } catch (MusicServiceException e) {
- logger.error(EELFLoggerDelegate.errorLogger, "removeSession failed with id " + id, e);
+ if(musicCache){
+ // todo need to add the clean up for "sessions" map if musicCache is enabled
+ sessions.remove(id);
+ }else{
+ try {
+ MusicService.removeSession(id);
+ } catch (MusicLockingException e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "removeSession locking failed with id " + id, e);
+ } catch (MusicServiceException e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "removeSession failed with id " + id, e);
+ }
}
}
public void put(String id, MusicSession musicSession) {
- sessions.put(id, musicSession);
- try {
- MusicService.setMetaAttribute(musicSession);
- MusicService.cleanUpMusic();
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, "setMetaAttribute failed with id " + id, e);
+ if(musicCache){
+ // todo need to add the clean up for "sessions" map if musicCache is enabled
+ sessions.put(id, musicSession);
+ }else{
+ try {
+ MusicService.setMetaAttribute(musicSession);
+ MusicService.cleanUpMusic();
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "setMetaAttribute failed with id " + id, e);
+ }
}
}