Source:
<code>private KalturaLiveEntry onClientConnect(WMSProperties properties, HashMap<String, String> requestParams) throws KalturaApiException, ClientConnectException, Exception { if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_ENTRY_ID)){ throw new ClientConnectException("Missing argument: entryId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_TOKEN)){ throw new ClientConnectException("Missing argument: token"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_PARTNER_ID)){ throw new ClientConnectException("Missing argument: partnerId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_SERVER_INDEX)){ throw new ClientConnectException("Missing argument: server index"); } int partnerId = Integer.parseInt(requestParams.get(Constants.REQUEST_PROPERTY_PARTNER_ID)); String entryId = requestParams.get(Constants.REQUEST_PROPERTY_ENTRY_ID); KalturaEntryServerNodeType serverIndex = KalturaEntryServerNodeType.get(requestParams.get(Constants.REQUEST_PROPERTY_SERVER_INDEX)); Object authenticationLock = KalturaEntryDataPersistence.setLock(entryId); synchronized (authenticationLock) { <START> try { <END> if ((boolean)KalturaEntryDataPersistence.getPropertyByEntry(entryId, Constants.KALTURA_ENTRY_AUTHENTICATION_ERROR_FLAG)) { throw new Exception("(" + entryId + ") Authentication failed for entry!"); } String token = requestParams.get(Constants.REQUEST_PROPERTY_TOKEN); KalturaLiveEntry liveEntry = authenticate(entryId, partnerId, token, serverIndex); synchronized (properties) { properties.setProperty(Constants.CLIENT_PROPERTY_SERVER_INDEX, requestParams.get(Constants.REQUEST_PROPERTY_SERVER_INDEX)); properties.setProperty(Constants.KALTURA_LIVE_ENTRY_ID, entryId); } return liveEntry; } catch (Exception e) { KalturaEntryDataPersistence.setProperty(entryId, Constants.KALTURA_ENTRY_AUTHENTICATION_ERROR_FLAG, true); throw e; } } }</code><technical_language>pls put try & catch authentication lock</technical_language>

Target:
private void onClientConnect(WMSProperties properties, HashMap<String, String> requestParams) throws KalturaApiException, ClientConnectException, Exception { if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_ENTRY_ID)){ throw new ClientConnectException("Missing argument: entryId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_TOKEN)){ throw new ClientConnectException("Missing argument: token"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_PARTNER_ID)){ throw new ClientConnectException("Missing argument: partnerId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_SERVER_INDEX)){ throw new ClientConnectException("Missing argument: server index"); } int partnerId = Integer.parseInt(requestParams.get(Constants.REQUEST_PROPERTY_PARTNER_ID)); String entryId = requestParams.get(Constants.REQUEST_PROPERTY_ENTRY_ID); String propertyServerIndex = requestParams.get(Constants.REQUEST_PROPERTY_SERVER_INDEX); String token = requestParams.get(Constants.REQUEST_PROPERTY_TOKEN); KalturaEntryServerNodeType serverIndex = KalturaEntryServerNodeType.get(propertyServerIndex); synchronized (properties) { properties.setProperty(Constants.CLIENT_PROPERTY_SERVER_INDEX, propertyServerIndex); properties.setProperty(Constants.KALTURA_LIVE_ENTRY_ID, entryId); } authenticate(entryId, partnerId, token, serverIndex); }