class CredentialManagerImpl implements CredentialManager,
		Observable<KeystoreChangedEvent> {

	@Override
	public boolean hasEntryWithAlias(KeystoreType ksType, String alias)
			throws CMException {
		// Need to make sure we are initialized before we do anything else
		// as Credential Manager can be created but not initialized
		initialize();

		try {
			switch (ksType) {
			case KEYSTORE:
				synchronized (keystore) {
					return keystore.containsAlias(alias);
				}
			case TRUSTSTORE:
				synchronized (truststore) {
					return truststore.containsAlias(alias);
				}
			default:
				return false;
			}
		} catch (Exception ex) {
			String exMessage = "failed to access the " + ksType
					+ " to check if an alias exists";
			logger.error(exMessage, ex);
			throw new CMException(exMessage, ex);
		}
	}

	public  CredentialManagerImpl();

}