Changeset 1257 for EDIS/trunk/java/tracking-server-vista/src
- Timestamp:
- Oct 2, 2011, 6:06:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkTemplate.java
r1227 r1257 4 4 import gov.va.med.vistalink.adapter.cci.VistaLinkAppProxyConnectionSpec; 5 5 import gov.va.med.vistalink.adapter.cci.VistaLinkConnection; 6 import gov.va.med.vistalink.adapter.cci.VistaLinkConnectionSpec; 6 7 import gov.va.med.vistalink.adapter.cci.VistaLinkDuzConnectionSpec; 7 8 import gov.va.med.vistalink.adapter.record.LoginsDisabledFaultException; 8 9 import gov.va.med.vistalink.adapter.record.VistaLinkFaultException; 10 import gov.va.med.vistalink.adapter.spi.VistaLinkServerInfo; 9 11 import gov.va.med.vistalink.rpc.*; 10 12 import gov.va.med.vistalink.security.m.SecurityFaultException; … … 31 33 */ 32 34 public class VistaLinkTemplate { 35 36 public static final int USER_TYPE_DUZ = 1; 37 public static final int USER_TYPE_APPLICATION_PROXY = 2; 33 38 34 39 static final int DEFAULT_TIMEOUT = 10000; … … 142 147 // return paramList; 143 148 // } 149 150 public VistaLinkServerInfo getConnectionInfo(final String division, final String user, final int userType) throws DataAccessException { 151 VistaLinkConnection conn = null; 152 ConnectionFactory connectionFactory = connectionFactoryLocator.getConnectionFactory(division); 153 try { 154 conn = (VistaLinkConnection) connectionFactory.getConnection(createConnectionSpec(division, user, userType)); 155 } catch (ResourceException e) { 156 throw new DataAccessResourceFailureException("error getting connection info", e); 157 } 158 VistaLinkServerInfo vistaLinkServerInfo = conn.getConnectionInfo(); 159 return vistaLinkServerInfo; 160 } 161 162 private VistaLinkConnectionSpec createConnectionSpec(String division, String user, int userType) { 163 switch (userType) { 164 case USER_TYPE_APPLICATION_PROXY: 165 return new VistaLinkAppProxyConnectionSpec(division, user); 166 case USER_TYPE_DUZ: 167 default: 168 return new VistaLinkDuzConnectionSpec(division, user); 169 } 170 } 144 171 }
Note:
See TracChangeset
for help on using the changeset viewer.