Package de.netsysit.model

Source Code of de.netsysit.model.ApplicationModel

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package de.netsysit.model;

import de.netsysit.policymanager.Enums.ApplicationBase;
import java.util.ArrayList;
import java.util.List;

/**
*
* @author ducksoul
*/
public class ApplicationModel extends BasicItemModel {
    private boolean expectRequestEncrypted;
    private ApplicationBase baseA;
    private ApplicationBase baseC;
    private ApplicationBase baseI;
    private List<ReceiverListModel> receiverLists;
   
    public ApplicationModel() {
        receiverLists = new ArrayList<ReceiverListModel>();
    }
   
    public boolean isExpectRequestEncrypted() {
        return expectRequestEncrypted;
    }
   
    public void setExpectRequestEncrypted(boolean expectRequestEncrypted) {
        boolean oldVal = this.expectRequestEncrypted;
        this.expectRequestEncrypted = expectRequestEncrypted;
        changeSupport.firePropertyChange("appExpectRequestEncrypted", oldVal, expectRequestEncrypted);
    }
   
    public ApplicationBase getBaseA() {
        return baseA;
    }
   
    public void setBaseA(ApplicationBase baseA) {
        ApplicationBase oldVal = this.baseA;
        this.baseA = baseA;
        changeSupport.firePropertyChange("appBaseA", oldVal, baseA);
    }
   
    public ApplicationBase getBaseC() {
        return baseC;
    }
   
    public void setBaseC(ApplicationBase baseC) {
        ApplicationBase oldVal = this.baseC;
        this.baseC = baseC;
        changeSupport.firePropertyChange("appBaseC", oldVal, baseC);
    }
   
    public ApplicationBase getBaseI() {
        return baseI;
    }
   
    public void setBaseI(ApplicationBase baseI) {
        ApplicationBase oldVal = this.baseI;
        this.baseI = baseI;
        changeSupport.firePropertyChange("appBaseI", oldVal, baseI);
    }   
   
    public List<ReceiverListModel> getReceiverLists() {
        return receiverLists;
    }
   
    public ChangeListModel getReceiverListsAsListModel() {
        ChangeListModel clm = new ChangeListModel();
       
        for(int i=0; i<receiverLists.size(); i++) {
            clm.addElement(receiverLists.get(i));
        }
       
        return clm;
    }   
   
    public void setReceiverLists(List receiverLists) {
        List oldVal = new ArrayList(this.receiverLists);
        this.receiverLists = receiverLists;
        changeSupport.firePropertyChange("appReceiverListsSet", oldVal, receiverLists);
    }
   
    public void addReceiverList(ReceiverListModel receiverList) {
        if(!receiverLists.contains(receiverList)) {
            List oldVal = new ArrayList(this.receiverLists);
            receiverLists.add(receiverList);
            changeSupport.firePropertyChange("appReceiverListAdded", oldVal, receiverLists);
        } else {
            //TODO Fehlerausgabe
        }
    }
   
    public void removeReceiverList(ReceiverListModel receiverList) {
        if(receiverLists.contains(receiverList)) {
            List oldVal = new ArrayList(this.receiverLists);
            receiverLists.remove(receiverList);
            changeSupport.firePropertyChange("appReceiverListRemoved", oldVal, receiverLists);
        } else {
            //TODO Fehlerausgabe
        }
    }          
}
TOP

Related Classes of de.netsysit.model.ApplicationModel

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.