/*
(non-Javadoc)

@see XcapClient#deleteIfNoneMatch(java.net.URI,
java.lang.String, Header[],
Credentials)
11432
public XcapResponse deleteIfNoneMatch(URI uri, String eTag,
			Header[] additionalRequestHeaders, Credentials credentials)
			throws IOException {
		checkState();
		return ra.getClient().deleteIfNoneMatch(uri, eTag,
				additionalRequestHeaders, credentials);
	}
984507
public T delete(String entityId, MnoHttpClient httpClient) throws AuthenticationException, ApiException {
		String jsonBody = httpClient.delete(getInstanceUrl(entityId));

		Type parsingType = new MnoAccountResponseParameterizedType(entitityClass);
		MnoAccountResponse<T> resp = GSON.fromJson(jsonBody, parsingType);

		return resp.getData();
	}
45300
public static boolean handleIfNoneMatch(final HttpServerExchange exchange, final List<ETag> etags, boolean allowWeak) {
        return handleIfNoneMatch(exchange.getRequestHeaders().getFirst(Headers.IF_NONE_MATCH), etags, allowWeak);
    }
1153863
private <TResponse> void callServiceOwnerDeleteApi(String path) throws AuthleteApiException
    {
        callServiceOwnerDeleteApi(path, (Map<String, String>)null);
    }
435609
public static ns_ssl_certkey delete(nitro_service client, ns_ssl_certkey resource) throws Exception
	{
		resource.validate("delete");
		return ((ns_ssl_certkey[]) resource.delete_resource(client))[0];
	}
719218
public static base_responses delete(nitro_service client, String crlname[]) throws Exception {
		base_responses result = null;
		if (crlname != null && crlname.length > 0) {
			sslcrl deleteresources[] = new sslcrl[crlname.length];
			for (int i=0;i<crlname.length;i++){
				deleteresources[i] = new sslcrl();
				deleteresources[i].crlname = crlname[i];
			}
			result = delete_bulk_request(client, deleteresources);
		}
		return result;
	}
753082
public static base_responses delete(nitro_service client, String certkey[]) throws Exception {
		base_responses result = null;
		if (certkey != null && certkey.length > 0) {
			sslcertkey deleteresources[] = new sslcertkey[certkey.length];
			for (int i=0;i<certkey.length;i++){
				deleteresources[i] = new sslcertkey();
				deleteresources[i].certkey = certkey[i];
			}
			result = delete_bulk_request(client, deleteresources);
		}
		return result;
	}
560465
private void removeEntryFromAuthCache(HttpServletRequest req, HttpServletResponse res, WebAppSecurityConfig config) {
        /*
         * TODO: we need to optimize this method... if the authCacheService.remove() method
         * return true for successfully removed the entry in the authentication cache, then we
         * do not have to call the second method for token. See defect 66015
         */
        removeEntryFromAuthCacheForUser(req, res);
        removeEntryFromAuthCacheForToken(req, res, config);
    }
653393
private void removeEntryFromAuthCacheForToken(HttpServletRequest req, HttpServletResponse res, WebAppSecurityConfig config) {
        getAuthCacheService();
        if (authCacheService == null) {
            return;
        }

        Cookie[] cookies = req.getCookies();
        if (cookies != null) {
            String cookieValues[] = null;
            cookieValues = CookieHelper.getCookieValues(cookies, ssoCookieHelper.getSSOCookiename());
            if ((cookieValues == null || cookieValues.length == 0) &&
                !SSOAuthenticator.DEFAULT_SSO_COOKIE_NAME.equalsIgnoreCase(ssoCookieHelper.getSSOCookiename())) {
                cookieValues = CookieHelper.getCookieValues(cookies, SSOAuthenticator.DEFAULT_SSO_COOKIE_NAME);
            }
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "Cookie size: ", cookieValues == null ? "<null>" : cookieValues.length);
            if (cookieValues != null && cookieValues.length > 0) {
                for (int n = 0; n < cookieValues.length; n++) {
                    String val = cookieValues[n];
                    if (val != null && val.length() > 0) {
                        try {
                            authCacheService.remove(val);
                            //Add token to the logged out cache if enabled
                            if (config.isTrackLoggedOutSSOCookiesEnabled())
                                addToLoggedOutTokenCache(val);
                        } catch (Exception e) {
                            String user = req.getRemoteUser();
                            if (user == null) {
                                Principal p = req.getUserPrincipal();
                                if (p != null)
                                    user = p.getName();
                            }
                            Tr.warning(tc, "AUTHENTICATE_CACHE_REMOVAL_EXCEPTION", user, e.toString());
                        }
                    }
                }
            }
        }
    }
111007
public XcapResponse delete(URI uri, Header[] additionalRequestHeaders,
			Credentials credentials) throws IOException {

		if (log.isDebugEnabled()) {
			log.debug("delete(uri=" + uri + " , additionalRequestHeaders = ( "
					+ Arrays.toString(additionalRequestHeaders) + " ) )");
		}

		return execute(new HttpDelete(uri), additionalRequestHeaders,
				credentials);
	}
931861
public void deleteIfMatch(URI uri, String eTag, String assertedUserId)
			throws IOException {
		deleteIfMatch(uri, eTag, assertedUserId, null);
	}
29959
private String _delete(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_id();
			if (name != null && name.length() > 0)
			{
				urlstr = urlstr + "/" + nitro_util.encode(nitro_util.encode(name));
			}

			/*if(req_args != null && req_args.length() > 0)
			{
				urlstr = urlstr + "?args=" + req_args;
			}*/

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

			httpURLConnection.setRequestMethod("DELETE");

			if(sessionid != null)
			{
				httpURLConnection.setRequestProperty("Cookie", "SESSID=" + nitro_util.encode(sessionid));
				httpURLConnection.setRequestProperty("Accept-Encoding", "gzip, deflate");
			}
			
			if (httpURLConnection instanceof HttpsURLConnection)
			{
				SSLContext sslContext = SSLContext.getInstance("SSL");
				//we are using an empty trust manager, because MPS 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);
				secured.setHostnameVerifier(new EmptyHostnameVerifier());
			}

			InputStream input = httpURLConnection.getInputStream();
			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)
		{
			System.err.println("Invalid URL");
		}
		catch (IOException ioe)
		{
			System.err.println("I/O Error - " + ioe);
		}
		catch(Exception e)
		{
			System.err.println("Error - " + e);
		}		
		
		return responseStr.toString();	
	}
1303309
public void deleteIfMatch(URI uri, String eTag, Credentials credentials)
			throws IOException {
		deleteIfMatch(uri, eTag, null, credentials);
	}
907652
synchronized boolean removeMapping(String virtualHost, HttpContext context)
    {
        boolean existing=false;
        if (_virtualHostMap!=null)
        {
            PathMap contextMap=(PathMap)_virtualHostMap.get(virtualHost);
            
            Iterator i2=contextMap.values().iterator();
            while(i2.hasNext())
            {
                List contextList = (List)i2.next();
                if (contextList.remove(context))
                    existing=true;                
                if (contextList.size()==0)
                    i2.remove();
            }
        }
        return existing;
    }
1306468
def deletePortMapping(nport,proto)
            checkProto(proto)
            checkPort(nport)
            joinThread()
            r = MiniUPnP.UPNP_DeletePortMapping(@urls.controlURL,@data.servicetype,
                                               nport.to_s,proto)
            if r != 0 then
                raise UPnPException.new , "Failed delete mapping: #{code2error(r)}."
            end
        end
742005
@Override
    public CompletableFuture<Void> disconnect(Serializable userid, InetSocketAddress sncpAddr) {
        tryAcquireSemaphore();
        CompletableFuture<Void> future = sncpNodeAddresses.removeSetItemAsync(SOURCE_SNCP_USERID_PREFIX + userid, InetSocketAddress.class, sncpAddr);
        if (semaphore != null) future.whenComplete((r, e) -> releaseSemaphore());
        if (logger.isLoggable(Level.FINEST)) logger.finest(WebSocketNodeService.class.getSimpleName() + ".event: " + userid + " disconnect from " + sncpAddr);
        return future;
    }
109737
public static boolean handleIfNoneMatch(final HttpServerExchange exchange, final ETag etag, boolean allowWeak) {
        return handleIfNoneMatch(exchange, Collections.singletonList(etag), allowWeak);
    }