docs: @Override
      public void setAttribute(ObjectName name,
                               Attribute attribute) throws InstanceNotFoundException, AttributeNotFoundException, InvalidAttributeValueException, MBeanException, ReflectionException, IOException {
          final String sourceMethod = "setAttribute";
          checkConnection();
          if (name == null)
              throw new RuntimeOperationsException(new IllegalArgumentException(RESTClientMessagesUtil.getMessage(RESTClientMessagesUtil.OBJECT_NAME_NULL)));
          else if (name.isPattern())
              throw new InstanceNotFoundException(RESTClientMessagesUtil.getMessage(RESTClientMessagesUtil.OBJECT_NAME_PATTERN, name));
          else if (attribute == null)
              throw new RuntimeOperationsException(new IllegalArgumentException(RESTClientMessagesUtil.getMessage(RESTClientMessagesUtil.ATTRIBUTE_NULL)));
  
          URL attributeURL;
          HttpsURLConnection connection;
          JSONConverter converter = JSONConverter.getConverter();
          try {
              // Get URL for attribute
              attributeURL = getAttributeURL(name, attribute.getName());
          } catch (ConnectException ce) {
              // Server is down; not a client bug
              throw ce;
          } catch (IntrospectionException intro) {
              getRequestErrorException(sourceMethod, intro);
              throw new IOException(intro);
          } catch (IOException io) {
              throw getRequestErrorException(sourceMethod, io);
          } finally {
              JSONConverter.returnConverter(converter);
          }
  
          try {
  
              // Get connection to server
              connection = getConnection(attributeURL, HttpMethod.PUT);
          } catch (IOException io) {
              throw getRequestErrorException(sourceMethod, io, attributeURL);
          } finally {
              JSONConverter.returnConverter(converter);
          }
  
          try {
              // Write Invocation JSON to connection output stream
              OutputStream output = connection.getOutputStream();
              converter.writePOJO(output, attribute.getValue());
              output.flush();
              output.close();
          } catch (ConnectException ce) {
              recoverConnection(ce);
              // Server is down; not a client bug
              throw ce;
          } catch (IOException io) {
              throw getRequestErrorException(sourceMethod, io, attributeURL);
          } finally {
              JSONConverter.returnConverter(converter);
          }
  
          // Check response code from server
          int responseCode = 0;
          try {
              responseCode = connection.getResponseCode();
          } catch (ConnectException ce) {
              recoverConnection(ce);
              // Server is down; not a client bug
              throw ce;
          }
          switch (responseCode) {
              case HttpURLConnection.HTTP_NO_CONTENT:
                  // No content expected
                  return;
              case HttpURLConnection.HTTP_BAD_REQUEST:
              case HttpURLConnection.HTTP_INTERNAL_ERROR:
                  try {
                      // Server response should be a serialized Throwable
                      throw getServerThrowable(sourceMethod, connection);
                  } catch (MBeanException me) {
                      throw me;
                  } catch (RuntimeMBeanException rme) {
                      throw rme;
                  } catch (AttributeNotFoundException anf) {
                      throw anf;
                  } catch (InstanceNotFoundException inf) {
                      throw inf;
                  } catch (InvalidAttributeValueException iav) {
                      throw iav;
                  } catch (ReflectionException re) {
                      throw re;
                  } catch (IOException io) {
                      throw io;
                  } catch (Throwable t) {
                      throw new IOException(RESTClientMessagesUtil.getMessage(RESTClientMessagesUtil.UNEXPECTED_SERVER_THROWABLE), t);
                  }
              case HttpURLConnection.HTTP_UNAUTHORIZED:
              case HttpURLConnection.HTTP_FORBIDDEN:
                  throw getBadCredentialsException(responseCode, connection);
              case HttpURLConnection.HTTP_GONE:
              case HttpURLConnection.HTTP_NOT_FOUND:
                  IOException ioe = getResponseCodeErrorException(sourceMethod, responseCode, connection);
                  recoverConnection(ioe);
                  throw ioe;
              default:
                  throw getResponseCodeErrorException(sourceMethod, responseCode, connection);
          }
  
      }