Package com.maverick.util

Examples of com.maverick.util.ByteArrayReader.readInt()


                    new IvParameterSpec(iv, 0, cipher.getBlockSize()));

                ByteArrayReader data = new ByteArrayReader(cipher.doFinal(
                            keyblob));

                if (data.readInt() == cookie) {
                    keyblob = data.readBinaryString();
                } else {
                    throw new InvalidKeyException(
                        "The host key is invalid, check the passphrase supplied");
                }
View Full Code Here


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

  }

  public byte[] open(byte[] data) throws IOException, ChannelOpenException {
    ByteArrayReader msg = new ByteArrayReader(data);
    this.hostname = msg.readString();
    this.port = (int) msg.readInt();
        this.socket = MultiplexedSocketFactory.getDefault().createSocket(hostname, port);
    return null;
  }
}
View Full Code Here

   * @see com.maverick.multiplex.MultiplexChannel#open(int, byte[])
   */
  public byte[] open(byte[] data) throws IOException {
    ByteArrayReader reader = new ByteArrayReader(data);
    hostname = reader.readString();
    port = (int)reader.readInt();

    socket = new Socket(hostname, port);

    return null;
  }
View Full Code Here

            Request request = new Request(ACTIVE_LOCAL_TUNNELS);
            if (tunnel.sendRequest(request, true) && request.getRequestData()!=null) {

                ByteArrayReader reader = new ByteArrayReader(request.getRequestData());
                int count = (int) reader.readInt();
                for (int i = 0; i < count; i++) {
                    activeTunnelIds.add(new Integer((int) reader.readInt()));
                }
            }
View Full Code Here

            if (tunnel.sendRequest(request, true) && request.getRequestData()!=null) {

                ByteArrayReader reader = new ByteArrayReader(request.getRequestData());
                int count = (int) reader.readInt();
                for (int i = 0; i < count; i++) {
                    activeTunnelIds.add(new Integer((int) reader.readInt()));
                }
            }

            // The server keeps track of 'remote' tunnels
            Collection<RemoteTunnel> activeRemoteTunnels = RemoteTunnelManagerFactory.getInstance().getRemoteTunnels(session);
View Full Code Here

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

      msg.writeString(launchSession.getId());
      Request request = new Request("openURL", msg.toByteArray());
      if (agent.sendRequest(request, true)) {
        if(request.getRequestData()!=null) {
        ByteArrayReader rdr = new ByteArrayReader(request.getRequestData());
        return (int) rdr.readInt();
        }
      }

    } catch (Exception e) {
      throw new CoreException(0, "", e);
View Full Code Here

    if (request.getRequestName().equals(GET_RESOURCES)) {
      try {
        if(request.getRequestData()!=null) {
            // Read the resource type requested.
          ByteArrayReader bar = new ByteArrayReader(request.getRequestData());
          int resourceTypeId = (int)bar.readInt();
          ResourceType<?> resourceType = PolicyDatabaseFactory.getInstance().getResourceType(resourceTypeId);
          if(resourceType == null) {
            throw new Exception("Request for list of resources of an unknown type (" + resourceTypeId + ")");
          }   
         
View Full Code Here

    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);
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.