package org.omg.SecurityReplaceable;

/** 
 * Helper class for : ClientSecurityContext
 *  
 * @author OpenORB Compiler
 */ 
public class ClientSecurityContextHelper
{
    /**
     * Insert ClientSecurityContext into an any
     * @param a an any
     * @param t ClientSecurityContext value
     */
    public static void insert(org.omg.CORBA.Any a, org.omg.SecurityReplaceable.ClientSecurityContext t)
    {
        a.insert_Object(t , type());
    }

    /**
     * Extract ClientSecurityContext from an any
     * @param a an any
     * @return the extracted ClientSecurityContext value
     */
    public static org.omg.SecurityReplaceable.ClientSecurityContext extract(org.omg.CORBA.Any a)
    {
        if (!a.type().equal(type()))
            throw new org.omg.CORBA.MARSHAL();
        try {
            return org.omg.SecurityReplaceable.ClientSecurityContextHelper.narrow(a.extract_Object());
        } catch (final org.omg.CORBA.BAD_PARAM e) {
            throw new org.omg.CORBA.MARSHAL(e.getMessage());
        }
    }

    //
    // Internal TypeCode value
    //
    private static org.omg.CORBA.TypeCode _tc = null;

    /**
     * Return the ClientSecurityContext TypeCode
     * @return a TypeCode
     */
    public static org.omg.CORBA.TypeCode type()
    {
        if (_tc == null) {
            org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
            _tc = orb.create_interface_tc(id(),"ClientSecurityContext");
        }
        return _tc;
    }

    /**
     * Return the ClientSecurityContext IDL ID
     * @return an ID
     */
    public static String id()
    {
        return _id;
    }

    private final static String _id = "IDL:omg.org/SecurityReplaceable/ClientSecurityContext:1.8";

    /**
     * Read ClientSecurityContext from a marshalled stream
     * @param istream the input stream
     * @return the readed ClientSecurityContext value
     */
    public static org.omg.SecurityReplaceable.ClientSecurityContext read(org.omg.CORBA.portable.InputStream istream)
    {
        throw new org.omg.CORBA.MARSHAL();
    }

    /**
     * Write ClientSecurityContext into a marshalled stream
     * @param ostream the output stream
     * @param value ClientSecurityContext value
     */
    public static void write(org.omg.CORBA.portable.OutputStream ostream, org.omg.SecurityReplaceable.ClientSecurityContext value)
    {
        throw new org.omg.CORBA.MARSHAL();
    }

    /**
     * Narrow CORBA::Object to ClientSecurityContext
     * @param obj the CORBA Object
     * @return ClientSecurityContext Object
     */
    public static ClientSecurityContext narrow(org.omg.CORBA.Object obj)
    {
        if (obj == null)
            return null;
        if (obj instanceof ClientSecurityContext)
            return (ClientSecurityContext)obj;

        throw new org.omg.CORBA.BAD_PARAM();
    }

    /**
     * Unchecked Narrow CORBA::Object to ClientSecurityContext
     * @param obj the CORBA Object
     * @return ClientSecurityContext Object
     */
    public static ClientSecurityContext unchecked_narrow(org.omg.CORBA.Object obj)
    {
        if (obj == null)
            return null;
        if (obj instanceof ClientSecurityContext)
            return (ClientSecurityContext)obj;

        throw new org.omg.CORBA.BAD_PARAM();
    }

}
