001
002/* ***** BEGIN LICENSE BLOCK *****
003 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
004 *
005 * The contents of this file are subject to the Mozilla Public License Version
006 * 1.1 (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 * http://www.mozilla.org/MPL/
009 *
010 * Software distributed under the License is distributed on an "AS IS" basis,
011 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
012 * for the specific language governing rights and limitations under the
013 * License.
014 *
015 * The Original Code is part of dcm4che, an implementation of DICOM(TM) in
016 * Java(TM), hosted at https://github.com/gunterze/dcm4che.
017 *
018 * The Initial Developer of the Original Code is
019 * Agfa Healthcare.
020 * Portions created by the Initial Developer are Copyright (C) 2011
021 * the Initial Developer. All Rights Reserved.
022 *
023 * Contributor(s):
024 * See @authors listed below
025 *
026 * Alternatively, the contents of this file may be used under the terms of
027 * either the GNU General Public License Version 2 or later (the "GPL"), or
028 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
029 * in which case the provisions of the GPL or the LGPL are applicable instead
030 * of those above. If you wish to allow use of your version of this file only
031 * under the terms of either the GPL or the LGPL, and not to allow others to
032 * use your version of this file under the terms of the MPL, indicate your
033 * decision by deleting the provisions above and replace them with the notice
034 * and other provisions required by the GPL or the LGPL. If you do not delete
035 * the provisions above, a recipient may use your version of this file under
036 * the terms of any one of the MPL, the GPL or the LGPL.
037 *
038 * ***** END LICENSE BLOCK ***** */
039
040package org.dcm4che3.net;
041
042import org.dcm4che3.conf.core.api.ConfigurableClass;
043import org.dcm4che3.conf.core.api.ConfigurableProperty;
044import org.dcm4che3.conf.core.api.LDAP;
045import org.dcm4che3.net.AEExtension;
046
047import java.util.ArrayList;
048import java.util.Collection;
049
050/**
051 * @author Hesham Elbadawi <bsdreko@gmail.com>
052 * 
053 */
054
055@LDAP(objectClasses = "dcmExternalArchiveAEExtension", noContainerNode = true)
056@ConfigurableClass
057public class ExternalArchiveAEExtension extends AEExtension {
058
059    private static final long serialVersionUID = -2390448404282661045L;
060
061    @ConfigurableProperty(name = "dcmAEFetchPriority")
062    private int aeFetchPriority;
063
064    @ConfigurableProperty(name = "dcmAEPrefersForwarding", defaultValue="false")
065    private boolean prefersForwarding = false;
066
067    @ConfigurableProperty(name = "dcmLinkedQueryAETs",
068            description = "List of AETs linked to this (tipically store) AET and to be used for query/retrieve",
069            collectionOfReferences = true)
070    private Collection<ApplicationEntity> linkedQueryAETs = new ArrayList<ApplicationEntity>();
071
072    @ConfigurableProperty(name = "dcmDefaultForStorage", defaultValue="false")
073    private boolean defaultForStorage = false;
074
075    public int getAeFetchPriority() {
076        return aeFetchPriority;
077    }
078    
079    public void setAeFetchPriority(int aeFetchPriority) {
080        this.aeFetchPriority = aeFetchPriority;
081    }
082
083    public boolean isPrefersForwarding() {
084        return prefersForwarding;
085    }
086
087    public void setPrefersForwarding(boolean prefersForwarding) {
088        this.prefersForwarding = prefersForwarding;
089    }
090
091    public Collection<ApplicationEntity> getLinkedQueryAETs() {
092        return linkedQueryAETs;
093    }
094
095    public void setLinkedQueryAETs(Collection<ApplicationEntity> linkedQueryAETs) {
096        this.linkedQueryAETs = linkedQueryAETs;
097    }
098
099    public void addIgnoreSeriesStudyMissmatchErrorsAET(ApplicationEntity ae) {
100        this.linkedQueryAETs.add(ae);
101    }
102
103    public boolean removeIgnoreSeriesStudyMissmatchErrorsAET(ApplicationEntity ae) {
104        return this.linkedQueryAETs.remove(ae);
105    }
106
107    public boolean isDefaultForStorage() {
108        return defaultForStorage;
109    }
110
111    public void setDefaultForStorage(boolean defaultForStorage) {
112        this.defaultForStorage = defaultForStorage;
113    }
114}