Package com.maverick.util

Examples of com.maverick.util.ByteArrayWriter.writeInt()


  }

  public void launchResource(int resourceId) { 
    try {
      ByteArrayWriter baw = new ByteArrayWriter();
      baw.writeInt(resourceId);
      Request request = new Request(SETUP_AND_LAUNCH_WEB_FORWARD, baw.toByteArray());
      if (agent.getConnection().sendRequest(request, true) && request.getRequestData()!=null) {
        ByteArrayReader bar = new ByteArrayReader(request.getRequestData());
        String uri = bar.readString();
        agent.getGUI().openBrowser(uri);
View Full Code Here


  }

  public void launchResource(int resourceId) { 
    try {
      ByteArrayWriter baw = new ByteArrayWriter();
      baw.writeInt(resourceId);
      Request request = new Request(SETUP_AND_LAUNCH_NETWORK_PLACE, baw.toByteArray());
      if (agent.getConnection().sendRequest(request, true) && request.getRequestData()!=null) {
        ByteArrayReader bar = new ByteArrayReader(request.getRequestData());
        String uri = bar.readString();
        agent.getGUI().openBrowser(uri);
View Full Code Here

      try {
        Hashtable l = getActiveLocalTunnels();

        ByteArrayWriter msg = new ByteArrayWriter();
        msg.writeInt(l.size());
        for (Enumeration e = l.keys(); e.hasMoreElements();) {
          msg.writeInt(((Integer) e.nextElement()).intValue());
        }

        request.setRequestData(msg.toByteArray());
View Full Code Here

        Hashtable l = getActiveLocalTunnels();

        ByteArrayWriter msg = new ByteArrayWriter();
        msg.writeInt(l.size());
        for (Enumeration e = l.keys(); e.hasMoreElements();) {
          msg.writeInt(((Integer) e.nextElement()).intValue());
        }

        request.setRequestData(msg.toByteArray());
        return true;
      } catch (IOException e) {
View Full Code Here

  }
 
  public byte[] create() throws IOException {
    ByteArrayWriter msg = new ByteArrayWriter();
    msg.writeString(hostname);
    msg.writeInt(port);
    msg.writeString(launchId);
    return msg.toByteArray();
  }

  public byte[] open(byte[] data) throws IOException {
View Full Code Here

  }

  public void getResources(int resourceType, String menu) {
    try {
      ByteArrayWriter baw = new ByteArrayWriter();
      baw.writeInt(resourceType);
      Request request = new Request("getResources", baw.toByteArray());
      if (agent.getConnection().sendRequest(request, true)) {
        if(request.getRequestData()!=null) {
          ByteArrayReader reader = new ByteArrayReader(request.getRequestData());
          int count = (int) reader.readInt();
View Full Code Here

   * @see com.adito.agent.client.AbstractResourceManager#launchResource(int)
   */
  public void launchResource(int resourceId) {
    try {
      ByteArrayWriter baw = new ByteArrayWriter();
      baw.writeInt(resourceId);
      Request request = new Request(SETUP_AND_LAUNCH_TUNNEL, baw.toByteArray());
      if (agent.getConnection().sendRequest(request, true)) {
        // #ifdef DEBUG
        log.debug("Tunnel launch setup");
        // #endif
View Full Code Here

   * @param id
   */
  public void closeLocalTunnel(int id) {
    try {
      ByteArrayWriter baw = new ByteArrayWriter();
      baw.writeInt(id);
      Request request = new Request(CLOSE_LOCAL_TUNNEL, baw.toByteArray());
      agent.getConnection().sendRequest(request, false);
    } catch (IOException e) {
      // #ifdef DEBUG
      log.error("Failed to setup and launch tunnel launch", e);
View Full Code Here

  }

  public void launchResource(int resourceId) {
    try {
      ByteArrayWriter baw = new ByteArrayWriter();
      baw.writeInt(resourceId);
      Request request = new Request("setupAndLaunchApplication", baw.toByteArray());
      if (agent.getConnection().sendRequest(request, true)) {
        // #ifdef DEBUG
        log.debug("Application launch setup");
        // #endif
View Full Code Here

    ByteArrayWriter baw = new ByteArrayWriter();
    for(Enumeration e = tunnels.elements(); e.hasMoreElements(); ) {
            TunnelConfiguration listeningSocketConfiguration = (TunnelConfiguration) e.nextElement();
            baw.writeString(listeningSocketConfiguration.getName());
            baw.writeString(listeningSocketConfiguration.getSourceInterface());
            baw.writeInt(listeningSocketConfiguration.getSourcePort());     
    }
    request.setRequestData(baw.toByteArray());
   
    return true;
  }
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.