Author: ips Date: Mon Jan 24 14:50:46 2005 New Revision: 126324 URL: http://svn.apache.org/viewcvs?view=rev&rev=126324 Log: misc Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/SimpleTypeResourceKey.java incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/query/QueryEngine.java incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/v1_2/porttype/impl/QueryResourcePropertiesProvider.java
Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/SimpleTypeResourceKey.java Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/SimpleTypeResourceKey.java?view=diff&rev=126324&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/SimpleTypeResourceKey.java&r1=126323&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/SimpleTypeResourceKey.java&r2=126324 ============================================================================== --- incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/SimpleTypeResourceKey.java (original) +++ incubator/apollo/trunk/src/java/org/apache/ws/resource/impl/SimpleTypeResourceKey.java Mon Jan 24 14:50:46 2005 @@ -22,6 +22,7 @@ import javax.xml.soap.SOAPElement; import javax.xml.soap.SOAPHeaderElement; +import javax.xml.namespace.QName; /** * LOG-DONE @@ -35,6 +36,11 @@ { private SOAPHeaderElement m_headerElem; + public SimpleTypeResourceKey( QName name, Object value ) + { + super( name, value ); + } + /** * Creates a new XmlBeanResourceKey. * Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/query/QueryEngine.java Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/query/QueryEngine.java?view=diff&rev=126324&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/query/QueryEngine.java&r1=126323&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/query/QueryEngine.java&r2=126324 ============================================================================== --- incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/query/QueryEngine.java (original) +++ incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/query/QueryEngine.java Mon Jan 24 14:50:46 2005 @@ -63,6 +63,7 @@ * * @param queryExpr query expression * @param resourcePropSet resource properties set to execute the query against + * @param nsContext a DOM element to use as the context for resolving namespace prefixes * * @return the result of the evaluation which depends on the expression. The results must be an xml serializable * object in order to be passed back correctly to a remote client. The easiest way of achieving this is to Modified: incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/v1_2/porttype/impl/QueryResourcePropertiesProvider.java Url: http://svn.apache.org/viewcvs/incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/v1_2/porttype/impl/QueryResourcePropertiesProvider.java?view=diff&rev=126324&p1=incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/v1_2/porttype/impl/QueryResourcePropertiesProvider.java&r1=126323&p2=incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/v1_2/porttype/impl/QueryResourcePropertiesProvider.java&r2=126324 ============================================================================== --- incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/v1_2/porttype/impl/QueryResourcePropertiesProvider.java (original) +++ incubator/apollo/trunk/src/java/org/apache/ws/resource/properties/v1_2/porttype/impl/QueryResourcePropertiesProvider.java Mon Jan 24 14:50:46 2005 @@ -23,156 +23,147 @@ import org.apache.ws.resource.properties.faults.InvalidQueryExpressionFaultException; import org.apache.ws.resource.properties.faults.QueryEvaluationErrorFaultException; import org.apache.ws.resource.properties.faults.UnknownQueryExpressionDialectFaultException; -import org.apache.ws.resource.properties.v1_2.porttype.QueryResourcePropertiesPortType; import org.apache.ws.resource.properties.query.InvalidQueryExpressionException; import org.apache.ws.resource.properties.query.QueryEngine; import org.apache.ws.resource.properties.query.QueryEvaluationErrorException; import org.apache.ws.resource.properties.query.UnknownQueryExpressionDialectException; import org.apache.ws.resource.properties.query.impl.QueryEngineImpl; import org.apache.ws.resource.properties.query.impl.XmlBeansQueryExpression; +import org.apache.ws.resource.properties.v1_2.porttype.QueryResourcePropertiesPortType; import org.apache.ws.util.XmlBeanUtils; import org.apache.ws.util.i18n.Messages; import org.apache.xmlbeans.XmlObject; import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryExpressionType; import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryResourcePropertiesDocument; import org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.QueryResourcePropertiesResponseDocument; -import javax.naming.directory.SchemaViolationException; + import javax.xml.rpc.JAXRPCException; import javax.xml.soap.SOAPEnvelope; import javax.xml.soap.SOAPException; import java.lang.reflect.Array; /** - * LOG-DONE - * An operation provider for wsrp:QueryResourceProperties. + * LOG-DONE An operation provider for wsrp:QueryResourceProperties. * * @author Ian P. Springer */ public class QueryResourcePropertiesProvider - extends AbstractResourcePropertiesPortType - implements QueryResourcePropertiesPortType + extends AbstractResourcePropertiesPortType + implements QueryResourcePropertiesPortType { - private static final Log LOG = LogFactory.getLog( QueryResourcePropertiesProvider.class ); - private static final Messages MSG = MessagesImpl.getInstance( ); + private static final Log LOG = LogFactory.getLog( QueryResourcePropertiesProvider.class ); + private static final Messages MSG = MessagesImpl.getInstance(); - /** - * DOCUMENT_ME - */ - private static final QueryEngine QUERY_ENGINE = new QueryEngineImpl( ); - - /** - * Creates a new [EMAIL PROTECTED] QueryResourcePropertiesProvider} object. - * - * @param resourceContext DOCUMENT_ME - */ - public QueryResourcePropertiesProvider( ResourceContext resourceContext ) - { - super( resourceContext ); - } - - /** - * Implementation of the wsrp:QueryResourceProperties operation. - * - * @param requestDoc the requestDoc XMLBean - * - * @return the response XMLBean - * - * @throws org.apache.ws.resource.faults.ResoureKeyHeaderNotFoundFaultException - * - * @throws org.apache.ws.resource.properties.faults.UnknownQueryExpressionDialectFaultException - * if query dialect is unsupported. - * @throws org.apache.ws.resource.properties.faults.QueryEvaluationErrorFaultException - * if query evaluation fails. - * @throws org.apache.ws.resource.properties.faults.InvalidQueryExpressionFaultException - * if query expression is invalid. - */ - public QueryResourcePropertiesResponseDocument queryResourceProperties( QueryResourcePropertiesDocument requestDoc ) - { - if ( LOG.isDebugEnabled( ) ) - { - LOG.debug( MSG.getMessage( Keys.QUERY_RP_REQ, - requestDoc.toString( ) ) ); - } - - QueryResourcePropertiesResponseDocument responseDoc = createResponseDocument( ); - QueryExpressionType queryExprElem = - requestDoc.getQueryResourceProperties( ).getQueryExpression( ); - SOAPEnvelope envelope; - try - { - envelope = getResourceContext( ).getSOAPMessage( ).getSOAPPart( ).getEnvelope( ); - } - catch ( SOAPException soape ) - { - throw new JAXRPCException( MSG.getMessage( Keys.FAILED_TO_EXTRACT_SOAP_ENV, soape ) ); - } - - XmlBeansQueryExpression queryExpr = null; - try - { - queryExpr = new XmlBeansQueryExpression( queryExprElem ); - } - catch ( SchemaViolationException sve ) - { - throw new JAXRPCException( sve ); - } - - refreshAllProperties( ); - Object result = null; - try - { - result = QUERY_ENGINE.executeQuery( queryExpr, - getProperties( ), - envelope ); - } - catch ( UnknownQueryExpressionDialectException uqede ) - { - throw new UnknownQueryExpressionDialectFaultException( uqede.getDialect( ) ); - } - catch ( QueryEvaluationErrorException qeee ) - { - throw new QueryEvaluationErrorFaultException( qeee.getMessage( ) ); - } - catch ( InvalidQueryExpressionException iqee ) - { - throw new InvalidQueryExpressionFaultException( queryExpr ); - } - - QueryResourcePropertiesResponseDocument.QueryResourcePropertiesResponse responseElem = - responseDoc.getQueryResourcePropertiesResponse( ); - if ( result.getClass( ).isArray( ) ) - { - for ( int i = 0; i < Array.getLength( result ); i++ ) - { - Object resultItem = Array.get( result, i ); - XmlObject resultXBean = null; - try + /** + * DOCUMENT_ME + */ + private static final QueryEngine QUERY_ENGINE = new QueryEngineImpl(); + + /** + * Creates a new [EMAIL PROTECTED] QueryResourcePropertiesProvider} object. + * + * @param resourceContext DOCUMENT_ME + */ + public QueryResourcePropertiesProvider( ResourceContext resourceContext ) + { + super( resourceContext ); + } + + /** + * Implementation of the wsrp:QueryResourceProperties operation. + * + * @param requestDoc the requestDoc XMLBean + * + * @return the response XMLBean + * + * @throws org.apache.ws.resource.faults.ResoureKeyHeaderNotFoundFaultException + * + * @throws org.apache.ws.resource.properties.faults.UnknownQueryExpressionDialectFaultException + * if query dialect is unsupported. + * @throws org.apache.ws.resource.properties.faults.QueryEvaluationErrorFaultException + * if query evaluation fails. + * @throws org.apache.ws.resource.properties.faults.InvalidQueryExpressionFaultException + * if query expression is invalid. + */ + public QueryResourcePropertiesResponseDocument queryResourceProperties( QueryResourcePropertiesDocument requestDoc ) + { + if ( LOG.isDebugEnabled() ) + { + LOG.debug( MSG.getMessage( Keys.QUERY_RP_REQ, + requestDoc.toString() ) ); + } + + QueryResourcePropertiesResponseDocument responseDoc = createResponseDocument(); + QueryExpressionType queryExprElem = + requestDoc.getQueryResourceProperties().getQueryExpression(); + SOAPEnvelope envelope; + try + { + envelope = getResourceContext().getSOAPMessage().getSOAPPart().getEnvelope(); + } + catch ( SOAPException soape ) + { + throw new JAXRPCException( MSG.getMessage( Keys.FAILED_TO_EXTRACT_SOAP_ENV, soape ) ); + } + + XmlBeansQueryExpression queryExpr = new XmlBeansQueryExpression( queryExprElem ); + + refreshAllProperties(); + Object result = null; + try + { + result = QUERY_ENGINE.executeQuery( queryExpr, + getProperties(), + envelope ); + } + catch ( UnknownQueryExpressionDialectException uqede ) + { + throw new UnknownQueryExpressionDialectFaultException( uqede.getDialect() ); + } + catch ( QueryEvaluationErrorException qeee ) + { + throw new QueryEvaluationErrorFaultException( qeee.getMessage() ); + } + catch ( InvalidQueryExpressionException iqee ) + { + throw new InvalidQueryExpressionFaultException( queryExpr ); + } + + QueryResourcePropertiesResponseDocument.QueryResourcePropertiesResponse responseElem = + responseDoc.getQueryResourcePropertiesResponse(); + if ( result.getClass().isArray() ) + { + for ( int i = 0; i < Array.getLength( result ); i++ ) { - resultXBean = XmlBeanUtils.toXmlObject( resultItem ); - } - catch ( Exception e ) - { - throw new JAXRPCException( e ); - } + Object resultItem = Array.get( result, i ); + XmlObject resultXBean = null; + try + { + resultXBean = XmlBeanUtils.toXmlObject( resultItem ); + } + catch ( Exception e ) + { + throw new JAXRPCException( e ); + } - XmlBeanUtils.addChildElement( responseElem, resultXBean ); - } - } - else - { - XmlBeanUtils.setValue( responseElem, - result.toString( ) ); - } - - return responseDoc; - } - - private QueryResourcePropertiesResponseDocument createResponseDocument( ) - { - QueryResourcePropertiesResponseDocument responseDoc = - QueryResourcePropertiesResponseDocument.Factory.newInstance( ); - responseDoc.addNewQueryResourcePropertiesResponse( ); - return responseDoc; - } + XmlBeanUtils.addChildElement( responseElem, resultXBean ); + } + } + else + { + XmlBeanUtils.setValue( responseElem, + result.toString() ); + } + + return responseDoc; + } + + private QueryResourcePropertiesResponseDocument createResponseDocument() + { + QueryResourcePropertiesResponseDocument responseDoc = + QueryResourcePropertiesResponseDocument.Factory.newInstance(); + responseDoc.addNewQueryResourcePropertiesResponse(); + return responseDoc; + } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
