org.omg.CORBA.Principal Java Examples

The following examples show how to use org.omg.CORBA.Principal. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RequestMessage_1_1.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
RequestMessage_1_1(ORB orb, ServiceContexts _service_contexts,
        int _request_id, boolean _response_expected, byte[] _reserved,
        byte[] _object_key, String _operation,
        Principal _requesting_principal) {
    super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN,
        Message.GIOPRequest, 0);
    this.orb = orb;
    this.wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    service_contexts = _service_contexts;
    request_id = _request_id;
    response_expected = _response_expected;
    reserved = _reserved;
    object_key = _object_key;
    operation = _operation;
    requesting_principal = _requesting_principal;
}
 
Example #2
Source File: RequestMessage_1_1.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
RequestMessage_1_1(ORB orb, ServiceContexts _service_contexts,
        int _request_id, boolean _response_expected, byte[] _reserved,
        byte[] _object_key, String _operation,
        Principal _requesting_principal) {
    super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN,
        Message.GIOPRequest, 0);
    this.orb = orb;
    this.wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    service_contexts = _service_contexts;
    request_id = _request_id;
    response_expected = _response_expected;
    reserved = _reserved;
    object_key = _object_key;
    operation = _operation;
    requesting_principal = _requesting_principal;
}
 
Example #3
Source File: RequestMessage_1_1.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
RequestMessage_1_1(ORB orb, ServiceContexts _service_contexts,
        int _request_id, boolean _response_expected, byte[] _reserved,
        byte[] _object_key, String _operation,
        Principal _requesting_principal) {
    super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN,
        Message.GIOPRequest, 0);
    this.orb = orb;
    this.wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    service_contexts = _service_contexts;
    request_id = _request_id;
    response_expected = _response_expected;
    reserved = _reserved;
    object_key = _object_key;
    operation = _operation;
    requesting_principal = _requesting_principal;
}
 
Example #4
Source File: RequestMessage_1_1.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
RequestMessage_1_1(ORB orb, ServiceContexts _service_contexts,
        int _request_id, boolean _response_expected, byte[] _reserved,
        byte[] _object_key, String _operation,
        Principal _requesting_principal) {
    super(Message.GIOPBigMagic, GIOPVersion.V1_1, FLAG_NO_FRAG_BIG_ENDIAN,
        Message.GIOPRequest, 0);
    this.orb = orb;
    this.wrapper = ORBUtilSystemException.get( orb,
        CORBALogDomains.RPC_PROTOCOL ) ;
    service_contexts = _service_contexts;
    request_id = _request_id;
    response_expected = _response_expected;
    reserved = _reserved;
    object_key = _object_key;
    operation = _operation;
    requesting_principal = _requesting_principal;
}
 
Example #5
Source File: RequestMessage_1_0.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
RequestMessage_1_0(ORB orb, ServiceContexts _service_contexts,
        int _request_id, boolean _response_expected, byte[] _object_key,
        String _operation, Principal _requesting_principal) {
    super(Message.GIOPBigMagic, false, Message.GIOPRequest, 0);
    this.orb = orb;
    service_contexts = _service_contexts;
    request_id = _request_id;
    response_expected = _response_expected;
    object_key = _object_key;
    operation = _operation;
    requesting_principal = _requesting_principal;
}
 
Example #6
Source File: AnyImpl.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
/**
 * @deprecated
 */
@Deprecated
public void insert_Principal(Principal p)
{
    typeCode = orb.get_primitive_tc(TCKind._tk_Principal);
    object = p;
    isInitialized = true;
}
 
Example #7
Source File: AnyImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @deprecated
 */
@Deprecated
public Principal extract_Principal()
{
    checkExtractBadOperation( TCKind._tk_Principal ) ;
    return (Principal)object;
}
 
Example #8
Source File: RequestMessage_1_0.java    From JDKSourceCode1.8 with MIT License 5 votes vote down vote up
RequestMessage_1_0(ORB orb, ServiceContexts _service_contexts,
        int _request_id, boolean _response_expected, byte[] _object_key,
        String _operation, Principal _requesting_principal) {
    super(Message.GIOPBigMagic, false, Message.GIOPRequest, 0);
    this.orb = orb;
    service_contexts = _service_contexts;
    request_id = _request_id;
    response_expected = _response_expected;
    object_key = _object_key;
    operation = _operation;
    requesting_principal = _requesting_principal;
}
 
Example #9
Source File: CDRInputStream_1_0.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Principal read_Principal() {
    int len = read_long();
    byte[] pvalue = new byte[len];
    read_octet_array(pvalue,0,len);

    Principal p = new PrincipalImpl();
    p.name(pvalue);
    return p;
}
 
Example #10
Source File: AnyImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @deprecated
 */
@Deprecated
public void insert_Principal(Principal p)
{
    typeCode = orb.get_primitive_tc(TCKind._tk_Principal);
    object = p;
    isInitialized = true;
}
 
Example #11
Source File: IDLJavaSerializationInputStream.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Principal read_Principal() {
    // We don't need an implementation for this method, since principal
    // is absent in GIOP version 1.2 or above.
    int len = read_long();
    byte[] pvalue = new byte[len];
    read_octet_array(pvalue,0,len);
    Principal p = new com.sun.corba.se.impl.corba.PrincipalImpl();
    p.name(pvalue);
    return p;
}
 
Example #12
Source File: AnyImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @deprecated
 */
@Deprecated
public void insert_Principal(Principal p)
{
    typeCode = orb.get_primitive_tc(TCKind._tk_Principal);
    object = p;
    isInitialized = true;
}
 
Example #13
Source File: IDLJavaSerializationInputStream.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Principal read_Principal() {
    // We don't need an implementation for this method, since principal
    // is absent in GIOP version 1.2 or above.
    int len = read_long();
    byte[] pvalue = new byte[len];
    read_octet_array(pvalue,0,len);
    Principal p = new com.sun.corba.se.impl.corba.PrincipalImpl();
    p.name(pvalue);
    return p;
}
 
Example #14
Source File: AnyImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @deprecated
 */
@Deprecated
public void insert_Principal(Principal p)
{
    typeCode = orb.get_primitive_tc(TCKind._tk_Principal);
    object = p;
    isInitialized = true;
}
 
Example #15
Source File: CDRInputStream_1_0.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Principal read_Principal() {
    int len = read_long();
    byte[] pvalue = new byte[len];
    read_octet_array(pvalue,0,len);

    Principal p = new PrincipalImpl();
    p.name(pvalue);
    return p;
}
 
Example #16
Source File: RequestMessage_1_0.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
RequestMessage_1_0(ORB orb, ServiceContexts _service_contexts,
        int _request_id, boolean _response_expected, byte[] _object_key,
        String _operation, Principal _requesting_principal) {
    super(Message.GIOPBigMagic, false, Message.GIOPRequest, 0);
    this.orb = orb;
    service_contexts = _service_contexts;
    request_id = _request_id;
    response_expected = _response_expected;
    object_key = _object_key;
    operation = _operation;
    requesting_principal = _requesting_principal;
}
 
Example #17
Source File: CDROutputStream_1_0.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public void write_Principal(Principal p)
{
    write_long(p.name().length);
    write_octet_array(p.name(), 0, p.name().length);
}
 
Example #18
Source File: RequestMessage_1_2.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Principal getPrincipal() {
    // REVISIT Should we throw an exception or return null ?
    return null;
}
 
Example #19
Source File: MessageBase.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public static RequestMessage createRequest(
        ORB orb, GIOPVersion gv, byte encodingVersion, int request_id,
        boolean response_expected, IOR ior,
        short addrDisp, String operation,
        ServiceContexts service_contexts, Principal requesting_principal) {

    RequestMessage requestMessage = null;
    IIOPProfile profile = ior.getProfile();

    if (addrDisp == KeyAddr.value) {
        // object key will be used for target addressing
        profile = ior.getProfile();
        ObjectKey objKey = profile.getObjectKey();
        byte[] object_key = objKey.getBytes(orb);
        requestMessage =
               createRequest(orb, gv, encodingVersion, request_id,
                             response_expected, object_key,
                             operation, service_contexts,
                             requesting_principal);
    } else {

        if (!(gv.equals(GIOPVersion.V1_2))) {
            // only object_key based target addressing is allowed for
            // GIOP 1.0 & 1.1
            throw wrapper.giopVersionError(
                CompletionStatus.COMPLETED_MAYBE);
        }

        // Note: Currently we use response_expected flag to decide if the
        // call is oneway or not. Ideally, it is possible to expect a
        // response on a oneway call too, but we do not support it now.
        byte response_flags = 0x03;
        if (response_expected) {
            response_flags = 0x03;
        } else {
            response_flags = 0x00;
        }

        TargetAddress target = new TargetAddress();
        if (addrDisp == ProfileAddr.value) { // iop profile will be used
            profile = ior.getProfile();
            target.profile(profile.getIOPProfile());
        } else if (addrDisp == ReferenceAddr.value) {  // ior will be used
            IORAddressingInfo iorInfo =
                new IORAddressingInfo( 0, // profile index
                    ior.getIOPIOR());
            target.ior(iorInfo);
        } else {
            // invalid target addressing disposition value
            throw wrapper.illegalTargetAddressDisposition(
                CompletionStatus.COMPLETED_NO);
        }

        requestMessage =
               new RequestMessage_1_2(orb, request_id, response_flags,
                              new byte[] { 0x00, 0x00, 0x00 }, target,
                              operation, service_contexts);
        requestMessage.setEncodingVersion(encodingVersion);
    }

    if (gv.supportsIORIIOPProfileComponents()) {
        // add request partitioning thread pool to use info
        int poolToUse = 0; // default pool
        IIOPProfileTemplate temp =
            (IIOPProfileTemplate)profile.getTaggedProfileTemplate();
        Iterator iter =
            temp.iteratorById(ORBConstants.TAG_REQUEST_PARTITIONING_ID);
        if (iter.hasNext()) {
            poolToUse =
                ((RequestPartitioningComponent)iter.next()).getRequestPartitioningId();
        }

        if (poolToUse < ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID ||
            poolToUse > ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID) {
            throw wrapper.invalidRequestPartitioningId(new Integer(poolToUse),
                  new Integer(ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID),
                  new Integer(ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID));
        }
        requestMessage.setThreadPoolToUse(poolToUse);
    }

    return requestMessage;
}
 
Example #20
Source File: RequestMessage_1_2.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public Principal getPrincipal() {
    // REVISIT Should we throw an exception or return null ?
    return null;
}
 
Example #21
Source File: IDLJavaSerializationOutputStream.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public final void write_Principal(Principal p) {
    // We don't need an implementation for this method, since principal
    // is absent in GIOP version 1.2 or above.
    write_long(p.name().length);
    write_octet_array(p.name(), 0, p.name().length);
}
 
Example #22
Source File: CDROutputStream.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public final void write_Principal(Principal value) {
    impl.write_Principal(value);
}
 
Example #23
Source File: RequestMessage_1_2.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
public Principal getPrincipal() {
    // REVISIT Should we throw an exception or return null ?
    return null;
}
 
Example #24
Source File: CustomOutputStream.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void write_Principal(Principal value) {
}
 
Example #25
Source File: CDRInputStream.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public final Principal read_Principal() {
    return impl.read_Principal();
}
 
Example #26
Source File: CDROutputStream_1_0.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public void write_Principal(Principal p)
{
    write_long(p.name().length);
    write_octet_array(p.name(), 0, p.name().length);
}
 
Example #27
Source File: MessageBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private static RequestMessage createRequest(
        ORB orb, GIOPVersion gv, byte encodingVersion, int request_id,
        boolean response_expected, byte[] object_key, String operation,
        ServiceContexts service_contexts, Principal requesting_principal) {

    if (gv.equals(GIOPVersion.V1_0)) { // 1.0
        return new RequestMessage_1_0(orb, service_contexts, request_id,
                                     response_expected, object_key,
                                     operation, requesting_principal);
    } else if (gv.equals(GIOPVersion.V1_1)) { // 1.1
        return new RequestMessage_1_1(orb, service_contexts, request_id,
            response_expected, new byte[] { 0x00, 0x00, 0x00 },
            object_key, operation, requesting_principal);
    } else if (gv.equals(GIOPVersion.V1_2)) { // 1.2
        // Note: Currently we use response_expected flag to decide if the
        // call is oneway or not. Ideally, it is possible to expect a
        // response on a oneway call too, but we do not support it now.
        byte response_flags = 0x03;
        if (response_expected) {
            response_flags = 0x03;
        } else {
            response_flags = 0x00;
        }
        /*
        // REVISIT The following is the correct way to do it. This gives
        // more flexibility.
        if ((DII::INV_NO_RESPONSE == false) && response_expected) {
            response_flags = 0x03; // regular two-way
        } else if ((DII::INV_NO_RESPONSE == false) && !response_expected) {
            // this condition is not possible
        } else if ((DII::INV_NO_RESPONSE == true) && response_expected) {
            // oneway, but we need response for LocationForwards or
            // SystemExceptions.
            response_flags = 0x01;
        } else if ((DII::INV_NO_RESPONSE == true) && !response_expected) {
            // oneway, no response required
            response_flags = 0x00;
        }
        */
        TargetAddress target = new TargetAddress();
        target.object_key(object_key);
        RequestMessage msg =
            new RequestMessage_1_2(orb, request_id, response_flags,
                                   new byte[] { 0x00, 0x00, 0x00 },
                                   target, operation, service_contexts);
        msg.setEncodingVersion(encodingVersion);
        return msg;
    } else {
        throw wrapper.giopVersionError(
            CompletionStatus.COMPLETED_MAYBE);
    }
}
 
Example #28
Source File: MessageBase.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public static RequestMessage createRequest(
        ORB orb, GIOPVersion gv, byte encodingVersion, int request_id,
        boolean response_expected, IOR ior,
        short addrDisp, String operation,
        ServiceContexts service_contexts, Principal requesting_principal) {

    RequestMessage requestMessage = null;
    IIOPProfile profile = ior.getProfile();

    if (addrDisp == KeyAddr.value) {
        // object key will be used for target addressing
        profile = ior.getProfile();
        ObjectKey objKey = profile.getObjectKey();
        byte[] object_key = objKey.getBytes(orb);
        requestMessage =
               createRequest(orb, gv, encodingVersion, request_id,
                             response_expected, object_key,
                             operation, service_contexts,
                             requesting_principal);
    } else {

        if (!(gv.equals(GIOPVersion.V1_2))) {
            // only object_key based target addressing is allowed for
            // GIOP 1.0 & 1.1
            throw wrapper.giopVersionError(
                CompletionStatus.COMPLETED_MAYBE);
        }

        // Note: Currently we use response_expected flag to decide if the
        // call is oneway or not. Ideally, it is possible to expect a
        // response on a oneway call too, but we do not support it now.
        byte response_flags = 0x03;
        if (response_expected) {
            response_flags = 0x03;
        } else {
            response_flags = 0x00;
        }

        TargetAddress target = new TargetAddress();
        if (addrDisp == ProfileAddr.value) { // iop profile will be used
            profile = ior.getProfile();
            target.profile(profile.getIOPProfile());
        } else if (addrDisp == ReferenceAddr.value) {  // ior will be used
            IORAddressingInfo iorInfo =
                new IORAddressingInfo( 0, // profile index
                    ior.getIOPIOR());
            target.ior(iorInfo);
        } else {
            // invalid target addressing disposition value
            throw wrapper.illegalTargetAddressDisposition(
                CompletionStatus.COMPLETED_NO);
        }

        requestMessage =
               new RequestMessage_1_2(orb, request_id, response_flags,
                              new byte[] { 0x00, 0x00, 0x00 }, target,
                              operation, service_contexts);
        requestMessage.setEncodingVersion(encodingVersion);
    }

    if (gv.supportsIORIIOPProfileComponents()) {
        // add request partitioning thread pool to use info
        int poolToUse = 0; // default pool
        IIOPProfileTemplate temp =
            (IIOPProfileTemplate)profile.getTaggedProfileTemplate();
        Iterator iter =
            temp.iteratorById(ORBConstants.TAG_REQUEST_PARTITIONING_ID);
        if (iter.hasNext()) {
            poolToUse =
                ((RequestPartitioningComponent)iter.next()).getRequestPartitioningId();
        }

        if (poolToUse < ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID ||
            poolToUse > ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID) {
            throw wrapper.invalidRequestPartitioningId(new Integer(poolToUse),
                  new Integer(ORBConstants.REQUEST_PARTITIONING_MIN_THREAD_POOL_ID),
                  new Integer(ORBConstants.REQUEST_PARTITIONING_MAX_THREAD_POOL_ID));
        }
        requestMessage.setThreadPoolToUse(poolToUse);
    }

    return requestMessage;
}
 
Example #29
Source File: CDROutputStream.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public final void write_Principal(Principal value) {
    impl.write_Principal(value);
}
 
Example #30
Source File: RequestMessage_1_0.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public Principal getPrincipal() {
    return this.requesting_principal;
}