public String getDataCenterOfServer ( final String server ) { final ODocument dcs = configuration . field ( DCS ) ; if ( dcs != null ) { for ( String dc : dcs . fieldNames ( ) ) { final ODocument dcConfig = dcs . field ( dc ) ; if ( dcConfig != null ) { final List < String > dcServers = dcConfig . field ( "servers" ) ; if ( dcServers != null && ! dcServers . isEmpty ( ) ) { if ( dcServers . contains ( server ) ) // FOUND return dc ; } } } } // NOT FOUND return null ; }
Returns the data center where the server belongs .