final HapiContext hapiContext = new DefaultHapiContext(); hapiContext.setValidationContext((ca.uhn.hl7v2.validation.ValidationContext) ValidationContextFactory.noValidation());
public DefaultHapiContext(ParserConfiguration parserConfiguration, ValidationContext validationContext, ModelClassFactory modelClassFactory) { VersionLogger.init(); setParserConfiguration(parserConfiguration); setValidationContext(validationContext); setModelClassFactory(modelClassFactory); setLowerLayerProtocol(new MinLowerLayerProtocol(false)); setSocketFactory(new StandardSocketFactory()); setValidationExceptionHandlerFactory(new ReportingValidationExceptionHandler(true)); setProfileStore(ProfileStoreFactory.getProfileStore()); setCodeStoreRegistry(new DefaultCodeStoreRegistry()); setServerConfiguration(new ServerConfiguration()); }
public DefaultHapiContext(ParserConfiguration parserConfiguration, ValidationRuleBuilder builder, ModelClassFactory modelClassFactory) { VersionLogger.init(); setParserConfiguration(parserConfiguration); setValidationRuleBuilder(builder); setModelClassFactory(modelClassFactory); setLowerLayerProtocol(new MinLowerLayerProtocol(false)); setSocketFactory(new StandardSocketFactory()); setProfileStore(ProfileStoreFactory.getProfileStore()); setCodeStoreRegistry(new DefaultCodeStoreRegistry()); setServerConfiguration(new ServerConfiguration()); }
/** * @since 2.2 */ public Connection attachLazily(DefaultHapiContext hapiContext, String host, int port, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, port, 0, hapiContext.getGenericParser(), hapiContext.getLowerLayerProtocol(), tls, hapiContext.getSocketFactory(), true)); }
public Connection newClient(String host, int outboundPort, int inboundPort, boolean tls) throws HL7Exception { return getConnectionHub().attach(this, host, outboundPort, inboundPort, tls); }
public <T extends Message> T newMessage(Class<T> clazz) throws HL7Exception { T msg = ReflectionUtil.instantiateMessage(clazz, getModelClassFactory()); msg.setParser(getGenericParser()); return msg; }
public Message newMessage(String eventType, String triggerEvent, Version version) throws HL7Exception { try { String structure = getModelClassFactory().getMessageStructureForEvent(eventType + "_" + triggerEvent, version); Class<? extends Message> messageClass = getModelClassFactory().getMessageClass(structure, version.getVersion(), false); Message msg = newMessage(messageClass); ((AbstractMessage) msg).initQuickstart(eventType, triggerEvent, "P"); return msg; } catch (IOException e) { throw new HL7Exception(e); } }
/** * Returns the ValidationContext. If none has been explicitly set, * {@link #getValidationRuleBuilder()} is called in order to to contruct a * context. If this is also null, the ca.uhn.hl7v2.validation.context_class * system property is evaluated, otherwise it returns the DefaultValidation * context. */ public ValidationContext getValidationContext() { if (validationContext == null) { if (getValidationRuleBuilder() != null) { setValidationContext(ValidationContextFactory .fromBuilder(getValidationRuleBuilder())); } else { try { setValidationContext(ValidationContextFactory.getContext()); } catch (HL7Exception e) { setValidationContext(ValidationContextFactory.defaultValidation()); } } } return validationContext; }
public DefaultHapiContext(ParserConfiguration parserConfiguration, ValidationContext validationContext, ModelClassFactory modelClassFactory) { VersionLogger.init(); setParserConfiguration(parserConfiguration); setValidationContext(validationContext); setModelClassFactory(modelClassFactory); setLowerLayerProtocol(new MinLowerLayerProtocol(false)); setSocketFactory(new StandardSocketFactory()); setValidationExceptionHandlerFactory(new ReportingValidationExceptionHandler(true)); setProfileStore(ProfileStoreFactory.getProfileStore()); setCodeStoreRegistry(new DefaultCodeStoreRegistry()); setServerConfiguration(new ServerConfiguration()); }
public DefaultHapiContext(ParserConfiguration parserConfiguration, ValidationRuleBuilder builder, ModelClassFactory modelClassFactory) { VersionLogger.init(); setParserConfiguration(parserConfiguration); setValidationRuleBuilder(builder); setModelClassFactory(modelClassFactory); setLowerLayerProtocol(new MinLowerLayerProtocol(false)); setSocketFactory(new StandardSocketFactory()); setProfileStore(ProfileStoreFactory.getProfileStore()); setCodeStoreRegistry(new DefaultCodeStoreRegistry()); setServerConfiguration(new ServerConfiguration()); }
/** * @since 2.1 */ public Connection attach(DefaultHapiContext hapiContext, String host, int port, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, port, 0, hapiContext.getGenericParser(), hapiContext.getLowerLayerProtocol(), tls, hapiContext.getSocketFactory(), false)); }
public Connection newLazyClient(String host, int port, boolean tls) throws HL7Exception { return getConnectionHub().attachLazily(this, host, port, tls); }
public <T extends Message> T newMessage(Class<T> clazz) throws HL7Exception { T msg = ReflectionUtil.instantiateMessage(clazz, getModelClassFactory()); msg.setParser(getGenericParser()); return msg; }
public Message newMessage(String eventType, String triggerEvent, Version version) throws HL7Exception { try { String structure = getModelClassFactory().getMessageStructureForEvent(eventType + "_" + triggerEvent, version); Class<? extends Message> messageClass = getModelClassFactory().getMessageClass(structure, version.getVersion(), false); Message msg = newMessage(messageClass); ((AbstractMessage) msg).initQuickstart(eventType, triggerEvent, "P"); return msg; } catch (IOException e) { throw new HL7Exception(e); } }
/** * Returns the ValidationContext. If none has been explicitly set, * {@link #getValidationRuleBuilder()} is called in order to to contruct a * context. If this is also null, the ca.uhn.hl7v2.validation.context_class * system property is evaluated, otherwise it returns the DefaultValidation * context. */ public ValidationContext getValidationContext() { if (validationContext == null) { if (getValidationRuleBuilder() != null) { setValidationContext(ValidationContextFactory .fromBuilder(getValidationRuleBuilder())); } else { try { setValidationContext(ValidationContextFactory.getContext()); } catch (HL7Exception e) { setValidationContext(ValidationContextFactory.defaultValidation()); } } } return validationContext; }
final HapiContext hapiContext = new DefaultHapiContext(); if (!inputVersion.equals("autodetect")) { hapiContext.setModelClassFactory(new CanonicalModelClassFactory(inputVersion));
/** * @since 2.1 */ public Connection attach(DefaultHapiContext hapiContext, String host, int port, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, port, 0, hapiContext.getGenericParser(), hapiContext.getLowerLayerProtocol(), tls, hapiContext.getSocketFactory(), false)); }
public Connection newClient(String host, int outboundPort, int inboundPort, boolean tls) throws HL7Exception { return getConnectionHub().attach(this, host, outboundPort, inboundPort, tls); }
/** * Uses DefaultModelClassFactory for model class lookup. */ public Parser() { this(new DefaultHapiContext()); }
/** * @since 2.1 */ public Connection attach(DefaultHapiContext hapiContext, String host, int outboundPort, int inboundPort, boolean tls) throws HL7Exception { return attach(new ConnectionData(host, outboundPort, inboundPort, hapiContext.getGenericParser(), hapiContext.getLowerLayerProtocol(), tls, hapiContext.getSocketFactory(), false)); }