/** * Associate a subnet to an existing route table */ public DeferredResult<Void> associateSubnetToRouteTable(String routeTableId, String subnetId) { AssociateRouteTableRequest req = new AssociateRouteTableRequest() .withSubnetId(subnetId) .withRouteTableId(routeTableId); String message = "Associate AWS Subnet [" + subnetId + "] to route table [" + routeTableId + "]."; AWSDeferredResultAsyncHandler<AssociateRouteTableRequest, AssociateRouteTableResult> handler = new AWSDeferredResultAsyncHandler<>(this.service, message); this.client.associateRouteTableAsync(req, handler); return handler.toDeferredResult() .thenAccept(ignore -> { }); }
@Override public RouteTableAssociation associateWithSubnet(AssociateRouteTableRequest request, ResultCapture<AssociateRouteTableResult> extractor) { ActionResult result = resource.performAction("AssociateWithSubnet", request, extractor); if (result == null) return null; return new RouteTableAssociationImpl(result.getResource()); }
@Override public AssociateRouteTableResult associateRouteTable(AssociateRouteTableRequest associateRouteTableRequest) throws AmazonServiceException, AmazonClientException { throw new UnsupportedOperationException("Not supported in mock"); }
/** * Performs the <code>AssociateWithSubnet</code> action and use a * ResultCapture to retrieve the low-level client response. * * <p> * The following request parameters will be populated from the data of this * <code>RouteTable</code> resource, and any conflicting parameter value set * in the request will be overridden: * <ul> * <li> * <b><code>RouteTableId</code></b> * - mapped from the <code>Id</code> identifier. * </li> * </ul> * * <p> * * @return The <code>RouteTableAssociation</code> resource object associated * with the result of this action. * @see AssociateRouteTableRequest */ RouteTableAssociation associateWithSubnet(AssociateRouteTableRequest request , ResultCapture<AssociateRouteTableResult> extractor);