Search in sources :

Example 1 with CallerFilter

use of de.janrufmonitor.repository.filter.CallerFilter in project janrufmonitor by tbrandt77.

the class JournalController method updateElement.

public synchronized void updateElement(Object call, boolean isUpdateAll) {
    if (call instanceof ICall) {
        ICallManager cm = this._getRepository();
        if (cm != null && cm.isActive() && cm.isSupported(IReadCallRepository.class) && cm.isSupported(IWriteCallRepository.class)) {
            ICaller caller = ((ICall) call).getCaller();
            if (!caller.getPhoneNumber().isClired() && isUpdateAll) {
                ICallList cl = ((IReadCallRepository) cm).getCalls(new CallerFilter(caller));
                ICall aCall = null;
                for (int i = cl.size() - 1; i >= 0; i--) {
                    aCall = cl.get(i);
                    aCall.setCaller(caller);
                }
                ((IWriteCallRepository) cm).updateCalls(cl);
            } else {
                // update a single CLIR call or isUpdateAll == false
                if (cm.isSupported(IWriteCallRepository.class))
                    ((IWriteCallRepository) cm).updateCall((ICall) call);
            }
        }
    }
}
Also used : ICallManager(de.janrufmonitor.repository.ICallManager) ICaller(de.janrufmonitor.framework.ICaller) IReadCallRepository(de.janrufmonitor.repository.types.IReadCallRepository) ICall(de.janrufmonitor.framework.ICall) ICallList(de.janrufmonitor.framework.ICallList) CallerFilter(de.janrufmonitor.repository.filter.CallerFilter) IWriteCallRepository(de.janrufmonitor.repository.types.IWriteCallRepository)

Example 2 with CallerFilter

use of de.janrufmonitor.repository.filter.CallerFilter in project janrufmonitor by tbrandt77.

the class FilterWizard method getCallerFilters.

private List getCallerFilters(IPhonenumber[] phones) {
    List l = new ArrayList();
    if (phones == null || phones.length == 0)
        return l;
    for (int i = 0; i < phones.length; i++) {
        ICaller c = getRuntime().getCallerFactory().createCaller(getRuntime().getCallerFactory().createName("", ""), phones[i]);
        l.add(new CallerFilter(c));
    }
    return l;
}
Also used : ICaller(de.janrufmonitor.framework.ICaller) ArrayList(java.util.ArrayList) CallerFilter(de.janrufmonitor.repository.filter.CallerFilter) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

ICaller (de.janrufmonitor.framework.ICaller)2 CallerFilter (de.janrufmonitor.repository.filter.CallerFilter)2 ICall (de.janrufmonitor.framework.ICall)1 ICallList (de.janrufmonitor.framework.ICallList)1 ICallManager (de.janrufmonitor.repository.ICallManager)1 IReadCallRepository (de.janrufmonitor.repository.types.IReadCallRepository)1 IWriteCallRepository (de.janrufmonitor.repository.types.IWriteCallRepository)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1