/* * Copyright 2014 Federal Chancellery Austria * MOA-ID has been developed in a cooperation between BRZ, the Federal * Chancellery Austria - ICT staff unit, and Graz University of Technology. * * Licensed under the EUPL, Version 1.1 or - as soon they will be approved by * the European Commission - subsequent versions of the EUPL (the "Licence"); * You may not use this work except in compliance with the Licence. * You may obtain a copy of the Licence at: * http://www.osor.eu/eupl/ * * Unless required by applicable law or agreed to in writing, software * distributed under the Licence is distributed on an "AS IS" basis, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the Licence for the specific language governing permissions and * limitations under the Licence. * * This product combines work with different licenses. See the "NOTICE" text * file for details on the various modules and licenses. * The "NOTICE" text file is part of the distribution. Any derivative works * that you distribute must include a readable copy of the "NOTICE" text file. */ package at.gv.egovernment.moa.id.data; import java.io.Serializable; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map.Entry; import java.util.Set; import at.gv.egiz.eaaf.core.api.IRequest; import at.gv.egiz.eaaf.core.api.idp.slo.ISLOInformationContainer; import at.gv.egiz.eaaf.core.api.idp.slo.SLOInformationInterface; /** * @author tlenz * */ public class SLOInformationContainer implements Serializable, ISLOInformationContainer { private static final long serialVersionUID = 7148730740582881862L; private IRequest sloRequest = null; private LinkedHashMap activeFrontChannalOAs; private LinkedHashMap activeBackChannelOAs; private List sloFailedOAs = null; private String transactionID = null; private String sessionID = null; /** * */ public SLOInformationContainer() { this.activeBackChannelOAs = new LinkedHashMap(); this.activeFrontChannalOAs = new LinkedHashMap(); this.sloFailedOAs = new ArrayList(); } /** * @return the activeFrontChannalOAs */ public LinkedHashMap getActiveFrontChannalOAs() { return activeFrontChannalOAs; } /** * @param activeFrontChannalOAs the activeFrontChannalOAs to set */ public void setActiveFrontChannalOAs(LinkedHashMap activeFrontChannalOAs) { this.activeFrontChannalOAs = activeFrontChannalOAs; } /** * @return the activeBackChannelOAs */ public LinkedHashMap getActiveBackChannelOAs() { return activeBackChannelOAs; } /** * @param activeBackChannelOAs the activeBackChannelOAs to set */ public void setActiveBackChannelOAs(LinkedHashMap activeBackChannelOAs) { this.activeBackChannelOAs = activeBackChannelOAs; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.ISLOInformationContainer#hasFrontChannelOA() */ @Override public boolean hasFrontChannelOA() { return !activeFrontChannalOAs.isEmpty(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.ISLOInformationContainer#getFrontChannelOASessionDescriptions() */ @Override public Set> getFrontChannelOASessionDescriptions() { return activeFrontChannalOAs.entrySet(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.ISLOInformationContainer#removeFrontChannelOA(java.lang.String) */ @Override public void removeFrontChannelOA(String oaID) { activeFrontChannalOAs.remove(oaID); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.ISLOInformationContainer#getNextBackChannelOA() */ @Override public Iterator getNextBackChannelOA() { return activeBackChannelOAs.keySet().iterator(); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.ISLOInformationContainer#getBackChannelOASessionDescripten(java.lang.String) */ @Override public SLOInformationInterface getBackChannelOASessionDescripten(String oaID) { return activeBackChannelOAs.get(oaID); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.ISLOInformationContainer#removeBackChannelOA(java.lang.String) */ @Override public void removeBackChannelOA(String oaID) { activeBackChannelOAs.remove(oaID); } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.ISLOInformationContainer#setSloRequest(at.gv.egovernment.moa.id.protocols.pvp2x.PVPTargetConfiguration) */ @Override public void setSloRequest(IRequest sloRequest) { this.sloRequest = sloRequest; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.ISLOInformationContainer#getSloFailedOAs() */ @Override public List getSloFailedOAs() { return sloFailedOAs; } /* (non-Javadoc) * @see at.gv.egovernment.moa.id.data.ISLOInformationContainer#putFailedOA(java.lang.String) */ @Override public void putFailedOA(String oaID) { if (sloFailedOAs == null) sloFailedOAs = new ArrayList(); sloFailedOAs.add(oaID); } /** * @return the transactionID */ public String getTransactionID() { return transactionID; } /** * @param transactionID the transactionID to set */ public void setTransactionID(String transactionID) { this.transactionID = transactionID; } public String getSessionID() { return this.sessionID; } /** * @param sessionID the sessionID to set */ public void setSessionID(String sessionID) { this.sessionID = sessionID; } @Override public IRequest getSloRequest() { return this.sloRequest; } }