- @Override
- public void run(ExtsysAppConfiguration configuration, Environment environment) {
- LOGGER.info("Start to initialize esr.");
- MsbConfig.setMsbServerAddr(configuration.getMsbServerAddr());
- MsbConfig.setMsbDiscoveryIp(configuration.getMsbDiscoveryIp());
- MsbConfig.setMsbDiscoveryPort(configuration.getMsbDiscoveryPort());
- environment.jersey().register(new EmsManager());
- environment.jersey().register(new ThirdpatySdncManager());
- environment.jersey().register(new VimManager());
- environment.jersey().register(new VnfmManager());
- environment.jersey().register(new ServiceTest());
- if (configuration.getRegistByHand().equals("true")){
- String MSB_IP=configuration.getMsbDiscoveryIp();
- Integer MSB_Port= Integer.valueOf(configuration.getMsbDiscoveryPort());
- MSBServiceClient msbClient = new MSBServiceClient(MSB_IP, MSB_Port);
- MsbHelper helper = new MsbHelper(msbClient);
- try {
- helper.registerMsb();
- LOGGER.info("Register esr-server to msb by java-sdk finished");
- } catch (Exception e) {
- LOGGER.error("Register esr-server to msb by java-sdk failed", e);
- }
+ @Override
+ public void run(ExtsysAppConfiguration configuration, Environment environment) {
+ LOGGER.info("Start to initialize esr.");
+ MsbConfig.setMsbServerAddr(configuration.getMsbServerAddr());
+ MsbConfig.setMsbDiscoveryIp(configuration.getMsbDiscoveryIp());
+ MsbConfig.setMsbDiscoveryPort(configuration.getMsbDiscoveryPort());
+ environment.jersey().register(new EmsManager());
+ environment.jersey().register(new ThirdpartySdncManager());
+ environment.jersey().register(new VimManager());
+ environment.jersey().register(new VnfmManager());
+ environment.jersey().register(new ServiceTest());
+ initSwaggerConfig(environment, configuration);
+ if ("false".equals(configuration.getRegistByHand())) {
+ String MSB_IP = configuration.getMsbDiscoveryIp();
+ Integer MSB_Port = Integer.valueOf(configuration.getMsbDiscoveryPort());
+ MSBServiceClient msbClient = new MSBServiceClient(MSB_IP, MSB_Port);
+ MsbHelper helper = new MsbHelper(msbClient);
+ try {
+ helper.registerMsb();
+ LOGGER.info("Register esr-server to msb by java-sdk finished");
+ } catch (Exception e) {
+ LOGGER.error("Register esr-server to msb by java-sdk failed", e);
+ }
+ }
+ LOGGER.info("Initialize extsys finished.");