Home » rampart-dist-1.4-src » org.apache » rampart » policy » model » [javadoc | source]

    1   package org.apache.rampart.policy.model;
    2   
    3   import java.util.Iterator;
    4   import java.util.Properties;
    5   
    6   import javax.xml.namespace.QName;
    7   import javax.xml.stream.XMLStreamException;
    8   import javax.xml.stream.XMLStreamWriter;
    9   
   10   import org.apache.neethi.Assertion;
   11   import org.apache.neethi.Constants;
   12   import org.apache.neethi.PolicyComponent;
   13   
   14   public class SSLConfig implements Assertion{
   15   	public final static String SSL_LN = RampartConfig.SSL_CONFIG;
   16   	public final static String PROPERTY_LN = "property";
   17   	public final static String PROPERTY_NAME_ATTR = "name";
   18   	
   19   	private Properties prop;
   20   	
   21   	public Properties getProp() {
   22           return prop;
   23       }
   24       public void setProp(Properties prop) {
   25           this.prop = prop;
   26       }
   27   	
   28   	public PolicyComponent normalize() {
   29           // TODO TODO
   30           throw new UnsupportedOperationException("TODO");
   31       }
   32   	
   33   	public QName getName() {
   34           return new QName(RampartConfig.NS, SSL_LN);
   35       }
   36   
   37       public boolean isOptional() {
   38           // TODO TODO
   39           throw new UnsupportedOperationException("TODO");
   40       }
   41       
   42       public void serialize(XMLStreamWriter writer) throws XMLStreamException {
   43           String prefix = writer.getPrefix(RampartConfig.NS);
   44           
   45           if (prefix == null) {
   46               prefix = RampartConfig.NS;
   47               writer.setPrefix(prefix, RampartConfig.NS);
   48           }                
   49           
   50           String key;
   51           String value;
   52           
   53           for (Iterator iterator = prop.keySet().iterator(); iterator.hasNext();) {
   54               key = (String) iterator.next();
   55               value = prop.getProperty(key);
   56               writer.writeStartElement(RampartConfig.NS, PROPERTY_LN);
   57   
   58               writer.writeAttribute("name", key);
   59   
   60               writer.writeCharacters(value);
   61               writer.writeEndElement();
   62           }
   63           
   64           writer.writeEndElement();
   65       }
   66       
   67       public short getType() {
   68           return Constants.TYPE_ASSERTION;
   69       }
   70       
   71       public boolean equal(PolicyComponent policyComponent) {
   72           throw new UnsupportedOperationException();
   73       }
   74       
   75   }

Home » rampart-dist-1.4-src » org.apache » rampart » policy » model » [javadoc | source]