Examples of SecurityMetadata


Examples of org.jboss.jms.server.security.SecurityMetadata

/*     */
/* 280 */     boolean isQueue = jbd.isQueue();
/* 281 */     String name = jbd.getName();
/*     */
/* 283 */     SecurityStore sm = conn.getSecurityManager();
/* 284 */     SecurityMetadata securityMetadata = sm.getSecurityMetadata(isQueue, name);
/*     */
/* 286 */     if (securityMetadata == null)
/*     */     {
/* 288 */       throw new JMSSecurityException("No security configuration avaliable for " + name);
/*     */     }
/*     */
/* 296 */     sm.authenticate(conn.getUsername(), conn.getPassword());
/*     */
/* 299 */     Set principals = checkType == CheckType.WRITE ? securityMetadata.getWritePrincipals() : checkType == CheckType.READ ? securityMetadata.getReadPrincipals() : securityMetadata.getCreatePrincipals();
/*     */     try
/*     */     {
/* 304 */       if (!sm.authorize(conn.getUsername(), principals, checkType))
/*     */       {
/* 306 */         String msg = "User: " + conn.getUsername() + " is not authorized to " + (checkType == CheckType.WRITE ? "write to" : checkType == CheckType.READ ? "read from" : "create durable sub on") + " destination " + name;
View Full Code Here

Examples of org.jboss.resource.metadata.mcf.SecurityMetaData

            // If we have an XAResourceRecoveryRegistry and the deployment is XA
            // lets register it for XA Resource Recovery using the "recover" definitions
            // from the -ds.xml file. Fallback to the standard definitions for
            // user name, password. Keep a seperate reference to the security-domain

            SecurityMetaData recoverSecurityDomainMD = xdsdm.getRecoverSecurityMetaData();
            if (recoverSecurityDomainMD != null)
               recoverSecurityDomain = recoverSecurityDomainMD.getDomain();

            SecurityMetaData securityDomainMD = xdsdm.getSecurityMetaData();
            if (securityDomainMD != null)
               securityDomain = securityDomainMD.getDomain();

            recoverUserName = xdsdm.getRecoverUserName();
            recoverPassword = xdsdm.getRecoverPassWord();

            if (recoverUserName == null)
View Full Code Here

Examples of org.jboss.resource.metadata.mcf.SecurityMetaData

      LocalDSInstanceClassFactory icf = new LocalDSInstanceClassFactory(mof);
      icf.setMof(mof);
      mof.setInstanceClassFactory(LocalDataSourceDeploymentMetaData.class, icf);
      LocalDataSourceDeploymentMetaData lds = new LocalDataSourceDeploymentMetaData();
      // Set a SecurityMetaData to validate its MO
      SecurityMetaData smd = new ApplicationManagedSecurityMetaData();
      smd.setDomain("java:/jaas/SomeDomain");
      lds.setSecurityMetaData(smd);
      ManagedObject mo = mof.initManagedObject(lds, "LocalDataSourceDeploymentMetaData", null);
      // Validate the expected property names
      Set<String> expectedPropertyNames = new TreeSet<String>();
      expectedPropertyNames.addAll(Arrays.asList(ManagedConnectionFactoryDeploymentMetaData_NAMES));
View Full Code Here

Examples of org.jboss.resource.metadata.mcf.SecurityMetaData

      LocalDSInstanceClassFactory icf = new LocalDSInstanceClassFactory(mof);
      icf.setMof(mof);
      mof.setInstanceClassFactory(LocalDataSourceDeploymentMetaData.class, icf);
      LocalDataSourceDeploymentMetaData lds = new LocalDataSourceDeploymentMetaData();
      // Set a SecurityMetaData to validate its MO
      SecurityMetaData smd = new ApplicationManagedSecurityMetaData();
      smd.setDomain("java:/jaas/SomeDomain");
      lds.setSecurityMetaData(smd);
      ManagedObject mo = mof.initManagedObject(lds, "LocalDataSourceDeploymentMetaData", null);
      // Validate the expected property names
      Set<String> expectedPropertyNames = new TreeSet<String>();
      expectedPropertyNames.addAll(Arrays.asList(ManagedConnectionFactoryDeploymentMetaData_NAMES));
View Full Code Here

Examples of org.jboss.resource.metadata.mcf.SecurityMetaData

         String domainName = (String) metaValueFactory.unwrap(compositeValue.get(DOMAIN));        
         SecurityDeploymentType deploymentType = (SecurityDeploymentType) metaValueFactory.unwrap(compositeValue.get(DeploymentTypeName));
         if(deploymentType == null)
            deploymentType = SecurityDeploymentType.NONE;
        
         SecurityMetaData securityDomain = null;
         switch(deploymentType)
         {
            case APPLICATION:
               securityDomain = new ApplicationManagedSecurityMetaData();
               break;
            case DOMAIN:
               securityDomain = new SecurityDomainMetaData();
               break;
            case DOMAIN_AND_APPLICATION:
               securityDomain = new SecurityDomainApplicationManagedMetaData();
               break;
            default:
            case NONE:
               securityDomain = new SecurityMetaData();
               break;
         }
         // Sanity check
         if(securityDomain.requiresDomain() && domainName == null)
            throw new IllegalStateException("null security domain not allowed for SecurityDeploymentType " + deploymentType);
         // Set the domain
         securityDomain.setDomain(domainName);
         //
         return securityDomain;
      }
      throw new IllegalStateException("Unable to unwrap securityDomain " + metaValue);
   }
View Full Code Here

Examples of org.jboss.test.managed.factory.support.mcf.SecurityMetaData

      lds.setPrefill(true);
      lds.setPreparedStatementCacheSize(50);
      lds.setQueryTimeout(30000);
      lds.setUserName("user");
      // Set a SecurityMetaData to validate its MO
      SecurityMetaData smd = new SecurityMetaData();
      smd.setDomain("java:/jaas/SomeDomain");
      lds.setSecurityMetaData(smd);

      ManagedConnectionFactoryDeploymentMetaData[] mds = {lds};
      mcfs.setDeployments(Arrays.asList(mds));
      mcfs.setUrl(new URL("file:/deploy/some-ds.xml"));
View Full Code Here

Examples of org.switchyard.security.SecurityMetadata

     * Creates a new ExchangeUtil for the specified Exchange.
     * @param exchange the Exchange
     */
    public DefaultExchangeSecurity(Exchange exchange) {
        _exchange = exchange;
        SecurityMetadata securityMetadata = SecurityMetadata.getSecurityMetadata(exchange);
        ServiceSecurity serviceSecurity = securityMetadata.getServiceSecurity();
        _securityDomain = serviceSecurity != null ? serviceSecurity.getSecurityDomain() : null;
        ServiceDomain serviceDomain = securityMetadata.getServiceDomain();
        _securityContextManager = serviceDomain != null ? new SecurityContextManager(serviceDomain) : null;
    }
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.