Examples of RouteInfo


Examples of org.apache.http.conn.routing.RouteInfo

                    HttpEntity entity = response.getEntity();
                    EntityUtils.consume(entity);

                    int sc = response.getStatusLine().getStatusCode();

                    RouteInfo route = localContext.getHttpRoute();
                    AuthState authState = null;
                    HttpHost authhost = null;
                    if (sc == HttpStatus.SC_UNAUTHORIZED) {
                        // Target host authentication required
                        authState = localContext.getTargetAuthState();
                        authhost = route.getTargetHost();
                    }
                    if (sc == HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED) {
                        // Proxy authentication required
                        authState = localContext.getProxyAuthState();
                        authhost = route.getProxyHost();
                    }

                    if (authState != null) {
                        System.out.println("----------------------------------------");
                        AuthScheme authscheme = authState.getAuthScheme();
View Full Code Here

Examples of org.woped.qualanalysis.structure.components.RouteInfo

    // ! the shortest route to the element described by the row
    // ! can be reconstructed by following the m_predecessor back-references
    public static RouteInfo[][] getAllConnections(Collection<AbstractPetriNetElementModel> netElements,
            boolean ignoreArcDirection) {
        int nNumNetElements = netElements.size();
        RouteInfo routeInfo[][] = new RouteInfo[nNumNetElements][nNumNetElements];
        HashMap<AbstractPetriNetElementModel, Integer> nodeToIndex = new HashMap<AbstractPetriNetElementModel, Integer>();

        // Build a map from node to index
        // We will need this when traversing the graph
        // (the graph doesn't know about our collection of input
        // net elements)
        Iterator<AbstractPetriNetElementModel> nodeIndexIterator = netElements.iterator();
        int nNodeIndex = 0;
        while (nodeIndexIterator.hasNext()) {
            nodeToIndex.put(nodeIndexIterator.next(), new Integer(nNodeIndex));
            ++nNodeIndex;
        }

        try {
            // Iterate through outer index
            for (int i = 0; i < nNumNetElements; ++i) {
                int j = 0;
                Iterator<AbstractPetriNetElementModel> innerIterator = netElements.iterator();
                while (innerIterator.hasNext()) {
                    routeInfo[i][j] = new RouteInfo();
                    routeInfo[i][j].m_thisElement = innerIterator.next();
                    ++j;
                }
                // Apply Moore's algorithm
                // We have a distance of zero to ourselves
                routeInfo[i][i].m_nDistanceToSource = 0;
                // Define the starting point
                LinkedList<RouteInfo> currentList = new LinkedList<RouteInfo>();
                currentList.add(routeInfo[i][i]);
                // Keep going until no more elements need to be processed
                while (currentList.size() > 0) {
                    // Create the follow-up list
                    LinkedList<RouteInfo> newList = new LinkedList<RouteInfo>();
                    for (Iterator<RouteInfo> listContent = currentList.iterator(); listContent.hasNext();) {
                        RouteInfo currentRouteInfo = listContent.next();
                        // Look up all connections (to and from, only from if directed
                        // and iterate them)
                        Set<AbstractPetriNetElementModel> connectedNodes = getDirectlyConnectedNodes(
                                currentRouteInfo.m_thisElement, connectionTypeOUTBOUND);
                        if (ignoreArcDirection == true) {
                            // Depending on our configuration we care about the
                            // direction of the edge or not
                            Set<AbstractPetriNetElementModel> wrongDirection = getDirectlyConnectedNodes(
                                    currentRouteInfo.m_thisElement, connectionTypeINBOUND);
                            connectedNodes.addAll(wrongDirection);

                        }
                        Iterator<AbstractPetriNetElementModel> nodeIterator = connectedNodes.iterator();
                        while (nodeIterator.hasNext()) {
                            AbstractPetriNetElementModel target = nodeIterator.next();
                            // Use our node to index lookup table to
                            // find the RouteInfo object corresponding to the
                            // target
                            Integer targetIndex = nodeToIndex.get(target);
                            if (targetIndex != null) {
                                RouteInfo newRouteInfo = routeInfo[i][targetIndex.intValue()];
                                // See whether this node has already been visited
                                if (newRouteInfo.m_nDistanceToSource == -1) {
                                    // Update the information on this node
                                    newRouteInfo.m_predecessor = currentRouteInfo;
                                    newRouteInfo.m_nDistanceToSource = currentRouteInfo.m_nDistanceToSource + 1;
View Full Code Here

Examples of org.xmlBlaster.util.cluster.RouteInfo

            boolean dirtyRead = RouteInfo.DEFAULT_dirtyRead;
            if (tmpDirty != null) {
               try { dirtyRead = new Boolean(tmpDirty.trim()).booleanValue(); } catch(NumberFormatException e) { log.severe("Invalid dirtyRead =" + tmpDirty); };
            }

            routeInfo = new RouteInfo(nodeId, stratum, timestamp);
            if (tmpDirty != null)
               routeInfo.setDirtyRead(dirtyRead);
         }
         return;
      }
View Full Code Here

Examples of org.xmlBlaster.util.cluster.RouteInfo

      // Set stratum to new values
      int offset = routeInfo.getStratum();
      if (offset < 0) offset = 0;

      for (int ii=routeNodeList.size()-1; ii>=0; ii--) {
         RouteInfo ri = (RouteInfo)routeNodeList.get(ii);
         ri.setStratum(offset++);
      }
   }
View Full Code Here

Examples of org.xmlBlaster.util.cluster.RouteInfo

   public int count(NodeId nodeId) {
      int count = 0;
      if (routeNodeList == null)
         return count;
      for (int ii=0; ii<routeNodeList.size(); ii++) {
         RouteInfo ri = (RouteInfo)routeNodeList.get(ii);
         if (ri.getNodeId().equals(nodeId))
            count++;
      }
      return count;
   }
View Full Code Here

Examples of org.xmlBlaster.util.cluster.RouteInfo

    */
   public final boolean isAtMaster() {
      if (routeNodeList == null || routeNodeList.size() == 0)
         return true;
      for (int ii=routeNodeList.size()-1; ii>=0; ii--) {
         RouteInfo ri = (RouteInfo)routeNodeList.get(ii);
         if (ri.getStratum() == 0 && !ri.getDirtyRead() && ri.getNodeId().equals(glob.getNodeId()))
            return true;
      }
      return false;
   }
View Full Code Here

Examples of org.xmlBlaster.util.cluster.RouteInfo

    */
   public boolean dirtyRead(NodeId nodeId) {
      if (routeNodeList == null || nodeId == null)
         return false;
      for (int ii=0; ii<routeNodeList.size(); ii++) {
         RouteInfo ri = (RouteInfo)routeNodeList.get(ii);
         if (ri.getNodeId().equals(nodeId)) {
            return ri.getDirtyRead();
         }
      }
      return false;
   }
View Full Code Here

Examples of org.xmlBlaster.util.cluster.RouteInfo

                  log.warning(text);
                  throw new XmlBlasterException(glob, ErrorCode.RESOURCE_CLUSTER_CIRCULARLOOP, ME, text + " Your QoS:" + publishQos.toXml(""));
               }
               int stratum = -1; // not known yet, addRouteInfo() sets my stratum to one closer to the master,
                                 // this needs to be checked here as soon as we know which stratum we are!!!
               publishQos.addRouteInfo(new RouteInfo(glob.getNodeId(), stratum, publishQos.getRcvTimestamp()));
            }
         }

         this.dispatchStatistic.incrNumPublish(1);
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.