static void extractPorts ( final Map < String , Integer > input , final Map < ServiceType , Integer > ports , final Map < ServiceType , Integer > sslPorts ) { for ( Map . Entry < String , Integer > entry : input . entrySet ( ) ) { String service = entry . getKey ( ) ; int port = entry . getValue ( ) ; if ( service . equals ( "mgmt" ) ) { ports . put ( ServiceType . CONFIG , port ) ; } else if ( service . equals ( "capi" ) ) { ports . put ( ServiceType . VIEW , port ) ; } else if ( service . equals ( "kv" ) ) { ports . put ( ServiceType . BINARY , port ) ; } else if ( service . equals ( "kvSSL" ) ) { sslPorts . put ( ServiceType . BINARY , port ) ; } else if ( service . equals ( "capiSSL" ) ) { sslPorts . put ( ServiceType . VIEW , port ) ; } else if ( service . equals ( "mgmtSSL" ) ) { sslPorts . put ( ServiceType . CONFIG , port ) ; } else if ( service . equals ( "n1ql" ) ) { ports . put ( ServiceType . QUERY , port ) ; } else if ( service . equals ( "n1qlSSL" ) ) { sslPorts . put ( ServiceType . QUERY , port ) ; } else if ( service . equals ( "fts" ) ) { ports . put ( ServiceType . SEARCH , port ) ; } else if ( service . equals ( "ftsSSL" ) ) { sslPorts . put ( ServiceType . SEARCH , port ) ; } else if ( service . equals ( "cbas" ) ) { ports . put ( ServiceType . ANALYTICS , port ) ; } else if ( service . equals ( "cbasSSL" ) ) { sslPorts . put ( ServiceType . ANALYTICS , port ) ; } } }
Helper method to extract ports from the raw services port mapping .