User:PrabasSrinivas/sandbox

TSS WEB API

Welcome to the wiki page for the TSS Web API
Hi welcome to this wiki page for TSS-API project related information,S/W info,work-space setup,git commands for code commit into remote, deployment process and so on.. Hope it will helpful and understandable.

The Team
Senior Developer   - Andersson Johan : JohanC.Andersson@telenor.com Developer          - Srinivasarao Guntakala: Srinivasarao.Guntakala@telenor.com Tester            - Johansson Lennie: Lennie.Johansson@telenor.se

Prerequisite
Order Capture Fixed Data,is using Java SE 8 and Java EE7 as core technologies. Required Software List: Windows-7 / 8 : Based on Windows version and bit version
 * MongoDB (http://www.mongodb.org/)
 * Java-1.8.0_92(jdk-8u92) (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
 * Wildfly 10.0.0 Final   (http://wildfly.org/downloads/)
 * Eclipse Mars.2 (4.5.2)  (https://www.eclipse.org/downloads/)
 * maven 3.3.9             (https://maven.apache.org/download.cgi) Binary Zip archive(apache-maven-3.3.9-bin.zip)
 * Git-2.8.2-64-bit        (https://git-scm.com/downloads)
 * MySQL Workbench 6.3.6   (https://dev.mysql.com/downloads/workbench/)
 * Mongodb 3.2.6	(https://www.mongodb.org/dl/win32/x86_64) [Download mongodb-win32-x86_64-2008plus-3.2.0.zip

Pre-Check and Set up Environment variables for Maven and Java if not yet done
Open the command prompt and see the whether maven and java has been set properly or not by using the command mvn -version and java -version. if these are sets properly we will get the below result. C:\Users\sg889540>mvn -version Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:4     7+01:00) Maven home: H:\TSSAPI\softwares\apache-maven-3.3.9 Java version: 1.8.0_92, vendor: Oracle Corporation Java home: C:\Program Files\Java\jdk1.8.0_92\jre Default locale: en_US, platform encoding: Cp1252 OS name: "windows 7", version: "6.1", arch: "amd64", family: "dos"

H->TSSAPI->username->software H->TSSAPI->username->workspace H->TSSAPI->username->maven_repo
 * If it doesn't shown the maven details then need to set the environment variables for java and maven.
 * Create a folder structure inside H drive(Citrix users user H drive instead of C). below is for your individual set-up.

NOTE for Citrix Users:

rundll32.exe sysdm.cpl,EditEnvironmentVariables .It will open the environment variables screen. In this screen we don't have permissions to edit System variables.So, use "user variables for " instead of System variables and add the JAVA_HOME,M2_HOME and PATH using the New button. Example :
 * 1) Copy or download the maven s/w into  H->TSSAPI->username->software and for your own maven repository  change the path to  H->TSSAPI->username->maven_repo in the settings.xml file.
 * 2) In Citrix machines we don't have permissions to open the environment variables through the GUI.So, open the Run dialogue box and enter the command "

for ex. : JAVA_HOME = C:\Program Files\Java\jdk1.8.0_92 M2_HOME  = C:\Program Files\apache-maven-3.3.9 PATH = %PATH%;%JAVA_HOME%\bin;%M2_HOME%\bin; ( if PATH exists then just append %JAVA_HOME%\bin;%M2_HOME%\bin; to the existing path string)
 * Now we will able to see the version of java and maven in command prompt.

Gerrit Code Review @Telenor
Today (2015-01-13) Gerrit is used by the Open Universe, Bredbandsbolaget, IPSUM, Företagsportalen, App-API and OCFDprojects. Open Universe has had a great success with using Gerrit together with GIT and Telenor has decided that all portal are going to be migrated to Git/Gerrit so we can enable a more formal code review process (and thereby lower the number of defects).

Below is a simple view of how the workflow looks when working with Gerrit:



Setting up a new project to work with Gerrit is simple since the required infrastructure is already setup and present at Telenor. Take a look below for Telenor specific details used when configuring Gerrit.

Note: Both Maven Repository and Project should be in Same Folder ( either 'C'/'D'/'E' ...) I used project and maven repository under C:\TSSAPI\. Don't use remote directory for project. beacuse while building it will take too much time to place jars in project target folder.
 * Create a folder for TSSAPI project in one drive (if it is telenor pc, use 'C' drive. If it is Citrix, use 'E' drive.(but not in remote drive).

Gerrit is a web based code review system which nicely integrates with Git and Jenkins (see https://code.google.com/p/gerrit/). Every single code modification which is pushed will be intercepted by Gerrit and a submitter/approver must accept the change. Gerrit web UI can be found on http://torvid-test.europolitan.se:8085 for example: git config --global user.name sg889540 git config --global user.email Srinivasarao.Guntakala@telenor.se
 * 1) Install your favorite Git client, e.g.http://git-scm.com/downloads (use default options, Citrix users should already have this client installed)
 * 2) Open the newly installed git bash window and type 'git config --global user.name ' and 'git config --global user.email your-email@telenor.se ' OBS!! Firstname.Lastname@telenor.se (capital letters)

Host torvid-test.europolitan.se KexAlgorithms +diffie-hellman-group1-sha1 Host tr Hostname torvid-test.europolitan.se  Port 29418 User 
 * 1) Create (run ssh-keygen -t rsa in git bash window no need to give any inputs just enter. it will generate ssh-key in c:\User\username\.ssh\  folder by-default) SSH-key pair and copy the text from your local public ssh-key. You can find your public key in ~/.ssh/id_rsa.pub or c:\Users\username\.ssh\id_rsa.pub)
 * 2) Login into Gerrit http://torvid-test.europolitan.se:8085 with standard username and password (TSE/LDAP/Citrix account details)
 * 3) Click on your user name (upper right corner) -> settings -> SSH Public Keys (left menu)
 * 4) Paste your public SSH key into Gerrit which you copied in step 3
 * 5) Go to your git bash window and clone the project you want,you can see in the link under Projects->List->TSS-API->SSH(http://torvid-test.europolitan.se:8085/#/admin/projects/tss-api) e.g.git clone ssh://sg889540@torvid-test.europolitan.se:29418/tss-api (OBS! Use SSH when cloning, not http!).  Make sure your in the correct destination directory for the work-space before you do this.copy this clone path and run in gitbash for import/download/clone the project into your work space folder.
 * 6) Please add below line in .ssh/config file(create this config file if it does not exist, note file name should be config only don't give any extension), if you encounter ssh error while cloning the repository.
 * 1) Run scp -p -P 29418 torvid-test.europolitan.se:hooks/commit-msg .git/hooks/ (Every change in Gerrit is traced by a Change-ID in the commit message. To enable automatic change-IDs this command must be run). Note! You must be in your project directory where you cloned your project!for ex. C:\TSSAPI\workspace\tss-api After running this command known_hosts file will automatically generates into c:\Users\username\.ssh\ location.
 * 2) Add the following to  c:\Users\username\.ssh\config (create this file if it does not exist) only if you intend to use git push review below

note : for the understanding purpose adding myconfig file details. Host tr Hostname torvid-test.europolitan.se  Port 29418 User sg889540 KexAlgorithms +diffie-hellman-group1-sha1 Host torvid-test.europolitan.se KexAlgorithms +diffie-hellman-group1-sha1 User sg889540

Now you should be ready to make your first commit!

The following can be useful to have in c:/users/ /.git/config file .... [remote "review"] url = tr: push = HEAD:refs/for/master

Note : below is my .gitconfig file details [user] email = Srinivasarao.Guntakala@telenor.se   name = sg889540 [merge] tool = kdiff3 [mergetool "kdiff3"] path = C:/Program Files/KDiff3/kdiff3.exe keepBackup = false trustExitCode = false [remote "tssapi"] url = tr:tss-api push = HEAD:refs/for/master [url "https://"] insteadOf = git:// [core] autocrlf = true This enables your to push commited changes via git push instead of git push ssh:// @torvid-test:29418/ HEAD:refs/for/master

for more info http://torvid-test/minasidor/index.php/GerritCodeReview

Build the application (Maven)

 * Open the git bash or command prompt or bash shell. Git bash is recommended
 * Go to the tssapi project directory where you cloned the code (where we have pom.xml, ex : C:\TSSAPI\workspace\tss-api)
 * Run -> mvn clean install

if you get "unable to find valid certification path to requested target" error. That means setting.xml is not configured properly under maven "apache-maven-3.3.9\conf\setting.xml". The fact is that your maven plugin try to connect to an https remote repository (e.g https://repo.maven.apache.org/maven2/) This is a new SSL connectivity for Maven Central was made available in august, 2014 ! So, verify that your settings.xml has the correct configuration and correct it. For back up copy the setting.xml and rename is as setting-old.xml and do the corresponding changes in setting.xml. Based on the our requirement mentioned the maven repository adding the line.(Better Maven Repository and Project should be in Same Folder( Means 'C'/'D'/'E')) C:\TSSAPI\maven_repo ( this is my repository location.)


 * Run -> mvn eclipse:eclipse
 * Run -> mvn eclipse:eclipse -Dwtpversion=2.0

Eclipse Settings and Code set-up

 * 1) Open the Eclipse-Mars or latest one which supports maven and wild-fly server.
 * 2) Go To Window->Preferences->java->Code Style->Formatter and import Google-java-checkstyle.xml from cloned project(for ex, E:\TSSAPI\sg889540\workspace\tss-api) and use it further.
 * 3) Go To window->Preferences->General->Workspace go to "Text file encoding-> Other" change this to UTF-8 and "New text file line delimiter-> Other" change this to UNIX if not there.
 * 4) Go To Window->Preferences->Validation, here please unchecked the check box for 'XMLValidator', 'XML Schema Validator' and 'HTML Syntax Validator' under Build.
 * 5) Select "Help->Eclipse Marketplace..->" search for Checkstyle and install Checkstyle pulg-in 6.16.0.
 * 6) Select "Help->Eclipse Marketplace..->" search for FindBugs and install FindBugs Eclipse Plugin 3.0.1.
 * 7) Now import->Maven->Existing Maven projects-> point the imported directory location.
 * 8) Go To the Windows->Preferences->Maven->User settings and check the setting.xml is correct one or not.if not add the installed maven setting file ( C:\Program Files\apache-maven-3.2.3\conf\settings.xml )
 * 9) In eclipse will show us 4-Maven problems,These are eclipse problems So, by using the quick fix ->Permanently mark goal unpack in pom.xml as ignored in Eclipse build and remove these errors.
 * 10) Below are the problems
 * 11) Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-checkstyle-plugin:2.17:check (execution: validate, phase: validate)
 * 12) Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (execution: default-compile, phase: compile)
 * 13) Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.1:testCompile (execution: default-testCompile, phase: test-compile)
 * 14) Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-dependency-plugin:2.8:unpack (execution: unpack, phase: process-test-classes)
 * 15) Project configuration is not up-to-date with pom.xml. Run Maven->Update Project or use Quick Fix.

Note:If maven libraries are available by-default then don't change any thing.
 * 1) Now we will have one error clear it by running on right click on project -> maven -> Update project
 * 2) Select the tssapi project and right click the project. Goto the the Properties -> java Buildpath->Libraries If, maven libraries not added by default then Add Variable->Select M2_REPO->Extended-> Select All folders. Now required jars are in place.
 * 3) We have several warnings. To resolve these warnings, Right click on imported project(tss-api) and goto Properties->Deployment Assembly -> add -> select Java Build path entries -> click on Next and it will show all M2_REPO jar files. So, select all jars and click on Ok. Now warnings are disappear.
 * 1) If you get strange project errors during the import related to Maven then perform the following additional steps:
 * 2) Delete all the projects from Eclipse again (do not delete it from disk!)
 * 3) Go back to the original directory where you cloned the code
 * 4) Run -> mvn eclipse:clean
 * 5) Go back to Eclipse
 * 6) Import the projects again
 * 7) Go back to the command prompt
 * 8) Run-> mvn install
 * 9) Run-> mvn eclipse:eclipse


 * Congratulations you have done work-space successfully.

Wildfly server set-up
INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 62) WFLYUT0021: Registered web context: / INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "tssapi.war" (runtime-name : "tssapi.war") INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) WFLYSRV0010: Deployed "mysql-connector-java-5.1.38-bin.jar" (runtime-name : "mysql-connector-java-5.1.38-bin.jar") INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started in 32520ms - Started 715 of 1042 services (456 services are  lazy, passive or on-demand)
 * 1) Copy the standalone.xml file from \\edison\PUB_DATA\SGUNTAKALA\TSS-API to installed wildfly server location(for ex: C:\TSSAPI\softwares\wildfly-10.0.0.Final\standalone\configuration)
 * 2) Better to rename the existing standalone file for backup.
 * 3) This standlone.xml file having the evironment details, DB connection and for connection, we need driver class which should be avaiable in "mysql-connector-java-5.1.38-bin.jar".
 * 4) So download this jar from net or copy from from \\edison\PUB_DATA\SGUNTAKALA\TSS-API to installed wildfly server location (for ex: C:\TSSAPI\softwares\wildfly-10.0.0.Final\standalone\deployments)
 * 5) Go To the eclipse,
 * 6) Select "Help->Eclipse Marketplace..." from the Eclipse menu bar. Choose "Eclipse Marketplace" if prompted for a marketplace catalog.
 * 7) Search for "JBoss" and install JBoss Tools 4.3.1 final.
 * 8) Here list of jars will available, We need only widfly related one. So, select "JBOSS AS,Wildfly & EAD servers Tools" and deselect remaining all and Wait until "Calculating requirements..." has finished and make sure that all features are checked, then confirm.
 * 9) Accept the license agreements and click "Finish". It will ask some conformation and select "continue",After installation restart the Eclipse.
 * 10) Now Go to the server and add new server. Now it show the JBOSS Community. (If we miss the above step. it wont show this option).
 * 11) Select the WildFly 10.0 under Jboss community. and press Next.
 * 12) Set the "Home Directory" entry to the installation directory of the WildFly AS, e.g. C:\TSSAPI\softwares\wildfly-10.0.0.Final, and click "Next".
 * 13) By using the "Add" button add the tss-api.war file to server ( from Available to Configured) and click "Finish".
 * 14) If code set-up done, then just start the wildfly server. wait until it starts if it starts successfully we can see the below message on the console.

MSC000001: Failed to start service jboss.deployment.unit."tssapi.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."tssapi.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "tssapi.war"
 * 1) If you get the error like below. please build the project again my using mvn clean install, mvn install.
 * 1) Congratulations, you have successfully installed WildFly,JBoss Tools and Eclipse server configuration!

Mongodb set-up
db.createUser({ user: "TestUser",pwd: "TestUser",roles: [{role: "read",db: "tss"}] })
 * Open the command prompt and Goto the location where we have the mongod.exe (ex. E:\TSSAPI\sg889540\softwares\mongodb-win32-x86_64-2008plus-3.2.0\bin )
 * For the Non-Citrix users, Run the "mongod.exe" file. It will ask the Data Directory So, create the directory manually.(for.ex. C:\data\db).
 * For the citrix users, you need to change the directory location.So use the command mongod.exe --dbpath  (ex. mongod.exe --dbpath E:\TSSAPI\sg889540\mongodb-data ).
 * Run the mongodb client and add the users information
 * 1) Open the another command prompt and Goto the bin folder location. here we have the mongo.exe
 * 2) Run the mongo.exe for adding the database and collections.
 * 3) Add the Database by using the command use tss.
 * 4) create the user by using the below commad

db.user.ensureIndex( { username:1}, {unique : true} )

Run the below command for Eniro :
 * Add the access server details towards TSS-API by using the below commands.

db.user.insert({"username": "Eniro",          "password": "UJaEg2G556kO3uyF2RMyhlSpOPSRKP7LuyTbrS4V6nw=$SnCsqsLj/OouxjqzhMXlOEwT3S0RgLSgNrh5+YA4MEM=",           "userrole": "TSS_AGENT" }) Run the below command for DeliveryPortal: db.user.insert({"username": "DeliveryPortal",           "password": "S0uOIM+iY7z+OGB6U4L2mXhsM5vb0YqqGhZ6Njhl0Ks=$rGmasPY4PUbEkIDXiQSu9U96PyVFrjCanAfL1fBTyoE=",            "userrole": "TELENOR_SYSTEM_ADMINISTRATOR" })


 * Now we have successfully configured user details towards TSS-API by using Mongodb.
 * Next time when you want to run the mangodb you need to run the command mongod.exe --dbpath E:\TSSAPI\ \mongodb-data under bin folder


 * Note: For stating the mongoDB we need to run the mongod.exe for non-citix users(mongod.exe --dbpath E:\TSSAPI\ \mongodb-data for citix users) and for shout-down/close use Ctrl+c. Don't use close button.

Making your first commit and push to Gerrit
If you have cloned 'Gerrit Playgroud' you can make a change in the file test.txt (NOTE! You could also type git push review if you have set the review alias in your Git config)
 * 1) type git add test.txt in the git bash window
 * 2) type git commit -m "My first change comment"
 * 3) type  git push ssh:// @torvid-test:29418/"Gerrit Playground" HEAD:refs/for/master (master is the name of the branch)

Now the change you commited to your local repository should be visible in Gerrit!

Creating a patch set
If your commit is not approved, you need to create at patch set. This is done in by the following steps
 * 1) type git pull --rebase to get the latest changes in your local repo
 * 2) Modify the file(s) that you need to update
 * 3) type git add XXX XXX XXXX XXX ( XXX means changed/ne files along with path)
 * 4) type git commit --amend  NOTE! You must add the flag --amend since that will not create a new commit, but instead reuse the previous one
 * 5) type git push review (assuming you setup the review alias in your Git config)
 * 6) http://torvid-test.europolitan.se:8085/#/dashboard/self is the Gerrit review link

Useful git commads

 * git add  : add the changed file to local repository.
 * git add . : add the all changed files to local repository.
 * git pull --rebase : take the update on the top of our local changes.
 * git pull --rebase --stat : take the update on the to of our local changes and see the list of upcoming changed files.
 * git diff filename : to see the difference from local with remote.
 * git status : to know the status
 * git checkout -- file1 file2 file3 ....  : check out the files
 * git log
 * git commit -m "commit message"  : to commit the changes with some commit message.
 * git commit --amend  : to commit the changes on the top of previous commit.
 * git push tssapi : to push the changes into tssapi repository.


 * It is highly recommended that always take latest code from remote first and then do the commit.

If we have code changes in our repository and trying to take latest changes from remote/head, git won't allow to take before commit our changes. So, we need to stash our changes first then take the latest code form remote and un-stash your changes. So that we have both latest code and local change code. By using the bellow commands we can achieve this process.
 * 1) git stash : Stash/place our changes from local repository.
 * 2) git pull --rebase : Take the latest updates into our branch.
 * 3) git stash pop : After taking the latest update un-stash our changes into local repository.

Commit and push the local code changes in our local repository by follow the below steps.
 * 1) mvn install  : Build the project.if build success then only commit the changes else fix the issues and the commit.
 * 2) git add  or git add .(for all files) : Add the changed file to repository.
 * 3) git commit -m "commit message" : Commit the changes into local repository using for the first commit after that if we have any code review changes on the top of the same commit then no need to give the commit message use the existing one only by using the git commit --amend.(This can use only on the top of previous commit files, if we have any code review changes or some build related changes ....
 * 4) git push tssapi : Push the changes into remote repository using.

If commit isn't successful due to wrong commit process or tried to commit on the top of another team member's last commit.
 * 1) git reset --soft HEAD^1 will get back our changes back into local work-space.
 * 2) git stash
 * 3) git pull --rebase
 * 4)  git add .
 * 5) git commit -m "commit related messages
 * 6) git push tssapi

Server details for TSS Web API
We have two servers for maintain the load balance. there is no downtime for these servers. If we want to deploy then one server we will shutdown and deploy the changes and start the server. check the changes are working fine or not. if everything is fine? then do the deployment on second server. If not rollback the changes from fist one. So that there is no impact/problems for the production servers.

tnstssbmap001 : 10.81.20.4 tnstssbmap002 : 10.81.20.5
 * Production

tnstssbmat801 : 10.81.20.20 tnstssbmat802 : 10.81.20.21 Note: We don't have stage servers for this application. we need to use the test servers for both development and AT/SIT teams accordingly
 * Test and development server

Server Set-UP
db.createUser({ user: "ProdUser",pwd: "ProdUser",roles: [{role: "read",db: "tss"}] }) db.user.ensureIndex( { username:1}, {unique : true} ) Run the below command for Eniro : db.user.insert({"username": "Eniro",          "password": "UJaEg2G556kO3uyF2RMyhlSpOPSRKP7LuyTbrS4V6nw=$SnCsqsLj/OouxjqzhMXlOEwT3S0RgLSgNrh5+YA4MEM=",           "userrole": "TSS_AGENT" }) Run the below command for DeliveryPortal: db.user.insert({"username": "DeliveryPortal",           "password": "S0uOIM+iY7z+OGB6U4L2mXhsM5vb0YqqGhZ6Njhl0Ks=$rGmasPY4PUbEkIDXiQSu9U96PyVFrjCanAfL1fBTyoE=",            "userrole": "TELENOR_SYSTEM_ADMINISTRATOR" })
 * 1) Login into server using Putty. for example login we can take tnstssbmap002
 * 2) create local user. for example username : tsswebapi password: xxxxxxxxx
 * 3) Go to var location by using cd /var/.
 * 4) make a new directory tss, if not availabl by using mkdir tss.
 * 5) run the below command
 * 6) sudo chown tsswebapi tss/
 * 7) sudo chgrp tsswebapi tss/
 * 8) Go to the hosts location by using sudo vi /etc/hosts, provide the server name here and save that information
 * 9) login into tnstssbmap002 server by using Winscp.
 * 10) goto the var->tss folder and copy the java,mongoDB and Wildfly Zip files which are downloaded for our project set-up and create a mongodata folder for DB.
 * 11) In putty go to the tss location and unzip the above copied 3 zip files by suing the commad tar -zxvf java-xxxxxxxx,tar -zxvf mongoDB-xxxxx and tar -zxvf Wildfly-xxxxx
 * 12) Now we have these 3 software folders so, we can delete the zip files from tss folder.
 * 13) We need to set-up *mongoDB* for server.
 * 14) go to the mongodb-xxxx->bin location and run the command ./mongod --dbpath /var/tss/mongodata &
 * 15) Add the Database by using the command use tss.
 * 16) create the user by using the below commad
 * 1) Add the access server details towards TSS-API by using the below commands.
 * 1) Now we have completed the MongoDB set-up for server like a code base.
 * 2) We need to set-up wildfly server.
 * 3) Go to the 'wildfly->bin folder and here we have standalone.conf file.please add the JAVA_HOME and provide the jdk path.
 * 4) Go to the wildfly->standalone->configuration->standalone.xml. open this xml file, add the details like system variables,DB details,Log details and address binding and soon..
 * 5) Go to the wildfly->standalone->deployments. place the mysql-connector-java-xxxx.jar file from our downloads.

Deployment Process
TokenCache will having the auto generated token for active-user and In prod server every 4-hrs( Test-1hr, dev -30min. ) user login details will removed.
 * 1) Open and login into the prod server by using putty.
 * 2) run the below commands
 * 3) cd /var/tss/wildfly-10.0.0.final
 * 4) ps -ef |grep java
 * 5) tail -500f standalone/log/server.log
 * 6) goto deployment folder and place the tssapi.war file into this location.
 * 7) Run the command ./bin/standalone.sh & for start the application.
 * 8) Now test the application and see the logs accordingly.
 * 9) for example tail -500f standalone/log/tss.transactions.log for checking the transaction logs
 * 10) test the all logs are correctly happin or not.
 * 11) Do the same process for second production sever.Every time one sever must be up and running.
 * 12) TSSAPI have two production servers for maintaining the load balance. Load balance is distributed based on the active-user information. for example P001 server handling the active-user#123 request and this user login information is cached till next 4 hours in this server. and another server P002 will handle the another active-user#124 and follows the same process.But we never know how these servers will distribute these requests because these are threads.
 * 1) For stop the sever run the command in bin under the bin folder kill xxxx(process number).

Data Base
We are using vu8020 database and This DB is already in use which is providing by Huwaei. For development,testing and production we are using the same DB. because we have only Read Only permissions. We are reading the data from one of the slave/cloned DB.

URLs

 * 1) Test URLs
 * 2) https://telcoapi-test.se.telenor.net/api-docs/
 * 3) https://telcoapi-test.se.telenor.net/api/swagger.json  for explore the swagger Gui
 * 4) Production URLs
 * 5) https://telcoapi.se.telenor.net/api-docs/
 * 6) https://telcoapi.se.telenor.net/api/swagger.json for explore the swagger Gui
 * 7) Dev URLs:
 * 8) http://127.0.0.1:8080/api-docs/#!/ or http://localhost:8080/api-docs/#!/
 * 9) http://localhost:8080/api/swagger.json  for explore the swagger Gui
 * 10) Gerrit MyReview
 * 11) http://torvid-test.europolitan.se:8085/#/dashboard/self
 * 12) Jenkins
 * 13) http://torvid-test.europolitan.se:8090/job/tss-api-gerrit-auto-master/93/

Access information
For Eniro: User name : Eniro Password : 5ekfo74ej4ta41dgms1hokm2s5

For DeliveryPortal: User name : DeliveryPortal Password : isi0ljglga8q23bqu3i12pii8p

What is the TSS-API?
This api wraps/encapsulated the database with an easy to use RESTful api, for the purpose of 1.limit the information from the database based on the user access. 2.We hide the complexity from the db. Because existing Api is that, there are limits in the information which it retrieved.

How many Uses are using this API? and how they will use?
For now we have below two users Delivery Portal : Delivery Portal will be able to extract comprehensive customer data from VU80/20 through this API for provisioning. Because Today's API doesn't return all needed the data that we provision from Delivery Portal Eniro : They are building an answering service which uses the data from vu8020 database.

Domain Objects
User : the logged user information into the tssapi. Role : role objects represents the complete information about a company, organization or a person. RoleNode : This Object holds the first and last name, roleId and list of parent roleIds. Reference : This object holds the reference information and helps to divert the call to some another available person in the same role.if the specific person isn't available. Tips : Any helpful information which helps to the telephonist which goes into the tips. ex. greeting message Message Template : Search Words : Role Image : The user image or a company logo

Code flow
TSS-API application contains swagger related stuff under src/main/webapp/api-docs. So, we need to run this swagger configuration file under this folder by using the URL https://telcoapi-test.se.telenor.net/api-docs/. Inside this folder swagger.json will execute and https://telcoapi-test.se.telenor.net/api/swagger.json will generate the json data by using all swagger annotations in side the application.This json should explore, then it will automatically generates the Swagger GUI screen. Now we can see the API GUI screen.

Release versions
http://torvid-test/minasidor/index.php/TSS_WEB_API/TSS_WB_API_versions TSS WEB API Release versions