- public static Integer getUniqueId(IdManager idManager, String idKey) {
- GetUniqueIdInput getIdInput = new GetUniqueIdInputBuilder()
- .setPoolName(IfmConstants.IFM_LPORT_TAG_IDPOOL_NAME)
- .setIdKey(idKey).build();
-
- try {
- Future<RpcResult<GetUniqueIdOutput>> result = idManager.
- getUniqueId(getIdInput);
- RpcResult<GetUniqueIdOutput> rpcResult = result.get();
- if(rpcResult.isSuccessful()) {
- return rpcResult.getResult().getIdValue().intValue();
- } else {
- LOG.warn("RPC Call to Get Unique Id returned with Errors {}", rpcResult.getErrors());
- }
- } catch (NullPointerException | InterruptedException | ExecutionException e) {
- LOG.warn("Exception when getting Unique Id",e);
- }
- return 0;
- }
-