Package edu.emory.mathcs.backport.java.util.concurrent

Examples of edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue$Node


  @Override
  public BasicOperator visit(final ASTArbitraryOccurencesNotZero node,
      final OperatorConnection connection, final Item graphConstraint,
      final Variable subject, final Variable object, final Node subjectNode, final Node objectNode) {
    if(USE_CLOSURE_AND_PATHLENGTHZERO_OPERATORS){
      Node predicateNode = node.jjtGetChild(0);
      while (predicateNode instanceof ASTArbitraryOccurences ||
          predicateNode instanceof ASTArbitraryOccurencesNotZero){
        if(predicateNode instanceof ASTArbitraryOccurences){
          return predicateNode.accept(this, connection, graphConstraint, subject, object, subjectNode, objectNode);
        }
        predicateNode = predicateNode.jjtGetChild(0);
      }
      final BasicOperator startingOperator = predicateNode.accept(this, connection, graphConstraint, subject, object, subjectNode, objectNode);

      Set<Literal> allowedObjects = null;
      Set<Literal> allowedSubjects = null;

      if(node.jjtGetParent() instanceof ASTTripleSet){
View Full Code Here


    if (graphConstraint != null && graphConstraint.isVariable()
        && !(node instanceof ASTSelectQuery && ((ASTSelectQuery)node).isSelectAll())) {

      boolean graphVariableIsSelected = false;
      for (int i = 0; i < node.jjtGetNumChildren(); i++) {
        final Node n = node.jjtGetChild(i);
        if (n instanceof ASTVar) {
          final ASTVar variable = (ASTVar) n;
          if (variable.getName().equals(graphConstraint.getName())) {
            graphVariableIsSelected = true;
          }
        }
      }
      // as a workaround we rename the graphvariable in the subquery
      if (!graphVariableIsSelected) {
        int index=0;
        do {
          graphConstraint = new Variable(graphConstraint.getName() + index);
          index++;
        } while (this.hasThisVariable(node, graphConstraint));
      }
    }
    final int numberChildren = node.jjtGetNumChildren();

    boolean onlyAggregations = true;

    // insert limit operator
    for (int i = 0; i < numberChildren; i++) {
      if (node.jjtGetChild(i) instanceof ASTLimit) {
        node.jjtGetChild(i).accept(this, connection);
      }
    }
    // insert offset operator
    for (int i = 0; i < numberChildren; i++) {
      if (node.jjtGetChild(i) instanceof ASTOffset) {
        node.jjtGetChild(i).accept(this, connection);
      }
    }

    if (node instanceof ASTSelectQuery && ((ASTSelectQuery)node).isDistinct()) {

      // or insert a DISTINCT operator into the operator graph:
      connection.connectAndSetAsNewOperatorConnection(new Distinct());
    }

    LinkedList<AddComputedBinding> listOACB = new LinkedList<AddComputedBinding>();
    boolean group = false;

    for (int i = 0; i < numberChildren; i++) {
      final Node childi = node.jjtGetChild(i);
      if (childi instanceof ASTGroup) {
        group = true;
      }
    }

    // insert projection operator

    if (!(node instanceof ASTSelectQuery && ((ASTSelectQuery)node).isSelectAll())) {
      final Projection p = new Projection();
      final LinkedList<AddComputedBinding> listOfAddComputedBindings = new LinkedList<AddComputedBinding>();
      for (int i = 0; i < numberChildren; i++) {
        if (node.jjtGetChild(i) instanceof ASTVar) {
          final ASTVar variable = (ASTVar) node.jjtGetChild(i);
          p.addProjectionElement(new Variable(variable.getName()));
          onlyAggregations = false;
        } else if (node.jjtGetChild(i) instanceof ASTAs) {
          final ASTVar variable = (ASTVar) node.jjtGetChild(i)
              .jjtGetChild(1);
          final lupos.sparql1_1.Node constraint = node.jjtGetChild(i)
              .jjtGetChild(0);
          /*
           * Detecting Errors in SelectQuery if aggregations are used
           * and additional variables are not bound by a GROUP BY
           * statement
           */
          // this.prooveBoundedGroup(node.jjtGetChild(i));

          if (!(constraint instanceof ASTAggregation)) {
            onlyAggregations = false;
          }
          final Variable var2 = new Variable(variable.getName());
          p.addProjectionElement(var2);
          final AddComputedBinding acb = group ? new GroupByAddComputedBinding()
              : new AddComputedBinding();
          acb.addProjectionElement(var2, constraint);
          listOfAddComputedBindings.add(acb);
        }
      }
      // deleting of values if there is only an aggregation statement
      if (onlyAggregations || group) {
        connection.connectAndSetAsNewOperatorConnection(new Distinct());
      }
      listOACB = this.topologicalSorting(listOfAddComputedBindings);
      connection.connectAndSetAsNewOperatorConnection(p);
    }

    // insert sort operator
    for (int i = 0; i < numberChildren; i++) {
      if (node.jjtGetChild(i) instanceof ASTOrderConditions) {
        node.jjtGetChild(i).accept(this, connection);
      }
    }

    for (final AddComputedBinding acb : listOACB) {
      connection.connectAndSetAsNewOperatorConnection(acb);
    }

    // Dealing with the HAVING clause
    for (int i = 0; i < numberChildren; i++) {
      final Node childi = node.jjtGetChild(i);
      if (childi instanceof ASTHaving) {
        for (int k = 0; k < childi.jjtGetNumChildren(); k++) {
          if (childi.jjtGetChild(k) instanceof ASTFilterConstraint) {
            final Having filter = new Having((ASTFilterConstraint) childi
                .jjtGetChild(k));
            this.processExistChildren(node, graphConstraint, filter);
            filter.setEvaluator(this.evaluator);
            connection.connectAndSetAsNewOperatorConnection(filter);
          }
        }

      }
    }

    // Dealing with the GROUP clause
    for (int j = 0; j < numberChildren; j++) {
      final Projection p = new Projection();
      final LinkedList<AddComputedBinding> listOfAddComputedBindings = new LinkedList<AddComputedBinding>();
      ASTVar variable = null;
      final Node childi = node.jjtGetChild(j);
      onlyAggregations = true;
      if (childi instanceof ASTGroup) {
        for (int i = 0; i < childi.jjtGetNumChildren(); i++) {
          if (childi.jjtGetChild(i) instanceof ASTAdditionNode
              || childi.jjtGetChild(i) instanceof ASTSubtractionNode
              || childi.jjtGetChild(i) instanceof ASTMultiplicationNode
              || childi.jjtGetChild(i) instanceof ASTDivisionNode) {
            throw new Error(
                "Error in GROUP BY statement: AS not found");

          } else if (childi.jjtGetChild(i) instanceof ASTAs) {

            variable = (ASTVar) childi.jjtGetChild(i).jjtGetChild(1);
            final lupos.sparql1_1.Node constraint = childi.jjtGetChild(i).jjtGetChild(0);

            /*
             * Detecting Errors in SelectQuery if aggregations are
             * used and additional variables are not bound by a
             * GROUP BY statement
View Full Code Here

 
  @Test
  public void addClientSubscriptionInfo() {
    ClientSubscriptionInfo clientSubscriptionInfo = new ClientSubscriptionInfo();
   
    Node node = new Node();
    node.setSecurityUrl("http://localhost:8080/services/securityUrl");
    node.setName("default");
   
    Clerk clerk = new Clerk();
    clerk.setName("default");
    clerk.setPublisher("root");
    clerk.setNode(node);
View Full Code Here

  public void setProperties(Properties properties) {
    this.properties = properties;
  }
 
  public Node getApiNode() {
    Node apiNode = new Node();
    apiNode.setCustodyTransferUrl(custodyTransferUrl);
    apiNode.setDescription(description);
    apiNode.setFactoryInitial(factoryInitial);
    apiNode.setFactoryNamingProvider(factoryNamingProvider);
    apiNode.setFactoryURLPkgs(factoryURLPkgs);
    apiNode.setInquiryUrl(inquiryUrl);
    apiNode.setJuddiApiUrl(juddiApiUrl);
    apiNode.setManagerName(managerName);
    apiNode.setName(name);
    apiNode.setProxyTransport(proxyTransport);
    apiNode.setPublishUrl(publishUrl);
    apiNode.setSecurityUrl(securityUrl);
    apiNode.setSubscriptionUrl(subscriptionUrl);
    return apiNode;
  }
View Full Code Here

 
  @Test
  public void addClientSubscriptionInfo() {
    ClientSubscriptionInfo clientSubscriptionInfo = new ClientSubscriptionInfo();
   
    Node node = new Node();
    node.setSecurityUrl("http://localhost:8080/services/securityUrl");
    node.setCustodyTransferUrl("http://localhost:8080/services/securityUrl");
    node.setDescription("description");
    node.setInquiryUrl("http://localhost:8080/services/securityUrl");
    node.setPublishUrl("http://localhost:8080/services/securityUrl");
    node.setProxyTransport("class");
    node.setSubscriptionUrl("http://localhost:8080/services/securityUrl");
    node.setName("default");
    node.setManagerName("defaultManager");
    SaveNode saveNode = new SaveNode();
    saveNode.setAuthInfo(authInfoJoe);
    saveNode.getNode().add(node);
   
    Clerk clerk = new Clerk();
    clerk.setName("clerkName");
    clerk.setPublisher("root");
    clerk.setNode(node);
    SaveClerk saveClerk = new SaveClerk();
    saveClerk.setAuthInfo(authInfoJoe);
    saveClerk.getClerk().add(clerk);
   
    clientSubscriptionInfo.setFromClerk(clerk);
   
    Node node2 = new Node();
    node2.setSecurityUrl("http://localhost:8080/services/securityUrl2");
    node2.setCustodyTransferUrl("https://localhost:8080/services/securityUrl2");
    node2.setDescription("description2");
    node2.setInquiryUrl("http://localhost:8080/services/securityUrl2");
    node2.setPublishUrl("http://localhost:8080/services/securityUrl2");
    node2.setProxyTransport("class2");
    node2.setSubscriptionUrl("http://localhost:8080/services/securityUrl2");
    node2.setName("default2");
    node2.setManagerName("default2Manager");
    saveNode.getNode().add(node2);
   
    Clerk clerk2 = new Clerk();
    clerk2.setName("clerkName2");
    clerk2.setPublisher("root");
View Full Code Here

  public void setProperties(Properties properties) {
    this.properties = properties;
  }
 
  public Node getApiNode() {
    Node apiNode = new Node();
    apiNode.setCustodyTransferUrl(custodyTransferUrl);
    apiNode.setDescription(description);
    apiNode.setFactoryInitial(factoryInitial);
    apiNode.setFactoryNamingProvider(factoryNamingProvider);
    apiNode.setFactoryURLPkgs(factoryURLPkgs);
    apiNode.setInquiryUrl(inquiryUrl);
    apiNode.setJuddiApiUrl(juddiApiUrl);
    apiNode.setClientName(clientName);
    apiNode.setName(name);
    apiNode.setProxyTransport(proxyTransport);
    apiNode.setPublishUrl(publishUrl);
    apiNode.setSecurityUrl(securityUrl);
    apiNode.setSubscriptionUrl(subscriptionUrl);
    return apiNode;
  }
View Full Code Here

 
    String publisherName = clerk.getPublisher();
    if (publisherName == null || publisherName.length() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.clerk.NoPublisherName"));
   
    Node node = clerk.getNode();
    if (node == null)
      throw new ValueNotAllowedException(new ErrorMessage("errors.clerk.NullNodeInput"));
   
    String nodeName = node.getName();
    if (nodeName == null || nodeName.length() == 0)
      throw new ValueNotAllowedException(new ErrorMessage("errors.node.NoName"));
   
    //make sure node exists
    Object obj = em.find(org.apache.juddi.model.Node.class, nodeName);
View Full Code Here

 
  @Test
  public void addClientSubscriptionInfo() {
    ClientSubscriptionInfo clientSubscriptionInfo = new ClientSubscriptionInfo();
   
    Node node = new Node();
    node.setSecurityUrl("http://localhost:8080/services/securityUrl");
    node.setCustodyTransferUrl("http://localhost:8080/services/securityUrl");
    node.setDescription("description");
    node.setInquiryUrl("http://localhost:8080/services/securityUrl");
    node.setPublishUrl("http://localhost:8080/services/publishUrl");
                node.setSubscriptionListenerUrl("http://localhost:8080/services/subUrladdClientSubscriptionInfo");
    node.setProxyTransport("org.apache.juddi.v3.client.transport.JAXWSTransport");
    node.setSubscriptionUrl("http://localhost:8080/services/securityUrl");
    node.setName("default");
    node.setClientName("defaultClient");
    SaveNode saveNode = new SaveNode();
    saveNode.setAuthInfo(authInfoJoe);
    saveNode.getNode().add(node);
   
    Clerk clerk = new Clerk();
    clerk.setName("clerkName");
    clerk.setPublisher("root");
    clerk.setNode(node);
    SaveClerk saveClerk = new SaveClerk();
    saveClerk.setAuthInfo(authInfoJoe);
    saveClerk.getClerk().add(clerk);
   
    clientSubscriptionInfo.setFromClerk(clerk);
   
    Node node2 = new Node();
    node2.setSecurityUrl("http://localhost:8080/services/securityUrl2");
    node2.setCustodyTransferUrl("https://localhost:8080/services/securityUrl2");
    node2.setDescription("description2");
    node2.setInquiryUrl("http://localhost:8080/services/securityUrl2");
    node2.setPublishUrl("http://localhost:8080/services/securityUrl2");
    node2.setProxyTransport("org.apache.juddi.v3.client.transport.JAXWSTransport");
    node2.setSubscriptionUrl("http://localhost:8080/services/securityUrl2");
                node2.setSubscriptionListenerUrl("http://localhost:8080/services/securityUrl2");
    node2.setName("default2");
    node2.setClientName("default2Client");
    saveNode.getNode().add(node2);
   
    Clerk clerk2 = new Clerk();
    clerk2.setName("clerkName2");
    clerk2.setPublisher("root");
View Full Code Here

       
       
        @Test(expected = ValueNotAllowedException.class)
  public void addNodeInvalidProxy() throws Exception {
   
    Node node = new Node();
    node.setSecurityUrl("http://localhost:8080/services/securityUrl");
    node.setCustodyTransferUrl("http://localhost:8080/services/securityUrl");
    node.setDescription("description");
    node.setInquiryUrl("http://localhost:8080/services/securityUrl");
    node.setPublishUrl("http://localhost:8080/services/publishUrl");
                node.setSubscriptionListenerUrl("http://localhost:8080/services/subUrladdClientSubscriptionInfo");
    node.setProxyTransport("orgasdasdasdasd.apache.juddi.v3.client.transport.JAXWSTransport");
    node.setSubscriptionUrl("http://localhost:8080/services/securityUrl");
    node.setName("default");
    node.setClientName("defaultClient");
    SaveNode saveNode = new SaveNode();
    saveNode.setAuthInfo(authInfoJoe);
    saveNode.getNode().add(node);
   
    NodeDetail nodeDetail = publisher.saveNode(saveNode);
View Full Code Here

        public List<Node> getUDDINodeList(){
                List<Node> ret = new ArrayList<Node>();
                Iterator<UDDINode> it = uddiNodes.values().iterator();
                while (it.hasNext()){
                        UDDINode next = it.next();
                        Node n = new Node();
                        n.setClientName(next.getClientName());
                        n.setDescription(next.getDescription());
                        n.setName(next.getName());
                        n.setProxyTransport(next.getProxyTransport());
                        ret.add(n);
                }
                return ret;
        }
View Full Code Here

TOP

Related Classes of edu.emory.mathcs.backport.java.util.concurrent.LinkedBlockingQueue$Node

Copyright © 2018 www.massapicom. 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.