public void updateInstanceUri ( String serviceName , String instanceId , String uri , boolean isOwned ) { String serviceUri = toInstanceUri ( serviceName , instanceId ) + "/uri" ; String body = null ; try { body = "uri=" + URLEncoder . encode ( uri , "UTF-8" ) + "&isOwned=" + isOwned ; } catch ( UnsupportedEncodingException e ) { LOGGER . error ( "UTF-8 not supported. " , e ) ; } Map < String , String > headers = new HashMap < String , String > ( ) ; headers . put ( "Content-Type" , "application/x-www-form-urlencoded" ) ; HttpResponse result = invoker . invoke ( serviceUri , body , HttpMethod . PUT , headers ) ; if ( result . getHttpCode ( ) != HTTP_OK ) { throw new ServiceException ( ErrorCode . REMOTE_DIRECTORY_SERVER_ERROR , "HTTP Code is not OK, code=%s" , result . getHttpCode ( ) ) ; } }
Update the ServiceInstance attribute uri .