/*
	Licensed Material - Property of IBM

	(C) Copyright 2015,2016 IBM Corp.

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
*/


'use strict';

/*
Builds the Windows mfpclient.properties file or updates it if oldData !== undefined
*/
function buildClientProperties(reswObj, serverInfo, runtime){
    var server = serverInfo;
    if(server.protocol){
      reswObj.setDataEntry('wlServerProtocol', server.protocol);
    }
    if(server.host){
      reswObj.setDataEntry('wlServerHost', server.host);
    }
    if(server.port){
      reswObj.setDataEntry('wlServerPort', server.port);
    }
    if(runtime){
      reswObj.setDataEntry('wlServerContext', '/'+runtime+'/');
    }

    return reswObj;
}

module.exports = buildClientProperties;
