1 19 20 package org.apache.excalibur.instrument.client.http; 21 22 import org.apache.avalon.framework.configuration.Configuration; 23 import org.apache.avalon.framework.configuration.ConfigurationException; 24 import org.apache.avalon.framework.logger.AbstractLogEnabled; 25 26 import org.apache.excalibur.instrument.client.Data; 27 import org.apache.excalibur.instrument.client.InstrumentManagerConnection; 28 29 35 abstract class AbstractHTTPData 36 extends AbstractLogEnabled 37 implements Data 38 { 39 40 private HTTPInstrumentManagerConnection m_connection; 41 42 43 private String m_description; 44 45 46 private int m_stateVersion; 47 48 51 57 protected AbstractHTTPData( HTTPInstrumentManagerConnection connection, 58 String description ) 59 { 60 m_connection = connection; 61 m_description = description; 62 m_stateVersion = -1; 63 } 64 65 68 73 public InstrumentManagerConnection getConnection() 74 { 75 return m_connection; 76 } 77 78 83 public String getDescription() 84 { 85 return m_description; 86 } 87 88 93 public int getStateVersion() 94 { 95 return m_stateVersion; 96 } 97 98 101 108 protected void update( Configuration configuration ) 109 throws ConfigurationException 110 { 111 m_description = configuration.getAttribute( "description", "" ); 112 m_stateVersion = configuration.getAttributeAsInteger( "state-version", 0 ); 113 } 114 115 122 protected String urlEncode( String val ) 123 { 124 return m_connection.urlEncode( val ); 125 } 126 } 127 | Popular Tags |