@Override public void handleGet(Operation get) { NetworkInterfaceState currentState = getState(get); boolean doExpand = get.getUri().getQuery() != null && UriUtils.hasODataExpandParamValue(get.getUri()); if (!doExpand) { get.setBody(currentState).complete(); return; } // retrieve the description and include in an augmented version of our // state. Operation getDesc = Operation .createGet(this, currentState.networkInterfaceDescriptionLink) .setCompletion( (o, e) -> { if (e != null) { get.fail(e); return; } NetworkInterfaceDescription desc = o .getBody(NetworkInterfaceDescription.class); NetworkInterfaceStateWithDescription stateWithDesc = NetworkInterfaceStateWithDescription .create(desc, currentState); get.setBody(stateWithDesc).complete(); }); sendRequest(getDesc); }
@Override public void handleGet(Operation get) { NetworkInterfaceState currentState = getState(get); boolean doExpand = get.getUri().getQuery() != null && UriUtils.hasODataExpandParamValue(get.getUri()); if (!doExpand) { get.setBody(currentState).complete(); return; } // retrieve the description and include in an augmented version of our // state. Operation getDesc = Operation .createGet(this, currentState.networkInterfaceDescriptionLink) .setCompletion( (o, e) -> { if (e != null) { get.fail(e); return; } NetworkInterfaceDescription desc = o .getBody(NetworkInterfaceDescription.class); NetworkInterfaceStateWithDescription stateWithDesc = NetworkInterfaceStateWithDescription .create(desc, currentState); get.setBody(stateWithDesc).complete(); }); sendRequest(getDesc); }