Examples of Tunnel


Examples of ch.softappeal.yass.core.remote.Tunnel

  }

  private final AtomicInteger nextRequestNumber = new AtomicInteger(Packet.END_REQUEST_NUMBER);

  @Override protected Object invoke(final ClientInvocation invocation) throws Throwable {
    return invocation.invoke(sessionInterceptor, new Tunnel() {
      @Override public Reply invoke(final Request request) {
        int requestNumber;
        do { // we can't use END_REQUEST_NUMBER as regular requestNumber
          requestNumber = nextRequestNumber.incrementAndGet();
        } while (requestNumber == Packet.END_REQUEST_NUMBER);
View Full Code Here

Examples of ch.softappeal.yass.core.remote.Tunnel

  @Override protected final Object invoke(final ClientInvocation invocation) throws Throwable {
    if (!opened) {
      throw new IllegalStateException("session is not yet opened");
    }
    return invocation.invoke(sessionInterceptor, new Tunnel() {
      @Override public Reply invoke(final Request request) {
        int requestNumber;
        do { // we can't use END_REQUEST_NUMBER as regular requestNumber
          requestNumber = nextRequestNumber.incrementAndGet();
        } while (requestNumber == Packet.END_REQUEST_NUMBER);
View Full Code Here

Examples of com.adito.tunnels.Tunnel

     * @see com.adito.policyframework.actions.AbstractResourceDispatchAction#commitCreatedResource(org.apache.struts.action.ActionMapping, com.adito.policyframework.forms.AbstractResourceForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
     */
    protected Resource commitCreatedResource(ActionMapping mapping, AbstractResourceForm form, HttpServletRequest request,
                                             HttpServletResponse response) throws Exception {
        TunnelForm tf = (TunnelForm) form;
        Tunnel tunnel = (Tunnel) tf.getResource();

        return TunnelDatabaseFactory.getInstance().createTunnel(tunnel.getRealmID(), tunnel.getResourceName(),
            tunnel.getResourceDescription(), tunnel.getType(), tunnel.isAutoStart(), tunnel.getTransport(), tunnel.getUsername(),
            tunnel.getSourcePort(), tunnel.getDestination(), tunnel.getSourceInterface());
    }
View Full Code Here

Examples of com.adito.tunnels.Tunnel

        int sourcePort = ((Integer) seq.getAttribute(TunnelDetailsForm.ATTR_SOURCE_PORT, null)).intValue();
        String destinationHost = (String) seq.getAttribute(TunnelDetailsForm.ATTR_DESTINATION_HOST, null);
        int destinationPort = ((Integer) seq.getAttribute(TunnelDetailsForm.ATTR_DESTINATION_PORT, null)).intValue();
        String sourceInterface = ((String) seq.getAttribute(TunnelDetailsForm.ATTR_SOURCE_INTERFACE, null));
        boolean autoStart = ((Boolean) seq.getAttribute(TunnelDetailsForm.ATTR_AUTO_START, null)).booleanValue();
        Tunnel tunnel = null;
        try {
            try {
                tunnel = TunnelDatabaseFactory.getInstance().createTunnel(user.getRealm().getRealmID(), name, description, type, autoStart, transport,
                                user.getPrincipalName(), sourcePort, new HostService(destinationHost, destinationPort),
                                sourceInterface);
                CoreServlet.getServlet().fireCoreEvent(
                                new CoreEvent(this, TunnelsEventConstants.CREATE_TUNNEL, null, info, CoreEvent.STATE_SUCCESSFUL)
                                                .addAttribute(CoreAttributeConstants.EVENT_ATTR_RESOURCE_NAME, name)
                                                .addAttribute(CoreAttributeConstants.EVENT_ATTR_RESOURCE_DESCRIPTION, description)
                                                .addAttribute(TunnelsEventConstants.EVENT_ATTR_TUNNEL_SOURCE_PORT,
                                                                Integer.toString(sourcePort)).addAttribute(
                                                                                TunnelsEventConstants.EVENT_ATTR_TUNNEL_DESTINATION,
                                                                String.valueOf(destinationHost + ":" + destinationPort))
                                                .addAttribute(TunnelsEventConstants.EVENT_ATTR_TUNNEL_TRANSPORT, transport)
                                                .addAttribute(
                                                                TunnelsEventConstants.EVENT_ATTR_TUNNEL_TYPE,
                                                                ((LabelValueBean) TransportType.TYPES.get(tunnel.getType()))
                                                                                .getLabel()));
            } catch (Exception e) {
                CoreServlet.getServlet().fireCoreEvent(
                                new CoreEvent(this, TunnelsEventConstants.CREATE_TUNNEL, null, info, CoreEvent.STATE_UNSUCCESSFUL)
                                                .addAttribute(CoreAttributeConstants.EVENT_ATTR_RESOURCE_NAME, name)
                                                .addAttribute(CoreAttributeConstants.EVENT_ATTR_RESOURCE_DESCRIPTION, description)
                                                .addAttribute(TunnelsEventConstants.EVENT_ATTR_TUNNEL_SOURCE_PORT,
                                                                Integer.toString(sourcePort)).addAttribute(
                                                                                TunnelsEventConstants.EVENT_ATTR_TUNNEL_DESTINATION,
                                                                String.valueOf(destinationHost + ":" + destinationPort))
                                                .addAttribute(TunnelsEventConstants.EVENT_ATTR_TUNNEL_TRANSPORT, transport)
                                                .addAttribute(
                                                                TunnelsEventConstants.EVENT_ATTR_TUNNEL_TYPE,
                                                                ((LabelValueBean) TransportType.TYPES.get(tunnel.getType()))
                                                                                .getLabel()));
                throw e;
            }
            actionStatus.add(new WizardActionStatus(WizardActionStatus.COMPLETED_OK,
                            "tunnelWizard.tunnelFinish.status.profileCreated"));
View Full Code Here

Examples of com.adito.tunnels.Tunnel

     *      boolean)
     */
    public void initialise(HttpServletRequest request, Resource resource, boolean editing, MultiSelectSelectionModel policyModel,
                           PropertyList selectedPolicies, User owner, boolean assignOnly) throws Exception {
        super.initialise(request, resource, editing, policyModel, selectedPolicies, owner, assignOnly);
        Tunnel tunnel = (Tunnel) resource;
        sourcePort = String.valueOf(tunnel.getSourcePort());
        destinationHost = tunnel.getDestination().getHost();
        destinationPort = String.valueOf(tunnel.getDestination().getPort());
        tunnelType = tunnel.getType();
        transport = tunnel.getTransport();
        autoStart = tunnel.isAutoStart();
        sourceInterface = tunnel.getSourceInterface();
    }
View Full Code Here

Examples of com.adito.tunnels.Tunnel

     * (non-Javadoc)
     *
     * @see com.adito.policyframework.forms.AbstractResourceForm#applyToResource()
     */
    public void applyToResource() throws Exception {
        Tunnel tunnel = (Tunnel) getResource();
        tunnel.setType(getTunnelType());
        tunnel.setAutoStart(isAutoStart());
        tunnel.setTransport(getTransport());
        tunnel.setSourcePort(Integer.parseInt(getSourcePort()));
        tunnel.setDestination(new HostService(getDestinationHost(), Integer.parseInt(getDestinationPort())));
        tunnel.setSourceInterface(getSourceInterface());
    }
View Full Code Here

Examples of com.adito.tunnels.Tunnel

        if (DefaultAgentManager.getInstance().hasActiveAgent(session)) {
            Set activeTunnels = ((TunnelingService) DefaultAgentManager.getInstance().getService(TunnelingService.class))
                            .getActiveTunnels(session);
            for (Iterator it = tunnels.iterator(); it.hasNext();) {
                Tunnel tunnel = (Tunnel) it.next();
                if (tunnel != null && tunnel.getResourceId() >= 0) {
                    Integer id = new Integer(tunnel.getResourceId());
                    LaunchSession launchSession = activeTunnels.contains(id) ? LaunchSessionFactory.getInstance()
                                    .getFirstLaunchSessionForResource(session, tunnel) : null;
                    TunnelItem ti = new TunnelItem(tunnel, PolicyDatabaseFactory.getInstance().getPoliciesAttachedToResource(
                                    tunnel, user.getRealm()), launchSession);
                    ti.setFavoriteType(getFavoriteType(tunnel.getResourceId()));
                    getModel().addItem(ti);
                }
            }
        } else {
            Iterator i = tunnels.iterator();
            while (i.hasNext()) {
                Tunnel tunnel = (Tunnel) i.next();
                if (tunnel != null) {
                    TunnelItem ti = new TunnelItem(tunnel, PolicyDatabaseFactory.getInstance().getPoliciesAttachedToResource(
                                    tunnel, user.getRealm()), null);
                    ti.setFavoriteType(getFavoriteType(ti.getTunnel().getResourceId()));
                    getModel().addItem(ti);
View Full Code Here

Examples of org.apache.axis2.transport.testkit.util.tcpmon.Tunnel

        this.portAllocator = portAllocator;
        smtpServerSetup = new ServerSetup(portAllocator.allocatePort(), "127.0.0.1", ServerSetup.PROTOCOL_SMTP);
        storeServerSetup = new ServerSetup(portAllocator.allocatePort(), "127.0.0.1", protocol);
        greenMail = new GreenMail(new ServerSetup[] { smtpServerSetup, storeServerSetup });
        greenMail.start();
        smtpTunnel = new Tunnel(new InetSocketAddress("127.0.0.1", smtpServerSetup.getPort()));
        smtpTunnel.start();
        unallocatedAccounts = new LinkedList<Account>();
        ServerUtil.waitForServer(smtpServerSetup.getPort());
        ServerUtil.waitForServer(storeServerSetup.getPort());
    }
View Full Code Here

Examples of org.apache.axis2.transport.testkit.util.tcpmon.Tunnel

    private @Transient Tunnel tunnel;
   
    @Setup @SuppressWarnings("unused")
    private void setUp(HttpTestEnvironment env) throws Exception {
        serviceName = "TestService-" + UUID.randomUUID();
        tunnel = new Tunnel(new InetSocketAddress("127.0.0.1", env.getServerPort()));
        tunnel.start();
    }
View Full Code Here

Examples of org.jgroups.protocols.TUNNEL

    }
   
    private void modifyChannel(JChannel... channels) throws Exception {
        for (JChannel c : channels) {
            ProtocolStack stack = c.getProtocolStack();
            TUNNEL t = (TUNNEL) stack.getBottomProtocol();
            String s = bindAddress + "[" + gr1.getPort() + "],";
            s+=bindAddress+"[" + gr2.getPort() + "]";
            t.setGossipRouterHosts(s);
            t.init();
        }       
    }
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.