001    /**
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (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     *
009     *     http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.geronimo.corba.security.config;
018    
019    import org.omg.CSIIOP.CompositeDelegation;
020    import org.omg.CSIIOP.Confidentiality;
021    import org.omg.CSIIOP.DelegationByClient;
022    import org.omg.CSIIOP.DetectMisordering;
023    import org.omg.CSIIOP.DetectReplay;
024    import org.omg.CSIIOP.EstablishTrustInClient;
025    import org.omg.CSIIOP.EstablishTrustInTarget;
026    import org.omg.CSIIOP.IdentityAssertion;
027    import org.omg.CSIIOP.Integrity;
028    import org.omg.CSIIOP.NoDelegation;
029    import org.omg.CSIIOP.NoProtection;
030    import org.omg.CSIIOP.SimpleDelegation;
031    
032    
033    /**
034     * @version $Revision: 451417 $ $Date: 2006-09-29 13:13:22 -0700 (Fri, 29 Sep 2006) $
035     */
036    public final class ConfigUtil {
037    
038        public static String flags(int flag) {
039            String result = "";
040    
041            if ((NoProtection.value & flag) != 0) {
042                result += "NoProtection ";
043            }
044            if ((Integrity.value & flag) != 0) {
045                result += "Integrity ";
046            }
047            if ((Confidentiality.value & flag) != 0) {
048                result += "Confidentiality ";
049            }
050            if ((DetectReplay.value & flag) != 0) {
051                result += "DetectReplay ";
052            }
053            if ((DetectMisordering.value & flag) != 0) {
054                result += "DetectMisordering ";
055            }
056            if ((EstablishTrustInTarget.value & flag) != 0) {
057                result += "EstablishTrustInTarget ";
058            }
059            if ((EstablishTrustInClient.value & flag) != 0) {
060                result += "EstablishTrustInClient ";
061            }
062            if ((NoDelegation.value & flag) != 0) {
063                result += "NoDelegation ";
064            }
065            if ((SimpleDelegation.value & flag) != 0) {
066                result += "SimpleDelegation ";
067            }
068            if ((CompositeDelegation.value & flag) != 0) {
069                result += "CompositeDelegation ";
070            }
071            if ((IdentityAssertion.value & flag) != 0) {
072                result += "IdentityAssertion ";
073            }
074            if ((DelegationByClient.value & flag) != 0) {
075                result += "DelegationByClient ";
076            }
077    
078            return result;
079        }
080    }