Package it.eng.spago.base

Examples of it.eng.spago.base.SourceBean


    RequestContainer requestContainer = requestContext.getRequestContainer();
    ResponseContainer responseContainer = requestContext.getResponseContainer();

    // Prepare service request for loopback management
        try {
            SourceBean loopbackServiceRequest = new SourceBean(Constants.SERVICE_REQUEST);
            loopbackServiceRequest.setAttribute(Navigator.NAVIGATOR_DISABLED, "TRUE");
           
            SourceBean renderingConfig = publisher.getRenderingConfig();
            List resourcesConfig = renderingConfig.getAttributeAsList("RESOURCES.PARAMETER");
            for (int j = 0; j < resourcesConfig.size(); j++) {
                SourceBean consequence = (SourceBean) resourcesConfig.get(j);
                String parameterName = (String) consequence.getAttribute("NAME");
                String parameterScope = (String) consequence.getAttribute("SCOPE");
                String parameterType = (String) consequence.getAttribute("TYPE");
                String parameterValue = (String) consequence.getAttribute("VALUE");
                Object inParameterValue = null;
                if (parameterType.equalsIgnoreCase("ABSOLUTE"))
                    inParameterValue = parameterValue;
                else {
                  inParameterValue = ContextScooping.getScopedParameter(requestContainer,
                                responseContainer,
                                parameterValue, parameterScope, consequence);
                }
               
                if (inParameterValue == null)
                    continue;
                if (inParameterValue instanceof SourceBean)
                    loopbackServiceRequest.setAttribute((SourceBean) inParameterValue);
                else
                    loopbackServiceRequest.setAttribute(parameterName, inParameterValue);
            } // for (int j = 0; j < consequences.size(); j++)
            // light navigator id propagation
            SourceBean serviceRequest = requestContainer.getServiceRequest();
            String lightNavigatorId = (String) serviceRequest.getAttribute(LightNavigationManager.LIGHT_NAVIGATOR_ID);
            if (lightNavigatorId != null && !lightNavigatorId.trim().equals("")) {
              loopbackServiceRequest.setAttribute(LightNavigationManager.LIGHT_NAVIGATOR_ID, lightNavigatorId);
            }
           
            responseContainer.setLoopbackServiceRequest(loopbackServiceRequest);
View Full Code Here


      logger.warn("Cannot record the association between exported engine "+exportedEngineLabel+" " +
          "and the engine " + existingEngineLabel + ", the association SourceBean is null");
      return;
    }
    try{
      SourceBean engineSB = (SourceBean) engineAssSB.getFilteredSourceBeanAttribute("ENGINE_ASSOCIATION", "exported", exportedEngineLabel);
      // association already recorder
      if(engineSB != null) {
        engineSB.updAttribute("associatedTo", existingEngineLabel);
        //return;
      } else {
        // record association
        engineSB = new SourceBean("ENGINE_ASSOCIATION");
        engineSB.setAttribute("exported", exportedEngineLabel);
        engineSB.setAttribute("associatedTo", existingEngineLabel);
        engineAssSB.setAttribute(engineSB);
      }
    } catch (Exception e) {
      logger.error("Error while recording the association between exported engine "+exportedEngineLabel+" " +
          "and the engine " + existingEngineLabel + " \n " , e);
View Full Code Here

      logger.warn("Cannot record the association between exported  "+exportedDataSourceName+" " +
          "and the data source " + existingDataSourceName + ", the association SourceBean is null");
      return;
    }
    try{
      SourceBean dsSB = (SourceBean) datasourceAssSB.getFilteredSourceBeanAttribute("DATA_SOURCE_ASSOCIATION", "exported", exportedDataSourceName);
      // association already recorder
      if(dsSB != null) {
        dsSB.updAttribute("associatedTo", existingDataSourceName);
        //return;
      } else {
        // record association
        dsSB = new SourceBean("DATA_SOURCE_ASSOCIATION");
        dsSB.setAttribute("exported", exportedDataSourceName);
        dsSB.setAttribute("associatedTo", existingDataSourceName);
        datasourceAssSB.setAttribute(dsSB);
        if(dsExportedToUserLabel==null)dsExportedToUserLabel=new HashMap<String, String>();
        dsExportedToUserLabel.put(exportedDataSourceName, existingDataSourceName);
      }
    } catch (Exception e) {
View Full Code Here

   * @param xmlStr the xml string which defines the associations
   */
  public void fillFromXml(String xmlStr) {
    logger.debug("IN");
    try {
      SourceBean associationSBtmp = SourceBean.fromXMLString(xmlStr);
      SourceBean roleAssSBtmp = (SourceBean)associationSBtmp.getAttribute("ROLE_ASSOCIATIONS");
      if(roleAssSBtmp==null) throw new Exception("Cannot recover ROLE_ASSOCIATIONS bean");
      SourceBean engineAssSBtmp = (SourceBean)associationSBtmp.getAttribute("ENGINE_ASSOCIATIONS");
      if(engineAssSBtmp==null) throw new Exception("Cannot recover ENGINE_ASSOCIATIONS bean");
      SourceBean datasourceAssSBtmp = (SourceBean)associationSBtmp.getAttribute("DATA_SOURCE_ASSOCIATIONS");
      if(datasourceAssSBtmp==null) throw new Exception("Cannot recover DATA_SOURCE_ASSOCIATIONS bean");
      associationSB = associationSBtmp;
      roleAssSB = roleAssSBtmp;
      engineAssSB = engineAssSBtmp;
      datasourceAssSB = datasourceAssSBtmp;
View Full Code Here

   * @return the associated role
   */
  public String getAssociatedRole(String expRoleName) {
    logger.debug("IN");
    String assRole = null;
    SourceBean assRoleSB = (SourceBean)roleAssSB.getFilteredSourceBeanAttribute("ROLE_ASSOCIATION", "exported", expRoleName);
    if(assRoleSB!=null) {
      assRole = (String)assRoleSB.getAttribute("associatedTo");
      if(assRole.trim().equals("")) {
        assRole = null;
      }
    }
    logger.debug("OUT");
View Full Code Here

   * @return the associated engine
   */
  public String getAssociatedEngine(String expEngineLabel) {
    logger.debug("IN");
    String assEngine = null;
    SourceBean assEngineSB = (SourceBean)engineAssSB.getFilteredSourceBeanAttribute("ENGINE_ASSOCIATION", "exported", expEngineLabel);
    if(assEngineSB!=null) {
      assEngine = (String)assEngineSB.getAttribute("associatedTo");
      if(assEngine.trim().equals("")) {
        assEngine = null;
      }
    }
    logger.debug("OUT");
View Full Code Here

   * @return the associated data source
   */
  public String getAssociatedDataSource(String expDataSourceName) {
    logger.debug("IN");
    String assDataSource = null;
    SourceBean assDataSourceSB = (SourceBean)datasourceAssSB.getFilteredSourceBeanAttribute("DATA_SOURCE_ASSOCIATION", "exported", expDataSourceName);
    if(assDataSourceSB!=null) {
      assDataSource = (String)assDataSourceSB.getAttribute("associatedTo");
      if(assDataSource.trim().equals("")) {
        assDataSource = null;
      }
    }
    logger.debug("OUT");
View Full Code Here

public class Configurator {
    private Configurator() {
      ConfigSingleton config = ConfigSingleton.getInstance();
      _parameterConnectionPoolDescriptors = new HashMap();
      _parameterRegisteredConnectionPoolNames = new ArrayList();
      SourceBean dataAccess = (SourceBean)config.getAttribute(DATA_ACCESS);
     
      List connectionPools = dataAccess.getAttributeAsList("CONNECTION-POOL");
      ConnectionPoolDescriptor connectionPoolDescriptor = null;
      SourceBean connectionPool = null;
      List poolParameters = null;
      String poolName = null;
      if (connectionPools != null) {
        for (int i = 0; i < connectionPools.size(); i++) {
          connectionPoolDescriptor = new ConnectionPoolDescriptor();
          connectionPool = (SourceBean)connectionPools.get(i)
          poolName = (String)connectionPool.getAttribute("connectionPoolName");
        connectionPoolDescriptor.setConnectionPoolName(poolName);
        connectionPoolDescriptor.setConnectionPoolFactory((String)connectionPool.getAttribute("connectionPoolFactoryClass"));
        poolParameters = connectionPool.getAttributeAsList("CONNECTION-POOL-PARAMETER");
        String parameterName = null;
        String parameterValue = null;
        if (poolParameters != null) {
          for (int j = 0; j < poolParameters.size(); j++) {       
            parameterName = (String)(((SourceBean)poolParameters.get(j)).getAttribute("parameterName"));
            parameterValue = (String)(((SourceBean)poolParameters.get(j)).getAttribute("parameterValue"));       
            ConnectionPoolParameter parameter = new ConnectionPoolParameter(parameterName, parameterValue);
            connectionPoolDescriptor.addConnectionPoolParameter(parameter);
         
        }
        _parameterConnectionPoolDescriptors.put(poolName, connectionPoolDescriptor);
        }
      }
      else
        TracerSingleton.log(
                  Constants.NOME_MODULO,
                  TracerSingleton.INFORMATION,
                  "Configurator::Configurator: nessuna definizione di CONNECTION-POOL");
     
    List registerPools= dataAccess.getAttributeAsList("CONNECTION-MANAGER.REGISTER-POOL");
      SourceBean poolRegister = null;
      if (registerPools != null) {
        for (int i = 0; i < registerPools.size(); i++) {
          poolRegister = (SourceBean)registerPools.get(i);
          _parameterRegisteredConnectionPoolNames.add((String)poolRegister.getAttribute("registeredPoolName"));
        }
      }
      else
        TracerSingleton.log(
                  Constants.NOME_MODULO,
View Full Code Here

      } catch (Exception e) {
        logger.error("Error while recovering template content: \n" + e);
        throw new EMFUserError(EMFErrorSeverity.ERROR, "1002", messageBundle);
      }
      // get bytes of template and transform them into a SourceBean
      SourceBean content = null;
      try {
        String contentStr = new String(contentBytes);
        content = SourceBean.fromXMLString(contentStr);
      } catch (Exception e) {
        logger.error("Error while converting the Template bytes into a SourceBean object: ", e);
View Full Code Here

    logger.debug("IN");

    EMFErrorHandler errorHandler = responseContainer.getErrorHandler();
   
    // get the module response
    SourceBean moduleResponse = (SourceBean)responseContainer.getServiceResponse();
    String publisher_Name = (String)moduleResponse.getAttribute("publisher_Name");
   
    // if there are errors and they are only validation errors return the name for the detail publisher
    if(errorHandler.isOK() && errorHandler.isOKBySeverity(EMFErrorSeverity.ERROR)) {
        if(publisher_Name!=null && publisher_Name !="") {       
          logger.info("Publish:" + publisher_Name);   
View Full Code Here

TOP

Related Classes of it.eng.spago.base.SourceBean

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.