Create a DeleteDurable request for an existing durable connection.

@param subName the name of the subscription to delete.
@param reqID The request ID to be used for the request.
@param dme The dme to which the request should be sent
8886
protected static ControlDeleteDurable createDurableDeleteDurable(
    MessageProcessor MP,
    String subName,
    String userName,
    long reqID,
    SIBUuid8 dme) 
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "createDurableDeleteDurable", new Object[] {MP, subName, userName, new Long(reqID), dme});

    ControlDeleteDurable msg = null;
      
    try
    {
      // Create and initialize the message
      msg = MessageProcessor.getControlMessageFactory().createNewControlDeleteDurable();
      initializeControlMessage(MP.getMessagingEngineUuid(), msg, dme);
      
      // Parameterize for CreateStream
      msg.setRequestID(reqID);
      msg.setDurableSubName(subName);
      msg.setSecurityUserid(userName);
    }
    catch (Exception e)
    {
      FFDCFilter.processException(e,
        "com.ibm.ws.sib.processor.impl.DurableInputHandler.createDurableDeleteDurable",
        "1:540:1.52.1.1",
        DurableInputHandler.class);
      SibTr.exception(tc, e);
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createDurableDeleteDurable", msg);
      
    return msg;
  }
814401
final Deferred<Object> delete(final byte[] key, final byte[][] qualifiers) {
    return client.delete(new DeleteRequest(table, key, FAMILY, qualifiers));
  }
921710
public ProjectSubscriptionName deleteSubscription(String subscriptionId) throws Exception {
    // [START pubsub_delete_subscription]
    try (SubscriptionAdminClient subscriptionAdminClient = SubscriptionAdminClient.create()) {
      ProjectSubscriptionName subscriptionName =
          ProjectSubscriptionName.of(projectId, subscriptionId);
      subscriptionAdminClient.deleteSubscription(subscriptionName);
      return subscriptionName;
    }
    // [END pubsub_delete_subscription]
  }
387631
@SuppressWarnings("unchecked")
  private <T extends Request> void resendRequest(Throwable cause, T request, BiFunction sender, Connection connection, CompletableFuture future) {
    // If the connection has not changed, reset it and connect to the next server.
    if (this.connection == connection) {
      LOGGER.trace("{} - Resetting connection. Reason: {}", id, cause);
      this.connection = null;
      connection.close();
    }

    // Create a new connection and resend the request. This will force retries to piggyback on any existing
    // connect attempts.
    connect().whenComplete((c, e) -> sendRequest(request, sender, c, e, future));
  }
696508
public static base_response delete(nitro_service client, String ip) throws Exception {
		dnsnameserver deleteresource = new dnsnameserver();
		deleteresource.ip = ip;
		return deleteresource.delete_resource(client);
	}
363726
def __sub_make_request(self, foc, gpid, callback):
        """"""
        # global
        if isinstance(gpid, string_types):
            gpid = uuid_to_hex(gpid)
            ref = (foc, gpid)
            with self.__sub_add_reference(ref):
                req = self._client._request_sub_create(self.__lid, foc, gpid, callback=callback)
        # local
        elif isinstance(gpid, Sequence) and len(gpid) == 2:
            ref = (foc, tuple(gpid))
            with self.__sub_add_reference(ref):
                req = self._client._request_sub_create_local(self.__lid, foc, *gpid, callback=callback)
        else:
            raise ValueError('gpid must be string or two-element tuple')

        req._run_on_completion(self.__sub_del_reference, ref)
        return req
207847
public void doRegister(String prefix, String name) throws IOException {
        transmit(CMD_SUBSCRIBE, prefix, name, _subscribeData, null);
    }
1075786
private base_response delete_request(nitro_service service, String req_args) throws Exception
	{
		StringBuilder responseStr = new StringBuilder();
		HttpURLConnection httpURLConnection = null;
		try
		{
			String urlstr;
			String ipaddress = service.get_ipaddress();
			String version = service.get_version();
			String sessionid = service.get_sessionid();
			String objtype = get_object_type();
			String protocol = service.get_protocol();

			// build URL
			urlstr = protocol + "://" + ipaddress + "/nitro/" + version + "/config/" + objtype;

			String name = this.get_object_name();
			if (name != null && name.length() > 0)
			{
				urlstr = urlstr+"/"+nitro_util.encode(nitro_util.encode(name));
			}

			if(req_args != null || (service.get_warning()!=null && service.get_warning())){
				urlstr = urlstr+"?";
				if(req_args != null)
				{
					urlstr = urlstr + "args=" + req_args;
				}
				if(service.get_warning()!=null && service.get_warning())
				{
					if (req_args != null)
					{
						urlstr = urlstr+"&";
					}
					urlstr = urlstr + "warning=yes";
				}
			}

			URL url = new URL(urlstr);
			httpURLConnection = (HttpURLConnection) url.openConnection();

			httpURLConnection.setRequestMethod("DELETE");

			httpURLConnection.setRequestProperty("Cookie", "sessionid=" + nitro_util.encode(sessionid));
			httpURLConnection.setRequestProperty("Accept-Encoding", "gzip, deflate");

			if (httpURLConnection instanceof HttpsURLConnection)
			{
				if (service.get_certvalidation()) {
					SocketFactory sslSocketFactory = SSLSocketFactory.getDefault();
					HttpsURLConnection secured = (HttpsURLConnection) httpURLConnection;
					secured.setSSLSocketFactory((SSLSocketFactory)sslSocketFactory);	
					if (!service.get_hostnameverification()) {
						/*
						 * override defualt hostNameverifier's verify method
						 * with EmptyHostnameVerifier's verify method to ignore hostname verification check.
						 */
						secured.setHostnameVerifier(new EmptyHostnameVerifier());
					}
				} else {
					SSLContext sslContext = SSLContext.getInstance("SSL");
					//we are using an empty trust manager, because NetScaler currently presents
					//a test certificate not issued by any signing authority, so we need to bypass
					//the credentials check
					sslContext.init(null, new TrustManager[]{new EmptyTrustManager()}, null);
					SocketFactory sslSocketFactory = sslContext.getSocketFactory();
					
					HttpsURLConnection secured = (HttpsURLConnection) httpURLConnection;
					secured.setSSLSocketFactory((SSLSocketFactory)sslSocketFactory);
					if (!service.get_hostnameverification()) {
						/*
						 * overriding defualt hostNameverifier's verify method
						 * with EmptyHostnameVerifier's verify method to bypass hostname check.
						 */
						secured.setHostnameVerifier(new EmptyHostnameVerifier());
					}
				}
			}

			InputStream input;
			try {
				input = httpURLConnection.getInputStream();
			}
			catch (Exception e) {
				input = httpURLConnection.getErrorStream();	
			}
			String contentEncoding = httpURLConnection.getContentEncoding();
			//	get correct input stream for compressed data:
			if (contentEncoding != null)
			{
				if(contentEncoding.equalsIgnoreCase("gzip"))
					input = new GZIPInputStream(input); //reads 2 bytes to determine GZIP stream!
				else if(contentEncoding.equalsIgnoreCase("deflate"))
					input = new InflaterInputStream(input);
			}

			int numOfTotalBytesRead;
			byte [] buffer = new byte[1024];
			while ((numOfTotalBytesRead = input.read(buffer, 0, buffer.length)) != -1)
			{
				responseStr.append(new String(buffer, 0, numOfTotalBytesRead));
			}

			httpURLConnection.disconnect();
			input.close();
		}
		catch (MalformedURLException mue)
		{
			throw mue;
		}
		catch (IOException ioe)
		{
			throw ioe;
		}
		catch(Exception e)
		{
			throw e;
		}
		base_response result =(base_response) service.get_payload_formatter().string_to_resource(base_response.class, responseStr.toString());
        if (result.errorcode != 0) 
        {
			if (result.errorcode == 444) {
				service.clear_session();
			}
			if(result.severity != null)
			{
				if(result.severity.equals("ERROR"))
					throw new nitro_exception(result.message,result.errorcode);
			}
			else
			{
				throw new nitro_exception(result.message,result.errorcode);
			}
		}
		return result;
	}
1128192
public void unsubscribeDurable(String subscriptionName)
            throws MessagingException {
        try {
            Session session =
                connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            MessageConsumer consumer = durableSubscriptions.get(subscriptionName);
            if(consumer != null) {
                consumer.close();
            }
            session.unsubscribe(subscriptionName);
        } catch (JMSException jmse) {
            String errMsg = "Unable to unsubscribe from subscription with name: "
                          + subscriptionName + " due to exception: "
                          + jmse.getMessage();
            logger.debug(errMsg, jmse);
            throw new MessagingException(errMsg, jmse);
        }
    }
14903
@Override
    final public ManagedConnection createManagedConnection(
                                                           final Subject subject, final ConnectionRequestInfo requestInfo)
                    throws ResourceException {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "createManagedConnection", new Object[] {
                                                                              JmsJcaManagedConnection.subjectToString(subject),
                                                                              requestInfo });
        }

        // If we have some request information then see if it already has a core
        // connection associated with it

        JmsJcaConnectionRequestInfo jmsJcaRequestInfo = null;
        SICoreConnection requestCoreConnection = null;
        SICoreConnection coreConnection = null;

        if (requestInfo != null) {

            // Check we have the right type of request information

            if (!(requestInfo instanceof JmsJcaConnectionRequestInfo)) {

                throw new ResourceAdapterInternalException(NLS
                                .getFormattedMessage(("EXCEPTION_RECEIVED_CWSJR1022"),
                                                     new Object[] {
                                                                   "createManagedConnection",
                                                                   JmsJcaConnectionRequestInfo.class
                                                                                   .getName(),
                                                                   requestInfo.getClass().getName() },
                                                     null));

            }

            jmsJcaRequestInfo = (JmsJcaConnectionRequestInfo) requestInfo;
            requestCoreConnection = jmsJcaRequestInfo.getSICoreConnection();

            if (requestCoreConnection != null) {
                // Check that the core connection is still available, ie hasn't been closed. If the
                // core connection is no longer available, null it out and continue without it.

                try {
                    // There is no isAvailable() method on a core connection we use getConnectionListeners()
                    // which is believed to be the cheapest alternative method.
                    requestCoreConnection.getConnectionListeners();

                } catch (final SIException e) {
                    // No FFDC code needed
                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled())
                        SibTr.debug(TRACE, "Connection Request Info core connection no longer available");
                    jmsJcaRequestInfo.setSICoreConnection(null);
                    requestCoreConnection = null;
                } catch (final SIErrorException e) {
                    // No FFDC code needed
                    if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled())
                        SibTr.debug(TRACE, "Connection Request Info core connection no longer available");
                    jmsJcaRequestInfo.setSICoreConnection(null);
                    requestCoreConnection = null;
                }
            }
        }

        // See if we can get a user name and password from the subject or
        // request information

        final JmsJcaUserDetails userDetails = getUserDetails(subject,
                                                             requestInfo);

        // If we didn't get any request information or we did but it didn't
        // contain a core connection, create a new one

        if (requestCoreConnection == null) {

            // Obtain a core connection factory

            final SICoreConnectionFactory coreConnectionFactory;

            if (!UTEHelperFactory.jmsTestEnvironmentEnabled) {

                try {

                    coreConnectionFactory = SICoreConnectionFactorySelector
                                    .getSICoreConnectionFactory(FactoryType.TRM_CONNECTION);

                } catch (final SIException exception) {

                    FFDCFilter.processException(exception, CLASS_NAME
                                                           + ".createManagedConnection", FFDC_PROBE_5, this);
                    throw new ResourceException(NLS.getFormattedMessage(
                                                                        "EXCEPTION_RECEIVED_CWSJR1021", new Object[] {
                                                                                                                      exception, "getSICoreConnectionFactory" },
                                                                        null), exception);

                }

            } else {

                coreConnectionFactory = UTEHelperFactory.getHelperInstance()
                                .setupJmsTestEnvironment();

            }

            // Check we have obtained a core connection factory successfully

            if (coreConnectionFactory == null) {

                throw new ResourceAdapterInternalException(NLS
                                .getFormattedMessage(
                                                     ("SICORECONNECTION_ERROR_CWSJR1023"),
                                                     new Object[] { "createManagedConnection" },
                                                     null));

            }

            // Create a connection

            try {

                final Map trmProperties = getTrmProperties();

                if (userDetails == null) {

                    requestCoreConnection = coreConnectionFactory
                                    .createConnection(subject, trmProperties);

                } else {

                    requestCoreConnection = coreConnectionFactory
                                    .createConnection(userDetails.getUserName(),
                                                      userDetails.getPassword(), trmProperties);

                }

            } catch (final SIException exception) {

                FFDCFilter.processException(exception, CLASS_NAME
                                                       + ".createManagedConnection", FFDC_PROBE_1, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                    SibTr.exception(this, TRACE, exception);
                }
                throw new ResourceException(NLS.getFormattedMessage(
                                                                    "EXCEPTION_RECEIVED_CWSJR1028", new Object[] {
                                                                                                                  exception, "createManagedConnection" }, null),
                                exception);

            } catch (final SIErrorException exception) {

                FFDCFilter.processException(exception, CLASS_NAME
                                                       + ".createManagedConnection", FFDC_PROBE_2, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                    SibTr.exception(this, TRACE, exception);
                }
                throw new ResourceException(NLS.getFormattedMessage(
                                                                    "EXCEPTION_RECEIVED_CWSJR1028", new Object[] {
                                                                                                                  exception, "createManagedConnection" }, null),
                                exception);

            }

            // If we have some request information, set the core connection back
            // into it

            if (jmsJcaRequestInfo != null) {

                jmsJcaRequestInfo.setSICoreConnection(requestCoreConnection);

            }

            // This is a new coreConnection so set this parent coreConnection in 
            // the managedConnection by assigning it to the coreConnection here.
            // The managedconnection will now have full control over the parent
            // coreconnection.
            coreConnection = requestCoreConnection;
        }
        else
        {

            try {
                // We are here as we already have a valid coreconnection in our requestInfo, this
                // means we already have a managedConnection that is looking at the parent, so we
                // need to create a clone of that coreConnection to pass into our new managedConnection.

                // Create a clone to give to the managed connection object which will be stored in the 
                // J2C connection pool.
                coreConnection = requestCoreConnection.cloneConnection();
            } catch (final SIException e) {
                FFDCFilter.processException(e, CLASS_NAME + ".createManagedConnection", FFDC_PROBE_7, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled())
                    SibTr.exception(this, TRACE, e);
                throw new ResourceException(NLS.getFormattedMessage("EXCEPTION_RECEIVED_CWSJR1028",
                                                                    new Object[] { e, "createManagedConnection" },
                                                                    null), e);
            } catch (final SIErrorException e) {
                FFDCFilter.processException(e, CLASS_NAME + ".createManagedConnection", FFDC_PROBE_8, this);
                if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled())
                    SibTr.exception(this, TRACE, e);
                throw new ResourceException(NLS.getFormattedMessage("EXCEPTION_RECEIVED_CWSJR1028",
                                                                    new Object[] { e, "createManagedConnection" },
                                                                    null), e);
            }
        }

        final JmsJcaManagedConnection managedConnection;

        try {

            // Create a managed connection

            if ((getShareDataSourceWithCMP() != null)
                && (getShareDataSourceWithCMP().booleanValue())) {

                // ShareDataSourceWithCMP is set - return a managed connection
                // implementing SynchronizationProvider

                managedConnection = new JmsJcaManagedConnectionSynchronizationProvider(
                                this, coreConnection, userDetails, subject);

            } else {

                // ShareDataSourceWithCMP is not set - return a normal managed
                // connection

                managedConnection = new JmsJcaManagedConnection(this,
                                coreConnection, userDetails, subject);

            }

        } catch (final SIException exception) {

            FFDCFilter.processException(exception, CLASS_NAME
                                                   + ".createManagedConnection", FFDC_PROBE_3, this);
            throw new ResourceException(NLS.getFormattedMessage(
                                                                "EXCEPTION_RECEIVED_CWSJR1026", new Object[] { exception,
                                                                                                              "createManagedConnection" }, null), exception);

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "createManagedConnection",
                       managedConnection);
        }
        return managedConnection;

    }
1320723
public static base_response delete(nitro_service client, String Dnssuffix) throws Exception {
		dnssuffix deleteresource = new dnssuffix();
		deleteresource.Dnssuffix = Dnssuffix;
		return deleteresource.delete_resource(client);
	}
369371
public void deleteUser(String userName){
        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.DeleteUser);

        DeleteUserProtocol p = new DeleteUserProtocol(userName);

        connection.submitRequest(header, p, null);
    }
746539
protected O onSuccess(ServiceRequestContext ctx, I req) throws Exception {
        return delegate().serve(ctx, req);
    }
1272531
public BoxRequestsFile.DeleteFile getDeleteRequest(String id) {
        BoxRequestsFile.DeleteFile request = new BoxRequestsFile.DeleteFile(id, getFileInfoUrl(id), mSession);
        return request;
    }
157400
@Override
	public DeleteMethodOutcome deleteByUrl(String theUrl, List<DeleteConflict> deleteConflicts, RequestDetails theRequest) {
		StopWatch w = new StopWatch();

		Set<Long> resourceIds = myMatchResourceUrlService.processMatchUrl(theUrl, myResourceType);
		if (resourceIds.size() > 1) {
			if (myDaoConfig.isAllowMultipleDelete() == false) {
				throw new PreconditionFailedException(getContext().getLocalizer().getMessage(BaseHapiFhirDao.class, "transactionOperationWithMultipleMatchFailure", "DELETE", theUrl, resourceIds.size()));
			}
		}

		List<ResourceTable> deletedResources = new ArrayList<>();
		for (Long pid : resourceIds) {
			ResourceTable entity = myEntityManager.find(ResourceTable.class, pid);
			deletedResources.add(entity);

			T resourceToDelete = toResource(myResourceType, entity, null, false);

			// Notify IServerOperationInterceptors about pre-action call
			HookParams hooks = new HookParams()
				.add(IBaseResource.class, resourceToDelete)
				.add(RequestDetails.class, theRequest)
				.addIfMatchesType(ServletRequestDetails.class, theRequest);
			myInterceptorBroadcaster.callHooks(Pointcut.STORAGE_PRESTORAGE_RESOURCE_DELETED, hooks);

			validateOkToDelete(deleteConflicts, entity, false);

			// Notify interceptors
			IdDt idToDelete = entity.getIdDt();
			if (theRequest != null) {
				ActionRequestDetails requestDetails = new ActionRequestDetails(theRequest, idToDelete.getResourceType(), idToDelete);
				notifyInterceptors(RestOperationTypeEnum.DELETE, requestDetails);
			}

			// Perform delete

			updateEntityForDelete(theRequest, entity);
			resourceToDelete.setId(entity.getIdDt());

			// Notify JPA interceptors
			TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
				@Override
				public void beforeCommit(boolean readOnly) {
					HookParams hookParams = new HookParams()
						.add(IBaseResource.class, resourceToDelete)
						.add(RequestDetails.class, theRequest)
						.addIfMatchesType(ServletRequestDetails.class, theRequest);
					myInterceptorBroadcaster.callHooks(Pointcut.STORAGE_PRECOMMIT_RESOURCE_DELETED, hookParams);
				}
			});
		}

		IBaseOperationOutcome oo;
		if (deletedResources.isEmpty()) {
			oo = OperationOutcomeUtil.newInstance(getContext());
			String message = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "unableToDeleteNotFound", theUrl);
			String severity = "warning";
			String code = "not-found";
			OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code);
		} else {
			oo = OperationOutcomeUtil.newInstance(getContext());
			String message = getContext().getLocalizer().getMessage(BaseHapiFhirResourceDao.class, "successfulDeletes", deletedResources.size(), w.getMillis());
			String severity = "information";
			String code = "informational";
			OperationOutcomeUtil.addIssue(getContext(), oo, severity, message, null, code);
		}

		ourLog.debug("Processed delete on {} (matched {} resource(s)) in {}ms", theUrl, deletedResources.size(), w.getMillis());

		DeleteMethodOutcome retVal = new DeleteMethodOutcome();
		retVal.setDeletedEntities(deletedResources);
		retVal.setOperationOutcome(oo);
		return retVal;
	}
768708
@Override
    protected void doDelete(final HttpServletRequest req, final HttpServletResponse res) throws ServletException, IOException {
        LOG.debug("Entering");
        final AtomHandler handler = createAtomRequestHandler(req, res);
        final String userName = handler.getAuthenticatedUsername();
        if (userName != null) {
            final AtomRequest areq = new AtomRequestImpl(req);
            try {
                if (handler.isEntryURI(areq)) {
                    handler.deleteEntry(areq);
                    res.setStatus(HttpServletResponse.SC_OK);
                } else {
                    res.setStatus(HttpServletResponse.SC_NOT_FOUND);
                }
            } catch (final AtomException ae) {
                res.sendError(ae.getStatus(), ae.getMessage());
                LOG.debug("An error occured while processing DELETE", ae);
            } catch (final Exception e) {
                res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, e.getMessage());
                LOG.debug("An error occured while processing DELETE", e);
            }
        } else {
            res.setHeader("WWW-Authenticate", "BASIC realm=\"AtomPub\"");
            // Wanted to use sendError() here but Tomcat sends 403 forbidden
            // when I do that, so sticking with setStatus() for time being.
            res.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
        }
        LOG.debug("Exiting");
    }
664731
@Override
    public void messagingEngineReloaded(JsMessagingEngine engine)
    {
        final String methodName = "messagingEngineReloaded";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, engine);
        }

        // We are now catching problems when ME's are not started and not throwing an error.
        // As such this check is not needed and is causing problems. The problem is that
        // we could have a cluster of MEs with only one ME running. If a queue is deleted
        // then recreated only the MDB that is sitting alongside the ME will reconnect, 
        // the other MEs will wait for the local ME to start to try to reconnect but this
        // may never happen so we need to try to reconnect at this point.
        try
        {
            clearTimer();
            timerLoop();
        } catch (final ResourceException exception)
        {
            // No FFDC code needed
            if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled())
            {
                SibTr.exception(this, TRACE, exception);
            }

            SibTr.error(TRACE, "RELOAD_FAILED_CWSIV0773", new Object[] {
                                                                        exception, engine.getName(), engine.getBusName(), this });
        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled())
        {
            SibTr.exit(this, TRACE, methodName);
        }
    }