/* (non-Javadoc)
@see org.parosproxy.paros.db.DatabaseIF#deleteSession(java.lang.String)
492321
@Override
	public void deleteSession(String sessionName) {
		logger.debug("deleteSession " + sessionName);
	    if (databaseServer == null) {
	    	return;
	    }
        try {
			databaseServer.shutdown(false);
		} catch (SQLException e) {
            logger.error(e.getMessage(), e);
		}
		
        deleteDbFile(new File(sessionName));
        deleteDbFile(new File(sessionName + ".data"));
        deleteDbFile(new File(sessionName + ".script"));
        deleteDbFile(new File(sessionName + ".properties"));
        deleteDbFile(new File(sessionName + ".backup"));
        deleteDbFile(new File(sessionName + ".lobs"));
        
        databaseServer = null;
    }
988026
public int deleteProjectPermissionOfAnyUser(DbSession dbSession, long projectId, String permission) {
    return mapper(dbSession).deleteProjectPermissionOfAnyUser(projectId, permission);
  }
573107
@Override
    public void dispose(final Session session) {
        if (session != null && session.isConnected()) {
            logger.trace("Disposing of hibernate session.");
            session.close();
        }
    }
446925
public void deleteCurrent(SITransaction transaction)
  throws SISessionUnavailableException, SISessionDroppedException,
         SIResourceException, SIConnectionLostException, SILimitExceededException,
         SIIncorrectCallException,
         SIErrorException, SIMPMessageNotLockedException
  {
    if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
      SibTr.entry(CoreSPILockedMessageEnumeration.tc, "deleteCurrent",
        new Object[] {new Integer(hashCode()), transaction, this});

    checkValidState("deleteCurrent");

    localConsumerPoint.checkNotClosed();

    if (transaction != null && !((TransactionCommon)transaction).isAlive())
    {
      SIIncorrectCallException e = new SIIncorrectCallException( nls.getFormattedMessage(
        "TRANSACTION_DELETE_USAGE_ERROR_CWSIP0778",
           new Object[] { consumerSession.getDestinationAddress() },
           null) );

      if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
        SibTr.exception(tc, e);

      if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
        SibTr.exit(CoreSPILockedMessageEnumeration.tc, "deleteCurrent", e);

      throw e;
    }

    JsMessageWrapper msg = null;
    boolean isStored = false;

    synchronized(this)
    {
      checkCurrentMessageAvailable((TransactionCommon) transaction);

      // Pull out the interesting bits of the message
      msg = currentMsg.message;
      isStored = currentMsg.isStored;

      //remove the message from the list
      removeMessage(currentMsg);

      // There is now no message under the cursor
      messageAvailable = false;
    } // synchronized


    if((msg != null))
    {
      // If the message was not recoverable (not on an itemStream) we've finished
      // Otherwise delete it from MS
      if (isStored)
      {
        removeMessageFromStore(msg,
                               (TransactionCommon) transaction,
                               true); // true = decrement active message count
      }
      else // !isStored
      {
        localConsumerPoint.removeActiveMessages(1);
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && CoreSPILockedMessageEnumeration.tc.isEntryEnabled())
      SibTr.exit(CoreSPILockedMessageEnumeration.tc, "deleteCurrent", this);
  }
734165
public static void removeSshSession(GlobalSessionObject<Map<String, SSHConnection>> sessionParam, String sessionId) {
        if (sessionParam != null) {
            SessionResource<Map<String, SSHConnection>> resource = sessionParam.getResource();
            if (resource != null) {
                Map<String, SSHConnection> tempMap = resource.get();
                if (tempMap != null) {
                    tempMap.remove(sessionId);
                }
            }
        }
    }
59464
private void destroySessionByToken(String id) {
		System.out.println(new LogEntry("destroying session " + id));
		synchronized (sessions) {
			synchronized (sessionsMirror) {
				StandardSession session = (StandardSession) sessions.get(id);
				if (session != null) {
					session.onDestruction();
					sessions.remove(id);
					sessionsMirror.remove(id);
				}
			}
		}
	}
597763
@Override
    public Session delete(String id) throws Exception {
        // get the session, if its not in memory, this will load it
        Session session = get(id);

        // Always delete it from the backing data store
        if (sessionDataStore != null) {
            boolean deleted = sessionDataStore.delete(id);
            if (log.isDebugEnabled()) {
                log.debug("Session " + id + " deleted in db: " + deleted);
            }
        }

        // delete it from the session object store
        if (session != null) {
            session.stopInactivityTimer();
            session.setResident(false);
        }

        return doDelete(id);
    }
985005
@Override
	public synchronized void delete(long historyId, String tag) throws DatabaseException {
    	try {
			psDeleteTag.setLong(1, historyId);
			psDeleteTag.setString(2, tag);
			psDeleteTag.executeUpdate();
		} catch (SQLException e) {
			throw new DatabaseException(e);
		}
    }
883566
public void removeCorrespondingSipApplicationSession(MobicentsSipApplicationSessionKey sipApplicationSession) {
		joinApplicationSession.remove(sipApplicationSession);
		replacesApplicationSession.remove(sipApplicationSession);
		Iterator<MobicentsSipApplicationSessionKey> it = joinApplicationSession.values().iterator();
		boolean found = false;
		while (it.hasNext() && !found) {
			MobicentsSipApplicationSessionKey sipApplicationSessionKey = it.next();
			if(sipApplicationSessionKey.equals(sipApplicationSession)) {
				joinApplicationSession.remove(sipApplicationSessionKey);
				found = true;
			}
		}
		it = replacesApplicationSession.values().iterator();
		found = false;
		while (it.hasNext() && !found) {
			MobicentsSipApplicationSessionKey sipApplicationSessionKey = it.next();
			if(sipApplicationSessionKey.equals(sipApplicationSession)) {
				replacesApplicationSession.remove(sipApplicationSessionKey);
				found = true;
			}
		}
	}
739862
ServerSessionContext unregisterSession(long sessionId) {
    ServerSessionContext session = sessions.remove(sessionId);
    if (session != null) {
      clients.remove(session.client(), session);
      connections.remove(session.client(), session.getConnection());
    }
    return session;
  }
9287
public void removeSessionProvider(Object key)
   {
      if (providers.containsKey(key))
      {
         getSessionProvider(key).close();
         providers.remove(key);
      }

      if (systemProviders.containsKey(key))
      {
         systemProviders.get(key).close();
         systemProviders.remove(key);
      }
   }
389777
public DeleteSessionResponse deleteSession(DeleteSessionRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        checkStringNotEmpty(request.getSessionId(), "The parameter sessionId should NOT be null or empty string.");
        InternalRequest internalRequest = createRequest(HttpMethodName.DELETE, request, LIVE_SESSION,
                request.getSessionId());
        return invokeHttpClient(internalRequest, DeleteSessionResponse.class);
    }
995724
public void destroySession() {
    	JsonObject session = get("session");
        if (session == null) {
            return;
        }

        String sessionId = session.getString("id");
        // remove from the context
        put("session", null);

        if (sessionId == null) {
            return;
        }

        store.destroy(sessionId, new Handler<Object>() {
            @Override
            public void handle(Object error) {
                if (error != null) {
                    // TODO: better handling of errors
                    System.err.println(error);
                }
            }
        });
    }
937602
public void removeFromMemory(String id) {
        final boolean isTraceOn = com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled();

        if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINER)) {
            LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[REMOVE_FROM_MEMORY], id);
        }

        BackedSession sess = (BackedSession) ((BackedHashMap) _sessions).superGet(id);
        if (sess != null) {
            if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE))
                LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[REMOVE_FROM_MEMORY],
                                                        "removing from memory");
            synchronized (sess) {
                BackedSession sess1 = (BackedSession) ((BackedHashMap) _sessions).accessObject(id);
                if (sess == sess1) {
                    Object removedEntry = ((BackedHashMap) _sessions).superRemove(id);
                    if (removedEntry != null) {
                        if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE))
                            LoggingUtil.SESSION_LOGGER_WAS.logp(Level.FINE, methodClassName, methodNames[REMOVE_FROM_MEMORY],
                                                                    "successfully removed from memory");
                    }
                }
            }
        }

        if (isTraceOn && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINER))
            LoggingUtil.SESSION_LOGGER_WAS.exiting(methodClassName, methodNames[REMOVE_FROM_MEMORY]);
    }
225630
static void deleteCurrentSession(Context context) {
		SharedPreferences.Editor editor = getPrefs(context).edit();
		editor.remove(PREFS_KEY_EMAIL_RECIPIENTS);
		editor.remove(PREFS_KEY_FILTER_PID);
		editor.apply();
	}
780685
public void remove(final boolean removeFromSession) {
        if (removeFromSession) {
            this.sessionStore.set(this.context, Pac4jConstants.USER_PROFILES, new LinkedHashMap<String, U>());
        }
        this.context.setRequestAttribute(Pac4jConstants.USER_PROFILES, new LinkedHashMap<String, U>());
    }
251976
private void deleteNoCheck(Session session, Row row) {

        if (row.isDeleted(session)) {
            return;
        }

        session.addDeleteAction(this, row);
    }