Commit 851531d9 authored by pchavan's avatar pchavan
parent 55fc4229
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/proteus-framework-head.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/wsdl4j.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/webitm-sun-itdecl1-2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/webitm-reports-sun1-1-0-38.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/webitm-hr1-0-0-5.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/webitm-gantt.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/webitm-barcodebeans.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/swtjasperviewer-1.2.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/saaj.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/json-simple-1.1.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/jaxrpc.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/jasperreports-6.0.0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/itext-pdfa-5.5.6.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/itextpdf-5.5.6.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase-webitm-trv1-10-2-2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-wsfa-otc2-7-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-wsfa3-0-0-7.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-wmsdashboard3-2-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-wms27-1-0-17.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-trv-gwt3-2-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-trv-desk1-6-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-taro-edi2-5-0-34-18.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-sys-utl1-1-0-2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-sys5-3-0-2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-sys5-0-20-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-sub1-1-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-stkhelp1-0-0-7.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-sscdashboard2-1-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-sfadashboard6-0-2-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-sag1-6-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-reports15-18-1-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-ptr1-1-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-mfg-rnd1-2-0-5.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-mfg-plant2-1-0-4.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-mfg-new1-1-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-mfgdashboard4-0-0-2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-mfg-adv5-7-32-12.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-mfg5-7-32-12.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-mattrf5-0-0-62.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-labplan5-1-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-itdecl-wiz5-2-0-2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-hrp2-5-3-0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-gst-head.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-fin-new2-2-5-0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-fin-advancevoucher1-0-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-fin-adv5-8-25-0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-fin5-8-25-0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-f16report-1-0-0-4.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-ess4-2-1-0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-erc2-3-2-0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-e12registration1-3-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-e12registration1-1-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-dis-port1-0-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-dis-adv5-17-14-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-dis5-17-14-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-dashboardparent1-1-0-2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-cover-plan3-2-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-calendardashboard1-0-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-applAdmin1-7-0-2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-adm-adv5-3-2-9.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-webitm-adm5-3-2-9.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-timeline1-0-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-sys6-5-5-103.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase3-organogram1-0-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/gwt-table-to-excel-0.0.5.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/doxia-converter-1.0-jar-with-dependencies.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/commons-discovery-0.2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/com.adsionline.ADSIShippingWS1-0-1-0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/bcprov-jdk14-138.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/BarcodeReport.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/barcode4j-2.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/axis-ant.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/axis.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/xsdlib.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/xmlgraphics-commons-1.3.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/XMLConnector.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/xdb.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/xalan.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/wsi-client.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/webitm-adm_SAG6-1-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/webitm4-stubs.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/tyrus-standalone-client-1.9.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/tomcat-6.0.16-jasper.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/stax-api.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/servlet-api.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/serializer-2.7.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/saxon-xml-apis.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/saxon9-dom.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/sax.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/rt.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/resolver.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/relaxngDatatype.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/poi-scratchpad-3.5-FINAL.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/poi-3.5-FINAL.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/pdf-renderer-1.0.5.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/pbase.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/mail.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/log4j.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jxl-2.6.12.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/json.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jndi-1.2.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jjwt-0.5.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jfreechart-1.0.12.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jep.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jdt-compiler-3.1.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jcr-2.0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jcommon-1.0.15.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jcodec-0.1.9.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jbossws-native-saaj.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jbossws-native-jaxws-ext.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jbossws-native-jaxws.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jbossws-native-jaxrpc.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-util.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jbosssx-3.0.0.Final.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-jdbc_ext.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-javaee.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-ejb-api_3.1_spec.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-ejb3x.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-ejb3-ext-api.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-ejb3-core-client.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-ejb3-common-client.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-common-jdbc-wrapper.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-as-varia-6.1.0.Final.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jboss-as-connector-6.1.0.final-jboss-common-jdbc-wrapper.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jaxr-impl.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jaxb-libs.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jaxb-impl.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jaxb-api.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jaxb1-impl.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/javax.websocket-api-1.0-rc5.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/jai_imageio.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/iText-2.1.0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/ibase-wrkflw-metadata.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/ibase-dw-metadata.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/ibase3-webitm-wsfa-transactions2-1-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/ibase3-webitm-savex12-1-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/ibase3-webitm-msfa4-1-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/ibase3-sessionnotification1-0-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/hibernate3.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/groovy-all-2.0.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/gcm.server.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/fop-0.9.5.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/ejb3-persistence.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/edireader-4.7.3.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/ecj-4.2.2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/easclient.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/cos.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/commons-logging-api-1.1.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/commons-logging.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/commons-io-1.3.2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/commons-fileupload-1.2.2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/commons-discovery-0.2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/commons-digester-1.7.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/commons-collections-3.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/commons-beanutils-1.8.2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/com.adsionline.ADSIShippingWS.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/cdi-api.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/bsh-2.0b4.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/batik-util-1.6-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/batik-transcoder-1.7.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/axis-ant.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/axis.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/antlr.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/lib/activation.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/xpp3.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/XMLConnector.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/webreporting-jsf.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/webreporting.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/validation-api-1.1.0.Final.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/solr-solrj-5.2.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/solr-core-5.2.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/solr1-0-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/QueryBuilder.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/pfjgraphics.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/persistence-api-1.0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/osgi-resource-locator-1.0.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/org.osgi.core-4.2.0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/logging.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/log4j.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/keycodeDecoder.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/jrcerom.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/jersey-server.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/jersey-media-jaxb.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/jersey-guava-2.22.2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/jersey-container-servlet-core.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/jersey-container-servlet.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/jersey-common.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/jersey-client.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/JDBInterface.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/jaxb-api-2.2.7.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/javax.servlet-api-3.0.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/javax.inject-2.4.0-b34.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/javax.annotation-api-1.2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/javassist-3.18.1-GA.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/jai_imageio.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/icu4j.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/ibase-crystalreport.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/ibase3-timeline1-0-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/ibase3-sessionnotification1-0-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/ibase3-organogram1-0-0-1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/hk2-utils-2.4.0-b34.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/hk2-locator-2.4.0-b34.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/hk2-api-2.4.0-b34.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/DatabaseConnectors.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/cvom.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/CrystalReportsRuntime.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/CrystalCommon2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/commons-logging.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/commons-lang-2.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/commons-io-2.4.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/commons-configuration-1.2.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/commons-collections-3.1.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/com.azalea.ufl.barcode.1.0.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/asm-debug-all-5.0.4.jar"/>
<classpathentry kind="lib" path="/home/base/wildfly-9.0.0.Final/server/default/deploy/ibase.ear/ibase.war/WEB-INF/lib/aopalliance-repackaged-2.4.0-b34.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/lib/jersey-server.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/lib/jersey-media-jaxb.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/lib/jersey-container-servlet-core.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/lib/jersey-container-servlet.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/lib/jersey-common.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/lib/jersey-client.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/validation-api-1.1.0.Final.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/persistence-api-1.0.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/osgi-resource-locator-1.0.1.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/org.osgi.core-4.2.0.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/jersey-guava-2.25.1.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/jaxb-api-2.2.7.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/javax.servlet-api-3.0.1.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/javax.inject-2.5.0-b32.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/javax.annotation-api-1.2.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/javassist-3.20.0-GA.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/hk2-utils-2.5.0-b32.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/hk2-locator-2.5.0-b32.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/hk2-api-2.5.0-b32.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/ext/aopalliance-repackaged-2.5.0-b32.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/jaxrs-ri/api/javax.ws.rs-api-2.0.1.jar"/>
<classpathentry kind="lib" path="/home/base/Chitranga/Gmail Utitly/oracle10g.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>webitm-webservice</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
eclipse.preferences.version=1
org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false
[Dolphin]
Timestamp=2017,6,23,12,18,14
Version=3
ViewMode=1
ExtAuthAppService_maxAllowedLoginAttempts = Maximum allowed login attempt exceeded. Please try after 5 minutes.
ExtAuthAppService_appNotActive = Sorry, we can't find what you are looking for.
ExtAuthAppService_authenticationSuccessful = Authentication successful.
ExtAuthAppService_employeeHasResigned = Employee has resigned !
ExtAuthAppService_accountIsLockedContactAdmin = Your account is locked ! Please, contact your administrator for further assistance.
ExtAuthAppService_passwordExpiredWouldYouLikeToChange = Your password has expired,currently you are working in grace period, it is recommended to change the password now. Please log on to sunpharmametis.com to change your password.
ExtAuthAppService_passwordExpiredChangeIt = Your password has expired, you must change the password now. Please log on to sunpharmametis.com to change your password.
ExtAuthAppService_compulsoryChangePasswordPleaseDoSo = You have to compulsorily change your password. Please log on to sunpharmametis.com to change your password.
ExtAuthAppService_pleaseEnterValidUserNameAndPassword = Please enter the valid User Name and Password.
ExtAuthAppService_pleaseLoginSunpharmaMetis = Please ensure you are able to log on to sunpharmametis.com and then try again here.
ExtAuthAppService_notAuthorized = You are not authorized to access.
ExtAuthAppService_authFail = Authentication failed.
ExtAuthAppService_httpsOnly = This option is only available with 'Https'.
<?xml version="1.0" encoding="UTF-8"?>
<project name="External Service" basedir="." default="build">
<description>External Service Compilation</description>
<property name="jboss.home" value="/home/base/BuildJars/" />
<target name="ExtService">
<jar jarfile="bin/ibase-extService-head.jar">
<fileset dir="classes">
<include name="ibase\webitm\webService\*.*" />
</fileset>
<fileset dir="classes">
<include name="ibase\webitm\webService\ejb\*.*" />
</fileset>
</jar>
<copy file="bin/ibase-extService-head.jar" todir="${jboss.home}" overwrite="true" />
</target>
<target name="build" depends="" />
</project>
\ No newline at end of file
[Dolphin]
Timestamp=2017,6,23,12,18,14
Version=3
ViewMode=1
This source diff could not be displayed because it is too large. You can view the blob instead.
package ibase.webitm.webService;
import ibase.bean.EventLogInfoBean;
import ibase.bean.ExtAuthApplicationBean;
import ibase.bean.ExtAuthRespBean;
import ibase.ejb.CommonDBAccessRemote;
import ibase.system.config.AppConnectParm;
import ibase.utility.BaseException;
import ibase.utility.CryptographyUtil;
import ibase.utility.E12GenericUtility;
import ibase.webitm.utility.ITMException;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import javax.naming.InitialContext;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.json.JSONObject;
import org.w3c.dom.Document;
/**
*
* This web service is for authenticate user andcreateExtServiceLog sending JWT token in response.
*
* @author Sandesh
*
*/
@Path("/ExtAuthAppService")
public class ExtAuthAppService
{
private E12GenericUtility genericUtility = new E12GenericUtility();
/**
* Used for authenticate user and send JWT token
*
* @param userCode
* @param password
* @param isPwdEncrypt
* @param appId
* @param request
* @return Response
* @throws BaseException
* @throws Exception
*/
@GET
@Path("/extauthapi")
@Produces(MediaType.APPLICATION_JSON)
public Response authAPIService(@QueryParam("USER_CODE") String userCode, @QueryParam("PASSWORD") String password,
@QueryParam("IS_PWD_ENCRYPT") String isPwdEncrypt, @QueryParam("APP_ID") String appId,
@Context HttpServletRequest request) throws BaseException, Exception
{
String result = "";
JSONObject resultJson = new JSONObject();
try
{
result = validateRequest(request);
if (result.equals("valid"))
{
userCode = E12GenericUtility.checkNull( userCode );
password = E12GenericUtility.checkNull( password );
appId = E12GenericUtility.checkNull( appId );
isPwdEncrypt = E12GenericUtility.checkNull(isPwdEncrypt).length() > 0
? E12GenericUtility.checkNull(isPwdEncrypt) : "true";
if ( userCode.length() > 0 && appId.length() > 0)
{
String chgIP = request.getRemoteAddr();
String remoteHostName = request.getParameter("MACHINENAME");
if( remoteHostName != null && remoteHostName.length() > 60 )
{
remoteHostName = remoteHostName.substring( 0, 60 );
}
else if ( remoteHostName == null || remoteHostName.length() == 0 )
{
remoteHostName = "";
}
ExtAuthApplicationBean applicationBean = getCommonDBAccess().getExtAuthApplicationInfo(appId);
boolean isAllowLoginAttempts = isAllowLoginAttempts(userCode);
System.out.println("ExtAuthAppService >> isAllowLoginAttempts =["+isAllowLoginAttempts+"]");
// If user exceeds the Max failed login attempt then will return error message.
if (!isAllowLoginAttempts
&& E12GenericUtility.checkNull(applicationBean.getEnableSecurity()).equalsIgnoreCase("T")
&& E12GenericUtility.checkNull(applicationBean.getActive()).equalsIgnoreCase("T"))
{
result = getMessage("ExtAuthAppService_maxAllowedLoginAttempts");
resultJson.put( "status", "error" );
}
else if (!E12GenericUtility.checkNull(applicationBean.getActive()).equalsIgnoreCase("T"))
{
result = getMessage("ExtAuthAppService_appNotActive");
resultJson.put( "status", "error" );
}
else
{
String authStatus = getAuthStatus( request, userCode, password, "", "I", isPwdEncrypt );
if ( "VALID".equalsIgnoreCase( authStatus ) )
{
// Insert into logintrace
getCommonDBAccess().insertSessionTrace( userCode, request.getSession().getId(), true, chgIP, remoteHostName);
result = getMessage("ExtAuthAppService_authenticationSuccessful");
// Create JWT token
String jwt = getJWTToken(userCode, applicationBean);
if (E12GenericUtility.checkNull(jwt).length() > 0)
{
resultJson.put("jwtToken", jwt);
}
}
else if (authStatus.equalsIgnoreCase("RESIGNED"))
{
result = getMessage("ExtAuthAppService_employeeHasResigned");
resultJson.put( "status", authStatus );
}
else if (authStatus.equalsIgnoreCase("LOCKED"))
{
result = getMessage("ExtAuthAppService_accountIsLockedContactAdmin");
resultJson.put( "status", authStatus );
}
else if(authStatus.indexOf("PASS_EXP") != -1)
{
if (authStatus.equalsIgnoreCase("PASS_EXP_GRACE"))
{
result = getMessage("ExtAuthAppService_passwordExpiredWouldYouLikeToChange");
resultJson.put( "status", authStatus );
}
else if (authStatus.equalsIgnoreCase("PASS_EXP_NOGRACE"))
{
result = getMessage("ExtAuthAppService_passwordExpiredChangeIt");
resultJson.put( "status", authStatus );
}
}
else if (authStatus.equalsIgnoreCase("FIRST_LOGIN"))
{
result = getMessage("ExtAuthAppService_compulsoryChangePasswordPleaseDoSo");
resultJson.put( "status", authStatus );
}
else if (authStatus.equalsIgnoreCase("INVALID_USR") || authStatus.equalsIgnoreCase("INVALID_PWD"))
{
// Insert into logintrace
getCommonDBAccess().insertSessionTrace( userCode, request.getSession().getId(), false, chgIP, remoteHostName);
result = getMessage("ExtAuthAppService_pleaseEnterValidUserNameAndPassword");
resultJson.put( "status", "error" );
}
else
{
result = getMessage("ExtAuthAppService_pleaseLoginSunpharmaMetis");
resultJson.put( "status", "error" );
}
}
}
else
{
resultJson.put( "status", getMessage("ExtAuthAppService_authFail") );
result = getMessage("ExtAuthAppService_notAuthorized");
}
}
resultJson.put( "results", result );
}
catch(Exception e)
{
System.out.println( "Exception in ExtAuthAppService :: authAPIService : "+ e.getMessage() );
e.printStackTrace();
throw new ITMException(e);
}
return Response.status(200).entity( resultJson.toString() ).build();
}
/**
* Get message from properties file based on key
* @param key
* @return
*/
public String getMessage(String key)
{
ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle("ibase.webitm.webService.messages");
try
{
return RESOURCE_BUNDLE.getString(key);
}
catch (MissingResourceException e) {
return '!' + key + '!';
}
}
/**
*
* This service for logout the user based on JWT token and applicationId
*
* @param jwt
* @param appId
* @param request
* @return
* @throws BaseException
* @throws Exception
*/
@GET
@Path("/extlogout")
@Produces(MediaType.APPLICATION_JSON)
public Response logoutAPIService(@QueryParam("JWT") String jwt, @QueryParam("APP_ID") String appId,
@Context HttpServletRequest request) throws BaseException, Exception
{
String result = "";
JSONObject resultJson = new JSONObject();
try
{
result = validateRequest(request);
if (result.equals("valid"))
{
ExtAuthApplicationBean applicationBean = getCommonDBAccess().getExtAuthApplicationInfo(appId);
String jwtResult = CryptographyUtil.parseBase64EncodedJWT(jwt, applicationBean.getSecretKey());
if (jwtResult.equalsIgnoreCase("expired"))
{
result = "Token has been expired";
resultJson.put( "results", result );
}
else if (jwtResult.equalsIgnoreCase("invalid"))
{
result = "Invalid Token";
resultJson.put( "results", result );
}
else
{
if (E12GenericUtility.checkNull(jwtResult).length() > 0 && jwtResult.contains("~"))
{
String tokenData[] = jwtResult.split("~");
if (E12GenericUtility.checkNull(tokenData[0]).length() > 0 && E12GenericUtility.checkNull(tokenData[1]).length() > 0)
{
// Usercode => tokenData[0], sessionId ==> tokenData[1]
result= logout( tokenData[0], tokenData[1] );
if (result.equalsIgnoreCase("User has been logged out."))
{
request.getSession().invalidate();
}
}
else
{
result = "Invalid Token";
}
resultJson.put( "results", result );
}
else
{
result = "Invalid Token";
}
}
}
resultJson.put( "results", result );
}
catch(Exception e)
{
System.out.println( "Exception in ExtAuthAppService :: logoutAPIService : "+ e.getMessage() );
e.printStackTrace();
throw new ITMException(e);
}
return Response.status(200).entity( resultJson.toString() ).build();
}
/**
* Validate Request
*
* @param request
* @return
*/
private String validateRequest( HttpServletRequest request )
{
String validStr = "valid";
try
{
if ( ! request.isSecure() )
{
validStr = getMessage("ExtAuthAppService_httpsOnly");
}
}
catch (Exception e)
{
System.out.println( "Exception in ExtAuthAppService : validateRequest : "+ e.getMessage() );
validStr = getStackTrace(e);
}
return validStr;
}
/**
* get a print stack trace
*
* @param e
* @return
*/
private String getStackTrace( Exception e )
{
String exception = "";
if ( genericUtility == null )
{
genericUtility = new E12GenericUtility();
}
exception = genericUtility.createErrorString(e);
return exception;
}
/**
* To get CommonDBAccessRemote object
*
* @return
* @throws BaseException
*/
private CommonDBAccessRemote getCommonDBAccess() throws BaseException
{
CommonDBAccessRemote ejbObj = null;
try
{
ejbObj = (CommonDBAccessRemote) getInitialContext().lookup("ibase/CommonDBAccessEJB/remote");
}
catch( BaseException be )
{
System.out.println("Exception in ExtAuthAppService: getCommonDBAccess:==>"+be);
throw be;
}
catch( Exception e )
{
System.out.println("Exception in ExtAuthAppService: getCommonDBAccess:==>"+e);
throw new BaseException( e );
}
return ejbObj;
}
/**
* It creates a object of InitialContext & returns the same.
*
* @return
* @throws ITMException
*/
private InitialContext getInitialContext() throws ITMException
{
InitialContext ctx = null;
try
{
AppConnectParm appConnect = new AppConnectParm();
ctx = new InitialContext( appConnect.getProperty() );
}
catch( ITMException itme )
{
System.out.println( "Exception in ExtAuthAppService : ITMException : getInitialContext : "+ itme.getMessage() );
throw itme;
}
catch(Exception e)
{
System.out.println( "Exception in ExtAuthAppService : getInitialContext : "+ e.getMessage() );
throw new ITMException(e);
}
return ctx;
}
/**
* Check allowed login attempts for user.
*
* @param userCode
* @return
*/
protected boolean isAllowLoginAttempts( String userCode )
{
boolean isAllowed = true;
try
{
isAllowed = getCommonDBAccess().checkLoginAttempts(userCode);
}
catch(Exception e)
{
System.out.println("Exception in ExtAuthAppService :: isAllowLoginAttempts() : "+ e.getMessage());
}
return isAllowed;
}
/**
*
* Create and get base64 encoded JWT token based on user and application information.
*
* @param userCode
* @param applicationBean
* @return
* @throws BaseException
* @throws Exception
*/
protected String getJWTToken(String userCode, ExtAuthApplicationBean applicationBean) throws BaseException, Exception
{
System.out.println("ExtAuthAppService :: getJWTToken");
// Get user details
ExtAuthRespBean userBean = getCommonDBAccess().getExtAuthRespBean(userCode);
//Create Base64 Encoded JWT token
String jwtToken = CryptographyUtil.createBase64EncodedJWT(applicationBean, userBean, "");
System.out.println("ExtAuthAppService :: getJWTToken: jwtToken : ["+ jwtToken +"]");
return jwtToken;
}
/**
* Get User Valid or not
*
* @param request
* @param userCode
* @param password
* @param siteCode
* @param authMode
* @param isSHA256Appld
* @return
* @throws Exception
* @throws BaseException
*/
private String getAuthStatus(HttpServletRequest request, String userCode, String password, String siteCode,
String authMode, String isSHA256Appld) throws Exception, BaseException
{
String authStatus = "false";
try
{
String xmlInfo = "";
if ( getCommonDBAccess() != null )
{
xmlInfo = getCommonDBAccess().authenticate(userCode, password, siteCode, authMode, isSHA256Appld);
System.out.println( "xmlInfo - ["+ xmlInfo +"]" );
authStatus = generateResponse(xmlInfo);
}
}
catch (Exception e)
{
System.out.println("Exception in ExtAuthAppService : getAuthStatus: "+ e.getMessage());
throw new BaseException(e);
}
System.out.println("isValidLogin - ["+ authStatus +"]");
return authStatus;
}
/**
* Generating server response after login
*
* @param xmlInfo
* @return
* @throws BaseException
*/
private String generateResponse( String xmlInfo )throws BaseException
{
System.out.println( "Generating Response...." );
String responseString = "";
try
{
if ( E12GenericUtility.checkNull( xmlInfo ).length() > 0 )
{
Document document = genericUtility.parseString( xmlInfo );
if (document.getElementsByTagName("STATUS_CODE").item(0) != null
&& document.getElementsByTagName("STATUS_CODE").item(0).getFirstChild() != null)
{
String statusCode = document.getElementsByTagName("STATUS_CODE").item(0).getFirstChild().getNodeValue();
responseString = statusCode;
if( statusCode.equalsIgnoreCase("VALID") )
{
if(document.getElementsByTagName( "SITE_CODE" ).item(0) != null)
{
String siteCodeValue = document.getElementsByTagName("SITE_CODE").item(0).getFirstChild().getNodeValue();
if ( siteCodeValue.equalsIgnoreCase("INVALID_SITE") )
{
responseString = "INVALID_SITE";
}
else if ( siteCodeValue.equalsIgnoreCase("INACCESSIBLE_SITE") )
{
responseString = "INACCESSIBLE_SITE";
}
}
}
}
}
}
catch( BaseException be )
{
System.out.println("Exception in ExtAuthAppService: generateResponse:==>"+be);
throw be;
}
catch( Exception e )
{
System.out.println("Exception in ExtAuthAppService: generateResponse:==>"+e);
throw new BaseException( e );
}
System.out.println( "responseString - ["+ responseString +"]" );
return responseString;
}
/**
* User Logout
*
* @param userCode
* @param sessionId
* @throws BaseException
*/
private String logout( String userCode, String sessionId ) throws BaseException
{
String result = "";
try
{
String islogout = isLogout(userCode, sessionId);
if(E12GenericUtility.checkNull(islogout).length() > 0)
{
result = "User has been already logged out.";
}
else
{
EventLogInfoBean eventInfoBean = new EventLogInfoBean( userCode );
eventInfoBean.removeSessionActivity( sessionId );
getCommonDBAccess().updateSessionTrace( userCode, sessionId );
result = "User has been logged out.";
}
}
catch (Exception e)
{
System.out.println( "Exception in ExtAuthAppService :: logout : "+ e.getMessage() );
e.printStackTrace();
}
return result;
}
/**
*
* To check user is already logged out.
*
* @param userCode
* @param sessionId
* @return
* @throws BaseException
*/
private String isLogout( String userCode, String sessionId ) throws BaseException
{
String isLogout = "";
try
{
isLogout = getCommonDBAccess().getLoginStatus(userCode, sessionId );
}
catch (Exception e)
{
System.out.println( "Exception in ExtAuthAppService :: logout : "+ e.getMessage() );
e.printStackTrace();
}
return isLogout;
}
}
/**
*
*/
package ibase.webitm.webService;
import java.io.BufferedReader;
import java.io.Console;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.URL;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.net.ssl.HttpsURLConnection;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.simple.JSONArray;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import NetComponents.SocketOutputStream;
import ibase.system.config.AppConnectParm;
import ibase.utility.BaseException;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.utility.GenericUtility;
import ibase.utility.UserInfoBean;
import ibase.webitm.utility.ITMException;
import ibase.webitm.webService.ejb.ExtServiceRemote;
import jdk.nashorn.internal.ir.BreakableNode;
import ibase.webitm.webService.ejb.GmailPluginEJBRemote;
/** provide services to gmail chrome extension plugin
* @author Samadhan pawar
*
*/
@Path("/gmailplugin")
public class GmailPluginService
{
private UserInfoBean userInfo = null;
private E12GenericUtility genericUtility = new E12GenericUtility();
String redirectUri = "";
String clientId = "";
String clientSecret = "";
/**
* Get External Service Data
*
* @return
* @throws BaseException
* @throws Exception
*/
@GET
@Path("/getemailcontext")
@Produces(MediaType.APPLICATION_JSON)
public Response getEmailContext(@QueryParam("refresh_token") String refreshToken,@QueryParam("thread_id") String threadId,@QueryParam("is_msg_id") String isMsgId,@Context HttpServletRequest request) throws BaseException, Exception
{
JSONObject responseJson = new JSONObject();
JSONObject resultJson = new JSONObject();
try
{
String result = "";
String authStatus = "";
//authStatus = getAuthStatus( request, userCode, password, "", "I", isPwdEncrypt );
authStatus = "VALID";
if ( "VALID".equalsIgnoreCase( authStatus ) )
{
System.out.println("Refresh token:"+refreshToken);
System.out.println("Thread id:"+threadId);
System.out.println("Message id:"+isMsgId);
String accessToken = getAccTknFrmRfreshTkn(refreshToken);
if(isMsgId.equalsIgnoreCase("True"))
{
threadId = getThreadId(threadId,accessToken);
System.out.println("thread id of mulitple mseesges"+threadId);
}
System.out.println("get Email json");
resultJson = getEmailJson(threadId, accessToken);
System.out.println("get Email json");
org.json.JSONArray messagesArr = (org.json.JSONArray) resultJson.get("messages");
System.out.println("Meassge length "+messagesArr.length());
for (int j = 0; j < messagesArr.length(); j++)
{
JSONObject currentMsg = (JSONObject) messagesArr.get(j);
System.out.println("currentMsg"+currentMsg);
String body = currentMsg.getString("body");
System.out.println("body "+body);
String beforeWrote;
String afterWrote;
if(body.contains("wrote"))
{
String[] abc=body.split("wrote");
beforeWrote = abc[0];
afterWrote = abc[1];
System.out.println("beforeWrote "+beforeWrote);
System.out.println("Afterroten "+afterWrote);
}else
{
beforeWrote=body;
}
if(beforeWrote.contains("E12ERPTrasnaction"))
{
String[] splited = beforeWrote.split("=");
/* System.out.println("splited (0) "+splited[0]);
System.out.println("splited (1) "+splited[1]);*/
String splitString = splited[1];
String removeQuotes = splitString.replace("\"", "").trim();
System.out.println("removeQuotes "+removeQuotes);
String[] colonSplit = removeQuotes. split("\\s+");
/* System.out.println("colonSplit[0] "+colonSplit[0]);
System.out.println("colonSplit[1] "+colonSplit[1]);
System.out.println("colonSplit[2] "+colonSplit[2]);*/
String action = colonSplit[0] ;
String objName = colonSplit[1];
String pkValues ;
String objAction;
System.out.println("action "+action);
System.out.println("objName "+objName);
if(action.equalsIgnoreCase("Add"))
{
objAction="A";
pkValues="";
}else
if(action.equalsIgnoreCase("View")){
objAction="V";
pkValues = colonSplit[2];
}else
{
objAction="E";
pkValues = colonSplit[2];
}
System.out.println("objAction "+objAction);
System.out.println("pkValues "+pkValues);
System.out.println("start of form action add sales order" );
currentMsg.put("action", action);
currentMsg.put("objName",objName);
currentMsg.put("objType","T");
currentMsg.put("objAction",objAction);
currentMsg.put("pkValues",pkValues);
currentMsg.put("actionLabel", action + " " + objName);
//System.out.println("end of form action add sales order" );
}
else
{
System.out.println("start of form action add Add to Customer" );
currentMsg.put("action", "Add");
currentMsg.put("objName","strg_customer");
currentMsg.put("objType","T");
currentMsg.put("objAction","A");
currentMsg.put("pkValues","");
currentMsg.put("actionLabel","Add to Customer");
System.out.println("end of form action add Add to Customer" );
}
}
System.out.println("reaching to successs");
responseJson.put( "status", "success" );
}
else
{
responseJson.put( "status", "error" );
}
System.out.println("returing result");
responseJson.put("result", resultJson);
}
catch (Exception e)
{
System.out.println( "Exception : GmailPluginService : "+ e.getMessage() );
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("result json in get Emailcontex "+responseJson);
return Response.status(200).entity( responseJson.toString() ).build();
}
@GET
@Path("/getContactDetail")
@Produces(MediaType.APPLICATION_JSON)
public Response getDetail(@QueryParam("refresh_token") String refreshToken,@QueryParam("email_id") String emailId,@QueryParam("name") String name,@Context HttpServletRequest request) throws BaseException, Exception
{
JSONObject responseJson = new JSONObject();
JSONObject resultJson = new JSONObject();
try
{
String result = "";
String authStatus = "";
//authStatus = getAuthStatus( request, userCode, password, "", "I", isPwdEncrypt );
authStatus = "VALID";
if ( "VALID".equalsIgnoreCase( authStatus ) )
{
String accessToken = getAccTknFrmRfreshTkn(refreshToken);
resultJson =getConatctDetail(emailId,name,accessToken);
responseJson.put( "status", "success" );
}
else
{
responseJson.put( "status", "error" );
}
responseJson.put("result", resultJson);
}
catch (Exception e)
{
System.out.println( "Exception : GmailPluginService : "+ e.getMessage() );
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("result in get contact details" +responseJson);
return Response.status(200).entity( responseJson.toString() ).build();
}
@GET
@Path("/GoogleApiReceiveAuthCode")
@Produces(MediaType.APPLICATION_JSON)
public String googleApiReceiveAuthCode(@QueryParam("code") String authCode,@Context HttpServletRequest request,@Context HttpServletResponse response) throws BaseException, Exception
{
String refreshToken = "";
String accessToken = "";
JSONObject tokenResJson = null;
String hostUrl = request.getRequestURL().toString();
try
{
System.out.println("googleApiReceiveAuthCode:authCode:"+authCode);
hostUrl = hostUrl.substring(0,hostUrl.indexOf("/gmailplugin/GoogleApiReceiveAuthCode"));
redirectUri = hostUrl+"/gmailplugin/GoogleApiReceiveAuthCode";
clientId = CommonConstants.GOOGLE_API_CLIENT_ID;
clientSecret = CommonConstants.GOOGLE_API_CLIENT_SECRET;
try
{
if(authCode != null)
{
tokenResJson = getRfrechTknFrmAthCode(authCode);
if(tokenResJson.has("refresh_token"))
{
refreshToken = tokenResJson.getString("refresh_token");
System.out.println("refresh token in google api"+refreshToken);
}
if(tokenResJson.has("access_token"))
{
accessToken = tokenResJson.getString("access_token");
}
}
} catch (JSONException e)
{
e.printStackTrace();
}
request.getSession().setAttribute("REFRESH_TOKEN", refreshToken);
request.getSession().setAttribute("ACCESS_TOKEN", accessToken);
/* PrintWriter out = response.getWriter();
out.println("<html><body>");
out.println("<script type=\"text/javascript\">");
out.println("window.close()");
out.println("</script>");
out.println("</body></html>");*/
/*response.getWriter().print("<script type='text/javascript'> " +
"window.close(); " +
"</script>");*/
//chrome-extension://efkblfijbklmfbnbchapkpllhajaobom/sidebar.html?SENDER=rakesh.naik@baseinformation.com&NAME=Rakesh%20Naik&THREADID=15c20ba0930465bc
//response.sendRedirect("chrome-extension://efkblfijbklmfbnbchapkpllhajaobom/AccessToken.html");
hostUrl = hostUrl.substring(0,hostUrl.indexOf("/ibase/rest"));
String redirectPage = hostUrl+"/ibase/GmailPlugin/jsp/GoogleAPIAccessToken.jsp?refresh_token="+refreshToken;
response.sendRedirect(redirectPage);
return "SUCCESS";
}
catch (Exception e)
{
System.out.println( "Exception : GmailPluginService : "+ e.getMessage() );
e.printStackTrace();
throw new ITMException(e);
}
}
@GET
@Path("/saveGoogleRefreshToken")
@Produces(MediaType.APPLICATION_JSON)
public String SaveGoogleRefreshTokens( @QueryParam("refresh_token")String RefreshToken, @QueryParam("email_id") String emailId ) throws BaseException, Exception
{
String returnString = "";
try
{
GmailPluginEJBRemote GmailServices = (GmailPluginEJBRemote) getInitialContext().lookup("ibase/GmailPluginEJB/remote");
String resultMap = GmailServices.SaveGoogleRefreshToken(RefreshToken, emailId);
// System.out.println(" in savegooglerefreshtokens ");
}
catch (Exception e)
{
System.out.println("Exception in savegooglerefreshtokens "+e.getMessage());
e.printStackTrace();
}
return returnString.toString();
}
@GET
@Path("/getRefreshToken")
@Produces(MediaType.APPLICATION_JSON)
public Response getGoogleRefreshTokens(@QueryParam("email_id") String emailId) throws BaseException, Exception
{
String returnString = "";
String googleRefreshToken = "";
JSONObject responseJson = new JSONObject();
try
{
GmailPluginEJBRemote GmailServices = (GmailPluginEJBRemote) getInitialContext().lookup("ibase/GmailPluginEJB/remote");
googleRefreshToken = GmailServices.getGoogleRefreshToken(emailId);
System.out.println("google refresh token in ge "+googleRefreshToken);
}
catch (Exception e)
{
System.out.println("Exception in getgooglerefreshtokens "+e.getMessage());
e.printStackTrace();
}
String accessToken = getAccTknFrmRfreshTkn(googleRefreshToken);
if(accessToken != null && accessToken.length() > 0)
{
System.out.println("in true google refresh token");
responseJson.put("googleRefreshToken", googleRefreshToken);
}
else
{
System.out.println("google refresh token error");
responseJson.put("googleRefreshToken", "");
}
return Response.status(200).entity( responseJson.toString() ).build();
//if(googleRefreshToken == null || googleRefreshToken.length() == 0)
//{
// googleRefreshToken = "NOT_FOUND";
//}
// responseJson.put("googleRefreshToken", googleRefreshToken);
//return googleRefreshToken;
// System.out.println("response json="+responseJson);
// return Response.status(200).entity( responseJson.toString() ).build();
}
public InitialContext getInitialContext() throws ITMException
{
InitialContext ctx = null;
try
{
AppConnectParm appConnect = new AppConnectParm();
ctx = new InitialContext( appConnect.getProperty() );
}
catch( ITMException itme )
{
System.out.println( "ITMException : getInitialContext : "+ itme.getMessage() );
throw itme;
}
catch(Exception e)
{
System.out.println( "Exception : getInitialContext : "+ e.getMessage() );
throw new ITMException(e);
}
return ctx;
}
public JSONObject getRfrechTknFrmAthCode(String authCode)
{
String refreshToken = "";
String accessToken = "";
JSONObject tokenResJson = null;
String url="https://www.googleapis.com/oauth2/v4/token";
try
{
String code = authCode;
String grant_type = "authorization_code";
String urlParameters = "code="+code+"&client_id="+clientId+"&client_secret="+clientSecret+"&redirect_uri="+redirectUri+"&scope=&grant_type="+grant_type+"&access_type:offline&approval_prompt=force";
String tokenRes = sendPost(url, urlParameters);
tokenResJson = new JSONObject(tokenRes);
} catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("token refresh= "+tokenResJson);
return tokenResJson;
}
public String sendPost(String url,String urlParameters) throws Exception
{
URL obj = new URL(url);
HttpsURLConnection con = (HttpsURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("User-Agent", "Mozilla/5.0");
con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
con.setDoOutput(true);
DataOutputStream wr = new DataOutputStream(con.getOutputStream());
wr.writeBytes(urlParameters);
wr.flush();
wr.close();
int responseCode = con.getResponseCode();
System.out.println("\nSending 'POST' request to URL : " + url);
System.out.println("Post parameters : " + urlParameters);
System.out.println("Response Code : " + responseCode);
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null)
{
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
return response.toString();
}
public String sendGet(String url)throws IOException
{
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent", "Mozilla/5.0");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null)
{
response.append(inputLine);
}
in.close();
System.out.println("SendGet:"+response.toString());
return response.toString();
}
public JSONObject getEmailJson(String emailThreadId,String accessToken ) throws IOException, ParseException {
String snippet="";
String from="";
String fromValue="";
String fromSplitValue="";
String to="";
String toValue="";
String cc="";
String ccValue="";
String bcc="";
String bccValue="";
String subject="";
String subjectValue="";
String[] parts;
String fromName = "";
String url = "";
JSONObject resEmailJson = null;
try {
url = "https://www.googleapis.com/gmail/v1/users/me/threads/"+emailThreadId+"?access_token="+accessToken+"";
String emailUrl = sendGet(url);
org.json.simple.JSONObject json = (org.json.simple.JSONObject)new JSONParser().parse(emailUrl);
JSONArray jsonArr = (JSONArray) json.get("messages");
org.json.JSONArray currThreadEmails = new org.json.JSONArray();
for (int i = 0; i < jsonArr.size(); i++)
{
org.json.simple.JSONObject jsonObj = (org.json.simple.JSONObject) jsonArr.get(i);
JSONObject emailData = new JSONObject();
snippet= (String) jsonObj.get("snippet");
org.json.simple.JSONObject payloadObj = (org.json.simple.JSONObject) jsonObj.get("payload");
JSONArray hh = (JSONArray) payloadObj.get("headers");
for (int j = 0; j < hh.size(); j++)
{
org.json.simple.JSONObject jsonObj1 = (org.json.simple.JSONObject) hh.get(j);
String headerName = "";
String headerValue = "";
if(jsonObj1.get("name") != null)
{
headerName = jsonObj1.get("name").toString();
}
if(jsonObj1.get("value") != null)
{
headerValue=jsonObj1.get("value").toString();
}
if(headerName.equalsIgnoreCase("From"))
{
// from=jsonObj1.get("name").toString();
fromValue=headerValue;
parts = fromValue.split("<");
fromName = parts[0];
if (fromValue.contains("<"))
{
fromValue = fromValue.substring(fromValue.indexOf("<") + 1);
fromValue = fromValue.substring(0, fromValue.indexOf(">"));
}
else
{
fromValue=fromName;
}
}
if(headerName.equalsIgnoreCase("To"))
{
//to=jsonObj1.get("name").toString();
toValue = headerValue;
}
if(headerName.equalsIgnoreCase("Cc"))
{
//cc=jsonObj1.get("name").toString();
ccValue = headerValue;
}
if(headerName.equalsIgnoreCase("Bcc"))
{
// bcc=jsonObj1.get("name").toString();
bccValue=headerValue;
}
if(headerName.equalsIgnoreCase("Subject"))
{
//subject=jsonObj1.get("name").toString();
subjectValue=headerValue;
}
}
JSONArray FirstPartsArray = (JSONArray) payloadObj.get("parts");
org.json.simple.JSONObject FirstpartObject = null;
org.json.simple.JSONObject FirstBodyObject = null;
org.json.simple.JSONObject BodyObject = null;
org.json.simple.JSONObject nextPartsObject = null;
org.json.simple.JSONObject SecondBodyObject = null;
String encodedBody="";
if(FirstPartsArray != null)
{
FirstpartObject = (org.json.simple.JSONObject) FirstPartsArray.get(0);
BodyObject = (org.json.simple.JSONObject)FirstpartObject.get("body");
System.out.println("size"+BodyObject.get("size"));
if(BodyObject.get("size").toString().equalsIgnoreCase("0"))
{
System.out.println("body has attchemnet");
/*JSONArray SecondPartsArray = (JSONArray) FirstpartObject.get("parts");
SecondPartsObject = (org.json.simple.JSONObject) SecondPartsArray.get(0);
SecondBodyObject = (org.json.simple.JSONObject)SecondPartsObject.get("body");
System.out.println("SecondBodyObject"+SecondBodyObject);
encodedBody=SecondBodyObject.get("data").toString();
System.out.println("encodedbody"+encodedBody);*/
org.json.simple.JSONObject tempPartObject = FirstpartObject;
while(true)
{
JSONArray SecondPartsArray = (JSONArray) tempPartObject.get("parts");
nextPartsObject = (org.json.simple.JSONObject) SecondPartsArray.get(0);
SecondBodyObject = (org.json.simple.JSONObject)nextPartsObject.get("body");
System.out.println("SecondBodyObject"+SecondBodyObject);
if(SecondBodyObject.get("size").toString().equalsIgnoreCase("0"))
{
tempPartObject = nextPartsObject;
continue;
}
encodedBody=SecondBodyObject.get("data").toString();
System.out.println("encodedbody"+encodedBody);
break;
}
}
else{
FirstBodyObject = (org.json.simple.JSONObject)FirstpartObject.get("body");
encodedBody=FirstBodyObject.get("data").toString();
}
}
else
{
FirstBodyObject = (org.json.simple.JSONObject)payloadObj.get("body");
encodedBody=FirstBodyObject.get("data").toString();
}
byte[] decodedBody = null;
decodedBody = Base64.getUrlDecoder().decode(encodedBody.getBytes(StandardCharsets.UTF_8));
// byte[] decodedBody = Base64.getDecoder().decode(encodedBody);
String emailBody = new String(decodedBody);
System.out.println("decoded body is : "+emailBody);
emailData.put("from_emailid",fromValue);
emailData.put("from_name", fromName);
emailData.put("to", toValue);
emailData.put("cc", ccValue);
emailData.put("bcc", bccValue);
emailData.put("subject", subjectValue);
emailData.put("body",emailBody);
currThreadEmails.put(i, emailData);
}
resEmailJson = new JSONObject();
resEmailJson.put("messages", currThreadEmails);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println(" in get email json "+resEmailJson);
return resEmailJson;
}
public JSONObject getConatctDetail(String usrEmailId,String usrName,String accessToken ) throws IOException, ParseException, BaseException, JSONException {
String url = "https://www.google.com/m8/feeds/contacts/default/full?q="+usrEmailId+"&v=3.0&access_token="+accessToken+"";
String contactsXml = sendGet(url);
System.out.println("Contact Xml:"+contactsXml);
GenericUtility utility = new GenericUtility();
Document contactDom = utility.parseString(contactsXml);
NodeList entryList = null;
Node entryNode = null;
Document entryDom = null;
JSONObject emailData = new JSONObject();
String name = usrName;
String emailId = usrEmailId;
String phoneNo = "";
String imageUrl = "";
if(contactDom != null)
{
entryList = contactDom.getElementsByTagName("entry");
System.out.println("Entry List: "+entryList);
if(entryList!=null && entryList.getLength() != 0)
{
System.out.println("Contact XML Parsing Start...............");
for( int i = 0; i < entryList.getLength(); i++ )
{
entryNode = entryList.item(i);
entryDom = utility.parseString(utility.serializeDom(entryNode));
if(entryDom != null)
{
NodeList titleNodeList = entryDom.getElementsByTagName("title");
NodeList emailIdNodeList = entryDom.getElementsByTagName("gd:email");
NodeList phoneNoNodeList = entryDom.getElementsByTagName("gd:phoneNumber");
NodeList linkNodeList = entryDom.getElementsByTagName("link");
if(titleNodeList != null)
{
if(titleNodeList.item(0) != null)
{
name = titleNodeList.item(0).getTextContent();
}
}
if(emailIdNodeList != null)
{
if(emailIdNodeList.item(0) != null)
{
if(emailIdNodeList.item(0).getAttributes() != null)
{
if(emailIdNodeList.item(0).getAttributes().getNamedItem("address") != null)
{
emailId = emailIdNodeList.item(0).getAttributes().getNamedItem("address").getNodeValue();
}
}
}
}
if(phoneNoNodeList != null)
{
if(phoneNoNodeList.item(0) != null)
{
phoneNo = phoneNoNodeList.item(0).getTextContent();
}
}
if(linkNodeList != null)
{
for(int cnt = 0; cnt < linkNodeList.getLength(); cnt++)
{
if(linkNodeList.item(cnt) != null)
{
if(linkNodeList.item(cnt).getAttributes() != null)
{
if(linkNodeList.item(cnt).getAttributes().getNamedItem("rel") != null)
{
if(linkNodeList.item(cnt).getAttributes().getNamedItem("rel").getNodeValue().contains("#photo"))
{
if(linkNodeList.item(cnt).getAttributes().getNamedItem("href") != null)
{
imageUrl = linkNodeList.item(cnt).getAttributes().getNamedItem("href").getNodeValue();
}
}
}
}
}
}
imageUrl = imageUrl+"?access_token="+accessToken+"";
System.out.println("imageUrl:"+imageUrl);
}
}
}
}
System.out.println("Contact XML Parsing End...............");
}
emailData.put("email_id",emailId);
emailData.put("name",name);
emailData.put("mobile_no",phoneNo);
emailData.put("img_url", imageUrl);
System.out.println("EmailData"+emailData);
return emailData;
}
private String getThreadId(String isMsgId, String accessToken) throws IOException, ParseException {
// isMsgId="15c29e3b668d66d5";
String thread_Id="";
//a3s aXjCH m15c5d0f75e5ca3ce
String url = "https://www.googleapis.com/gmail/v1/users/me/messages/"+isMsgId+"?access_token="+accessToken+"";
//https://www.googleapis.com/gmail/v1/users/me/messages/15ba500f0142821b
String emailUrl = sendGet(url);
//org.json.simple.JSONObject json = (JSONObject)new JSONParser().parse(contactsXml);
org.json.simple.JSONObject json = (org.json.simple.JSONObject)new JSONParser().parse(emailUrl);
thread_Id = (String) json.get("threadId");
return thread_Id;
}
public String getAccTknFrmRfreshTkn(String refreshToken) throws Exception
{
String accessToken = "";
System.out.println("refresh toktn in get acc"+refreshToken);
try
{
String grant_type = "refresh_token";
JSONObject tokenResJson = null;
String url="https://www.googleapis.com/oauth2/v4/token";
clientId = CommonConstants.GOOGLE_API_CLIENT_ID;
clientSecret = CommonConstants.GOOGLE_API_CLIENT_SECRET;
String urlParameters = "refresh_token="+refreshToken+"&client_id="+clientId+"&client_secret="+clientSecret+"&grant_type="+grant_type+"";
String tokenRes = sendPost(url, urlParameters);
tokenResJson = new JSONObject(tokenRes);
accessToken = tokenResJson.getString("access_token");
System.out.println("in try access token");
}
catch (Exception e) {
// TODO Auto-generated catch block
System.out.println("in catch access token");
return "";
//e.printStackTrace();
//throw e;
}
System.out.println("acess token"+accessToken);
return accessToken;
}
@GET
@Path("/getvalidemail")
@Produces(MediaType.APPLICATION_JSON)
public Response getValidEmail(@QueryParam("refresh_token") String refreshToken) throws BaseException, Exception
{
JSONObject responseJson = new JSONObject();
JSONObject resultJson = new JSONObject();
try
{
String result = "";
String authStatus = "";
//authStatus = getAuthStatus( request, userCode, password, "", "I", isPwdEncrypt );
System.out.println("Refresh token:"+refreshToken);
String accessToken = getAccTknFrmRfreshTkn(refreshToken);
System.out.println("accessToken in getValidEmail"+accessToken);
// JSONObject resultJson = new JSONObject();
resultJson = JsongetValidEmail( accessToken);
// org.json.JSONArray messagesArr = (org.json.JSONArray) resultJson.get("emailData");
System.out.println("resultJson in get valid email"+resultJson);
responseJson.put("email_id", resultJson);
}
catch (Exception e)
{
System.out.println( "Exception : GmailPluginService : "+ e.getMessage() );
e.printStackTrace();
throw new ITMException(e);
}
System.out.println("responseJson in getvalidemail"+responseJson);
return Response.status(200).entity( responseJson.toString() ).build();
}
public JSONObject JsongetValidEmail(String accessToken) throws IOException, ParseException, JSONException, BaseException {
String url= "https://www.googleapis.com/oauth2/v1/userinfo?access_token="+accessToken+"";
System.out.println("In JsongetValidEmail"+url);
JSONObject resultJson = new JSONObject();
String email="";
String contactsXml = sendGet(url);
org.json.simple.JSONObject json = (org.json.simple.JSONObject)new JSONParser().parse(contactsXml);
System.out.println("In JsongetValidEmail contact XML"+json);
JSONObject emailData = new JSONObject();
//JSONObject json = (JSONObject)new JSONParser().parse(contactsXml);
emailData.put("email_id",json.get("email"));
return emailData;
}
}
\ No newline at end of file
package ibase.webitm.webService.ejb;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean;
import ibase.webitm.utility.ITMException;
import java.io.ByteArrayInputStream;
import java.io.OutputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.HashMap;
import javax.ejb.Stateless;
@Stateless
public class ExtServiceEJB implements ExtServiceRemote,ExtServiceLocal
{
@Override
public HashMap<String, String> getEmployeeDetails(UserInfoBean userInfoBean)
{
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
HashMap<String, String> resultDtlMap = new HashMap<String, String>();
try
{
E12GenericUtility genericUtility = new E12GenericUtility();
String transDB = genericUtility.checkNull(userInfoBean.getTransDB());
ConnDriver connDriver = new ConnDriver();
if( transDB.length() > 0 )
{
conn = connDriver.getConnectDB( transDB );
}
else
{
conn = connDriver.getConnectDB( "DriverITM" );
}
connDriver = null;
String sql = " SELECT (E1.EMP_FNAME || ' ' || E1.EMP_MNAME || ' ' || E1.EMP_LNAME) EMP_NAME, E1.GRADE, E1.CADRE, E1.DESIGNATION, E1.REPORT_TO, " +
" (E2.EMP_FNAME || ' ' || E2.EMP_MNAME || ' ' || E2.EMP_LNAME) REPORT_TO_NAME, E1.EMAIL_ID_OFF, E1.EMP_SITE, E1.EMP_CODE__HOD, " +
" (E3.EMP_FNAME || ' ' || E3.EMP_MNAME || ' ' || E3.EMP_LNAME) HOD_NAME, E2.EMAIL_ID_OFF REPORT_TO_EMAIL, E3.EMAIL_ID_OFF HOD_EMAIL, E1.CCTR_CODE__SAL, " +
" E1.PAY_SITE, E1.WORK_SITE, E1.ALTER_CODE FROM EMPLOYEE E1 " +
" LEFT OUTER JOIN EMPLOYEE E2 ON E2.EMP_CODE = E1.REPORT_TO " +
" LEFT OUTER JOIN EMPLOYEE E3 ON E3.EMP_CODE = E1.EMP_CODE__HOD " +
" WHERE E1.EMP_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, userInfoBean.getEmpCode());
rs = pstmt.executeQuery();
ResultSetMetaData rsmd = rs.getMetaData();
int colCount = rsmd.getColumnCount();
while( rs.next() )
{
for( int colNo = 1; colNo <= colCount; colNo++ )
{
String colName = rsmd.getColumnName(colNo);
colName = colName.toUpperCase();
colName = new E12GenericUtility().initCap( colName, "_" );
String colValues = genericUtility.checkNull(rs.getString( colNo ));
resultDtlMap.put( colName, colValues );
}
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
catch (Exception e)
{
resultDtlMap = null;
e.printStackTrace();
}
finally
{
try
{
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
if( rs != null )
{
rs.close();
rs = null;
}
if( conn != null )
{
conn.close();
conn = null;
}
}
catch( Exception e )
{
System.out.println( "Exception :getEmployeeDtl " + e.getMessage() );
e.printStackTrace();
}
}
System.out.println("resultDtlJson in EJB - ["+ resultDtlMap +"]");
return resultDtlMap;
}
//Added by Prasad on 11/05/17 [for creating log of accessing web service] START
@Override
public String createExtServiceLog(String tokenId, String action, String params, String responseType, String response, String requestedTerm, String requestedUser, String hostName, String hostIP, UserInfoBean userInfo) throws ITMException
{
String returnString = "";
Connection conn = null;
PreparedStatement pstmt = null;
try
{
E12GenericUtility genericUtility = new E12GenericUtility();
System.out.println("In createExtServiceLog - \ntokenId - ["+ tokenId +"], \naction - ["+ action +"], \nparams - ["+ params +"]");
ConnDriver connDriver = new ConnDriver();
String transDB = "";
if ( userInfo != null )
{
transDB = genericUtility.checkNull( userInfo.getTransDB() );
}
if( transDB.length() > 0 )
{
conn = connDriver.getConnectDB( transDB );
}
else
{
conn = connDriver.getConnectDB( "DriverITM" );
}
conn.setAutoCommit(false);
connDriver = null;
String tranId = "";
String seqQuery = "SELECT EXT_SERVICE_LOG_SEQ.NEXTVAL FROM DUAL";
pstmt = conn.prepareStatement( seqQuery );
ResultSet rs = pstmt.executeQuery();
if( rs.next() )
{
tranId = rs.getString(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
String sql = "";
int insertCnt = 0;
if( "mysql".equalsIgnoreCase( CommonConstants.DB_NAME ) )
{
sql = "INSERT INTO EXT_SERVICE_LOG (TRAN_ID, TOKEN_ID, ACTION, PARAM, RESPONSE_TYPE, RESPONSE, REQ_ON, REQ_BY, REQ_TERM, HOST_NAME, HOST_IP) "
+ " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
byte[] paramsArray = (params != null ? params.getBytes() : null );
ByteArrayInputStream paramsByteArray = (paramsArray != null ? new ByteArrayInputStream( paramsArray ) : null );
byte[] responseArray = (response != null ? response.getBytes() : null );
ByteArrayInputStream responseByteArray = (responseArray != null ? new ByteArrayInputStream( responseArray ) : null );
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
pstmt.setString(2, tokenId);
pstmt.setString(3, action);
if(paramsByteArray != null )
{
pstmt.setBinaryStream(4, paramsByteArray, paramsByteArray.available());
}
else
{
pstmt.setBinaryStream(4, null, 0);
}
pstmt.setString(5, responseType);
if(responseByteArray != null )
{
pstmt.setBinaryStream(6, responseByteArray, responseByteArray.available());
}
else
{
pstmt.setBinaryStream(6, null, 0);
}
pstmt.setTimestamp(7, new java.sql.Timestamp(System.currentTimeMillis()));
pstmt.setString(8, requestedUser );
pstmt.setString(9, requestedTerm );
pstmt.setString(10, hostName );
pstmt.setString(11, hostIP );
insertCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
}
else
{
sql = "INSERT INTO EXT_SERVICE_LOG (TRAN_ID, TOKEN_ID, ACTION, PARAM, RESPONSE_TYPE, RESPONSE, REQ_ON, REQ_BY, REQ_TERM, HOST_NAME, HOST_IP) "
+ " VALUES (?, ?, ?, EMPTY_BLOB(), ?, EMPTY_BLOB(), ?, ?, ?, ?, ?)";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId);
pstmt.setString(2, tokenId);
pstmt.setString(3, action);
pstmt.setString(4, responseType);
pstmt.setTimestamp(5, new java.sql.Timestamp(System.currentTimeMillis()));
pstmt.setString(6, requestedUser );
pstmt.setString(7, requestedTerm );
pstmt.setString(8, hostName );
pstmt.setString(9, hostIP );
insertCnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
boolean updateFlag = false;
if ( insertCnt > 0 )
{
pstmt = conn.prepareStatement("SELECT PARAM, RESPONSE FROM EXT_SERVICE_LOG WHERE TRAN_ID = ? FOR UPDATE");
pstmt.setString( 1, tranId );
rs = pstmt.executeQuery();
if( rs.next() )
{
updateFlag = true;
Blob mapBlob = rs.getBlob(1);
OutputStream blobOutputStream = ((oracle.sql.BLOB)mapBlob).getBinaryOutputStream();
params = genericUtility.checkNull( params );
blobOutputStream.write( params.getBytes() );
blobOutputStream.close();
blobOutputStream = null;
mapBlob = null;
mapBlob = rs.getBlob(2);
blobOutputStream = ((oracle.sql.BLOB)mapBlob).getBinaryOutputStream();
response = genericUtility.checkNull( response );
blobOutputStream.write( response.getBytes() );
blobOutputStream.close();
blobOutputStream = null;
mapBlob = null;
}
pstmt.close();
pstmt = null;
rs.close();
rs = null;
}
System.out.println( "updateFlag - "+ updateFlag );
}
System.out.println("<..........ROW INSERTED.............> [" + insertCnt + "]");
if ( conn != null )
{
conn.commit();
conn.close();
conn = null;
}
returnString = "<ROOT><RESULT>Success</RESULT></ROOT>";
}
catch (SQLException e)
{
returnString = "<ROOT><RESULT>"+ e.getMessage() +"</RESULT></ROOT>";
e.printStackTrace();
throw new ITMException(e);
}
catch (Exception e)
{
returnString = "<ROOT><RESULT>"+ e.getMessage() +"</RESULT></ROOT>";
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
if( conn != null )
{
conn.close();
conn = null;
}
}
catch( Exception e )
{
System.out.println( "Exception :" + e.getMessage() );
e.printStackTrace();
}
}
System.out.println("returnString - ["+ returnString +"]");
return returnString;
}
//Added by Prasad on 11/05/17 [for creating log of accessing web service] END
}
\ No newline at end of file
package ibase.webitm.webService.ejb;
import ibase.utility.UserInfoBean;
import ibase.webitm.utility.ITMException;
import java.util.HashMap;
import javax.ejb.Local;
@Local
public interface ExtServiceLocal
{
public HashMap<String, String> getEmployeeDetails(UserInfoBean userInfoBean);
//Added by Prasad on 11/05/17 [for creating log of accessing web service]
public String createExtServiceLog( String tokenId, String action, String params, String responseType, String response, String requestedTerm, String requestedUser, String hostName, String hostIP, UserInfoBean userInfo ) throws ITMException;
}
package ibase.webitm.webService.ejb;
import ibase.utility.UserInfoBean;
import ibase.webitm.utility.ITMException;
import java.util.HashMap;
import javax.ejb.Remote;
@Remote
public interface ExtServiceRemote
{
public HashMap<String, String> getEmployeeDetails(UserInfoBean userInfoBean) throws ITMException;
//Added by Prasad on 11/05/17 [for creating log of accessing web service]
public String createExtServiceLog( String tokenId, String action, String params, String responseType, String response, String requestedTerm, String requestedUser, String hostName, String hostIP, UserInfoBean userInfo ) throws ITMException;
}
package ibase.webitm.webService.ejb;
import ibase.system.config.ConnDriver;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean;
import ibase.webitm.utility.ITMException;
import java.io.ByteArrayInputStream;
import java.io.OutputStream;
import java.sql.Blob;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.HashMap;
import javax.ejb.Stateless;
@Stateless
public class GmailPluginEJB implements GmailPluginEJBRemote,GmailPluginEJBLocal
{
@Override
public String SaveGoogleRefreshToken(String RefreshToken, String EmailId) throws ITMException
{
String returnString = "";
Connection conn = null;
PreparedStatement pstmt = null;
try
{
E12GenericUtility genericUtility = new E12GenericUtility();
System.out.println("In createExtServiceLog - \nRefreshToken - ["+ RefreshToken +"], \nEmailId - ["+ EmailId +"]");
ConnDriver connDriver = new ConnDriver();
String transDB = "";
if( transDB.length() > 0 )
{
conn = connDriver.getConnectDB( transDB );
}
else
{
conn = connDriver.getConnectDB( "DriverITM" );
}
conn.setAutoCommit(false);
connDriver = null;
pstmt = null;
String sql = "";
int insertCnt = 0;
System.out.println("refresh token"+RefreshToken);
sql = "UPDATE USERS SET GOOGLE_REFRESH_TOKEN = ? WHERE EMAIL_ID = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, RefreshToken);
pstmt.setString(2, EmailId);
insertCnt = pstmt.executeUpdate();
pstmt.close();
if(insertCnt > 0)
{
returnString = "Success";
}
conn.commit();
System.out.println("after commit");
}
catch (SQLException e)
{
e.printStackTrace();
throw new ITMException(e);
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
if( conn != null )
{
conn.close();
conn = null;
}
}
catch( Exception e )
{
System.out.println( "Exception :" + e.getMessage() );
e.printStackTrace();
}
}
return returnString;
}
public String getGoogleRefreshToken( String emailId) throws ITMException
{
System.out.println("in getGoogleRefreshToken");
// String returnString = "";
Connection conn = null;
String googleRefreshToken = "";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
E12GenericUtility genericUtility = new E12GenericUtility();
System.out.println("In createExtServiceLog - \nEmailId - ["+ emailId +"]");
ConnDriver connDriver = new ConnDriver();
String transDB = "";
if( transDB.length() > 0 )
{
conn = connDriver.getConnectDB( transDB );
}
else
{
conn = connDriver.getConnectDB( "DriverITM" );
}
conn.setAutoCommit(false);
connDriver = null;
pstmt = null;
String sql = "";
// int insertCnt = 0;
sql = "SELECT GOOGLE_REFRESH_TOKEN FROM USERS WHERE EMAIL_ID = ?";
pstmt = conn.prepareStatement(sql);
System.out.println(sql);
pstmt.setString(1, emailId);
rs = pstmt.executeQuery();
if(rs.next())
{
googleRefreshToken = rs.getString("GOOGLE_REFRESH_TOKEN");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
catch (SQLException e)
{
e.printStackTrace();
throw new ITMException(e);
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
}
finally
{
try
{
if( pstmt != null )
{
pstmt.close();
pstmt = null;
}
if( conn != null )
{
conn.close();
conn = null;
}
}
catch( Exception e )
{
System.out.println( "Exception :" + e.getMessage() );
e.printStackTrace();
}
}
// System.out.println("returnString - ["+ returnString +"]");
System.out.println("GOOGLE_REFRESH_TOKEN - ["+ googleRefreshToken +"]");
return googleRefreshToken;
}
}
\ No newline at end of file
package ibase.webitm.webService.ejb;
import ibase.utility.UserInfoBean;
import ibase.webitm.utility.ITMException;
import java.util.HashMap;
import javax.ejb.Local;
@Local
public interface GmailPluginEJBLocal
{
public String getGoogleRefreshToken(String emailId) throws ITMException;
public String SaveGoogleRefreshToken(String RefreshToken, String EmailId ) throws ITMException;
}
package ibase.webitm.webService.ejb;
import ibase.utility.UserInfoBean;
import ibase.webitm.utility.ITMException;
import java.util.HashMap;
import javax.ejb.Remote;
@Remote
public interface GmailPluginEJBRemote
{
public String getGoogleRefreshToken(String emailId) throws ITMException;
public String SaveGoogleRefreshToken( String RefreshToken, String EmailId ) throws ITMException;
}
ExtAuthAppService_maxAllowedLoginAttempts = Maximum allowed login attempt exceeded. Please try after 5 minutes.
ExtAuthAppService_appNotActive = Sorry, we can't find what you are looking for.
ExtAuthAppService_authenticationSuccessful = Authentication successful.
ExtAuthAppService_employeeHasResigned = Employee has resigned !
ExtAuthAppService_accountIsLockedContactAdmin = Your account is locked ! Please, contact your administrator for further assistance.
ExtAuthAppService_passwordExpiredWouldYouLikeToChange = Your password has expired,currently you are working in grace period, it is recommended to change the password now. Please log on to sunpharmametis.com to change your password.
ExtAuthAppService_passwordExpiredChangeIt = Your password has expired, you must change the password now. Please log on to sunpharmametis.com to change your password.
ExtAuthAppService_compulsoryChangePasswordPleaseDoSo = You have to compulsorily change your password. Please log on to sunpharmametis.com to change your password.
ExtAuthAppService_pleaseEnterValidUserNameAndPassword = Please enter the valid User Name and Password.
ExtAuthAppService_pleaseLoginSunpharmaMetis = Please ensure you are able to log on to sunpharmametis.com and then try again here.
ExtAuthAppService_notAuthorized = You are not authorized to access.
ExtAuthAppService_authFail = Authentication failed.
ExtAuthAppService_httpsOnly = This option is only available with 'Https'.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment