code: public void checkWritePermission(TimedDirContext ctx) throws OperationNotSupportedException {
          if (!iWriteToSecondary) {
              String providerURL = getProviderURL(ctx);
              if (!getPrimaryURL().equalsIgnoreCase(providerURL)) {
                  String msg = Tr.formatMessage(tc, WIMMessageKey.WRITE_TO_SECONDARY_SERVERS_NOT_ALLOWED, WIMMessageHelper.generateMsgParms(providerURL));
                  throw new OperationNotSupportedException(WIMMessageKey.WRITE_TO_SECONDARY_SERVERS_NOT_ALLOWED, msg);
              }
          }
      }
docs: Check whether we can write on the LDAP server the context is currently connected to. It is not
  permissible to write to a fail-over server if write to secondary is disabled.
  
  @param ctx The context with a connection to the current LDAP server.
  @throws OperationNotSupportedException If write to secondary is disabled and the context
  is not connected to the primary LDAP server.