Package org.omg.IOP

Examples of org.omg.IOP.TaggedComponent


    public short getRequires() {
        return 0;
    }

    public TaggedComponent encodeIOR(ORB orb, Codec codec) {
        TaggedComponent result = new TaggedComponent();

        result.tag = TAG_NULL_TAG.value;
        result.component_data = new byte[0];

        return result;
View Full Code Here


   {
      CompoundSecMechList csmList = null;
      CompoundSecMech securityMech = null;
      try
      {
          TaggedComponent tc = ri.get_effective_component(TAG_CSI_SEC_MECH_LIST.value);

          Any any = codec.decode_value(tc.component_data,
             CompoundSecMechListHelper.type());

          csmList = CompoundSecMechListHelper.extract(any);
View Full Code Here

   /**
    * Make a deep copy of an IOP:TaggedComponent
    **/
   public static TaggedComponent createCopy(TaggedComponent tc)
   {
      TaggedComponent copy = null;

      if( tc != null )
      {
         byte[] buf = new byte[tc.component_data.length];
         System.arraycopy(tc.component_data, 0, buf, 0, tc.component_data.length);

         copy = new TaggedComponent(tc.tag, buf);
      }

      return copy;
   }
View Full Code Here

      {
         log.debug("createSSLTaggedComponent() called with null metadata");
         return null;
      }

      TaggedComponent tc = null;

      try
      {
         int supports = createTargetSupports(metadata.getTransportConfig());
         int requires = createTargetRequires(metadata.getTransportConfig());
         SSL ssl = new SSL((short) supports, (short) requires, (short) sslPort);
         Any any = orb.create_any();
         SSLHelper.insert(any, ssl);
         byte[] componentData = codec.encode_value(any);
         tc = new TaggedComponent(TAG_SSL_SEC_TRANS.value, componentData);
      }
      catch(InvalidTypeForEncoding e)
      {
         log.warn("Caught unexcepted exception while encoding SSL component", e);
         throw new RuntimeException(e);
View Full Code Here

      {
         log.debug("createSecurityTaggedComponent() called with null metadata");
         return null;
      }

      TaggedComponent tc = null;
     
      // Get the the supported security mechanisms (just one :)
      CompoundSecMech[] mechList =
         createCompoundSecMechanisms(metadata, codec, sslPort, orb);
        
      // the above is wrapped into a CSIIOP.CompoundSecMechList
      // structure, which is NOT a CompoundSecMech[] !!!
      //
      //  We DONT support stateful/reusable security contexts (false)
      CompoundSecMechList csmList = new CompoundSecMechList(false,
         mechList);
      // finally, the CompoundSecMechList must be encoded as a TaggedComponent
      try
      {
         Any any = orb.create_any();

         CompoundSecMechListHelper.insert(any, csmList);
         byte[] b = codec.encode_value(any);

         tc = new TaggedComponent(TAG_CSI_SEC_MECH_LIST.value, b);
      }
      catch(InvalidTypeForEncoding e)
      {
         log.warn("Caught unexcepted exception while encoding CompoundSecMechList", e);
         throw new RuntimeException(e);
View Full Code Here

      // target_requires, transport_mech, as_context_mech, sas_context_mech
     
      // The transport mechanism is an IOP.TaggedComponent itself
      // to allow for arbitrary transport mechanisms be specified.
      // This will configure SSL or none.
      TaggedComponent transport_mech = createTransportMech(
         metadata.getTransportConfig(), codec, sslPort, orb
      );
     
      // Create AS Context
      AS_ContextSec asContext = createAuthenticationServiceContext(metadata);
View Full Code Here

      Codec codec,
      int sslPort,
      ORB orb
      )
   {
      TaggedComponent tc = null;
     
      // what we support and require as a target
      int support = 0;
      int require = 0;

      if( tconfig != null )
      {
         require = createTargetRequires(tconfig);
         support = createTargetSupports(tconfig);
      }

      if( tconfig == null || support == 0 || sslPort < 0 )
      {
         // no support for transport security
         tc = new TaggedComponent(TAG_NULL_TAG.value, new byte[0]);
      }
      else
      {
         // my ip address
         String host;
         try
         {
            host = InetAddress.getLocalHost().getHostAddress();
         }
         catch(java.net.UnknownHostException e)
         {
            host = "127.0.0.1";
         }
        
         // this will create only one transport address
         TransportAddress[] taList = createTransportAddress(host, sslPort);

         TLS_SEC_TRANS tst = new TLS_SEC_TRANS((short) support,
            (short) require,
            taList);

         // The tricky part, we must encode TLS_SEC_TRANS into an octet sequence
         try
         {
            Any any = orb.create_any();

            TLS_SEC_TRANSHelper.insert(any, tst);
            byte[] b = codec.encode_value(any);

            tc = new TaggedComponent(TAG_TLS_SEC_TRANS.value, b);
         }
         catch(InvalidTypeForEncoding e)
         {
            log.warn("Caught unexcepted exception while encoding TLS_SEC_TRANS", e);
            throw new RuntimeException(e);
View Full Code Here

      short clientRequires)
   {
      CompoundSecMechList csmList = null;
      try
      {
         TaggedComponent tc =
            ri.get_effective_component(TAG_CSI_SEC_MECH_LIST.value);

         Any any = codec.decode_value(tc.component_data,
            CompoundSecMechListHelper.type());
View Full Code Here

            (short) sslPort);
         ORB orb = ORB.init();
         Any any = orb.create_any();
         SSLHelper.insert(any, ssl);
         byte[] componentData = codec.encode_value(any);
         defaultSSLComponent = new TaggedComponent(TAG_SSL_SEC_TRANS.value,
            componentData);

         IorSecurityConfigMetaData metadata = new IorSecurityConfigMetaData();
         defaultCSIComponent = CSIv2Util.createSecurityTaggedComponent(metadata,
            codec, sslPort, orb);
View Full Code Here

      if (csiv2Policy != null)
      {
         // if csiv2Policy effective, stuff a copy of the TaggedComponents
         // already created by the CSIv2Policy into the IOR's IIOP profile
         TaggedComponent sslComponent =
            csiv2Policy.getSSLTaggedComponent();
         if (sslComponent != null &&
             CorbaORBService.getSSLComponentsEnabledFlag() == true)
         {
            info.add_ior_component_to_profile(sslComponent,
                                              TAG_INTERNET_IOP.value);
         }
         TaggedComponent csiv2Component =
            csiv2Policy.getSecurityTaggedComponent();
         if (csiv2Component != null)
         {
            info.add_ior_component_to_profile(csiv2Component,
               TAG_INTERNET_IOP.value);
View Full Code Here

TOP

Related Classes of org.omg.IOP.TaggedComponent

Copyright © 2018 www.massapicom. 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.