Search in sources :

Example 1 with RepositoryManagerComparator

use of de.janrufmonitor.repository.RepositoryManagerComparator in project janrufmonitor by tbrandt77.

the class IdentifyAction method getAllActiveCallerManagers.

private List getAllActiveCallerManagers(IRuntime r, String ignoreManager) {
    List allManagers = r.getCallerManagerFactory().getAllCallerManagers();
    List activeManager = new ArrayList();
    Object o = null;
    ICallerManager cm = null;
    for (int i = 0; i < allManagers.size(); i++) {
        o = allManagers.get(i);
        if (o != null && o instanceof ICallerManager) {
            cm = (ICallerManager) o;
            if (cm.isActive() && !cm.getManagerID().equalsIgnoreCase(ignoreManager) && !cm.getManagerID().equalsIgnoreCase("CountryDirectory")) {
                activeManager.add(cm);
            }
        }
    }
    Collections.sort(activeManager, new RepositoryManagerComparator());
    return activeManager;
}
Also used : ArrayList(java.util.ArrayList) RepositoryManagerComparator(de.janrufmonitor.repository.RepositoryManagerComparator) ArrayList(java.util.ArrayList) ICallerList(de.janrufmonitor.framework.ICallerList) List(java.util.List) ICallerManager(de.janrufmonitor.repository.ICallerManager)

Example 2 with RepositoryManagerComparator

use of de.janrufmonitor.repository.RepositoryManagerComparator in project janrufmonitor by tbrandt77.

the class Caller method getInitialManagers.

private List getInitialManagers() {
    List ids = this.getRuntime().getCallerManagerFactory().getAllCallerManagers();
    Collections.sort(ids, new RepositoryManagerComparator());
    List idList = new ArrayList();
    String manager = null;
    for (int i = 0; i < ids.size(); i++) {
        manager = ((ICallerManager) ids.get(i)).getManagerID();
        if (!manager.startsWith("TelephoneSystemCallerManager")) {
            idList.add(manager);
        }
    }
    return idList;
}
Also used : ArrayList(java.util.ArrayList) RepositoryManagerComparator(de.janrufmonitor.repository.RepositoryManagerComparator) ArrayList(java.util.ArrayList) List(java.util.List)

Example 3 with RepositoryManagerComparator

use of de.janrufmonitor.repository.RepositoryManagerComparator in project janrufmonitor by tbrandt77.

the class Identifier method getAllActiveCallerManagers.

private static List getAllActiveCallerManagers(IRuntime r) {
    List allManagers = r.getCallerManagerFactory().getAllCallerManagers();
    List activeManager = new ArrayList();
    Object o = null;
    ICallerManager cm = null;
    for (int i = 0; i < allManagers.size(); i++) {
        o = allManagers.get(i);
        if (o != null && o instanceof ICallerManager) {
            cm = (ICallerManager) o;
            if (cm.isActive()) {
                activeManager.add(cm);
            }
        }
    }
    Collections.sort(activeManager, new RepositoryManagerComparator());
    Identifier.logger.info("List with all caller managers: " + allManagers.toString());
    Identifier.logger.info("List with all active caller managers: " + activeManager.toString());
    return activeManager;
}
Also used : ArrayList(java.util.ArrayList) RepositoryManagerComparator(de.janrufmonitor.repository.RepositoryManagerComparator) ArrayList(java.util.ArrayList) List(java.util.List) ICallerManager(de.janrufmonitor.repository.ICallerManager)

Example 4 with RepositoryManagerComparator

use of de.janrufmonitor.repository.RepositoryManagerComparator in project janrufmonitor by tbrandt77.

the class ReIdentifyAction method getAllActiveCallerManagers.

private List getAllActiveCallerManagers(IRuntime r) {
    List allManagers = r.getCallerManagerFactory().getAllCallerManagers();
    List activeManager = new ArrayList();
    Object o = null;
    ICallerManager cm = null;
    for (int i = 0; i < allManagers.size(); i++) {
        o = allManagers.get(i);
        if (o != null && o instanceof ICallerManager) {
            cm = (ICallerManager) o;
            if (cm.isActive() && cm.isSupported(IIdentifyCallerRepository.class)) {
                activeManager.add(cm);
            }
        }
    }
    activeManager.remove(r.getCallerManagerFactory().getDefaultCallerManager());
    Collections.sort(activeManager, new RepositoryManagerComparator());
    m_logger.info("List with all active caller managers: " + allManagers.toString());
    return activeManager;
}
Also used : ArrayList(java.util.ArrayList) IIdentifyCallerRepository(de.janrufmonitor.repository.types.IIdentifyCallerRepository) RepositoryManagerComparator(de.janrufmonitor.repository.RepositoryManagerComparator) ArrayList(java.util.ArrayList) List(java.util.List) ICallerManager(de.janrufmonitor.repository.ICallerManager)

Aggregations

RepositoryManagerComparator (de.janrufmonitor.repository.RepositoryManagerComparator)4 ArrayList (java.util.ArrayList)4 List (java.util.List)4 ICallerManager (de.janrufmonitor.repository.ICallerManager)3 ICallerList (de.janrufmonitor.framework.ICallerList)1 IIdentifyCallerRepository (de.janrufmonitor.repository.types.IIdentifyCallerRepository)1