/*
 *  ClientRequest.java v0.10 28-JAN-2000
 *  Copyright (c) TKK/TLM/Calypso
 *  Author: Alexey Mednonogov
 */

package codec.client;

import java.io.*;
import java.util.*;

import codec.*;
import codec.adapt.*;
import codec.convert.*;
import codec.debug.*;
import codec.dyntree.*;
import codec.export.*;
import codec.orb.*;
import codec.pco.*;
import codec.server.*;
import codec.client.*;
import codec.visit.*;
import codec.build.*;

/** Class representing Gateway-oriented model of CORBA Request. */
final public class ClientRequest {

    private String pcoName;
    /** Get PCO name through which original call was issued. */
    public String getPcoName() { return pcoName; }

    private String aspName;
    /** Get PDU name associated with original call. */
    public String getAspName() { return aspName; }

    private long callID;
    /** Get "CALL_ID" PDU field associated with original call. */
    public long getCallID() { return callID; }

    private org.omg.CORBA.ServerRequest request;
    /** Get core part of the request. */
    public org.omg.CORBA.ServerRequest getRequest() { return request; }

	private DynObject object;
	/** Get Universal Servant through which request has been initiated. */
	public DynObject getObject() { return object; }

	/* This field is normally set later by Builder after ClientRequest is
     * created and exploited by Visitor after response arrives from Tester. */
	public org.omg.CORBA.NVList nvList;

    /* This field is normally set later by Builder after ClientRequest is
     * created and exploited by Visitor after response arrives from Tester. */
	public org.omg.CORBA.Any result;

	/** Defines whether response to request did arrive from Tester
     *  and was processed by Gateway. After "ClientRequest" is just
     *  created, "isProcessed" is always set to false. */
	public volatile Boolean isProcessed;

    /** Defines whether an exceptional situation happened during invocation
     *  which requires to immediately raise CORBA::UNKNOWN exception. */
	public volatile Boolean isException;

    public ClientRequest(String pcoName_, String aspName_, long callID_,
        org.omg.CORBA.ServerRequest request_, DynObject object_) {

        pcoName = pcoName_;
        aspName = aspName_;
        callID = callID_;
        request = request_;
        object = object_;
        isProcessed = new Boolean(false);
        isException = new Boolean(false);
        nvList = null;
    }
}
