Examples of EventException


Examples of org.w3c.dom.events.EventException

        EventImpl evt = (EventImpl)event;

        // VALIDATE -- must have been initialized at least once, must have
        // a non-null non-blank name.
        if(!evt.initialized || evt.type == null || evt.type.equals(""))
            throw new EventException(EventException.UNSPECIFIED_EVENT_TYPE_ERR,
                                     "DOM010 Unspecified event type");
       
        // If nobody is listening for this event, discard immediately
        LCount lc = LCount.lookup(evt.getType());
        if (lc.captures + lc.bubbles + lc.defaults == 0)
View Full Code Here

Examples of org.w3c.dom.events.EventException

     * create your own RangeException subclass.
     * @param code the exception code
     * @param message the detail message
     */
    private static EventException createEventException(short code, String s) {
  return new EventException(code, s);
    }
View Full Code Here

Examples of org.w3c.dom.events.EventException

        // VALIDATE -- must have been initialized at least once, must have
        // a non-null non-blank name.
        if(!evt.initialized || evt.type == null || evt.type.equals("")) {
            String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "UNSPECIFIED_EVENT_TYPE_ERR", null);
            throw new EventException(EventException.UNSPECIFIED_EVENT_TYPE_ERR, msg);
        }
       
        // If nobody is listening for this event, discard immediately
        LCount lc = LCount.lookup(evt.getType());
        if (lc.total == 0)
View Full Code Here

Examples of org.wso2.event.exceptions.EventException

            }

        }else if (event.getMessage() instanceof MessageContext) {
            payload = (OMElement)event.getMessage();
        }else{
            throw new EventException("Carbon Dispatcher only support OMElement and MessageContext as EventType");
        }
       
        payload = payload.cloneOMElement();

View Full Code Here

Examples of org.wso2.event.exceptions.EventException

        String topicName = subscription.getFilterDesc().getFilterValue();
        if(EventBrokerUtils.isSecureTopic(topicName)){
            UserRealm userRealm = AdminServicesUtil.getUserRealm();
            if(!userRealm.getAuthorizationManager().isUserAuthorized(EventBrokerUtils.getLoggedInUserName(),
                    Utils.getSecureTopicPermissionPath(topicName), "write")){
                throw new EventException("User is not authorized to subscribe to Secure topic "+ topicName);
            }
        }
       
       
        if (subscription != null && subscription.getId() != null) {
            if (log.isDebugEnabled()) {
                log.debug("Subscription request recieved  : " + subscription.getId());
            }
            String subID = getBrokerService().subscribe(subscription);
            if (subID != null) {
                if (log.isDebugEnabled()) {
                    log.debug("Sending subscription response for Subscription ID : " +
                            subscription.getId());
                }
                SOAPEnvelope soapEnvelope = builder.fromSubscription(subscription);
                dispatchResponse(soapEnvelope, CommandBuilderConstants.WSE_SUBSCRIBE_RESPONSE, mc, false);
            } else {
                log.debug("Subscription Failed, sending fault response");
                SOAPEnvelope soapEnvelope = BuilderUtils.genFaultResponse(
                        CommandBuilderConstants.WSE_FAULT_CODE_RECEIVER, "EventSourceUnableToProcess",
                        "Unable to subscribe ", "", mc.isSOAP11());
                dispatchResponse(soapEnvelope, CommandBuilderConstants.WSA_FAULT, mc, true);
            }
        } else {
            log.debug("Subscription Failed, sending fault response");
            SOAPEnvelope soapEnvelope = BuilderUtils.genFaultResponse(
                    CommandBuilderConstants.WSE_FAULT_CODE_RECEIVER, "EventSourceUnableToProcess",
                    "Unable to subscribe ", "", mc.isSOAP11());
            dispatchResponse(soapEnvelope, CommandBuilderConstants.WSA_FAULT, mc, true);
        }
        }catch(Exception e){
            throw new EventException("Error at Subscribing ",e);
        }
    }
View Full Code Here

Examples of org.wso2.event.exceptions.EventException

        }
        subscription = getBrokerService().getSubscriptionManager().getSubscription(subscription.getId());
        if (subscription != null) {
            String loggedInUser = EventBrokerUtils.getLoggedInUserName();
            if(!loggedInUser.equals("admin") && !loggedInUser.equals(subscription.getOwner())){
                throw new EventException("User "+ loggedInUser + " does not own subscription "+ subscription.getId());
            }
            if (log.isDebugEnabled()) {
                log.debug("Sending GetStatus responce for Subscription ID : " +
                        subscription.getId());
            }
View Full Code Here

Examples of org.wso2.event.exceptions.EventException

                        subscription.getId());
            }
           
            String loggedInUser = EventBrokerUtils.getLoggedInUserName();
            if(!loggedInUser.equals("admin") && !loggedInUser.equals(subscription.getOwner())){
                throw new EventException("User "+ loggedInUser + " does not own subscription "+ subscription.getId());
            }
           
            if (getBrokerService().getSubscriptionManager().renew(subscription)) {
                if (log.isDebugEnabled()) {
                    log.debug("Sending Renew response for Subscription ID : " +
View Full Code Here

Examples of org.wso2.event.exceptions.EventException

           
           
            SOAPEnvelope getSubscriptionsResponseEnv = GetSubscriptionsCommandBuilder.buildResponseforGetSubscriptions(filteredSubscriptions, maxResultCount, firstIndex);
            dispatchResponse(getSubscriptionsResponseEnv, CommandBuilderConstants.WSE_RENEW_RESPONSE, mc, false);
        } catch (AxisFault e) {
           throw new EventException("Error at Get Subscriptions:"+e.getMessage(), e);
        }
    }
View Full Code Here

Examples of org.wso2.event.exceptions.EventException

                    map.put("query", "SELECT R.REG_PATH_ID, R.REG_NAME FROM REG_RESOURCE R, REG_PROPERTY PP, REG_RESOURCE_PROPERTY RP WHERE"
                            + " R.REG_VERSION=RP.REG_VERSION AND RP.REG_PROPERTY_ID=PP.REG_ID AND PP.REG_NAME=? AND PP.REG_VALUE=?");
                    for(String token:tokens){
                        String[] nameVal = token.split("=");
                        if(nameVal.length != 2){
                            throw new EventException("searchStr "+ searchStr + " is not formatted correctly");
                        }
                        map.put("1", nameVal[0]);
                        map.put("2", nameVal[1]);  
                    }               
                   
                    Collection results = registry.executeQuery(null, map);
                    for(String path:results.getChildren()){
                       if(path.startsWith(subStorePath)){
                            Subscription sub = regStorageToSubscription(registry.get(path));
                            String id = path.substring(path.indexOf('/'));
                            sub.setId(id);
                            subscriptionList.add(sub);
                       }
                    }
                }else{
                    Properties property = resTopicIndex.getProperties();
                    if (property != null) {
                        if (!property.isEmpty()) {
                            for (Enumeration e = property.propertyNames() ; e.hasMoreElements() ;) {
                                String id = (String)e.nextElement();
                                if (RegistryUtils.isHiddenProperty(id)) {
                                    continue;
                                }
                                String topic = resTopicIndex.getProperty(id);
                                String subStorePath = getSubscriptionStoragePath();
                                if (subStorePath != null) {
                                    subStorePath = subStorePath + topic;
                                } else {
                                    subStorePath = topic;
                                }
                                String regPath = subStorePath + "/" + id;
                                if (registry.resourceExists(regPath)) {
                                    Resource resource = registry.get(regPath);
                                    if (resource != null) {
                                        Subscription sub;
                                        if (EPR_TYPE.equals(resource.getMediaType())) {
                                            sub = regStorageToSubscription(resource);
                                            sub.setId(id);
                                            subscriptionList.add(sub);
                                        }
                                    }
                                }
                            }
                        }
                    }

                }
            }
        } catch (RegistryException e) {
            throw new EventException("Error reading subscription" + e.toString());
        } catch (XMLStreamException e) {
            throw new EventException("Error processing subscription" + e.toString());
        }
        return subscriptionList;
    }
View Full Code Here

Examples of org.wso2.event.exceptions.EventException

            Resource root = registry.get(topicIndexPath);
            TopicNode rootTopic = new TopicNode(new Topic("/", false));
            buildTopicTree(rootTopic, (Collection)root);
            return rootTopic;
        } catch (RegistryException e) {
            throw new EventException(e.getMessage(),e);
        }
    }
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.