Examples of IHandler


Examples of info.javadev.jSEO.filter.handler.IHandler

    OutputStream out = response.getOutputStream();
   
    chain.doFilter(reqWrap,rspWrap);
   
    IHandler dynaHandler = JSeoConstants.getHandler(rspWrap.getContentType());
   
    String dynaString = dynaHandler.process(new String(rspWrap.getResponseBytes()), mapper);
   
    out.write(dynaString.getBytes());
    out.close();
  }
View Full Code Here

Examples of org.apache.juddi.handler.IHandler

     
      // Lookup the appropriate XML handler.  Throw an
      // UnsupportedException if one could not be located.

      HandlerMaker maker = HandlerMaker.getInstance();
      IHandler requestHandler = maker.lookup(operation);
      if (requestHandler == null)
        throw new UnsupportedException("The UDDI service operation " +
          "specified is unknown or unsupported: " +operation);
     
      // Unmarshal the raw xml into the appropriate jUDDI
      // request object.

      RegistryObject uddiReqObj = requestHandler.unmarshal(uddiReq);
     
      // Grab a reference to the shared jUDDI registry
      // instance (make sure it's running) and execute the
      // requested UDDI function.
     
      RegistryObject uddiResObj = null;     
      RegistryEngine registry = RegistryServlet.getRegistry();
      if ((registry != null) && (registry.isAvailable()))
        uddiResObj = registry.execute(uddiReqObj);
      else
        throw new BusyException("The Registry is currently unavailable.");
     
      // Lookup the appropriate response handler which will
      // be used to marshal the UDDI object into the appropriate
      // xml format.
     
      IHandler responseHandler = maker.lookup(uddiResObj.getClass().getName());
      if (responseHandler == null)
        throw new FatalErrorException("The response object " +
          "type is unknown: " +uddiResObj.getClass().getName());
     
      // Create a new 'temp' XML element to use as a container
      // in which to marshal the UDDI response data into.
       
      DocumentBuilder docBuilder = getDocumentBuilder();
      Document document = docBuilder.newDocument();
      Element element = document.createElement("temp");
       
      // Lookup the appropriate response handler and marshal
      // the juddi object into the appropriate xml format (we
      // only support UDDI v2.0 at this time).  Attach the
      // results to the body of the SOAP response.
       
      responseHandler.marshal(uddiResObj,element);
     
      // Grab a reference to the 'temp' element's
      // only child here (this has the effect of
      // discarding the temp element) and append
      // this child to the soap response body
View Full Code Here

Examples of org.apache.juddi.handler.IHandler

    try
    {
      // Lookup the appropriate XML handler.  Throw an
      // UnsupportedException if one could not be located.
      HandlerMaker maker = HandlerMaker.getInstance();
      IHandler requestHandler = maker.lookup(operation);
      if (requestHandler == null)
        throw new UnsupportedException("The UDDI service operation " +
          "specified is unknown or unsupported: " +operation);
     
      // Unmarshal the raw xml into the appropriate jUDDI
      // request object.

      RegistryObject uddiReqObj = requestHandler.unmarshal(uddiReq);
     
      // Grab a reference to the shared jUDDI registry
      // instance (make sure it's running) and execute the
      // requested UDDI function.
     
      RegistryObject uddiResObj = null;     
      RegistryEngine registry = Registry.getRegistry();
      if ((registry != null) && (registry.isAvailable()))
        uddiResObj = registry.execute(uddiReqObj);
      else
        throw new BusyException("The Registry is currently unavailable.");
     
      // Lookup the appropriate response handler which will
      // be used to marshal the UDDI object into the appropriate
      // xml format.
     
      IHandler responseHandler = maker.lookup(uddiResObj.getClass().getName());
      if (responseHandler == null)
        throw new FatalErrorException("The response object " +
          "type is unknown: " +uddiResObj.getClass().getName());
     
      // Create a new 'temp' XML element to use as a container
      // in which to marshal the UDDI response data into.
       
      DocumentBuilder docBuilder = getDocumentBuilder();
      Document document = docBuilder.newDocument();
      Element element = document.createElement("temp");
     
      // Lookup the appropriate response handler and marshal
      // the juddi object into the appropriate xml format (we
      // only support UDDI v2.0 at this time).  Attach the
      // results to the body of the SOAP response.
       
      responseHandler.marshal(uddiResObj,element);
     
      // Grab a reference to the 'temp' element's
      // only child here (this has the effect of
      // discarding the temp element) and append
      // this child to the soap response body
View Full Code Here

Examples of org.apache.juddi.handler.IHandler

            String function = uddiReq.getLocalName();
            if ((function == null) || (function.trim().length() == 0))
                throw new FatalErrorException("The name of the UDDI request " +
                        "could not be identified.");
            IHandler requestHandler = maker.lookup(function);
            if (requestHandler == null)
                throw new UnsupportedException("The UDDI request " +
                        "type specified is unknown: " + function);

            String generic = uddiReq.getAttribute("generic");
            if (generic == null)
                throw new FatalErrorException("A UDDI generic attribute " +
                        "value was not found for UDDI request: " + function + " (The " +
                        "'generic' attribute must be present)");
            else if (!generic.equals(IRegistry.UDDI_V2_GENERIC))
                throw new UnsupportedException("Currently only UDDI v2 " +
                        "requests are supported. The generic attribute value " +
                        "received was: " + generic);

            // Unmarshal the raw xml into the appropriate jUDDI
            // request object.

            RegistryObject uddiReqObj = requestHandler.unmarshal(uddiReq);
            if(uddiReqObj == null)
               throw new FatalErrorException("Uddi Request is null");

            // Grab a reference to the shared jUDDI registry
            // instance (make sure it's running) and execute the
            // requested UDDI function.

            RegistryObject uddiResObj = null;
            RegistryEngine registry = RegistryServlet.getRegistry();
            if ((registry != null) && (registry.isAvailable()))
                uddiResObj = registry.execute(uddiReqObj);
            else
                throw new BusyException("The Registry is currently unavailable.");

            // Lookup the appropriate response handler which will
            // be used to marshal the UDDI object into the appropriate
            // xml format.

            IHandler responseHandler = maker.lookup(uddiResObj.getClass().getName());
            if (responseHandler == null)
                throw new FatalErrorException("The response object " +
                        "type is unknown: " + uddiResObj.getClass().getName());

            // Create a new 'temp' XML element to use as a container
            // in which to marshal the UDDI response data into.

            DocumentBuilder docBuilder = getDocumentBuilder();
            Document document = docBuilder.newDocument();
            Element element = document.createElement("temp");

            // Lookup the appropriate response handler and marshal
            // the juddi object into the appropriate xml format (we
            // only support UDDI v2.0 at this time).  Attach the
            // results to the body of the SOAP response.

            responseHandler.marshal(uddiResObj, element);
            log.debug("Response that will be sent:");
            log.debug(XMLUtils.toString((Element) element.getFirstChild()));

            // Grab a reference to the 'temp' element's
            // only child here (this has the effect of
View Full Code Here

Examples of org.apache.juddi.handler.IHandler

    try
    {
      // Lookup the appropriate XML handler.  Throw an
      // UnsupportedException if one could not be located.
      HandlerMaker maker = HandlerMaker.getInstance();
      IHandler requestHandler = maker.lookup(operation);
      if (requestHandler == null)
        throw new UnsupportedException("The UDDI service operation " +
          "specified is unknown or unsupported: " +operation);
     
      // Unmarshal the raw xml into the appropriate jUDDI
      // request object.

      RegistryObject uddiReqObj = requestHandler.unmarshal(uddiReq);
     
      // Grab a reference to the shared jUDDI registry
      // instance (make sure it's running) and execute the
      // requested UDDI function.
     
      RegistryObject uddiResObj = null;     
      RegistryEngine registry = Registry.getRegistry();
      if ((registry != null) && (registry.isAvailable()))
        uddiResObj = registry.execute(uddiReqObj);
      else
        throw new BusyException("The Registry is currently unavailable.");
     
      // Lookup the appropriate response handler which will
      // be used to marshal the UDDI object into the appropriate
      // xml format.
     
      IHandler responseHandler = maker.lookup(uddiResObj.getClass().getName());
      if (responseHandler == null)
        throw new FatalErrorException("The response object " +
          "type is unknown: " +uddiResObj.getClass().getName());
     
      // Create a new 'temp' XML element to use as a container
      // in which to marshal the UDDI response data into.
       
      DocumentBuilder docBuilder = getDocumentBuilder();
      Document document = docBuilder.newDocument();
      Element element = document.createElement("temp");
     
      // Lookup the appropriate response handler and marshal
      // the juddi object into the appropriate xml format (we
      // only support UDDI v2.0 at this time).  Attach the
      // results to the body of the SOAP response.
       
      responseHandler.marshal(uddiResObj,element);
     
      // Grab a reference to the 'temp' element's
      // only child here (this has the effect of
      // discarding the temp element) and append
      // this child to the soap response body
View Full Code Here

Examples of org.apache.juddi.handler.IHandler

            String function = uddiReq.getLocalName();
            if ((function == null) || (function.trim().length() == 0))
                throw new FatalErrorException("The name of the UDDI request " +
                        "could not be identified.");
            IHandler requestHandler = maker.lookup(function);
            if (requestHandler == null)
                throw new UnsupportedException("The UDDI request " +
                        "type specified is unknown: " + function);

            String generic = uddiReq.getAttribute("generic");
            if (generic == null)
                throw new FatalErrorException("A UDDI generic attribute " +
                        "value was not found for UDDI request: " + function + " (The " +
                        "'generic' attribute must be present)");
            else if (!generic.equals(IRegistry.UDDI_V2_GENERIC))
                throw new UnsupportedException("Currently only UDDI v2 " +
                        "requests are supported. The generic attribute value " +
                        "received was: " + generic);

            // Unmarshal the raw xml into the appropriate jUDDI
            // request object.

            RegistryObject uddiReqObj = requestHandler.unmarshal(uddiReq);
            if(uddiReqObj == null)
               throw new FatalErrorException("Uddi Request is null");

            // Grab a reference to the shared jUDDI registry
            // instance (make sure it's running) and execute the
            // requested UDDI function.

            RegistryObject uddiResObj = null;
            RegistryEngine registry = RegistryServlet.getRegistry();
            if ((registry != null) && (registry.isAvailable()))
                uddiResObj = registry.execute(uddiReqObj);
            else
                throw new BusyException("The Registry is currently unavailable.");

            // Lookup the appropriate response handler which will
            // be used to marshal the UDDI object into the appropriate
            // xml format.

            IHandler responseHandler = maker.lookup(uddiResObj.getClass().getName());
            if (responseHandler == null)
                throw new FatalErrorException("The response object " +
                        "type is unknown: " + uddiResObj.getClass().getName());

            // Create a new 'temp' XML element to use as a container
            // in which to marshal the UDDI response data into.

            DocumentBuilder docBuilder = getDocumentBuilder();
            Document document = docBuilder.newDocument();
            Element element = document.createElement("temp");

            // Lookup the appropriate response handler and marshal
            // the juddi object into the appropriate xml format (we
            // only support UDDI v2.0 at this time).  Attach the
            // results to the body of the SOAP response.

            responseHandler.marshal(uddiResObj, element);
            log.debug("Response that will be sent:");
            log.debug(XMLUtils.toString((Element) element.getFirstChild()));

            // Grab a reference to the 'temp' element's
            // only child here (this has the effect of
View Full Code Here

Examples of org.apache.juddi.handler.IHandler

      // lookup the appropriate xml handler, throw
      // an UnsupportedException if one could not be
      // located.

      IHandler requestHandler = maker.lookup(function);
      if (requestHandler == null)
        throw new UnsupportedException("The request " +
          "type is unknown: " +function);

      // unmarshal the raw xml into an associated
      // jUDDI request object.

      RegistryObject uddiRequest = requestHandler.unmarshal(request);

      // Determine if this message came from through
      // the Publish, Inquiry or Admin API and handle
      // it appropriately.

      Object juddiServlet = messageContext.getProperty("transport.http.servlet");

      // confirm that the the appropriate endpoint
      // was used to invoke the selected jUDDI/UDDI
      // function.

      if((juddiServlet instanceof InquiryServlet) &&
         (!(uddiRequest instanceof org.apache.juddi.datatype.request.Inquiry)))
      {
        throw new RegistryException("Inquiry API " +
          "does not support function: "+function);
      }
      else if (juddiServlet instanceof PublishServlet &&
         (!(uddiRequest instanceof org.apache.juddi.datatype.request.Publish) &&
          !(uddiRequest instanceof org.apache.juddi.datatype.request.SecurityPolicy)))
      {
        throw new RegistryException("Publish API " +
          "does not support function: "+function);
      }
      else if ((juddiServlet instanceof AdminServlet) &&    // Admin
         (!(uddiRequest instanceof org.apache.juddi.datatype.request.Admin)))
      {
        throw new RegistryException("Admin API " +
          "does not support function: "+function);
      }

      // grab a reference to the shared jUDDI registry
      // instance (make sure it's running) and execute
      // the requested UDDI function.

      RegistryObject uddiResponse = null;
     
      RegistryEngine registry = RegistryServlet.getRegistry();
      if ((registry != null) && (registry.isAvailable()))
        uddiResponse = registry.execute(uddiRequest);
      else
        throw new BusyException("The Registry is unavailable");

      // create a new 'temp' XML element. This
      // element is used as a container in which
      // to marshal the UDDI response into.

      Document document = XMLUtils.createDocument();
      Element element = document.createElement("temp");

      // lookup the appropriate response handler
      // and marshal the juddi object into the
      // appropriate xml format (we only support
      // uddi v2.0 at this time) attaching results
      // to the temporary 'temp' element.

      IHandler responseHandler = maker.lookup(uddiResponse.getClass().getName());
      responseHandler.marshal(uddiResponse,element);

      // grab a reference to the 'temp' element's
      // only child here (this has the effect of
      // discarding the temp element) and appending
      // this child to the soap response body.
View Full Code Here

Examples of org.apache.juddi.handler.IHandler

     
      // Lookup the appropriate XML handler.  Throw an
      // UnsupportedException if one could not be located.

      HandlerMaker maker = HandlerMaker.getInstance();
      IHandler requestHandler = maker.lookup(operation);
      if (requestHandler == null)
        throw new UnsupportedException("The UDDI service operation " +
          "specified is unknown or unsupported: " +operation);
     
      // Unmarshal the raw xml into the appropriate jUDDI
      // request object.

      RegistryObject uddiReqObj = requestHandler.unmarshal(uddiReq);
     
      // Grab a reference to the shared jUDDI registry
      // instance (make sure it's running) and execute the
      // requested UDDI function.
     
      RegistryObject uddiResObj = null;     
      RegistryEngine registry = RegistryServlet.getRegistry();
      if ((registry != null) && (registry.isAvailable()))
        uddiResObj = registry.execute(uddiReqObj);
      else
        throw new BusyException("The Registry is currently unavailable.");
     
      // Lookup the appropriate response handler which will
      // be used to marshal the UDDI object into the appropriate
      // xml format.
     
      IHandler responseHandler = maker.lookup(uddiResObj.getClass().getName());
      if (responseHandler == null)
        throw new FatalErrorException("The response object " +
          "type is unknown: " +uddiResObj.getClass().getName());
     
      // Create a new 'temp' XML element to use as a container
      // in which to marshal the UDDI response data into.
       
      DocumentBuilder docBuilder = getDocumentBuilder();
      Document document = docBuilder.newDocument();
      Element element = document.createElement("temp");
       
      // Lookup the appropriate response handler and marshal
      // the juddi object into the appropriate xml format (we
      // only support UDDI v2.0 at this time).  Attach the
      // results to the body of the SOAP response.
       
      responseHandler.marshal(uddiResObj,element);
     
      // Grab a reference to the 'temp' element's
      // only child here (this has the effect of
      // discarding the temp element) and append
      // this child to the soap response body
View Full Code Here

Examples of org.apache.juddi.handler.IHandler

    // appropriate xml format (we only support
    // uddi v2.0 at this time) attaching results
    // to the temporary 'temp' element.

    String requestName = uddiRequest.getClass().getName();
    IHandler requestHandler = maker.lookup(requestName);
    requestHandler.marshal(uddiRequest,temp);
    Element request = (Element)temp.getFirstChild();

    request.setAttribute("generic",this.getUddiVersion());
    request.setAttribute("xmlns",this.getUddiNamespace());

    // A SOAP request is made and a SOAP response
    // is returned.

    Element response = transport.send(request,endPointURL);

    // First, let's make sure that a response
    // (any response) is found in the SOAP Body.

    String responseName = response.getLocalName();
    if (responseName == null)
    {
      throw new RegistryException("Unsupported response " +
        "from registry. A value was not present.");
    }

    // Let's now try to determine which UDDI response
    // we received and unmarshal it appropriately or
    // throw a RegistryException if it's unknown.

    IHandler handler = maker.lookup(responseName.toLowerCase());
    if (handler == null)
    {
      throw new RegistryException("Unsupported response " +
        "from registry. Response type '" + responseName +
        "' is unknown.");
    }

    // Well, we have now determined that something was
    // returned and it is "a something" that we know
    // about so let's unmarshal it into a RegistryObject

    RegistryObject uddiResponse = handler.unmarshal(response);

    // Next, let's make sure we didn't recieve a SOAP
    // Fault. If it is a SOAP Fault then throw it
    // immediately.
View Full Code Here

Examples of org.apache.juddi.handler.IHandler

    // appropriate xml format (we only support
    // uddi v2.0 at this time) attaching results
    // to the temporary 'temp' element.

    String requestName = uddiRequest.getClass().getName();
    IHandler requestHandler = maker.lookup(requestName);
    requestHandler.marshal(uddiRequest,temp);
    Element request = (Element)temp.getFirstChild();

    request.setAttribute("generic",this.getUddiVersion());
    request.setAttribute("xmlns",this.getUddiNamespace());

    // A SOAP request is made and a SOAP response
    // is returned.

    Element response = transport.send(request,endPointURL,httpProxySet,httpProxyHost,httpProxyPort);

    // First, let's make sure that a response
    // (any response) is found in the SOAP Body.

    String responseName = response.getLocalName();
    if (responseName == null)
    {
      throw new RegistryException("Unsupported response " +
        "from registry. A value was not present.");
    }

    // Let's now try to determine which UDDI response
    // we received and unmarshal it appropriately or
    // throw a RegistryException if it's unknown.

    IHandler handler = maker.lookup(responseName.toLowerCase());
    if (handler == null)
    {
      throw new RegistryException("Unsupported response " +
        "from registry. Response type '" + responseName +
        "' is unknown.");
    }

    // Well, we have now determined that something was
    // returned and it is "a something" that we know
    // about so let's unmarshal it into a RegistryObject

    RegistryObject uddiResponse = handler.unmarshal(response);

    // Next, let's make sure we didn't recieve a SOAP
    // Fault. If it is a SOAP Fault then throw it
    // immediately.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.