org.apache.axis2.engine.AxisEvent Java Examples

The following examples show how to use org.apache.axis2.engine.AxisEvent. 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: UrlMappingDeploymentInterceptor.java    From carbon-commons with Apache License 2.0 6 votes vote down vote up
public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) {

        Parameter mapping = axisService.getParameter("custom-mapping");
        int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
        if (mapping == null) {
            return;
        } else {
            if (((String) mapping.getValue()).equalsIgnoreCase("true")) {
                if (axisEvent.getEventType() == 1 || axisEvent.getEventType() == 3) {
                    if (tenantId != MultitenantConstants.SUPER_TENANT_ID) {
                        HostUtil.addServiceUrlMapping(tenantId, axisService.getName());
                    }
                } else if (axisEvent.getEventType() == 0 || axisEvent.getEventType() == 2) {
                    tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
                    HostUtil.removeUrlMappingFromMap(tenantId, axisService.getName());
                }
            }
        }
    }
 
Example #2
Source File: TenantSTSObserver.java    From carbon-identity with Apache License 2.0 6 votes vote down vote up
@Override
public void serviceUpdate(AxisEvent axisEvent, AxisService service) {
    int eventType = axisEvent.getEventType();
    if (eventType == AxisEvent.SERVICE_DEPLOY) {
        try {
            if (ServerConstants.STS_NAME.equals(service.getName())) {
                if (log.isDebugEnabled()) {
                    log.debug("Configuring the STS service for tenant: " +
                              PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain() +
                              "[" + PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId() + "]");
                }
                STSConfigAdmin.configureGenericSTS(service.getAxisConfiguration());
            }
        } catch (IdentityProviderException e) {
            log.error("Failed to configure STS service for tenant: " +
                      PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId() +
                      " - " + PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(), e);
        }
    }
}
 
Example #3
Source File: IWADeploymentInterceptor.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void serviceUpdate(AxisEvent event, AxisService service) {
    if (event.getEventType() == AxisEvent.SERVICE_DEPLOY
            && IWA_SERVICE_NAME.equals(service.getName())) {
        try {
            populateRampartConfig(service.getAxisConfiguration());
        } catch (Exception e) {
            log.error("Error while updating " + IWA_SERVICE_NAME
                    + " in IWADeploymentInterceptor", e);
            throw new RuntimeException(e);
        }
    }
}
 
Example #4
Source File: TargetServiceObserver.java    From carbon-commons with Apache License 2.0 5 votes vote down vote up
public void serviceUpdate(AxisEvent event, AxisService service) {
    int eventType = event.getEventType();
    if (eventType == AxisEvent.SERVICE_START ||
            eventType == AxisEvent.SERVICE_DEPLOY ||
            eventType == CarbonConstants.AxisEvent.TRANSPORT_BINDING_ADDED ||
            eventType == CarbonConstants.AxisEvent.TRANSPORT_BINDING_REMOVED) {

        // send the hello message
        sendHello(service);

    } else if ((event.getEventType() == AxisEvent.SERVICE_STOP) ||
                    (event.getEventType() == AxisEvent.SERVICE_REMOVE)){
        // send the bye message
        MessageSender messageSender = new MessageSender();
        Parameter discoveryProxyParam =
                this.axisConfiguration.getParameter(DiscoveryConstants.DISCOVERY_PROXY);

        if (discoveryProxyParam != null) {
            if (log.isDebugEnabled()) {
                log.debug("Sending WS-Discovery Bye message for the " +
                        "service " + service.getName());
            }

            try {
                messageSender.sendBye(service, (String) discoveryProxyParam.getValue());
            } catch (DiscoveryException e) {
                log.error("Cannot send the bye message ", e);
            }
        }
    }
}
 
Example #5
Source File: SystemStatisticsDeploymentInterceptor.java    From carbon-commons with Apache License 2.0 5 votes vote down vote up
public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) {

        if (SystemFilter.isFilteredOutService(axisService.getAxisServiceGroup()) || axisService.isClientSide()) {
            return;
        }
        if (axisEvent.getEventType() == AxisEvent.SERVICE_DEPLOY) {
            for (Iterator iter = axisService.getOperations(); iter.hasNext(); ) {
                AxisOperation op = (AxisOperation) iter.next();
                setCountersAndProcessors(op);
            }
            // see ESBJAVA-2327
            if (JavaUtils.isTrueExplicitly(axisService.getParameterValue("disableOperationValidation"))) {
                AxisOperation defaultOp = (AxisOperation) axisService.getParameterValue("_default_mediate_operation_");
                if (defaultOp != null) {
                    setCountersAndProcessors(defaultOp);
                }
            }
            // Service response time processor
            Parameter responseTimeProcessor = new Parameter();
            responseTimeProcessor.setName(StatisticsConstants.SERVICE_RESPONSE_TIME_PROCESSOR);
            responseTimeProcessor.setValue(new ResponseTimeProcessor());
            try {
                axisService.addParameter(responseTimeProcessor);
            } catch (AxisFault axisFault) {
                // will not occur
            }
        }
    }
 
Example #6
Source File: STSDeploymentInterceptor.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void serviceUpdate(AxisEvent event, AxisService service) {
    if (event.getEventType() == AxisEvent.SERVICE_DEPLOY
        && ServerConstants.STS_NAME.equals(service.getName())) {
        try {
            updateSTSService(service.getAxisConfiguration());
        } catch (Exception e) {
            log.error("Error while updating " + ServerConstants.STS_NAME
                      + " in STSDeploymentInterceptor", e);
        }
    }
}
 
Example #7
Source File: STSObserver.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
@Override
public void serviceUpdate(AxisEvent axisEvent, AxisService service) {
    int eventType = axisEvent.getEventType();
    if (eventType == AxisEvent.SERVICE_DEPLOY) {
        try {
            STSConfigAdmin.configureService(service.getName());
            if (ServerConstants.STS_NAME.equals(service.getName())) {
                STSConfigAdmin.configureGenericSTS();
            }
        } catch (IdentityProviderException e) {
            log.error(e);
        }
    }

}
 
Example #8
Source File: SecurityDeploymentInterceptor.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
@Override
public void moduleUpdate(AxisEvent event, AxisModule module) {
    // This method will not be used
}
 
Example #9
Source File: IdentityMgtDeploymentInterceptor.java    From carbon-identity-framework with Apache License 2.0 4 votes vote down vote up
@Override
public void serviceGroupUpdate(AxisEvent axisEvent, AxisServiceGroup axisServiceGroup) {
    //Overridden method from parent interface, don't need any code here.
}
 
Example #10
Source File: IdentityMgtDeploymentInterceptor.java    From carbon-identity-framework with Apache License 2.0 4 votes vote down vote up
@Override
public void moduleUpdate(AxisEvent axisEvent, AxisModule axisModule) {
    //Overridden method from parent interface, don't need any code here.
}
 
Example #11
Source File: SystemStatisticsDeploymentInterceptor.java    From carbon-commons with Apache License 2.0 4 votes vote down vote up
public void moduleUpdate(AxisEvent axisEvent, AxisModule axisModule) {
    // Nothing to implement
}
 
Example #12
Source File: SystemStatisticsDeploymentInterceptor.java    From carbon-commons with Apache License 2.0 4 votes vote down vote up
public void serviceGroupUpdate(AxisEvent axisEvent, AxisServiceGroup axisServiceGroup) {
    // Nothing to implement
}
 
Example #13
Source File: STSObserver.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
@Override
public void moduleUpdate(AxisEvent arg0, AxisModule arg1) {
    // Nothing to implement

}
 
Example #14
Source File: IdentityMgtDeploymentInterceptor.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
@Override
public void moduleUpdate(AxisEvent axisEvent, AxisModule axisModule) {
    //Overridden method from parent interface, don't need any code here.
}
 
Example #15
Source File: IdentityMgtDeploymentInterceptor.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
@Override
public void serviceGroupUpdate(AxisEvent axisEvent, AxisServiceGroup axisServiceGroup) {
    //Overridden method from parent interface, don't need any code here.
}
 
Example #16
Source File: IdentityMgtDeploymentInterceptor.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
@Override
public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) {
    //Overridden method from parent interface, don't need any code here.
}
 
Example #17
Source File: SecurityDeploymentInterceptor.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
@Override
public void serviceGroupUpdate(AxisEvent event, AxisServiceGroup serviceGroup) {
    // This method will not be used
}
 
Example #18
Source File: IdentityMgtDeploymentInterceptor.java    From carbon-identity-framework with Apache License 2.0 4 votes vote down vote up
@Override
public void serviceUpdate(AxisEvent axisEvent, AxisService axisService) {
    //Overridden method from parent interface, don't need any code here.
}
 
Example #19
Source File: STSDeploymentInterceptor.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void serviceGroupUpdate(AxisEvent event, AxisServiceGroup group) {
    // Nothing to implement
}
 
Example #20
Source File: STSDeploymentInterceptor.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void moduleUpdate(AxisEvent arg0, AxisModule arg1) {
    // Nothing to implement
}
 
Example #21
Source File: STSObserver.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
@Override
public void serviceGroupUpdate(AxisEvent arg0, AxisServiceGroup arg1) {
    // Nothing to implement

}
 
Example #22
Source File: TenantSTSObserver.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
@Override
public void moduleUpdate(AxisEvent axisEvent, AxisModule axisModule) {
    // Nothing to implement
}
 
Example #23
Source File: TenantSTSObserver.java    From carbon-identity with Apache License 2.0 4 votes vote down vote up
@Override
public void serviceGroupUpdate(AxisEvent axisEvent, AxisServiceGroup axisServiceGroup) {
    // Nothing to implement
}
 
Example #24
Source File: UrlMappingDeploymentInterceptor.java    From carbon-commons with Apache License 2.0 2 votes vote down vote up
public void serviceGroupUpdate(AxisEvent axisEvent, AxisServiceGroup axisServiceGroup) {

    }
 
Example #25
Source File: UrlMappingDeploymentInterceptor.java    From carbon-commons with Apache License 2.0 2 votes vote down vote up
public void moduleUpdate(AxisEvent axisEvent, AxisModule axisModule) {

    }
 
Example #26
Source File: TargetServiceObserver.java    From carbon-commons with Apache License 2.0 2 votes vote down vote up
public void moduleUpdate(AxisEvent event, AxisModule module) {

    }
 
Example #27
Source File: TargetServiceObserver.java    From carbon-commons with Apache License 2.0 2 votes vote down vote up
public void serviceGroupUpdate(AxisEvent event, AxisServiceGroup serviceGroup) {

    }
 
Example #28
Source File: IWADeploymentInterceptor.java    From carbon-identity with Apache License 2.0 2 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void serviceGroupUpdate(AxisEvent event, AxisServiceGroup group) {
}
 
Example #29
Source File: IWADeploymentInterceptor.java    From carbon-identity with Apache License 2.0 2 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void moduleUpdate(AxisEvent arg0, AxisModule arg1) {
}