Package com.adito.agent

Examples of com.adito.agent.AgentTunnel$PropertyRequest


    public void initializeTunnel(AgentTunnel tunnel) {
    tunnel.registerRequestHandler(SETUP_AND_LAUNCH_WEB_FORWARD, this);
  }

  public boolean processRequest(Request request, MultiplexedConnection connection) {
    AgentTunnel agent = (AgentTunnel) connection;
    if (request.getRequestName().equals(SETUP_AND_LAUNCH_WEB_FORWARD) && request.getRequestData()!=null) {
      try {
        ByteArrayReader reader = new ByteArrayReader(request.getRequestData());
        int id = (int)reader.readInt();
        WebForward resource = (WebForward)WebForwardPlugin.WEBFORWARD_RESOURCE_TYPE.getResourceById(id);
        if (resource == null) {
          throw new Exception("No resource with ID " + id);
        }
        Policy policy = LaunchSessionManager.getLaunchRequestPolicy(null, agent.getSession(), resource);
        if (resource.sessionPasswordRequired(agent.getSession())) {
          // TODO: prompt user for credentials through agent!
          return true;
        } else {
          LaunchSession launchSession = LaunchSessionFactory.getInstance().createLaunchSession(agent.getSession(),
            resource,
            policy);
          launchSession.checkAccessRights(null, agent.getSession());
                    String uri = resource.getLaunchUri(launchSession);
                    ByteArrayWriter baw = new ByteArrayWriter();
                    baw.writeString(uri);
                    request.setRequestData(baw.toByteArray());
                  return true;
View Full Code Here


          StringBuffer tunnels = new StringBuffer();
         
          if (DefaultAgentManager.getInstance().hasActiveAgent(session)) {
          try {
            Request agentRequest = ((ApplicationService) DefaultAgentManager.getInstance().getService(ApplicationService.class)).launchApplication(launchSession);
            AgentTunnel agent = DefaultAgentManager.getInstance().getAgentBySession(launchSession.getSession());
            if (!agent.sendRequest(agentRequest, true, 60000)) {
              throw new ExtensionException(ExtensionException.AGENT_REFUSED_LAUNCH);
            }
            ByteArrayReader baw = new ByteArrayReader(agentRequest.getRequestData());
            try {
              while(true) {
View Full Code Here

    // SessionInfo session =
    // LogonControllerFactory.getInstance().getSessionInfo(request);
    if (DefaultAgentManager.getInstance().hasActiveAgent(launchSession.getSession())) {
      try {
        Request agentRequest = ((ApplicationService) DefaultAgentManager.getInstance().getService(ApplicationService.class)).launchApplication(launchSession);
        AgentTunnel agent = DefaultAgentManager.getInstance().getAgentBySession(launchSession.getSession());
        if (!agent.sendRequest(agentRequest, true, 60000)) {
          throw new ExtensionException(ExtensionException.AGENT_REFUSED_LAUNCH);
        }
      } catch (ExtensionException ee) {
        throw ee;
      } catch (Exception e) {
View Full Code Here

    SessionInfo session = launchSession.getSession();
    if (DefaultAgentManager.getInstance().hasActiveAgent(session)) {
      try {
        Request agentRequest = ((ApplicationService) DefaultAgentManager.getInstance().getService(ApplicationService.class)).launchApplication(launchSession);
        AgentTunnel agent = DefaultAgentManager.getInstance().getAgentBySession(launchSession.getSession());
        if (!agent.sendRequest(agentRequest, true, 60000)) {
          throw new ExtensionException(ExtensionException.AGENT_REFUSED_LAUNCH);
        }
      } catch (ExtensionException ee) {
        throw ee;
      } catch (Exception e) {
View Full Code Here

    public void initializeTunnel(AgentTunnel tunnel) {
    tunnel.registerRequestHandler(SETUP_AND_LAUNCH_NETWORK_PLACE, this);
  }

  public boolean processRequest(Request request, MultiplexedConnection connection) {
    AgentTunnel agent = (AgentTunnel) connection;
    if (request.getRequestName().equals(SETUP_AND_LAUNCH_NETWORK_PLACE) && request.getRequestData()!=null) {
      try {
        ByteArrayReader reader = new ByteArrayReader(request.getRequestData());
        int id = (int)reader.readInt();
        NetworkPlace resource = (NetworkPlace)NetworkPlacePlugin.NETWORK_PLACE_RESOURCE_TYPE.getResourceById(id);
        if (resource == null) {
          throw new Exception("No resource with ID " + id);
        }
        Policy policy = LaunchSessionManager.getLaunchRequestPolicy(null, agent.getSession(), resource);
        if (resource.sessionPasswordRequired(agent.getSession())) {
          // TODO: prompt user for credentials through agent!
          return true;
        } else {
          LaunchSession launchSession = LaunchSessionFactory.getInstance().createLaunchSession(agent.getSession(),
            resource,
            policy);
          launchSession.checkAccessRights(null, agent.getSession());
                    String uri = resource.getLaunchUri(launchSession);
                    ByteArrayWriter baw = new ByteArrayWriter();
                    baw.writeString(uri);
                    request.setRequestData(baw.toByteArray());
                  return true;
View Full Code Here

        if (!DefaultAgentManager.getInstance().hasActiveAgent(launchSession.getSession())) {
            throw new TunnelException(TunnelException.INTERNAL_ERROR, (Throwable)null, "No agent.");
        } else {
            Tunnel tunnel = (Tunnel) launchSession.getResource();
            launchSession.checkAccessRights(null, agent.getSession());
            AgentTunnel agent = DefaultAgentManager.getInstance().getAgentBySession(launchSession.getSession());

            try {
                if (tunnel.getType() == TransportType.LOCAL_TUNNEL_ID) {
                    startLocalTunnel(agent, tunnel, launchSession);
                } else if (tunnel.getType() == TransportType.REMOTE_TUNNEL_ID) {
View Full Code Here

  public void initializeTunnel(AgentTunnel tunnel) {
    tunnel.registerRequestHandler(SETUP_AND_LAUNCH_TUNNEL, this);
  }

  public boolean processRequest(Request request, MultiplexedConnection connection) {
    AgentTunnel agent = (AgentTunnel) connection;
    if (request.getRequestName().equals(SETUP_AND_LAUNCH_TUNNEL) && request.getRequestData()!=null) {
      try {
        ByteArrayReader reader = new ByteArrayReader(request.getRequestData());
        int id = (int)reader.readInt();
        Tunnel resource = (Tunnel)TunnelPlugin.SSL_TUNNEL_RESOURCE_TYPE.getResourceById(id);
        if (resource == null) {
          throw new Exception("No resource with ID " + id);
        }
        Policy policy = LaunchSessionManager.getLaunchRequestPolicy(null, agent.getSession(), resource);
        if (resource.sessionPasswordRequired(agent.getSession())) {
          // TODO: prompt user for credentials through agent!
          return true;
        } else {
          LaunchSession launchSession = LaunchSessionFactory.getInstance().createLaunchSession(agent.getSession(),
            resource,
            policy);
          launchSession.checkAccessRights(null, agent.getSession());
                  if (resource.getType() == TransportType.LOCAL_TUNNEL_ID) {
                      try {
                          Request req = buildLocalTunnel(resource, launchSession);
                          request.setRequestData(req.getRequestData());
                        return true;
View Full Code Here

        DefaultAgentManager agentManager = DefaultAgentManager.getInstance();
        if (agentManager.hasActiveAgent(info) && info.getUser().getPrincipalName().equals(recipient.getRecipientAlias())) {
            try {
                Request request = new Request("agentMessage", msg.toByteArray());
                AgentTunnel tunnel = agentManager.getAgentBySession(info);
                if (tunnel != null) {
                    tunnel.sendRequest(request, false, 0);
                    return true;
                }
            } catch (IOException e) {
                LOG.error("Failed to send message to agent. Did it disconnect before we could send it?", e);
            }
View Full Code Here

  /* (non-Javadoc)
   * @see com.maverick.multiplex.RequestHandler#processRequest(com.maverick.multiplex.Request, com.maverick.multiplex.MultiplexedConnection)
   */
  public boolean processRequest(Request request, MultiplexedConnection connection) {

    AgentTunnel agent = (AgentTunnel) connection;

    if (request.getRequestName().equals("setupAndLaunchApplication") && request.getRequestData()!=null) {

      try {
        ByteArrayReader reader = new ByteArrayReader(request.getRequestData());
        int id = (int)reader.readInt();
        Resource resource = ApplicationsPlugin.APPLICATION_SHORTCUT_RESOURCE_TYPE.getResourceById(id);
        if (resource == null) {
          throw new Exception("No resource with ID " + id);
        }
        Policy policy = LaunchSessionManager.getLaunchRequestPolicy(null, agent.getSession(), resource);
        if (resource.sessionPasswordRequired(agent.getSession())) {
          // TODO: prompt user for credentials through agent!
          return true;
        } else {
          LaunchSession launchSession = LaunchSessionFactory.getInstance().createLaunchSession(agent.getSession(),
            resource,
            policy);
          launchSession.checkAccessRights(null, agent.getSession());

          ApplicationShortcut shortcut = (ApplicationShortcut) launchSession.getResource();
          ExtensionDescriptor descriptor = ExtensionStore.getInstance().getExtensionDescriptor(shortcut.getApplication());

          Request newRequest = launchApplication(launchSession);
View Full Code Here

TOP

Related Classes of com.adito.agent.AgentTunnel$PropertyRequest

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.