{
final ContextFactoryMapper contextFactoryMapper = ContextFactoryMapper.getFactory() ;
try
{
final String coordinationType = createCoordinationContext.getCoordinationType() ;
final ContextFactory contextFactory = contextFactoryMapper.getContextFactory(coordinationType) ;
if (contextFactory != null)
{
final CoordinationContext coordinationContext ;
try
{
final Expires expiresElement = createCoordinationContext.getExpires() ;
final Long expires = (expiresElement == null ? null : new Long(expiresElement.getValue())) ;
coordinationContext = contextFactory.create(coordinationType, expires, createCoordinationContext.getCurrentContext(), isSecure) ;
final CreateCoordinationContextResponseType response = new CreateCoordinationContextResponseType() ;
response.setCoordinationContext(coordinationContext) ;
return response;
}
catch (final InvalidCreateParametersException invalidCreateParametersException)