Examples of HostService


Examples of com.adito.boot.HostService

    cookie2.setPath("/");
    // We now set the domain on the cookie so the new Active DNS feature for
    // Reverse Proxy works correctly
    String host = request.getHeader("Host");
    if (host != null) {
      HostService hostService = new HostService(host);
      cookie2.setDomain(hostService.getHost());
    }
    cookie.setSecure(true);
    response.addCookie(cookie2);
    return info;
  }
View Full Code Here

Examples of com.adito.boot.HostService

        PropertyList validExternalHosts = Property.getPropertyList(new SystemConfigKey("webServer.validExternalHostnames"));
        ;
        if (validExternalHosts.size() != 0) {
            Iterator<String> it = validExternalHosts.iterator();
            String host = request.getHeader("Host");
            HostService hostService = host == null ? null : new HostService(host);
            boolean hostOk = false;
            String firstHost = (String) it.next();
            if (hostService != null && !hostService.getHost().equals("")) {
                if (hostService.getHost().startsWith("activeproxy")) {
                    int idx = hostService.getHost().indexOf(".");
                    hostService.setHost(hostService.getHost().substring(idx + 1));
                }
                String thisHost = firstHost;
                do {
                    if (hostService.getHost().equals(thisHost)) {
                        hostOk = true;
                    } else {
                        if (it.hasNext()) {
                            thisHost = it.next();
                        }
View Full Code Here

Examples of com.adito.boot.HostService

        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)
View Full Code Here

Examples of com.adito.boot.HostService

    }

    @Override
    public Tunnel getEmptyResource() throws Exception {
        Calendar calendar = Calendar.getInstance();
        return new DefaultTunnel(-1, "", "a ", -1, 0, false, "", "", 8080, new HostService(""), null, calendar, calendar);
    }
View Full Code Here

Examples of com.adito.boot.HostService

    }

    @Override
    public Tunnel getNormalResource() throws Exception {
        Calendar calendar = Calendar.getInstance();
        return new DefaultTunnel(getDefaultRealm().getRealmID(), "tunnel", "a tunnel", -1, 0, false, "TCP", "username", 8080, new HostService("localhost"), null, calendar, calendar);
    }
View Full Code Here

Examples of com.adito.boot.HostService

    }

    @Override
    public Tunnel getNullResource() throws Exception {
        Calendar calendar = Calendar.getInstance();
        return new DefaultTunnel(-1, null, null, -1, 0, false, null, null, 8080, new HostService(""), null, calendar, calendar);
    }
View Full Code Here

Examples of com.adito.boot.HostService

    }
   
    @Test
    public void createUncommonTunnel() throws Exception {
        DefaultTunnel tunnel = new DefaultTunnel(-1, "�2�$-_=+$%%^", "�2�-_=+2�$", -1, 0, false,
            "�2�$-_=+$%%^w", "�2�$%$%%^grre-_=+", 8080, new HostService("localhost"), null, Calendar.getInstance(), Calendar.getInstance());
        assertEquals("There should not be any Tunnel", 0, getTunnelService().getTunnels().size());
        Tunnel createdTunnel = createResource(tunnel);
        assertEquals("There should not be any Tunnel", 1, getTunnelService().getTunnels().size());
        deleteResource(createdTunnel);
    }
View Full Code Here

Examples of com.adito.boot.HostService

        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.boot.HostService

        Timestamp ad = rs.getTimestamp("date_amended");
        Calendar a = Calendar.getInstance();
        a.setTimeInMillis(ad == null ? System.currentTimeMillis() : ad.getTime());
        return new DefaultTunnel(rs.getInt("realm_id"), rs.getString("name"), rs.getString("description"), rs.getInt("tunnel_id"), rs.getInt("type"), rs
                        .getBoolean("auto_start"), rs.getString("transport"), rs.getString("username"), rs.getInt("source_port"),
                        new HostService(rs.getString("destination_host"), rs.getInt("destination_port")), rs
                                        .getString("source_interface"), c, a);
    }
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.