bugged
stringlengths 6
599k
| fixed
stringlengths 10
599k
| __index_level_0__
int64 0
1.13M
|
|---|---|---|
public ATObject meta_invoke(ATObject receiver, ATSymbol atSelector, ATTable arguments) throws InterpreterException { String jSelector = Reflection.upMetaLevelSelector(atSelector); try { return NATMirrorFactory._INSTANCE_.createMirror( Reflection.downObject( Reflection.upInvocation( principal_, // implementor and self jSelector, arguments))); } catch (XSelectorNotFound e) { // Principal does not have a corresponding meta_level method // try for a base_level method of the mirror itself. return super.meta_invoke(receiver, atSelector, arguments); } }
|
public ATObject meta_invoke(ATObject receiver, ATSymbol atSelector, ATTable arguments) throws InterpreterException { String jSelector = Reflection.upMetaLevelSelector(atSelector); try { return atValue( Reflection.downObject( Reflection.upInvocation( principal_, // implementor and self jSelector, arguments))); } catch (XSelectorNotFound e) { // Principal does not have a corresponding meta_level method // try for a base_level method of the mirror itself. return super.meta_invoke(receiver, atSelector, arguments); } }
| 1,117,876
|
public ATObject meta_newInstance(ATTable init) throws XArityMismatch, XTypeMismatch { ATObject[] initargs = init.asNativeTable().elements_; if(initargs.length != 1) { ATObject reflectee = initargs[0]; return NATMirrorFactory._INSTANCE_.base_createMirror(reflectee); } else { throw new XArityMismatch("init", 1, initargs.length); } }
|
public ATObject meta_newInstance(ATTable init) throws XArityMismatch, XTypeMismatch { ATObject[] initargs = init.asNativeTable().elements_; if(initargs.length != 1) { ATObject reflectee = initargs[0]; return atValue(reflectee); } else { throw new XArityMismatch("init", 1, initargs.length); } }
| 1,117,877
|
public ATObject meta_resolve() throws InterpreterException { return NATMirrorFactory._INSTANCE_.base_createMirror(principal_); }
|
public ATObject meta_resolve() throws InterpreterException { return NATMirrorFactory._INSTANCE_.base_createMirror(principal_); }
| 1,117,878
|
public ATObject meta_select(ATObject receiver, ATSymbol atSelector) throws InterpreterException { String jSelector = null; try { jSelector = Reflection.upMetaFieldAccessSelector(atSelector); return NATMirrorFactory._INSTANCE_.createMirror( Reflection.downObject(Reflection.upFieldSelection(principal_, jSelector))); } catch (XSelectorNotFound e) { try { jSelector = Reflection.upMetaLevelSelector(atSelector); return NATMirrorFactory._INSTANCE_.createMirror( Reflection.downObject( Reflection.upMethodSelection( principal_, jSelector, atSelector))); } catch (XSelectorNotFound e2) { // Principal does not have a corresponding meta_level field nor // method try for a base_level field or method of the mirror itself. return super.meta_select(receiver, atSelector); } } }
|
public ATObject meta_select(ATObject receiver, ATSymbol atSelector) throws InterpreterException { String jSelector = null; try { jSelector = Reflection.upMetaFieldAccessSelector(atSelector); return atValue( Reflection.downObject(Reflection.upFieldSelection(principal_, jSelector))); } catch (XSelectorNotFound e) { try { jSelector = Reflection.upMetaLevelSelector(atSelector); return atValue( Reflection.downObject( Reflection.upMethodSelection( principal_, jSelector, atSelector))); } catch (XSelectorNotFound e2) { // Principal does not have a corresponding meta_level field nor // method try for a base_level field or method of the mirror itself. return super.meta_select(receiver, atSelector); } } }
| 1,117,879
|
public ATObject meta_clone() throws NATException { return NATNil._INSTANCE_; }
|
public ATObject meta_clone() throws NATException { return NATMirror._PROTOTYPE_; }
| 1,117,880
|
public static Object invokeJavaMethod ( Class jClass, Object jReceiver, String jSelector, Object[] jArguments) throws NATException { try { Method[] applicable = getMethodsForSelector(jClass, jSelector); switch(applicable.length) { case 0: throw new XSelectorNotFound(AGSymbol.alloc(jSelector), (ATObject)jReceiver); case 1: // TODO: will have to convert some NATObjects to proper ATXXX argument interfaces using mirages! return applicable[0].invoke(jReceiver, jArguments); default: throw new XIllegalOperation("Dynamic dispatching on overloaded methods not yet implemented"); } } catch (Exception e) { //TODO: you're catching your own XIllegalOperation here... // Exceptions during method invocation imply that the requested method was // not found in the interface. Hence a XTypeMismatch is thrown to signal // that the object could not respond to the request. // e.printStackTrace(); throw new XTypeMismatch( "Could not invoke method with selector " + jSelector.toString() + " on the given object.", e, (ATObject)jReceiver); } }
|
public static Object invokeJavaMethod ( Class jClass, Object jReceiver, String jSelector, Object[] jArguments) throws NATException { try { Method[] applicable = getMethodsForSelector(jClass, jSelector); switch(applicable.length) { case 0: throw new XSelectorNotFound(AGSymbol.alloc(jSelector), (ATObject)jReceiver); case 1: // TODO: will have to convert some NATObjects to proper ATXXX argument interfaces using mirages! return applicable[0].invoke(jReceiver, jArguments); default: throw new XIllegalOperation("Dynamic dispatching on overloaded methods not yet implemented"); } } catch (NATException nate) { throw nate; } catch (InvocationTargetException ite) { if(ite.getCause() instanceof AssertionFailedError) { throw (AssertionFailedError)ite.getCause(); } else { throw new XTypeMismatch( "Could not invoke method with selector " + jSelector.toString() + " on the given object.", ite, (ATObject)jReceiver); } } catch (Exception e) { //TODO: you're catching your own XIllegalOperation here... // Exceptions during method invocation imply that the requested method was // not found in the interface. Hence a XTypeMismatch is thrown to signal // that the object could not respond to the request. // e.printStackTrace(); throw new XTypeMismatch( "Could not invoke method with selector " + jSelector.toString() + " on the given object.", e, (ATObject)jReceiver); } }
| 1,117,881
|
public void addMethods(WebdavNsIntf nsIntf) throws WebdavException{ HashMap methods = nsIntf.getMethods(); super.addMethods(nsIntf); // Replace methods methods.put("MKCALENDAR", new CDMkcolMethod()); methods.put("REPORT", new ReportMethod()); }
|
public void addMethods(WebdavNsIntf nsIntf) throws WebdavException{ HashMap methods = nsIntf.getMethods(); super.addMethods(nsIntf); // Replace methods methods.put("MKCALENDAR", new MkcalendarMethod()); methods.put("REPORT", new ReportMethod()); }
| 1,117,882
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } CalSvcI svci = form.getCalSvcI(); /** User requested a category from the list. Retrieve it, embed it in * the form so we can display the page */ int id = form.getCategoryId(); BwCategory category = svci.getCategory(id); if (debug) { if (category == null) { logIt("No category with id " + id); } else { logIt("Retrieved category " + category.getId()); } } form.setCategory(category); if (category == null) { form.getErr().emit("org.bedework.pubevents.error.nosuchcategory", id); return "notFound"; } return "continue"; }
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { /** Check access */ if (!form.getAuthorisedUser()) { return "noAccess"; } CalSvcI svci = form.getCalSvcI(); /** User requested a category from the list. Retrieve it, embed it in * the form so we can display the page */ int id = form.getCategoryId(); BwCategory category = svci.getCategory(id); if (debug) { if (category == null) { logIt("No category with id " + id); } else { logIt("Retrieved category " + category.getId()); } } form.setCategory(category); if (category == null) { form.getErr().emit("org.bedework.client.error.nosuchcategory", id); return "notFound"; } return "continue"; }
| 1,117,883
|
protected static void scaleYvalues(int[][] comp, LocalSeismogram seismogram, MicroSecondTimeRange tr, UnitRangeImpl ampRange, Dimension size) { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); for( int i =0 ; i < comp[1].length; i++) { comp[1][i] = Math.round((float)(linearInterp(yMin, 0, yMax, size.height, comp[1][i]))); } flipArray(comp[1], size.height); }
|
protected static void scaleYvalues(int[][] comp, LocalSeismogram seismogram, MicroSecondTimeRange tr, UnitRangeImpl ampRange, Dimension size) { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); for( int i =0 ; i < comp[1].length; i++) { comp[1][i] = Math.round((float)(linearInterp(yMin, 0, yMax, size.height, comp[1][i]))); } }
| 1,117,884
|
public List getDataCenter(NetworkAccess net) { return getDataCenter(net.get_attributes().get_id()); }
|
public List getDataCenter(NetworkAccess net) { return getDataCenter(net.get_attributes().get_code()); }
| 1,117,885
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { CalSvcI svci = form.fetchSvci(); boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } form.assignAddingEvent(false); /** User requested an event from the list. Retrieve it, embed it in * the form so we can display the page */ int id = form.getEventId(); if (id <= 0) { return "notFound"; } EventInfo einf = svci.getEvent(id); if (debug) { if (einf == null) { log.debug("No event with id " + id); } else { log.debug("Retrieved event " + einf.getEvent().getId()); log.debug(" start=" + einf.getEvent().getDtstart()); } } /** ************************************ We should ensure the alert status is correct ********************************* */ form.setEventInfo(einf); if (einf == null) { form.getErr().emit("org.bedework.client.error.nosuchevent", id); return "notFound"; } return "continue"; }
|
public String doAction(HttpServletRequest request, BwSession sess, PEActionForm form) throws Throwable { CalSvcI svci = form.fetchSvci(); boolean alerts = form.getAlertEvent(); /** Check access and set request parameters */ if (alerts) { if (!form.getUserAuth().isAlertUser()) { return "noAccess"; } } else { if (!form.getAuthorisedUser()) { return "noAccess"; } } form.assignAddingEvent(false); /** User requested an event from the list. Retrieve it, embed it in * the form so we can display the page */ int id = this.getIntReqPar(request, "eventId", -1); if (id <= 0) { return "notFound"; } EventInfo einf = svci.getEvent(id); if (debug) { if (einf == null) { log.debug("No event with id " + id); } else { log.debug("Retrieved event " + einf.getEvent().getId()); log.debug(" start=" + einf.getEvent().getDtstart()); } } /** ************************************ We should ensure the alert status is correct ********************************* */ form.setEventInfo(einf); if (einf == null) { form.getErr().emit("org.bedework.client.error.nosuchevent", id); return "notFound"; } return "continue"; }
| 1,117,887
|
public Locale calculateLocale(FacesContext arg0) { return getParentViewHandler().calculateLocale(arg0); }
|
public Locale calculateLocale(FacesContext arg0) { IWContext iwc = IWContext.getIWContext(arg0); return iwc.getCurrentLocale(); }
| 1,117,889
|
public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; }
|
public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new RuntimeException("CbpViewHandler: Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; }
| 1,117,890
|
public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; }
|
public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new RuntimeException("CbpViewHandler: Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; }
| 1,117,891
|
public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; }
|
public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new RuntimeException("CbpViewHandler: An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; }
| 1,117,892
|
public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new SmileException("Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; }
|
public UIViewRoot createView(FacesContext ctx, String viewId) { UIViewRoot ret = new UIViewRoot(); ret.setViewId(viewId); // TODO : Hack to allow unit tests to select empty views if(viewId.startsWith("unittesttree.")) { return ret; } try { Class descriptorClazz = getDescriptorClassNameForViewId(viewId); if(descriptorClazz == null) { // JSP page.... } else { if(Page.class.isAssignableFrom(descriptorClazz)) { Page page = (Page) descriptorClazz.newInstance(); page.init(ctx,ret); } else { throw new SmileException("Descriptor Class for '" + viewId + "' must implement net.sourceforge.smile.context.Page !"); } } } catch(IllegalAccessException e) { throw new SmileException("Please make sure that the default constructor for descriptor class of <" + viewId + "> is public.",e); } catch(InstantiationException e) { throw new SmileException("An exception was generated by the default constructor of the descriptor class of <" + viewId + ">.",e); } catch(Throwable t) { throw new RuntimeException("CbpViewHandler: Descriptor Class for '" + viewId + "' threw an exception during initialize() !",t); } //set the locale ret.setLocale(calculateLocale(ctx)); //set the view on the session ctx.getExternalContext().getSessionMap().put(net.sourceforge.smile.application.CbpStateManagerImpl.SESSION_KEY_CURRENT_VIEW,ret); return ret; }
| 1,117,893
|
public void renderView(FacesContext ctx, UIViewRoot viewRoot) throws IOException, FacesException { // Apparently not all versions of tomcat have the same // default content-type. // So we'll set it explicitly. HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse(); response.setContentType("text/html"); // make sure to set the responsewriter initializeResponseWriter(ctx); if(viewRoot == null) { throw new SmileRuntimeException("No component tree is available !"); } String renderkitId = viewRoot.getRenderKitId(); if (renderkitId == null) { renderkitId = calculateRenderKitId(ctx); } viewRoot.setRenderKitId(renderkitId); ResponseWriter out = ctx.getResponseWriter(); try { out.startDocument(); renderComponent(ctx.getViewRoot(),ctx); out.endDocument(); ctx.getResponseWriter().flush(); } catch (RuntimeException e) { throw new SmileRuntimeException(e.getMessage(),e); } }
|
public void renderView(FacesContext ctx, UIViewRoot viewRoot) throws IOException, FacesException { // Apparently not all versions of tomcat have the same // default content-type. // So we'll set it explicitly. HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse(); response.setContentType("text/html"); // make sure to set the responsewriter initializeResponseWriter(ctx); if(viewRoot == null) { throw new RuntimeException("CbpViewHandler: No component tree is available !"); } String renderkitId = viewRoot.getRenderKitId(); if (renderkitId == null) { renderkitId = calculateRenderKitId(ctx); } viewRoot.setRenderKitId(renderkitId); ResponseWriter out = ctx.getResponseWriter(); try { out.startDocument(); renderComponent(ctx.getViewRoot(),ctx); out.endDocument(); ctx.getResponseWriter().flush(); } catch (RuntimeException e) { throw new SmileRuntimeException(e.getMessage(),e); } }
| 1,117,894
|
public void renderView(FacesContext ctx, UIViewRoot viewRoot) throws IOException, FacesException { // Apparently not all versions of tomcat have the same // default content-type. // So we'll set it explicitly. HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse(); response.setContentType("text/html"); // make sure to set the responsewriter initializeResponseWriter(ctx); if(viewRoot == null) { throw new SmileRuntimeException("No component tree is available !"); } String renderkitId = viewRoot.getRenderKitId(); if (renderkitId == null) { renderkitId = calculateRenderKitId(ctx); } viewRoot.setRenderKitId(renderkitId); ResponseWriter out = ctx.getResponseWriter(); try { out.startDocument(); renderComponent(ctx.getViewRoot(),ctx); out.endDocument(); ctx.getResponseWriter().flush(); } catch (RuntimeException e) { throw new SmileRuntimeException(e.getMessage(),e); } }
|
public void renderView(FacesContext ctx, UIViewRoot viewRoot) throws IOException, FacesException { // Apparently not all versions of tomcat have the same // default content-type. // So we'll set it explicitly. HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse(); response.setContentType("text/html"); // make sure to set the responsewriter initializeResponseWriter(ctx); if(viewRoot == null) { throw new SmileRuntimeException("No component tree is available !"); } String renderkitId = viewRoot.getRenderKitId(); if (renderkitId == null) { renderkitId = calculateRenderKitId(ctx); } viewRoot.setRenderKitId(renderkitId); ResponseWriter out = ctx.getResponseWriter(); out.startDocument(); renderComponent(ctx.getViewRoot(),ctx); out.endDocument(); ctx.getResponseWriter().flush(); } catch (RuntimeException e) { throw new SmileRuntimeException(e.getMessage(),e); } }
| 1,117,895
|
public void renderView(FacesContext ctx, UIViewRoot viewRoot) throws IOException, FacesException { // Apparently not all versions of tomcat have the same // default content-type. // So we'll set it explicitly. HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse(); response.setContentType("text/html"); // make sure to set the responsewriter initializeResponseWriter(ctx); if(viewRoot == null) { throw new SmileRuntimeException("No component tree is available !"); } String renderkitId = viewRoot.getRenderKitId(); if (renderkitId == null) { renderkitId = calculateRenderKitId(ctx); } viewRoot.setRenderKitId(renderkitId); ResponseWriter out = ctx.getResponseWriter(); try { out.startDocument(); renderComponent(ctx.getViewRoot(),ctx); out.endDocument(); ctx.getResponseWriter().flush(); } catch (RuntimeException e) { throw new SmileRuntimeException(e.getMessage(),e); } }
|
public void renderView(FacesContext ctx, UIViewRoot viewRoot) throws IOException, FacesException { // Apparently not all versions of tomcat have the same // default content-type. // So we'll set it explicitly. HttpServletResponse response = (HttpServletResponse) ctx.getExternalContext().getResponse(); response.setContentType("text/html"); // make sure to set the responsewriter initializeResponseWriter(ctx); if(viewRoot == null) { throw new SmileRuntimeException("No component tree is available !"); } String renderkitId = viewRoot.getRenderKitId(); if (renderkitId == null) { renderkitId = calculateRenderKitId(ctx); } viewRoot.setRenderKitId(renderkitId); ResponseWriter out = ctx.getResponseWriter(); try { out.startDocument(); renderComponent(ctx.getViewRoot(),ctx); out.endDocument(); ctx.getResponseWriter().flush(); } catch (RuntimeException e) { throw new SmileRuntimeException(e.getMessage(),e); } }
| 1,117,896
|
public void commit() throws CalFacadeException { if (exc != null) { // Didn't hear me last time? throw new CalFacadeException(exc); } try { if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) { tx.commit(); } tx = null; } catch (Throwable t) { exc = t; throw new CalFacadeException(t); } }
|
public void commit() throws CalFacadeException { if (exc != null) { // Didn't hear me last time? throw new CalFacadeException(exc); } try { if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) { tx.commit(); } tx = null; } catch (Throwable t) { exc = t; throw new CalFacadeException(t); } }
| 1,117,898
|
public void commit() throws CalFacadeException { if (exc != null) { // Didn't hear me last time? throw new CalFacadeException(exc); } try { if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) { tx.commit(); } tx = null; } catch (Throwable t) { exc = t; throw new CalFacadeException(t); } }
|
public void commit() throws CalFacadeException { if (exc != null) { // Didn't hear me last time? throw new CalFacadeException(exc); try { if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) { tx.commit(); tx = null; catch (Throwable t) { exc = t; throw new CalFacadeException(t);
| 1,117,899
|
private void handleException(Throwable t) throws CalFacadeException { try { Logger log = getLogger(); if (log.isDebugEnabled()) { log.debug("handleException called"); log.error(this, t); } } catch (Throwable dummy) {} try { if (tx != null) { try { tx.rollback(); } catch (Throwable t1) { rollbackException(t1); } tx = null; } } finally { try { sess.close(); } catch (Throwable t2) {} sess = null; } exc = t; throw new CalFacadeException(t); }
|
private void handleException(Throwable t) throws CalFacadeException { try { Logger log = getLogger(); if (log.isDebugEnabled()) { log.debug("handleException called"); log.error(this, t); } } catch (Throwable dummy) {} try { if (tx != null) { try { tx.rollback(); } catch (Throwable t1) { rollbackException(t1); } tx = null; } } finally { try { sess.close(); } catch (Throwable t2) {} sess = null; } exc = t; throw new CalFacadeException(t); }
| 1,117,901
|
public void rollback() throws CalFacadeException {/* if (exc != null) { // Didn't hear me last time? throw new CalFacadeException(exc); }*/ Logger log = getLogger(); if (log.isDebugEnabled()) { log.debug("Enter rollback"); } try { if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) { if (log.isDebugEnabled()) { log.debug("About to rollback"); } tx.rollback(); } tx = null; } catch (Throwable t) { exc = t; throw new CalFacadeException(t); } }
|
public void rollback() throws CalFacadeException {/* if (exc != null) { // Didn't hear me last time? throw new CalFacadeException(exc); }*/ Logger log = getLogger(); if (log.isDebugEnabled()) { log.debug("Enter rollback"); } try { if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) { if (log.isDebugEnabled()) { log.debug("About to rollback"); } tx.rollback(); } tx = null; } catch (Throwable t) { exc = t; throw new CalFacadeException(t); } }
| 1,117,902
|
public void rollback() throws CalFacadeException {/* if (exc != null) { // Didn't hear me last time? throw new CalFacadeException(exc); }*/ Logger log = getLogger(); if (log.isDebugEnabled()) { log.debug("Enter rollback"); } try { if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) { if (log.isDebugEnabled()) { log.debug("About to rollback"); } tx.rollback(); } tx = null; } catch (Throwable t) { exc = t; throw new CalFacadeException(t); } }
|
public void rollback() throws CalFacadeException {/* if (exc != null) { // Didn't hear me last time? throw new CalFacadeException(exc); }*/ Logger log = getLogger(); if (log.isDebugEnabled()) { log.debug("Enter rollback"); } try { if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) { if (log.isDebugEnabled()) { log.debug("About to rollback"); } tx.rollback(); } tx = null; } catch (Throwable t) { exc = t; throw new CalFacadeException(t); } }
| 1,117,903
|
private void rollbackException(Throwable t) { Logger log = getLogger(); if (log.isDebugEnabled()) { log.debug("HibSession: ", t); } log.error(this, t); }
|
private void rollbackException(Throwable t) { Logger log = getLogger(); if (log.isDebugEnabled()) { log.debug("HibSession: ", t); } log.error(this, t); }
| 1,117,904
|
private void rollbackException(Throwable t) { Logger log = getLogger(); if (log.isDebugEnabled()) { log.debug("HibSession: ", t); } log.error(this, t); }
|
private void rollbackException(Throwable t) { Logger log = getLogger(); if (log.isDebugEnabled()) { log.debug("HibSession: ", t); } getLogger().error(this, t); }
| 1,117,905
|
public void changeAccess(Object o, Collection aces) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); }
|
public void changeAccess(BwShareableDbentity ent, Collection aces) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); }
| 1,117,906
|
public Collection getAces(Object o) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); }
|
public Collection getAces(BwShareableDbentity ent) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); }
| 1,117,907
|
public void setData(HashMap newData){ Iterator e = newData.keySet().iterator(); while(e.hasNext()){ DataSetSeismogram curr = ((DataSetSeismogram)e.next()); this.addSeismogram(curr, ((MicroSecondDate)newData.get(curr))); } updateTimeSyncListeners(); }
|
public void setData(HashMap newData){ Iterator e = newData.keySet().iterator(); while(e.hasNext()){ DataSetSeismogram curr = ((DataSetSeismogram)e.next()); this.addSeismogram(curr); } updateTimeSyncListeners(); }
| 1,117,910
|
public void setData(HashMap newData){ Iterator e = newData.keySet().iterator(); while(e.hasNext()){ DataSetSeismogram curr = ((DataSetSeismogram)e.next()); this.addSeismogram(curr, ((MicroSecondDate)newData.get(curr))); } updateTimeSyncListeners(); }
|
public void setData(HashMap newData){ Iterator e = newData.keySet().iterator(); while(e.hasNext()){ DataSetSeismogram curr = ((DataSetSeismogram)e.next()); this.addSeismogram(curr, ((MicroSecondDate)newData.get(curr))); } }
| 1,117,911
|
public FissuresNamingService(org.omg.CORBA_2_3.ORB orb) { this.orb = orb; }
|
public FissuresNamingService(org.omg.CORBA_2_3.ORB orb) { this.orb = orb; }
| 1,117,914
|
public TPosClient(IWApplicationContext iwc) throws Exception { init(iwc); }
|
public TPosClient(IWApplicationContext iwc, CreditCardMerchant merchant) throws Exception { this._merchant = merchant; init(iwc); }
| 1,117,916
|
public String creditcardAuthorization(String nameOnCard, String cardnumber, String monthExpires, String yearExpires, String ccVerifyNumber, double amount, String currency, String referenceNumber) throws CreditCardAuthorizationException{ throw new CreditCardAuthorizationException("Unsupported"); }
|
public String creditcardAuthorization(String nameOnCard, String cardnumber, String monthExpires, String yearExpires, String ccVerifyNumber, double amount, String currency, String referenceNumber) throws CreditCardAuthorizationException{ return (doAuth(cardnumber, monthExpires, yearExpires, amount, currency, "5", null, referenceNumber)); }
| 1,117,917
|
private String doAuth(String cardnumber, String monthExpires, String yearExpires, double amount, String currency, String transactionType, Object parentDataPK) throws TPosException { if(_client != null) { _client.setProperty(TPOS3Client.PN_USERID, _userId); _client.setProperty(TPOS3Client.PN_PASSWORD, _passwd); _client.setProperty(TPOS3Client.PN_MERCHANTID, _merchantId); _client.setProperty(TPOS3Client.PN_LOCATIONID, _locationId); _client.setProperty(TPOS3Client.PN_POSID, _posId); _client.setProperty(TPOS3Client.PN_PAN, cardnumber); _client.setProperty(TPOS3Client.PN_EXPIRE, monthExpires + yearExpires); //_client.setProperty(TPOS3Client.PN_EXPIRE, yearExpires + monthExpires); amount *= amountMultiplier; String stringAmount = Integer.toString((int)amount); _client.setProperty(TPOS3Client.PN_AMOUNT, stringAmount); _client.setProperty(TPOS3Client.PN_CURRENCY, currency); _client.setProperty(TPOS3Client.PN_TRANSACTIONTYPE, transactionType); if (transactionType.equals("2")) { _client.setProperty(TPOS3Client.PN_CARDHOLDERCODE, "2"); } boolean valid = _client.sendAuthorisationReq(); boolean inserted = false; TPosAuthorisationEntriesBean entry; try { entry = TPosAuthorisationEntriesHome.getInstance().getNewElement(); // entry.setAttachmentCount(_client.getProperty(TPOS3Client.pn)); entry.setAuthorisationAmount(_client.getProperty(TPOS3Client.PN_AUTHORAMOUNT)); entry.setAuthorisationCode(_client.getProperty(TPOS3Client.PN_AUTHORISATIONCODE)); entry.setAuthorisationCurrency(_client.getProperty(TPOS3Client.PN_AUTHORCURRENCY)); entry.setAuthorisationIdRsp(_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); entry.setAuthorisationPathReasonCode(_client.getProperty(TPOS3Client.PN_AUTHPATHREASONCODE)); entry.setBatchNumber(_client.getProperty(TPOS3Client.PN_BATCHNUMBER)); entry.setBrandId(_client.getProperty(TPOS3Client.PN_CARDBRANDID)); entry.setBrandName(_client.getProperty(TPOS3Client.PN_CARDBRANDNAME)); entry.setCardCharacteristics(_client.getProperty(TPOS3Client.PN_CARDCHARACTER)); entry.setCardExpires(_client.getProperty(TPOS3Client.PN_EXPIRE)); entry.setCardName(_client.getProperty(TPOS3Client.PN_CARDTYPENAME)); entry.setCardType(_client.getProperty(TPOS3Client.PN_CARDTYPEID)); entry.setDetailExpected(_client.getProperty(TPOS3Client.PN_DETAILEXPECTED)); entry.setEntryDate(_client.getProperty(TPOS3Client.PN_DATE)); entry.setEntryTime(_client.getProperty(TPOS3Client.PN_TIME)); entry.setErrorNo(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); entry.setErrorText(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); entry.setLocationNr(_client.getProperty(TPOS3Client.PN_LOCATIONNUMBER)); entry.setMerchantNrAuthorisation(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERAUTHOR)); entry.setMerchantNrOtherServices(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBEROTHERSERVICES)); entry.setMerchantNrSubmission(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERSUBMISSION)); // entry.setPan("***********"); entry.setPosNr(_client.getProperty(TPOS3Client.PN_POSNUMBER)); entry.setPosSerialNr(_client.getProperty(TPOS3Client.PN_POSSERIAL)); // entry.setPrintData(_client.getProperty(TPOS3Client.pn_p)); entry.setSubmissionAmount(_client.getProperty(TPOS3Client.PN_SUBMISSIONAMOUNT)); entry.setSubmissionCurrency(_client.getProperty(TPOS3Client.PN_SUBMISSIONCURRENCY)); entry.setTotalResponseCode(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE)); entry.setTransactionNr(_client.getProperty(TPOS3Client.PN_TRANSACTIONNUMBER)); entry.setVoidedAuthorisationIdResponse(_client.getProperty(TPOS3Client.PN_VOIDEDAUTHIDRSP)); entry.setVoidedTransactionNr(_client.getProperty(TPOS3Client.PN_VOIDEDTRANSNUMBER)); // entry.setXMLAttachment(_client.getProperty(TPOS3Client.)); entry.setCardNumber(CreditCardBusinessBean.encodeCreditCardNumber(cardnumber)); if (parentDataPK != null) { try { entry.setParentID(((Integer) parentDataPK).intValue()); } catch (Exception e) { System.out.println("TPosClient : could not set parentID : "+parentDataPK); } } inserted = TPosAuthorisationEntriesHome.getInstance().insert(entry); } catch (Exception e) { e.printStackTrace(); } if (!inserted) { System.err.println("Unable to save entry to database"); } if (!valid) { TPosException e = new TPosException("Error in authorisation"); e.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); e.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); e.setDisplayError("Error in authorisation (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw e; } TPosException tposEx = null; switch (Integer.parseInt(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE), 10)) { case 0: return (_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); case 1: tposEx = new TPosException("Authorisation denied"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 2: tposEx = new TPosException("Authorisation denied, pick up card"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 3: tposEx = new TPosException("Authorisation denied, call for manual authorisation"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; } } return ("-1"); }
|
private String doAuth(String cardnumber, String monthExpires, String yearExpires, double amount, String currency, String transactionType, Object parentDataPK, String authRspID) throws TPosException { if(_client != null) { _client.setProperty(TPOS3Client.PN_USERID, _userId); _client.setProperty(TPOS3Client.PN_PASSWORD, _passwd); _client.setProperty(TPOS3Client.PN_MERCHANTID, _merchantId); _client.setProperty(TPOS3Client.PN_LOCATIONID, _locationId); _client.setProperty(TPOS3Client.PN_POSID, _posId); _client.setProperty(TPOS3Client.PN_PAN, cardnumber); _client.setProperty(TPOS3Client.PN_EXPIRE, monthExpires + yearExpires); //_client.setProperty(TPOS3Client.PN_EXPIRE, yearExpires + monthExpires); amount *= amountMultiplier; String stringAmount = Integer.toString((int)amount); _client.setProperty(TPOS3Client.PN_AMOUNT, stringAmount); _client.setProperty(TPOS3Client.PN_CURRENCY, currency); _client.setProperty(TPOS3Client.PN_TRANSACTIONTYPE, transactionType); if (transactionType.equals("2")) { _client.setProperty(TPOS3Client.PN_CARDHOLDERCODE, "2"); } boolean valid = _client.sendAuthorisationReq(); boolean inserted = false; TPosAuthorisationEntriesBean entry; try { entry = TPosAuthorisationEntriesHome.getInstance().getNewElement(); // entry.setAttachmentCount(_client.getProperty(TPOS3Client.pn)); entry.setAuthorisationAmount(_client.getProperty(TPOS3Client.PN_AUTHORAMOUNT)); entry.setAuthorisationCode(_client.getProperty(TPOS3Client.PN_AUTHORISATIONCODE)); entry.setAuthorisationCurrency(_client.getProperty(TPOS3Client.PN_AUTHORCURRENCY)); entry.setAuthorisationIdRsp(_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); entry.setAuthorisationPathReasonCode(_client.getProperty(TPOS3Client.PN_AUTHPATHREASONCODE)); entry.setBatchNumber(_client.getProperty(TPOS3Client.PN_BATCHNUMBER)); entry.setBrandId(_client.getProperty(TPOS3Client.PN_CARDBRANDID)); entry.setBrandName(_client.getProperty(TPOS3Client.PN_CARDBRANDNAME)); entry.setCardCharacteristics(_client.getProperty(TPOS3Client.PN_CARDCHARACTER)); entry.setCardExpires(_client.getProperty(TPOS3Client.PN_EXPIRE)); entry.setCardName(_client.getProperty(TPOS3Client.PN_CARDTYPENAME)); entry.setCardType(_client.getProperty(TPOS3Client.PN_CARDTYPEID)); entry.setDetailExpected(_client.getProperty(TPOS3Client.PN_DETAILEXPECTED)); entry.setEntryDate(_client.getProperty(TPOS3Client.PN_DATE)); entry.setEntryTime(_client.getProperty(TPOS3Client.PN_TIME)); entry.setErrorNo(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); entry.setErrorText(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); entry.setLocationNr(_client.getProperty(TPOS3Client.PN_LOCATIONNUMBER)); entry.setMerchantNrAuthorisation(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERAUTHOR)); entry.setMerchantNrOtherServices(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBEROTHERSERVICES)); entry.setMerchantNrSubmission(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERSUBMISSION)); // entry.setPan("***********"); entry.setPosNr(_client.getProperty(TPOS3Client.PN_POSNUMBER)); entry.setPosSerialNr(_client.getProperty(TPOS3Client.PN_POSSERIAL)); // entry.setPrintData(_client.getProperty(TPOS3Client.pn_p)); entry.setSubmissionAmount(_client.getProperty(TPOS3Client.PN_SUBMISSIONAMOUNT)); entry.setSubmissionCurrency(_client.getProperty(TPOS3Client.PN_SUBMISSIONCURRENCY)); entry.setTotalResponseCode(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE)); entry.setTransactionNr(_client.getProperty(TPOS3Client.PN_TRANSACTIONNUMBER)); entry.setVoidedAuthorisationIdResponse(_client.getProperty(TPOS3Client.PN_VOIDEDAUTHIDRSP)); entry.setVoidedTransactionNr(_client.getProperty(TPOS3Client.PN_VOIDEDTRANSNUMBER)); // entry.setXMLAttachment(_client.getProperty(TPOS3Client.)); entry.setCardNumber(CreditCardBusinessBean.encodeCreditCardNumber(cardnumber)); if (parentDataPK != null) { try { entry.setParentID(((Integer) parentDataPK).intValue()); } catch (Exception e) { System.out.println("TPosClient : could not set parentID : "+parentDataPK); } } inserted = TPosAuthorisationEntriesHome.getInstance().insert(entry); } catch (Exception e) { e.printStackTrace(); } if (!inserted) { System.err.println("Unable to save entry to database"); } if (!valid) { TPosException e = new TPosException("Error in authorisation"); e.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); e.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); e.setDisplayError("Error in authorisation (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw e; } TPosException tposEx = null; switch (Integer.parseInt(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE), 10)) { case 0: return (_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); case 1: tposEx = new TPosException("Authorisation denied"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 2: tposEx = new TPosException("Authorisation denied, pick up card"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 3: tposEx = new TPosException("Authorisation denied, call for manual authorisation"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; } } return ("-1"); }
| 1,117,918
|
private String doAuth(String cardnumber, String monthExpires, String yearExpires, double amount, String currency, String transactionType, Object parentDataPK) throws TPosException { if(_client != null) { _client.setProperty(TPOS3Client.PN_USERID, _userId); _client.setProperty(TPOS3Client.PN_PASSWORD, _passwd); _client.setProperty(TPOS3Client.PN_MERCHANTID, _merchantId); _client.setProperty(TPOS3Client.PN_LOCATIONID, _locationId); _client.setProperty(TPOS3Client.PN_POSID, _posId); _client.setProperty(TPOS3Client.PN_PAN, cardnumber); _client.setProperty(TPOS3Client.PN_EXPIRE, monthExpires + yearExpires); //_client.setProperty(TPOS3Client.PN_EXPIRE, yearExpires + monthExpires); amount *= amountMultiplier; String stringAmount = Integer.toString((int)amount); _client.setProperty(TPOS3Client.PN_AMOUNT, stringAmount); _client.setProperty(TPOS3Client.PN_CURRENCY, currency); _client.setProperty(TPOS3Client.PN_TRANSACTIONTYPE, transactionType); if (transactionType.equals("2")) { _client.setProperty(TPOS3Client.PN_CARDHOLDERCODE, "2"); } boolean valid = _client.sendAuthorisationReq(); boolean inserted = false; TPosAuthorisationEntriesBean entry; try { entry = TPosAuthorisationEntriesHome.getInstance().getNewElement(); // entry.setAttachmentCount(_client.getProperty(TPOS3Client.pn)); entry.setAuthorisationAmount(_client.getProperty(TPOS3Client.PN_AUTHORAMOUNT)); entry.setAuthorisationCode(_client.getProperty(TPOS3Client.PN_AUTHORISATIONCODE)); entry.setAuthorisationCurrency(_client.getProperty(TPOS3Client.PN_AUTHORCURRENCY)); entry.setAuthorisationIdRsp(_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); entry.setAuthorisationPathReasonCode(_client.getProperty(TPOS3Client.PN_AUTHPATHREASONCODE)); entry.setBatchNumber(_client.getProperty(TPOS3Client.PN_BATCHNUMBER)); entry.setBrandId(_client.getProperty(TPOS3Client.PN_CARDBRANDID)); entry.setBrandName(_client.getProperty(TPOS3Client.PN_CARDBRANDNAME)); entry.setCardCharacteristics(_client.getProperty(TPOS3Client.PN_CARDCHARACTER)); entry.setCardExpires(_client.getProperty(TPOS3Client.PN_EXPIRE)); entry.setCardName(_client.getProperty(TPOS3Client.PN_CARDTYPENAME)); entry.setCardType(_client.getProperty(TPOS3Client.PN_CARDTYPEID)); entry.setDetailExpected(_client.getProperty(TPOS3Client.PN_DETAILEXPECTED)); entry.setEntryDate(_client.getProperty(TPOS3Client.PN_DATE)); entry.setEntryTime(_client.getProperty(TPOS3Client.PN_TIME)); entry.setErrorNo(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); entry.setErrorText(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); entry.setLocationNr(_client.getProperty(TPOS3Client.PN_LOCATIONNUMBER)); entry.setMerchantNrAuthorisation(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERAUTHOR)); entry.setMerchantNrOtherServices(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBEROTHERSERVICES)); entry.setMerchantNrSubmission(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERSUBMISSION)); // entry.setPan("***********"); entry.setPosNr(_client.getProperty(TPOS3Client.PN_POSNUMBER)); entry.setPosSerialNr(_client.getProperty(TPOS3Client.PN_POSSERIAL)); // entry.setPrintData(_client.getProperty(TPOS3Client.pn_p)); entry.setSubmissionAmount(_client.getProperty(TPOS3Client.PN_SUBMISSIONAMOUNT)); entry.setSubmissionCurrency(_client.getProperty(TPOS3Client.PN_SUBMISSIONCURRENCY)); entry.setTotalResponseCode(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE)); entry.setTransactionNr(_client.getProperty(TPOS3Client.PN_TRANSACTIONNUMBER)); entry.setVoidedAuthorisationIdResponse(_client.getProperty(TPOS3Client.PN_VOIDEDAUTHIDRSP)); entry.setVoidedTransactionNr(_client.getProperty(TPOS3Client.PN_VOIDEDTRANSNUMBER)); // entry.setXMLAttachment(_client.getProperty(TPOS3Client.)); entry.setCardNumber(CreditCardBusinessBean.encodeCreditCardNumber(cardnumber)); if (parentDataPK != null) { try { entry.setParentID(((Integer) parentDataPK).intValue()); } catch (Exception e) { System.out.println("TPosClient : could not set parentID : "+parentDataPK); } } inserted = TPosAuthorisationEntriesHome.getInstance().insert(entry); } catch (Exception e) { e.printStackTrace(); } if (!inserted) { System.err.println("Unable to save entry to database"); } if (!valid) { TPosException e = new TPosException("Error in authorisation"); e.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); e.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); e.setDisplayError("Error in authorisation (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw e; } TPosException tposEx = null; switch (Integer.parseInt(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE), 10)) { case 0: return (_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); case 1: tposEx = new TPosException("Authorisation denied"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 2: tposEx = new TPosException("Authorisation denied, pick up card"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 3: tposEx = new TPosException("Authorisation denied, call for manual authorisation"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; } } return ("-1"); }
|
private String doAuth(String cardnumber, String monthExpires, String yearExpires, double amount, String currency, String transactionType, Object parentDataPK) throws TPosException { if(_client != null) { _client.setProperty(TPOS3Client.PN_USERID, _userId); _client.setProperty(TPOS3Client.PN_PASSWORD, _passwd); _client.setProperty(TPOS3Client.PN_MERCHANTID, _merchantId); _client.setProperty(TPOS3Client.PN_LOCATIONID, _locationId); _client.setProperty(TPOS3Client.PN_POSID, _posId); _client.setProperty(TPOS3Client.PN_PAN, cardnumber); _client.setProperty(TPOS3Client.PN_EXPIRE, monthExpires + yearExpires); //_client.setProperty(TPOS3Client.PN_EXPIRE, yearExpires + monthExpires); amount *= amountMultiplier; String stringAmount = Integer.toString((int)amount); _client.setProperty(TPOS3Client.PN_AMOUNT, stringAmount); _client.setProperty(TPOS3Client.PN_CURRENCY, currency); _client.setProperty(TPOS3Client.PN_TRANSACTIONTYPE, transactionType); if (transactionType.equals("2")) { _client.setProperty(TPOS3Client.PN_CARDHOLDERCODE, "2"); } boolean valid = false; try { valid = _client.sendAuthorisationReq(); } catch (IllegalArgumentException e) { getKeys(); createNewBatch(); _client.setProperty(TPOS3Client.PN_USERID, _userId); _client.setProperty(TPOS3Client.PN_PASSWORD, _passwd); _client.setProperty(TPOS3Client.PN_MERCHANTID, _merchantId); _client.setProperty(TPOS3Client.PN_LOCATIONID, _locationId); _client.setProperty(TPOS3Client.PN_POSID, _posId); _client.setProperty(TPOS3Client.PN_PAN, cardnumber); _client.setProperty(TPOS3Client.PN_EXPIRE, monthExpires + yearExpires); _client.setProperty(TPOS3Client.PN_AMOUNT, stringAmount); _client.setProperty(TPOS3Client.PN_CURRENCY, currency); _client.setProperty(TPOS3Client.PN_TRANSACTIONTYPE, transactionType); if (transactionType.equals("2")) { _client.setProperty(TPOS3Client.PN_CARDHOLDERCODE, "2"); } valid = _client.sendAuthorisationReq(); } boolean inserted = false; TPosAuthorisationEntriesBean entry; try { entry = TPosAuthorisationEntriesHome.getInstance().getNewElement(); // entry.setAttachmentCount(_client.getProperty(TPOS3Client.pn)); entry.setAuthorisationAmount(_client.getProperty(TPOS3Client.PN_AUTHORAMOUNT)); entry.setAuthorisationCode(_client.getProperty(TPOS3Client.PN_AUTHORISATIONCODE)); entry.setAuthorisationCurrency(_client.getProperty(TPOS3Client.PN_AUTHORCURRENCY)); entry.setAuthorisationIdRsp(_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); entry.setAuthorisationPathReasonCode(_client.getProperty(TPOS3Client.PN_AUTHPATHREASONCODE)); entry.setBatchNumber(_client.getProperty(TPOS3Client.PN_BATCHNUMBER)); entry.setBrandId(_client.getProperty(TPOS3Client.PN_CARDBRANDID)); entry.setBrandName(_client.getProperty(TPOS3Client.PN_CARDBRANDNAME)); entry.setCardCharacteristics(_client.getProperty(TPOS3Client.PN_CARDCHARACTER)); entry.setCardExpires(_client.getProperty(TPOS3Client.PN_EXPIRE)); entry.setCardName(_client.getProperty(TPOS3Client.PN_CARDTYPENAME)); entry.setCardType(_client.getProperty(TPOS3Client.PN_CARDTYPEID)); entry.setDetailExpected(_client.getProperty(TPOS3Client.PN_DETAILEXPECTED)); entry.setEntryDate(_client.getProperty(TPOS3Client.PN_DATE)); entry.setEntryTime(_client.getProperty(TPOS3Client.PN_TIME)); entry.setErrorNo(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); entry.setErrorText(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); entry.setLocationNr(_client.getProperty(TPOS3Client.PN_LOCATIONNUMBER)); entry.setMerchantNrAuthorisation(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERAUTHOR)); entry.setMerchantNrOtherServices(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBEROTHERSERVICES)); entry.setMerchantNrSubmission(_client.getProperty(TPOS3Client.PN_MERCHANTNUMBERSUBMISSION)); // entry.setPan("***********"); entry.setPosNr(_client.getProperty(TPOS3Client.PN_POSNUMBER)); entry.setPosSerialNr(_client.getProperty(TPOS3Client.PN_POSSERIAL)); // entry.setPrintData(_client.getProperty(TPOS3Client.pn_p)); entry.setSubmissionAmount(_client.getProperty(TPOS3Client.PN_SUBMISSIONAMOUNT)); entry.setSubmissionCurrency(_client.getProperty(TPOS3Client.PN_SUBMISSIONCURRENCY)); entry.setTotalResponseCode(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE)); entry.setTransactionNr(_client.getProperty(TPOS3Client.PN_TRANSACTIONNUMBER)); entry.setVoidedAuthorisationIdResponse(_client.getProperty(TPOS3Client.PN_VOIDEDAUTHIDRSP)); entry.setVoidedTransactionNr(_client.getProperty(TPOS3Client.PN_VOIDEDTRANSNUMBER)); // entry.setXMLAttachment(_client.getProperty(TPOS3Client.)); entry.setCardNumber(CreditCardBusinessBean.encodeCreditCardNumber(cardnumber)); if (parentDataPK != null) { try { entry.setParentID(((Integer) parentDataPK).intValue()); } catch (Exception e) { System.out.println("TPosClient : could not set parentID : "+parentDataPK); } } inserted = TPosAuthorisationEntriesHome.getInstance().insert(entry); } catch (Exception e) { e.printStackTrace(); } if (!inserted) { System.err.println("Unable to save entry to database"); } if (!valid) { TPosException e = new TPosException("Error in authorisation"); e.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); e.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); e.setDisplayError("Error in authorisation (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw e; } TPosException tposEx = null; switch (Integer.parseInt(_client.getProperty(TPOS3Client.PN_TOTALRESPONSECODE), 10)) { case 0: return (_client.getProperty(TPOS3Client.PN_AUTHORIDENTIFYRSP)); case 1: tposEx = new TPosException("Authorisation denied"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 2: tposEx = new TPosException("Authorisation denied, pick up card"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; case 3: tposEx = new TPosException("Authorisation denied, call for manual authorisation"); tposEx.setErrorNumber(_client.getProperty(TPOS3Client.PN_ERRORNUMBER)); tposEx.setErrorMessage(_client.getProperty(TPOS3Client.PN_ERRORTEXT)); tposEx.setDisplayError("Authorisation denied (" + _client.getProperty(TPOS3Client.PN_ERRORNUMBER) + ")"); throw tposEx; } } return ("-1"); }
| 1,117,919
|
public String doRefund(String cardnumber, String monthExpires, String yearExpires, String ccVerifyNumber, double amount, String currency, Object parentDataPK, String captureProperties) throws TPosException { System.out.println("Warning : TPosClient is NOT using CVC number"); return doAuth(cardnumber, monthExpires, yearExpires, amount, currency, "3", parentDataPK); }
|
public String doRefund(String cardnumber, String monthExpires, String yearExpires, String ccVerifyNumber, double amount, String currency, Object parentDataPK, String captureProperties) throws TPosException { System.out.println("Warning : TPosClient is NOT using CVC number"); return doAuth(cardnumber, monthExpires, yearExpires, amount, currency, "3", parentDataPK, null); }
| 1,117,920
|
public String doSale(String nameOnCard, String cardnumber, String monthExpires, String yearExpires, String ccVerifyNumber, double amount, String currency, String referenceNumber) throws TPosException { return (doAuth(cardnumber, monthExpires, yearExpires, amount, currency, "1", null)); }
|
public String doSale(String nameOnCard, String cardnumber, String monthExpires, String yearExpires, String ccVerifyNumber, double amount, String currency, String referenceNumber) throws TPosException { return (doAuth(cardnumber, monthExpires, yearExpires, amount, currency, "1", null, null)); }
| 1,117,921
|
private void init(IWApplicationContext iwc) throws Exception{ _iwc = iwc; _iwb = iwc.getIWMainApplication().getBundle(IW_BUNDLE_IDENTIFIER); //if (_iwb != null) { // _iwrb = _iwb.getResourceBundle(iwc); //} String path = _iwb.getPropertiesRealPath(); if (path == null) { throw new Exception("Unable to find properties file"); } String seperator = java.io.File.separator; if (!path.endsWith(seperator)) { path = path + seperator + _iwb.getProperty("properties_file"); } else { path = path + _iwb.getProperty("properties_file"); } try { _client = new TPOS3Client(path); String ipset = _iwb.getProperty(TPOS_IP_SET); _client.setIPSet(Integer.parseInt(ipset)); if (_merchant == null) { System.out.println("TPosClient : Using default TPosMerchant"); _userId = _iwb.getProperty(TPOS_USER_ID); _passwd = _iwb.getProperty(TPOS_PASSWD); _merchantId = _iwb.getProperty(TPOS_MERCHANT_ID); _locationId = _iwb.getProperty(TPOS_LOCATION_ID); _posId = _iwb.getProperty(TPOS_POS_ID); _receivePasswd = _iwb.getProperty(TPOS_KEY_RECEIVE_PASSWD); }else { System.out.println("TPosClient : Using TPosMerchant "+_merchant.getName()); _userId = _merchant.getUser(); _passwd = _merchant.getPassword(); _merchantId = _merchant.getMerchantID(); _locationId = _merchant.getLocation(); _posId = _merchant.getTerminalID(); _receivePasswd = _merchant.getExtraInfo(); } } catch (Exception e) { System.out.println("Got an exception trying to create client"); } }
|
private void init(IWApplicationContext iwc) throws Exception{ _iwc = iwc; _iwb = iwc.getIWMainApplication().getBundle(IW_BUNDLE_IDENTIFIER); //if (_iwb != null) { // _iwrb = _iwb.getResourceBundle(iwc); //} String path = _iwb.getPropertiesRealPath(); if (path == null) { throw new Exception("Unable to find properties file"); } String seperator = java.io.File.separator; if (!path.endsWith(seperator)) { path = path + seperator + _iwb.getProperty("properties_file"); } else { path = path + _iwb.getProperty("properties_file"); } try { _client = new TPOS3Client(path); String ipset = _iwb.getProperty(TPOS_IP_SET); _client.setIPSet(Integer.parseInt(ipset)); if (_merchant == null) { System.out.println("TPosClient : Using default TPosMerchant, ipset = "+ipset); _userId = _iwb.getProperty(TPOS_USER_ID); _passwd = _iwb.getProperty(TPOS_PASSWD); _merchantId = _iwb.getProperty(TPOS_MERCHANT_ID); _locationId = _iwb.getProperty(TPOS_LOCATION_ID); _posId = _iwb.getProperty(TPOS_POS_ID); _receivePasswd = _iwb.getProperty(TPOS_KEY_RECEIVE_PASSWD); }else { System.out.println("TPosClient : Using TPosMerchant "+_merchant.getName()); _userId = _merchant.getUser(); _passwd = _merchant.getPassword(); _merchantId = _merchant.getMerchantID(); _locationId = _merchant.getLocation(); _posId = _merchant.getTerminalID(); _receivePasswd = _merchant.getExtraInfo(); } } catch (Exception e) { System.out.println("Got an exception trying to create client"); } }
| 1,117,922
|
private void init(IWApplicationContext iwc) throws Exception{ _iwc = iwc; _iwb = iwc.getIWMainApplication().getBundle(IW_BUNDLE_IDENTIFIER); //if (_iwb != null) { // _iwrb = _iwb.getResourceBundle(iwc); //} String path = _iwb.getPropertiesRealPath(); if (path == null) { throw new Exception("Unable to find properties file"); } String seperator = java.io.File.separator; if (!path.endsWith(seperator)) { path = path + seperator + _iwb.getProperty("properties_file"); } else { path = path + _iwb.getProperty("properties_file"); } try { _client = new TPOS3Client(path); String ipset = _iwb.getProperty(TPOS_IP_SET); _client.setIPSet(Integer.parseInt(ipset)); if (_merchant == null) { System.out.println("TPosClient : Using default TPosMerchant"); _userId = _iwb.getProperty(TPOS_USER_ID); _passwd = _iwb.getProperty(TPOS_PASSWD); _merchantId = _iwb.getProperty(TPOS_MERCHANT_ID); _locationId = _iwb.getProperty(TPOS_LOCATION_ID); _posId = _iwb.getProperty(TPOS_POS_ID); _receivePasswd = _iwb.getProperty(TPOS_KEY_RECEIVE_PASSWD); }else { System.out.println("TPosClient : Using TPosMerchant "+_merchant.getName()); _userId = _merchant.getUser(); _passwd = _merchant.getPassword(); _merchantId = _merchant.getMerchantID(); _locationId = _merchant.getLocation(); _posId = _merchant.getTerminalID(); _receivePasswd = _merchant.getExtraInfo(); } } catch (Exception e) { System.out.println("Got an exception trying to create client"); } }
|
private void init(IWApplicationContext iwc) throws Exception{ _iwc = iwc; _iwb = iwc.getIWMainApplication().getBundle(IW_BUNDLE_IDENTIFIER); //if (_iwb != null) { // _iwrb = _iwb.getResourceBundle(iwc); //} String path = _iwb.getPropertiesRealPath(); if (path == null) { throw new Exception("Unable to find properties file"); } String seperator = java.io.File.separator; if (!path.endsWith(seperator)) { path = path + seperator + _iwb.getProperty("properties_file"); } else { path = path + _iwb.getProperty("properties_file"); } try { _client = new TPOS3Client(path); String ipset = _iwb.getProperty(TPOS_IP_SET); _client.setIPSet(Integer.parseInt(ipset)); if (_merchant == null) { System.out.println("TPosClient : Using default TPosMerchant"); _userId = _iwb.getProperty(TPOS_USER_ID); _passwd = _iwb.getProperty(TPOS_PASSWD); _merchantId = _iwb.getProperty(TPOS_MERCHANT_ID); _locationId = _iwb.getProperty(TPOS_LOCATION_ID); _posId = _iwb.getProperty(TPOS_POS_ID); _receivePasswd = _iwb.getProperty(TPOS_KEY_RECEIVE_PASSWD); }else { System.out.println("TPosClient : Using TPosMerchant "+_merchant.getName()+", ipset = "+ipset); _userId = _merchant.getUser(); _passwd = _merchant.getPassword(); _merchantId = _merchant.getMerchantID(); _locationId = _merchant.getLocation(); _posId = _merchant.getTerminalID(); _receivePasswd = _merchant.getExtraInfo(); } } catch (Exception e) { System.out.println("Got an exception trying to create client"); } }
| 1,117,923
|
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { int eventId = form.getEventId(); if (eventId < 0) { // Do nothing return "doNothing"; } EventInfo ei = form.getCalSvcI().getEvent(eventId); BwEvent ev = null; if (ei != null) { ev = ei.getEvent(); } form.assignCurrentEvent(ev); if (ei == null) { form.getErr().emit("org.bedework.error.eventnotfound"); return "notFound"; } return "success"; }
|
public String doAction(HttpServletRequest request, BwActionForm form) throws Throwable { int eventId = form.getEventId(); if (eventId < 0) { // Do nothing return "doNothing"; } EventInfo ei = form.getCalSvcI().getEvent(eventId); BwEvent ev = null; if (ei != null) { ev = ei.getEvent(); } form.assignCurrentEvent(ev); if (ei == null) { form.getErr().emit("org.bedework.client.error.eventnotfound"); return "notFound"; } return "success"; }
| 1,117,924
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { String calPath = request.getParameter("calPath"); if (calPath == null) { // bogus request return "notFound"; } cal = svci.getCalendar(calPath); if (cal == null) { form.getErr().emit("org.bedework.client.error.nosuchcalendar", calPath); return "notFound"; } } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } char[] howchs = how.toCharArray(); for (int hi = 0; hi <= howchs.length; hi++) { char howch = howchs[hi]; boolean found = false; for (int pi = 0; pi <= PrivilegeDefs.privMaxType; pi++) { if (howch == PrivilegeDefs.privEncoding[pi]) { aces.add(new Ace(who, false, whoType, Privileges.makePriv(pi))); found = true; break; } if (!found) { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } } } if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { String calPath = request.getParameter("calPath"); if (calPath == null) { // bogus request return "notFound"; } cal = svci.getCalendar(calPath); if (cal == null) { form.getErr().emit("org.bedework.client.error.nosuchcalendar", calPath); return "notFound"; } } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } char[] howchs = how.toCharArray(); for (int hi = 0; hi < howchs.length; hi++) { char howch = howchs[hi]; boolean found = false; for (int pi = 0; pi <= PrivilegeDefs.privMaxType; pi++) { if (howch == PrivilegeDefs.privEncoding[pi]) { aces.add(new Ace(who, false, whoType, Privileges.makePriv(pi))); found = true; break; } if (!found) { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } } } if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
| 1,117,925
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { String calPath = request.getParameter("calPath"); if (calPath == null) { // bogus request return "notFound"; } cal = svci.getCalendar(calPath); if (cal == null) { form.getErr().emit("org.bedework.client.error.nosuchcalendar", calPath); return "notFound"; } } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } char[] howchs = how.toCharArray(); for (int hi = 0; hi <= howchs.length; hi++) { char howch = howchs[hi]; boolean found = false; for (int pi = 0; pi <= PrivilegeDefs.privMaxType; pi++) { if (howch == PrivilegeDefs.privEncoding[pi]) { aces.add(new Ace(who, false, whoType, Privileges.makePriv(pi))); found = true; break; } if (!found) { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } } } if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { String calPath = request.getParameter("calPath"); if (calPath == null) { // bogus request return "notFound"; } cal = svci.getCalendar(calPath); if (cal == null) { form.getErr().emit("org.bedework.client.error.nosuchcalendar", calPath); return "notFound"; } } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } char[] howchs = how.toCharArray(); for (int hi = 0; hi <= howchs.length; hi++) { char howch = howchs[hi]; boolean found = false; for (int pi = 0; pi <= PrivilegeDefs.privMaxType; pi++) { if (howch == PrivilegeDefs.privEncoding[pi]) { aces.add(new Ace(who, false, whoType, Privileges.makePriv(pi))); found = true; break; } if (!found) { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } } } if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
| 1,117,926
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { String calPath = request.getParameter("calPath"); if (calPath == null) { // bogus request return "notFound"; } cal = svci.getCalendar(calPath); if (cal == null) { form.getErr().emit("org.bedework.client.error.nosuchcalendar", calPath); return "notFound"; } } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } char[] howchs = how.toCharArray(); for (int hi = 0; hi <= howchs.length; hi++) { char howch = howchs[hi]; boolean found = false; for (int pi = 0; pi <= PrivilegeDefs.privMaxType; pi++) { if (howch == PrivilegeDefs.privEncoding[pi]) { aces.add(new Ace(who, false, whoType, Privileges.makePriv(pi))); found = true; break; } if (!found) { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } } } if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { String calPath = request.getParameter("calPath"); if (calPath == null) { // bogus request return "notFound"; } cal = svci.getCalendar(calPath); if (cal == null) { form.getErr().emit("org.bedework.client.error.nosuchcalendar", calPath); return "notFound"; } } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } char[] howchs = how.toCharArray(); for (int hi = 0; hi <= howchs.length; hi++) { char howch = howchs[hi]; boolean found = false; for (int pi = 0; pi <= PrivilegeDefs.privMaxType; pi++) { if (howch == PrivilegeDefs.privEncoding[pi]) { aces.add(new Ace(who, false, whoType, Privileges.makePriv(pi))); found = true; break; } if (!found) { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } } } if (ev != null) { svci.changeAccess(ev, aces); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
| 1,117,927
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { String calPath = request.getParameter("calPath"); if (calPath == null) { // bogus request return "notFound"; } cal = svci.getCalendar(calPath); if (cal == null) { form.getErr().emit("org.bedework.client.error.nosuchcalendar", calPath); return "notFound"; } } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } char[] howchs = how.toCharArray(); for (int hi = 0; hi <= howchs.length; hi++) { char howch = howchs[hi]; boolean found = false; for (int pi = 0; pi <= PrivilegeDefs.privMaxType; pi++) { if (howch == PrivilegeDefs.privEncoding[pi]) { aces.add(new Ace(who, false, whoType, Privileges.makePriv(pi))); found = true; break; } if (!found) { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } } } if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); svci.updateCalendar(cal); } return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (form.getGuest()) { return "notFound"; } CalSvcI svci = form.fetchSvci(); BwCalendar cal = null; EventInfo ei = null; BwEvent ev = null; String rpar = getReqPar(request, "guid"); if (rpar != null) { // Assume event ei = findEvent(request, form); if (ei == null) { // Do nothing form.getErr().emit("org.bedework.client.error.nosuchevent"); return "doNothing"; } ev = ei.getEvent(); } else { String calPath = request.getParameter("calPath"); if (calPath == null) { // bogus request return "notFound"; } cal = svci.getCalendar(calPath); if (cal == null) { form.getErr().emit("org.bedework.client.error.nosuchcalendar", calPath); return "notFound"; } } String whoTypeStr = request.getParameter("whoType"); int whoType = -1; if (whoTypeStr == null) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("owner")) { whoType = Ace.whoTypeOwner; } else if (whoTypeStr.equals("user")) { whoType = Ace.whoTypeUser; } else if (whoTypeStr.equals("group")) { whoType = Ace.whoTypeGroup; form.getErr().emit("org.bedework.client.error.unimplemented"); return "error"; } else if (whoTypeStr.equals("unauth")) { whoType = Ace.whoTypeUnauthenticated; } else if (whoTypeStr.equals("other")) { whoType = Ace.whoTypeOther; } else { form.getErr().emit("org.bedework.client.error.badwhotype"); return "error"; } String who = request.getParameter("who"); if (who != null) { BwUser user = svci.findUser(who); if (user == null) { form.getErr().emit("org.bedework.client.error.usernotfound"); return "notFound"; } } else { who = null; } ArrayList aces = new ArrayList(); String how = getReqPar(request, "how"); if (how == null) { form.getErr().emit("org.bedework.client.error.nohowaccess"); return "error"; } char[] howchs = how.toCharArray(); for (int hi = 0; hi <= howchs.length; hi++) { char howch = howchs[hi]; boolean found = false; for (int pi = 0; pi <= PrivilegeDefs.privMaxType; pi++) { if (howch == PrivilegeDefs.privEncoding[pi]) { aces.add(new Ace(who, false, whoType, Privileges.makePriv(pi))); found = true; break; } if (!found) { form.getErr().emit("org.bedework.client.error.badhow"); return "error"; } } } if (ev != null) { svci.changeAccess(ev, aces); svci.updateEvent(ev); } else { svci.changeAccess(cal, aces); } return "success"; }
| 1,117,928
|
public ChannelId[] getChannelIds() { SeismogramAttr[] seismogramAttrs = getSeismogramAttrs(); ChannelId[] channelIds = new ChannelId[seismogramAttrs.length]; for(int counter = 0; counter < seismogramAttrs.length; counter++) { channelIds[counter] = ((SeismogramAttrImpl)seismogramAttrs[counter]).getChannelID(); } return channelIds; }
|
public ChannelId[] getChannelIds() { SeismogramAttr[] seismogramAttrs = getSeismogramAttrs(); ChannelId[] channelIds = new ChannelId[seismogramAttrs.length]; for(int counter = 0; counter < seismogramAttrs.length; counter++) { channelIds[counter] = ((SeismogramAttrImpl)seismogramAttrs[counter]).getChannelID(); } return channelIds; }
| 1,117,929
|
public ChannelId[] getChannelIds() { SeismogramAttr[] seismogramAttrs = getSeismogramAttrs(); ChannelId[] channelIds = new ChannelId[seismogramAttrs.length]; for(int counter = 0; counter < seismogramAttrs.length; counter++) { channelIds[counter] = ((SeismogramAttrImpl)seismogramAttrs[counter]).getChannelID(); } return channelIds; }
|
public ChannelId[] getChannelIds() { SeismogramAttr[] seismogramAttrs = getSeismogramAttrs(); ChannelId[] channelIds = new ChannelId[seismogramAttrs.length]; for(int counter = 0; counter < seismogramAttrs.length; counter++) { channelIds[counter] = ((SeismogramAttrImpl)seismogramAttrs[counter]).getChannelID(); } return channelIds; }
| 1,117,930
|
private double dBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinaryIndexSum(start, middle) + dBinaryIndexSum(middle, finish); } }
|
private double dBinaryIndexSum(int start, int finish) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += i * dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinaryIndexSum(start, middle) + dBinaryIndexSum(middle, finish); } }
| 1,117,931
|
private double dBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinarySum(start, middle) + dBinarySum(middle, finish); } }
|
private double dBinarySum(int start, int finish) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += dSeries[i]; } return val; } else { int middle = (start + finish) / 2; return dBinarySum(start, middle) + dBinarySum(middle, finish); } }
| 1,117,932
|
private double dBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (dSeries[i]-mean)*(dSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevLag(start, middle, mean, lag) + dBinarySumDevLag(middle, finish, mean, lag); } }
|
private double dBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (dSeries[i]-mean)*(dSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevLag(start, middle, mean, lag) + dBinarySumDevLag(middle, finish, mean, lag); } }
| 1,117,933
|
private double dBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (dSeries[i]-mean)*(dSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevSqr(start, middle, mean) + dBinarySumDevSqr(middle, finish, mean); } }
|
private double dBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += (dSeries[i]-mean)*(dSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return dBinarySumDevSqr(start, middle, mean) + dBinarySumDevSqr(middle, finish, mean); } }
| 1,117,934
|
private double fBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinaryIndexSum(start, middle) + fBinaryIndexSum(middle, finish); } }
|
private double fBinaryIndexSum(int start, int finish) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += i * fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinaryIndexSum(start, middle) + fBinaryIndexSum(middle, finish); } }
| 1,117,935
|
private double fBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinarySum(start, middle) + fBinarySum(middle, finish); } }
|
private double fBinarySum(int start, int finish) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += fSeries[i]; } return val; } else { int middle = (start + finish) / 2; return fBinarySum(start, middle) + fBinarySum(middle, finish); } }
| 1,117,936
|
private double fBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (fSeries[i]-mean)*(fSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevLag(start, middle, mean, lag) + fBinarySumDevLag(middle, finish, mean, lag); } }
|
private double fBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (fSeries[i]-mean)*(fSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevLag(start, middle, mean, lag) + fBinarySumDevLag(middle, finish, mean, lag); } }
| 1,117,937
|
private double fBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (fSeries[i]-mean)*(fSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevSqr(start, middle, mean) + fBinarySumDevSqr(middle, finish, mean); } }
|
private double fBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += (fSeries[i]-mean)*(fSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return fBinarySumDevSqr(start, middle, mean) + fBinarySumDevSqr(middle, finish, mean); } }
| 1,117,938
|
private double iBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinaryIndexSum(start, middle) + iBinaryIndexSum(middle, finish); } }
|
private double iBinaryIndexSum(int start, int finish) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += i * iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinaryIndexSum(start, middle) + iBinaryIndexSum(middle, finish); } }
| 1,117,939
|
private double iBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinarySum(start, middle) + iBinarySum(middle, finish); } }
|
private double iBinarySum(int start, int finish) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += iSeries[i]; } return val; } else { int middle = (start + finish) / 2; return iBinarySum(start, middle) + iBinarySum(middle, finish); } }
| 1,117,940
|
private double iBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (iSeries[i]-mean)*(iSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return iBinarySumDevLag(start, middle, mean, lag) + iBinarySumDevLag(middle, finish, mean, lag); } }
|
private double iBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (iSeries[i]-mean)*(iSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return iBinarySumDevLag(start, middle, mean, lag) + iBinarySumDevLag(middle, finish, mean, lag); } }
| 1,117,941
|
private double iBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (iSeries[i]-mean)*(iSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return iBinarySumDevSqr(start, middle, mean) + iBinarySumDevSqr(middle, finish, mean); } }
|
private double iBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += (iSeries[i]-mean)*(iSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return iBinarySumDevSqr(start, middle, mean) + iBinarySumDevSqr(middle, finish, mean); } }
| 1,117,942
|
public double[] linearLeastSquares() { int n = getLength()-1; // use zero based, so n => n-1 int sumToN = n*(n+1)/2; int sumSqrToN = n*(n+1)*(2*n+1)/6; double sumValues = binarySum(0, getLength()); double indexSumValues = binaryIndexSum(0, getLength()); double d = (n+1)*sumSqrToN - sumToN*sumToN; double[] out = new double[2]; out[0] = (sumSqrToN * sumValues - sumToN * indexSumValues)/d; out[1] = ((n+1) * indexSumValues - sumToN * sumValues)/d; return out; }
|
public double[] linearLeastSquares() { int n = getLength()-1; // use zero based, so n => n-1 int sumToN = n*(n+1)/2; int sumSqrToN = n*(n+1)*(2*n+1)/6; double sumValues = binarySum(0, getLength()); double indexSumValues = binaryIndexSum(0, getLength()); double d = (n+1)*sumSqrToN - sumToN*sumToN; double[] out = new double[2]; out[0] = (sumSqrToN * sumValues - sumToN * indexSumValues)/d; out[1] = ((n+1) * indexSumValues - sumToN * sumValues)/d; return out; }
| 1,117,943
|
private double sBinaryIndexSum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += i * sSeries[i]; } return val; } else { int middle = (start + finish) / 2; return sBinaryIndexSum(start, middle) + sBinaryIndexSum(middle, finish); } }
|
private double sBinaryIndexSum(int start, int finish) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += i * sSeries[i]; } return val; } else { int middle = (start + finish) / 2; return sBinaryIndexSum(start, middle) + sBinaryIndexSum(middle, finish); } }
| 1,117,944
|
private double sBinarySum(int start, int finish) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += sSeries[i]; } return val; } else { int middle = (start + finish) / 2; return sBinarySum(start, middle) + sBinarySum(middle, finish); } }
|
private double sBinarySum(int start, int finish) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += sSeries[i]; } return val; } else { int middle = (start + finish) / 2; return sBinarySum(start, middle) + sBinarySum(middle, finish); } }
| 1,117,945
|
private double sBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+8) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (sSeries[i]-mean)*(sSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return sBinarySumDevLag(start, middle, mean, lag) + sBinarySumDevLag(middle, finish, mean, lag); } }
|
private double sBinarySumDevLag(int start, int finish, double mean, int lag) { if (finish-start < lag+SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish && i<getLength()-lag; i++) { val += (sSeries[i]-mean)*(sSeries[i+lag]-mean); } return val; } else { int middle = (start + finish) / 2; return sBinarySumDevLag(start, middle, mean, lag) + sBinarySumDevLag(middle, finish, mean, lag); } }
| 1,117,946
|
private double sBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < 8) { double val = 0; for (int i=start; i< finish; i++) { val += (sSeries[i]-mean)*(sSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return sBinarySumDevSqr(start, middle, mean) + sBinarySumDevSqr(middle, finish, mean); } }
|
private double sBinarySumDevSqr(int start, int finish, double mean) { if (finish-start < SPLIT_SUMMING_LIMIT) { double val = 0; for (int i=start; i< finish; i++) { val += (sSeries[i]-mean)*(sSeries[i]-mean); } return val; } else { int middle = (start + finish) / 2; return sBinarySumDevSqr(start, middle, mean) + sBinarySumDevSqr(middle, finish, mean); } }
| 1,117,947
|
public PSNEventRecord(PSNHeader header, DataInputStream data) throws IOException{ dis = data; fixedHeader = header; varHeader = new PSNVariableHeader(dis, (int)header.getVarHeadLength()); readSampleData(); if(fixedHeader.getFlags() == 1){ if(dis.readShort() != 0){ throw new IOException("CRC-16 check has wrong value!"); } } else{ dis.skipBytes(2); } }
|
public PSNEventRecord(PSNHeader header, DataInputStream data) throws IOException{ dis = data; fixedHeader = header; varHeader = new PSNVariableHeader(dis, (int)header.getVarHeadLength()); readSampleData(); if(fixedHeader.getFlags() == 1){ if(dis.readShort() != 0){ throw new IOException("CRC-16 check has wrong value!"); } } else{ dis.skipBytes(2); } }
| 1,117,948
|
public ATNil meta_addMethod(ATMethod method) throws NATException { ATSymbol name = method.base_getName(); if (methodDictionary_.containsKey(name)) { throw new XDuplicateSlot("method", name.getText().asNativeText().javaValue); } else { // first check whether the method dictionary is shared if (this.isFlagSet(_SHARE_DCT_FLAG_)) { methodDictionary_ = (HashMap) methodDictionary_.clone(); this.unsetFlag(_SHARE_DCT_FLAG_); } methodDictionary_.put(name, method); } return NATNil._INSTANCE_; }
|
public ATNil meta_addMethod(ATMethod method) throws NATException { ATSymbol name = method.base_getName(); if (methodDictionary_.containsKey(name)) { throw new XDuplicateSlot("method", name.base_getText().asNativeText().javaValue); } else { // first check whether the method dictionary is shared if (this.isFlagSet(_SHARE_DCT_FLAG_)) { methodDictionary_ = (HashMap) methodDictionary_.clone(); this.unsetFlag(_SHARE_DCT_FLAG_); } methodDictionary_.put(name, method); } return NATNil._INSTANCE_; }
| 1,117,949
|
protected static int[][] compressYvalues(LocalSeismogram seismogram, TimePlotConfig config, Dimension size)throws UnsupportedDataEncoding { int[][] uncomp = scaleXvalues(seismogram, config, size); // enough points to take the extra time to compress the line int[][] comp = new int[2][]; int pixels = size.width; int numValuesperPixel = uncomp[0].length/size.width; comp[0] = new int[2*pixels]; comp[1] = new int[2*pixels]; int j=0, i, startIndex, endIndex; int xvalue; startIndex = 0; if(uncomp[0].length != 0) xvalue = umcomp[0][0];; for(i = 1, j = 0; i < uncomp[0].length; i++) { if(uncomp[0][i] != xvalue) { endIndex = i-1; comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][endIndex]; comp[0][j+1] = uncomp[0][endIndex]; j = j + 2; startIndex = endIndex + 1; xvalue = uncomp[0][i]; } } return comp; }
|
protected static int[][] compressYvalues(LocalSeismogram seismogram, TimePlotConfig config, Dimension size)throws UnsupportedDataEncoding { int[][] uncomp = scaleXvalues(seismogram, config, size); // enough points to take the extra time to compress the line int[][] comp = new int[2][]; int pixels = size.width; int numValuesperPixel = uncomp[0].length/size.width; comp[0] = new int[2*pixels]; comp[1] = new int[2*pixels]; int j=0, i, startIndex, endIndex; int xvalue = 0; startIndex = 0; if(uncomp[0].length != 0) xvalue = umcomp[0][0];; for(i = 1, j = 0; i < uncomp[0].length; i++) { if(uncomp[0][i] != xvalue) { endIndex = i-1; comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][endIndex]; comp[0][j+1] = uncomp[0][endIndex]; j = j + 2; startIndex = endIndex + 1; xvalue = uncomp[0][i]; } } return comp; }
| 1,117,950
|
protected static int[][] compressYvalues(LocalSeismogram seismogram, TimePlotConfig config, Dimension size)throws UnsupportedDataEncoding { int[][] uncomp = scaleXvalues(seismogram, config, size); // enough points to take the extra time to compress the line int[][] comp = new int[2][]; int pixels = size.width; int numValuesperPixel = uncomp[0].length/size.width; comp[0] = new int[2*pixels]; comp[1] = new int[2*pixels]; int j=0, i, startIndex, endIndex; int xvalue; startIndex = 0; if(uncomp[0].length != 0) xvalue = umcomp[0][0];; for(i = 1, j = 0; i < uncomp[0].length; i++) { if(uncomp[0][i] != xvalue) { endIndex = i-1; comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][endIndex]; comp[0][j+1] = uncomp[0][endIndex]; j = j + 2; startIndex = endIndex + 1; xvalue = uncomp[0][i]; } } return comp; }
|
protected static int[][] compressYvalues(LocalSeismogram seismogram, TimePlotConfig config, Dimension size)throws UnsupportedDataEncoding { int[][] uncomp = scaleXvalues(seismogram, config, size); // enough points to take the extra time to compress the line int[][] comp = new int[2][]; int pixels = size.width; int numValuesperPixel = uncomp[0].length/size.width; comp[0] = new int[2*pixels]; comp[1] = new int[2*pixels]; int j=0, i, startIndex, endIndex; int xvalue; startIndex = 0; endIndex = 0; if(uncomp[0].length != 0) xvalue = uncomp[0][0];; for(i = 1, j = 0; i < uncomp[0].length; i++) { if(uncomp[0][i] != xvalue) { endIndex = i-1; comp[1][j] = getMinValue(uncomp[1], startIndex, endIndex); comp[1][j+1] = (int)getMaxValue(uncomp[1], startIndex, endIndex); comp[0][j] = uncomp[0][endIndex]; comp[0][j+1] = uncomp[0][endIndex]; j = j + 2; startIndex = endIndex + 1; xvalue = uncomp[0][i]; } } return comp; }
| 1,117,951
|
protected static int[][] scaleXvalues(LocalSeismogram seismogram, TimePlotConfig config, Dimension size) throws UnsupportedDataEncoding { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; int[][] out = new int[2][]; int seisIndex = 0; int pixelIndex = 0; int numAdded = 0; if ( seis.getEndTime().before(config.getBeginTime()) || seis.getBeginTime().after(config.getEndTime()) ) { out[0] = new int[0]; out[1] = new int[0]; logger.info("The end time is before the beginTime in simple seismogram"); return out; } MicroSecondDate tMin = config.getBeginTime(); MicroSecondDate tMax = config.getEndTime(); UnitRangeImpl ampRange = config.getAmpRange().convertTo(seis.getUnit()); double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); int seisStartIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), config.getBeginTime()); int seisEndIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), config.getEndTime()); seisStartIndex--; seisEndIndex++; if (seisStartIndex < 0) { seisStartIndex = 0; } if (seisEndIndex >= seis.getNumPoints()) { seisEndIndex = seis.getNumPoints()-1; } MicroSecondDate tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStartIndex); int pixelStartIndex = getPixel(size.width, config.getBeginTime(), config.getEndTime(), tempdate); tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEndIndex); int pixelEndIndex = getPixel(size.width, config.getBeginTime(), config.getEndTime(), tempdate); int pixels = size.width; out[0] = new int[2*pixels]; out[1] = new int[out[0].length]; int tempYvalues[] = new int [out[0].length]; seisIndex = seisStartIndex; numAdded = 0; int xvalue = 0; int tempValue; xvalue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); seisIndex++; int j; j = 0; while (seisIndex <= seisEndIndex) { tempValue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); tempYvalues[j++] = (int)seis.getValueAt(seisIndex).getValue(); if(tempValue != xvalue) { out[0][numAdded] = xvalue; out[0][numAdded+1] = xvalue; out[1][numAdded] = getMinValue(tempYvalues, 0, j-1); out[1][numAdded+1] = (int)getMaxValue(tempYvalues, 0, j-1); j = 0; xvalue = tempValue; numAdded = numAdded+2; } seisIndex++; } int temp[][] = new int[2][]; temp[0] = new int[numAdded]; temp[1] = new int[numAdded]; System.arraycopy(out[0], 0, temp[0], 0, numAdded); System.arraycopy(out[1], 0, temp[1], 0, numAdded); return temp; }
|
protected static int[][] scaleXvalues(LocalSeismogram seismogram, TimePlotConfig config, Dimension size) throws UnsupportedDataEncoding { LocalSeismogramImpl seis = (LocalSeismogramImpl)seismogram; int[][] out = new int[2][]; int seisIndex = 0; int pixelIndex = 0; int numAdded = 0; if ( seis.getEndTime().before(config.getBeginTime()) || seis.getBeginTime().after(config.getEndTime()) ) { out[0] = new int[0]; out[1] = new int[0]; logger.info("The end time is before the beginTime in simple seismogram"); return out; } MicroSecondDate tMin = config.getBeginTime(); MicroSecondDate tMax = config.getEndTime(); UnitRangeImpl ampRange = config.getAmpRange().convertTo(seis.getUnit()); double yMin = ampRange.getMinValue(); double yMax = ampRange.getMaxValue(); int seisStartIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), config.getBeginTime()); int seisEndIndex = getPixel(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), config.getEndTime()); seisStartIndex--; seisEndIndex++; if (seisStartIndex < 0) { seisStartIndex = 0; } if (seisEndIndex >= seis.getNumPoints()) { seisEndIndex = seis.getNumPoints()-1; } MicroSecondDate tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisStartIndex); int pixelStartIndex = getPixel(size.width, config.getBeginTime(), config.getEndTime(), tempdate); tempdate = getValue(seis.getNumPoints(), seis.getBeginTime(), seis.getEndTime(), seisEndIndex); int pixelEndIndex = getPixel(size.width, config.getBeginTime(), config.getEndTime(), tempdate); int pixels = size.width; out[0] = new int[2*pixels]; out[1] = new int[out[0].length]; int tempYvalues[] = new int [out[0].length]; seisIndex = seisStartIndex; numAdded = 0; int xvalue = 0; int tempValue; xvalue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); seisIndex++; int j; j = 0; while (seisIndex <= seisEndIndex) { tempValue = Math.round((float)(linearInterp(seisStartIndex, pixelStartIndex, seisEndIndex, pixelEndIndex, seisIndex))); tempYvalues[j++] = (int)seis.getValueAt(seisIndex).getValue(); if(tempValue != xvalue) { out[0][numAdded] = xvalue; out[0][numAdded+1] = xvalue; out[1][numAdded] = getMinValue(tempYvalues, 0, j-1); out[1][numAdded+1] = (int)getMaxValue(tempYvalues, 0, j-1); j = 0; xvalue = tempValue; numAdded = numAdded+2; } seisIndex++; } int temp[][] = new int[2][]; temp[0] = new int[numAdded]; temp[1] = new int[numAdded]; System.arraycopy(out[0], 0, temp[0], 0, numAdded); System.arraycopy(out[1], 0, temp[1], 0, numAdded); return temp; }
| 1,117,953
|
public BwFreeBusy getFreeBusy(BwCalendar cal, BwPrincipal who, BwDateTime start, BwDateTime end, BwDuration granularity, boolean returnAll) throws CalFacadeException { if (!(who instanceof BwUser)) { throw new CalFacadeException("Unsupported: non user principal for free-busy"); } BwUser u = (BwUser)who; Collection subs; if (cal != null) { getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); BwSubscription sub = BwSubscription.makeSubscription(cal); subs = new ArrayList(); subs.add(sub); } else if (currentUser().equals(who)) { subs = getSubscriptions(); } else { cal = getCal().getCalendars(u, PrivilegeDefs.privReadFreeBusy); if (cal == null) { throw new CalFacadeAccessException(); } getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); subs = dbi.fetchPreferences(u).getSubscriptions(); } BwFreeBusy fb = new BwFreeBusy(who, start, end); Collection events = new TreeSet(); Iterator subit = subs.iterator(); while (subit.hasNext()) { BwSubscription sub = (BwSubscription)subit.next(); if (!sub.getAffectsFreeBusy()) { continue; } // XXX If it's an external subscription we probably just get free busy and // merge it in. Collection evs = getEvents(sub, null, start, end, CalFacadeDefs.retrieveRecurExpanded, true); // Filter out transparent events Iterator it = evs.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // XXX Need to add sub.ignoreTransparency if (BwEvent.transparencyTransparent.equals(ev.getTransparency())) { continue; } events.add(ei); } } try { if (granularity != null) { // chunked. GetPeriodsPars gpp = new GetPeriodsPars(); gpp.events = events; gpp.startDt = start; gpp.dur = granularity; gpp.tzcache = getTimezones(); BwFreeBusyComponent fbc = null; if (!returnAll) { // One component fbc = new BwFreeBusyComponent(); fb.addTime(fbc); } int limit = 10000; // XXX do this better /* endDt is null first time through, then represents end of last * segment. */ while ((gpp.endDt == null) || (gpp.endDt.before(end))) { //if (debug) { // trace("gpp.startDt=" + gpp.startDt + " end=" + end); //} if (limit < 0) { throw new CalFacadeException("org.bedework.svci.limit.exceeded"); } limit--; Collection periodEvents = CalFacadeUtil.getPeriodsEvents(gpp); if (returnAll) { fbc = new BwFreeBusyComponent(); fb.addTime(fbc); DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); if (periodEvents.size() == 0) { fbc.setType(BwFreeBusyComponent.typeFree); } } else if (periodEvents.size() != 0) { // Some events fall in the period. Add an entry. DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); } } return fb; } /* For the moment just build a single BwFreeBusyComponent */ BwFreeBusyComponent fbc = new BwFreeBusyComponent(); Iterator it = events.iterator(); TreeSet eventPeriods = new TreeSet(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // Ignore if times were specified and this event is outside the times BwDateTime estart = ev.getDtstart(); BwDateTime eend = ev.getDtend(); /* Don't report out of the requested period */ String dstart; String dend; if (estart.before(start)) { dstart = start.getDtval(); } else { dstart = estart.getDtval(); } if (eend.after(end)) { dend = end.getDtval(); } else { dend = eend.getDtval(); } eventPeriods.add(new EventPeriod(new DateTime(dstart), new DateTime(dend))); } /* iterate through the sorted periods combining them where they are adjacent or overlap */ Period p = null; it = eventPeriods.iterator(); while (it.hasNext()) { EventPeriod ep = (EventPeriod)it.next(); if (p == null) { p = new Period(ep.start, ep.end); } else if (ep.start.after(p.getEnd())) { // Non adjacent periods fbc.addPeriod(p); p = new Period(ep.start, ep.end); } else if (ep.end.after(p.getEnd())) { // Extend the current period p = new Period(p.getStart(), ep.end); } // else it falls within the existing period } if (p != null) { fbc.addPeriod(p); } fb.addTime(fbc); } catch (Throwable t) { throw new CalFacadeException(t); } return fb; }
|
public BwFreeBusy getFreeBusy(BwCalendar cal, BwPrincipal who, BwDateTime start, BwDateTime end, BwDuration granularity, boolean returnAll) throws CalFacadeException { if (!(who instanceof BwUser)) { throw new CalFacadeException("Unsupported: non user principal for free-busy"); } BwUser u = (BwUser)who; Collection subs; if (cal != null) { getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); BwSubscription sub = BwSubscription.makeSubscription(cal); subs = new ArrayList(); subs.add(sub); } else if (currentUser().equals(who)) { subs = getSubscriptions(); } else { cal = getCal().getCalendars(u, PrivilegeDefs.privReadFreeBusy); if (cal == null) { throw new CalFacadeAccessException(); } getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); subs = dbi.fetchPreferences(u).getSubscriptions(); } BwFreeBusy fb = new BwFreeBusy(who, start, end); Collection events = new TreeSet(); Iterator subit = subs.iterator(); while (subit.hasNext()) { BwSubscription sub = (BwSubscription)subit.next(); if (!sub.getAffectsFreeBusy()) { continue; } // XXX If it's an external subscription we probably just get free busy and // merge it in. Collection evs = getEvents(sub, null, start, end, CalFacadeDefs.retrieveRecurExpanded, true); // Filter out transparent events Iterator it = evs.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // XXX Need to add sub.ignoreTransparency if (BwEvent.transparencyTransparent.equals(ev.getTransparency())) { continue; } events.add(ei); } } try { if (granularity != null) { // chunked. GetPeriodsPars gpp = new GetPeriodsPars(); gpp.events = events; gpp.startDt = start; gpp.dur = granularity; gpp.tzcache = getTimezones(); BwFreeBusyComponent fbc = null; if (!returnAll) { // One component fbc = new BwFreeBusyComponent(); fb.addTime(fbc); } int limit = 10000; // XXX do this better /* endDt is null first time through, then represents end of last * segment. */ while ((gpp.endDt == null) || (gpp.endDt.before(end))) { //if (debug) { // trace("gpp.startDt=" + gpp.startDt + " end=" + end); //} if (limit < 0) { throw new CalFacadeException("org.bedework.svci.limit.exceeded"); } limit--; Collection periodEvents = CalFacadeUtil.getPeriodsEvents(gpp); if (returnAll) { fbc = new BwFreeBusyComponent(); fb.addTime(fbc); DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); if (periodEvents.size() == 0) { fbc.setType(BwFreeBusyComponent.typeFree); } } else if (periodEvents.size() != 0) { // Some events fall in the period. Add an entry. DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); } } return fb; } /* For the moment just build a single BwFreeBusyComponent */ Iterator it = events.iterator(); TreeSet eventPeriods = new TreeSet(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // Ignore if times were specified and this event is outside the times BwDateTime estart = ev.getDtstart(); BwDateTime eend = ev.getDtend(); /* Don't report out of the requested period */ String dstart; String dend; if (estart.before(start)) { dstart = start.getDtval(); } else { dstart = estart.getDtval(); } if (eend.after(end)) { dend = end.getDtval(); } else { dend = eend.getDtval(); } eventPeriods.add(new EventPeriod(new DateTime(dstart), new DateTime(dend))); } /* iterate through the sorted periods combining them where they are adjacent or overlap */ Period p = null; it = eventPeriods.iterator(); while (it.hasNext()) { EventPeriod ep = (EventPeriod)it.next(); if (p == null) { p = new Period(ep.start, ep.end); } else if (ep.start.after(p.getEnd())) { // Non adjacent periods fbc.addPeriod(p); p = new Period(ep.start, ep.end); } else if (ep.end.after(p.getEnd())) { // Extend the current period p = new Period(p.getStart(), ep.end); } // else it falls within the existing period } if (p != null) { fbc.addPeriod(p); } fb.addTime(fbc); } catch (Throwable t) { throw new CalFacadeException(t); } return fb; }
| 1,117,955
|
public BwFreeBusy getFreeBusy(BwCalendar cal, BwPrincipal who, BwDateTime start, BwDateTime end, BwDuration granularity, boolean returnAll) throws CalFacadeException { if (!(who instanceof BwUser)) { throw new CalFacadeException("Unsupported: non user principal for free-busy"); } BwUser u = (BwUser)who; Collection subs; if (cal != null) { getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); BwSubscription sub = BwSubscription.makeSubscription(cal); subs = new ArrayList(); subs.add(sub); } else if (currentUser().equals(who)) { subs = getSubscriptions(); } else { cal = getCal().getCalendars(u, PrivilegeDefs.privReadFreeBusy); if (cal == null) { throw new CalFacadeAccessException(); } getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); subs = dbi.fetchPreferences(u).getSubscriptions(); } BwFreeBusy fb = new BwFreeBusy(who, start, end); Collection events = new TreeSet(); Iterator subit = subs.iterator(); while (subit.hasNext()) { BwSubscription sub = (BwSubscription)subit.next(); if (!sub.getAffectsFreeBusy()) { continue; } // XXX If it's an external subscription we probably just get free busy and // merge it in. Collection evs = getEvents(sub, null, start, end, CalFacadeDefs.retrieveRecurExpanded, true); // Filter out transparent events Iterator it = evs.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // XXX Need to add sub.ignoreTransparency if (BwEvent.transparencyTransparent.equals(ev.getTransparency())) { continue; } events.add(ei); } } try { if (granularity != null) { // chunked. GetPeriodsPars gpp = new GetPeriodsPars(); gpp.events = events; gpp.startDt = start; gpp.dur = granularity; gpp.tzcache = getTimezones(); BwFreeBusyComponent fbc = null; if (!returnAll) { // One component fbc = new BwFreeBusyComponent(); fb.addTime(fbc); } int limit = 10000; // XXX do this better /* endDt is null first time through, then represents end of last * segment. */ while ((gpp.endDt == null) || (gpp.endDt.before(end))) { //if (debug) { // trace("gpp.startDt=" + gpp.startDt + " end=" + end); //} if (limit < 0) { throw new CalFacadeException("org.bedework.svci.limit.exceeded"); } limit--; Collection periodEvents = CalFacadeUtil.getPeriodsEvents(gpp); if (returnAll) { fbc = new BwFreeBusyComponent(); fb.addTime(fbc); DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); if (periodEvents.size() == 0) { fbc.setType(BwFreeBusyComponent.typeFree); } } else if (periodEvents.size() != 0) { // Some events fall in the period. Add an entry. DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); } } return fb; } /* For the moment just build a single BwFreeBusyComponent */ BwFreeBusyComponent fbc = new BwFreeBusyComponent(); Iterator it = events.iterator(); TreeSet eventPeriods = new TreeSet(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // Ignore if times were specified and this event is outside the times BwDateTime estart = ev.getDtstart(); BwDateTime eend = ev.getDtend(); /* Don't report out of the requested period */ String dstart; String dend; if (estart.before(start)) { dstart = start.getDtval(); } else { dstart = estart.getDtval(); } if (eend.after(end)) { dend = end.getDtval(); } else { dend = eend.getDtval(); } eventPeriods.add(new EventPeriod(new DateTime(dstart), new DateTime(dend))); } /* iterate through the sorted periods combining them where they are adjacent or overlap */ Period p = null; it = eventPeriods.iterator(); while (it.hasNext()) { EventPeriod ep = (EventPeriod)it.next(); if (p == null) { p = new Period(ep.start, ep.end); } else if (ep.start.after(p.getEnd())) { // Non adjacent periods fbc.addPeriod(p); p = new Period(ep.start, ep.end); } else if (ep.end.after(p.getEnd())) { // Extend the current period p = new Period(p.getStart(), ep.end); } // else it falls within the existing period } if (p != null) { fbc.addPeriod(p); } fb.addTime(fbc); } catch (Throwable t) { throw new CalFacadeException(t); } return fb; }
|
public BwFreeBusy getFreeBusy(BwCalendar cal, BwPrincipal who, BwDateTime start, BwDateTime end, BwDuration granularity, boolean returnAll) throws CalFacadeException { if (!(who instanceof BwUser)) { throw new CalFacadeException("Unsupported: non user principal for free-busy"); } BwUser u = (BwUser)who; Collection subs; if (cal != null) { getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); BwSubscription sub = BwSubscription.makeSubscription(cal); subs = new ArrayList(); subs.add(sub); } else if (currentUser().equals(who)) { subs = getSubscriptions(); } else { cal = getCal().getCalendars(u, PrivilegeDefs.privReadFreeBusy); if (cal == null) { throw new CalFacadeAccessException(); } getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); subs = dbi.fetchPreferences(u).getSubscriptions(); } BwFreeBusy fb = new BwFreeBusy(who, start, end); Collection events = new TreeSet(); Iterator subit = subs.iterator(); while (subit.hasNext()) { BwSubscription sub = (BwSubscription)subit.next(); if (!sub.getAffectsFreeBusy()) { continue; } // XXX If it's an external subscription we probably just get free busy and // merge it in. Collection evs = getEvents(sub, null, start, end, CalFacadeDefs.retrieveRecurExpanded, true); // Filter out transparent events Iterator it = evs.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // XXX Need to add sub.ignoreTransparency if (BwEvent.transparencyTransparent.equals(ev.getTransparency())) { continue; } events.add(ei); } } try { if (granularity != null) { // chunked. GetPeriodsPars gpp = new GetPeriodsPars(); gpp.events = events; gpp.startDt = start; gpp.dur = granularity; gpp.tzcache = getTimezones(); BwFreeBusyComponent fbc = null; if (!returnAll) { // One component fbc = new BwFreeBusyComponent(); fb.addTime(fbc); } int limit = 10000; // XXX do this better /* endDt is null first time through, then represents end of last * segment. */ while ((gpp.endDt == null) || (gpp.endDt.before(end))) { //if (debug) { // trace("gpp.startDt=" + gpp.startDt + " end=" + end); //} if (limit < 0) { throw new CalFacadeException("org.bedework.svci.limit.exceeded"); } limit--; Collection periodEvents = CalFacadeUtil.getPeriodsEvents(gpp); if (returnAll) { fbc = new BwFreeBusyComponent(); fb.addTime(fbc); DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); if (periodEvents.size() == 0) { fbc.setType(BwFreeBusyComponent.typeFree); } } else if (periodEvents.size() != 0) { // Some events fall in the period. Add an entry. DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); } } return fb; } /* For the moment just build a single BwFreeBusyComponent */ BwFreeBusyComponent fbc = new BwFreeBusyComponent(); Iterator it = events.iterator(); TreeSet eventPeriods = new TreeSet(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // Ignore if times were specified and this event is outside the times BwDateTime estart = ev.getDtstart(); BwDateTime eend = ev.getDtend(); /* Don't report out of the requested period */ String dstart; String dend; if (estart.before(start)) { dstart = start.getDtval(); } else { dstart = estart.getDtval(); } if (eend.after(end)) { dend = end.getDtval(); } else { dend = eend.getDtval(); } eventPeriods.add(new EventPeriod(new DateTime(dstart), new DateTime(dend))); } /* iterate through the sorted periods combining them where they are adjacent or overlap */ Period p = null; it = eventPeriods.iterator(); while (it.hasNext()) { EventPeriod ep = (EventPeriod)it.next(); if (p == null) { p = new Period(ep.start, ep.end); } else if (ep.start.after(p.getEnd())) { // Non adjacent periods fbc.addPeriod(p); p = new Period(ep.start, ep.end); } else if (ep.end.after(p.getEnd())) { // Extend the current period p = new Period(p.getStart(), ep.end); } // else it falls within the existing period } if (p != null) { fbc.addPeriod(p); } fb.addTime(fbc); } catch (Throwable t) { throw new CalFacadeException(t); } return fb; }
| 1,117,956
|
public BwFreeBusy getFreeBusy(BwCalendar cal, BwPrincipal who, BwDateTime start, BwDateTime end, BwDuration granularity, boolean returnAll) throws CalFacadeException { if (!(who instanceof BwUser)) { throw new CalFacadeException("Unsupported: non user principal for free-busy"); } BwUser u = (BwUser)who; Collection subs; if (cal != null) { getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); BwSubscription sub = BwSubscription.makeSubscription(cal); subs = new ArrayList(); subs.add(sub); } else if (currentUser().equals(who)) { subs = getSubscriptions(); } else { cal = getCal().getCalendars(u, PrivilegeDefs.privReadFreeBusy); if (cal == null) { throw new CalFacadeAccessException(); } getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); subs = dbi.fetchPreferences(u).getSubscriptions(); } BwFreeBusy fb = new BwFreeBusy(who, start, end); Collection events = new TreeSet(); Iterator subit = subs.iterator(); while (subit.hasNext()) { BwSubscription sub = (BwSubscription)subit.next(); if (!sub.getAffectsFreeBusy()) { continue; } // XXX If it's an external subscription we probably just get free busy and // merge it in. Collection evs = getEvents(sub, null, start, end, CalFacadeDefs.retrieveRecurExpanded, true); // Filter out transparent events Iterator it = evs.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // XXX Need to add sub.ignoreTransparency if (BwEvent.transparencyTransparent.equals(ev.getTransparency())) { continue; } events.add(ei); } } try { if (granularity != null) { // chunked. GetPeriodsPars gpp = new GetPeriodsPars(); gpp.events = events; gpp.startDt = start; gpp.dur = granularity; gpp.tzcache = getTimezones(); BwFreeBusyComponent fbc = null; if (!returnAll) { // One component fbc = new BwFreeBusyComponent(); fb.addTime(fbc); } int limit = 10000; // XXX do this better /* endDt is null first time through, then represents end of last * segment. */ while ((gpp.endDt == null) || (gpp.endDt.before(end))) { //if (debug) { // trace("gpp.startDt=" + gpp.startDt + " end=" + end); //} if (limit < 0) { throw new CalFacadeException("org.bedework.svci.limit.exceeded"); } limit--; Collection periodEvents = CalFacadeUtil.getPeriodsEvents(gpp); if (returnAll) { fbc = new BwFreeBusyComponent(); fb.addTime(fbc); DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); if (periodEvents.size() == 0) { fbc.setType(BwFreeBusyComponent.typeFree); } } else if (periodEvents.size() != 0) { // Some events fall in the period. Add an entry. DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); } } return fb; } /* For the moment just build a single BwFreeBusyComponent */ BwFreeBusyComponent fbc = new BwFreeBusyComponent(); Iterator it = events.iterator(); TreeSet eventPeriods = new TreeSet(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // Ignore if times were specified and this event is outside the times BwDateTime estart = ev.getDtstart(); BwDateTime eend = ev.getDtend(); /* Don't report out of the requested period */ String dstart; String dend; if (estart.before(start)) { dstart = start.getDtval(); } else { dstart = estart.getDtval(); } if (eend.after(end)) { dend = end.getDtval(); } else { dend = eend.getDtval(); } eventPeriods.add(new EventPeriod(new DateTime(dstart), new DateTime(dend))); } /* iterate through the sorted periods combining them where they are adjacent or overlap */ Period p = null; it = eventPeriods.iterator(); while (it.hasNext()) { EventPeriod ep = (EventPeriod)it.next(); if (p == null) { p = new Period(ep.start, ep.end); } else if (ep.start.after(p.getEnd())) { // Non adjacent periods fbc.addPeriod(p); p = new Period(ep.start, ep.end); } else if (ep.end.after(p.getEnd())) { // Extend the current period p = new Period(p.getStart(), ep.end); } // else it falls within the existing period } if (p != null) { fbc.addPeriod(p); } fb.addTime(fbc); } catch (Throwable t) { throw new CalFacadeException(t); } return fb; }
|
public BwFreeBusy getFreeBusy(BwCalendar cal, BwPrincipal who, BwDateTime start, BwDateTime end, BwDuration granularity, boolean returnAll) throws CalFacadeException { if (!(who instanceof BwUser)) { throw new CalFacadeException("Unsupported: non user principal for free-busy"); } BwUser u = (BwUser)who; Collection subs; if (cal != null) { getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); BwSubscription sub = BwSubscription.makeSubscription(cal); subs = new ArrayList(); subs.add(sub); } else if (currentUser().equals(who)) { subs = getSubscriptions(); } else { cal = getCal().getCalendars(u, PrivilegeDefs.privReadFreeBusy); if (cal == null) { throw new CalFacadeAccessException(); } getCal().checkAccess(cal, PrivilegeDefs.privReadFreeBusy, false); subs = dbi.fetchPreferences(u).getSubscriptions(); } BwFreeBusy fb = new BwFreeBusy(who, start, end); Collection events = new TreeSet(); Iterator subit = subs.iterator(); while (subit.hasNext()) { BwSubscription sub = (BwSubscription)subit.next(); if (!sub.getAffectsFreeBusy()) { continue; } // XXX If it's an external subscription we probably just get free busy and // merge it in. Collection evs = getEvents(sub, null, start, end, CalFacadeDefs.retrieveRecurExpanded, true); // Filter out transparent events Iterator it = evs.iterator(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // XXX Need to add sub.ignoreTransparency if (BwEvent.transparencyTransparent.equals(ev.getTransparency())) { continue; } events.add(ei); } } try { if (granularity != null) { // chunked. GetPeriodsPars gpp = new GetPeriodsPars(); gpp.events = events; gpp.startDt = start; gpp.dur = granularity; gpp.tzcache = getTimezones(); BwFreeBusyComponent fbc = null; if (!returnAll) { // One component fbc = new BwFreeBusyComponent(); if (fbc != null) { fb.addTime(fbc); } } int limit = 10000; // XXX do this better /* endDt is null first time through, then represents end of last * segment. */ while ((gpp.endDt == null) || (gpp.endDt.before(end))) { //if (debug) { // trace("gpp.startDt=" + gpp.startDt + " end=" + end); //} if (limit < 0) { throw new CalFacadeException("org.bedework.svci.limit.exceeded"); } limit--; Collection periodEvents = CalFacadeUtil.getPeriodsEvents(gpp); if (returnAll) { fbc = new BwFreeBusyComponent(); if (fbc != null) { fb.addTime(fbc); } DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); if (periodEvents.size() == 0) { fbc.setType(BwFreeBusyComponent.typeFree); } } else if (periodEvents.size() != 0) { // Some events fall in the period. Add an entry. DateTime psdt = new DateTime(gpp.startDt.getDtval()); DateTime pedt = new DateTime(gpp.endDt.getDtval()); psdt.setUtc(true); pedt.setUtc(true); fbc.addPeriod(new Period(psdt, pedt)); } } return fb; } /* For the moment just build a single BwFreeBusyComponent */ BwFreeBusyComponent fbc = new BwFreeBusyComponent(); Iterator it = events.iterator(); TreeSet eventPeriods = new TreeSet(); while (it.hasNext()) { EventInfo ei = (EventInfo)it.next(); BwEvent ev = ei.getEvent(); // Ignore if times were specified and this event is outside the times BwDateTime estart = ev.getDtstart(); BwDateTime eend = ev.getDtend(); /* Don't report out of the requested period */ String dstart; String dend; if (estart.before(start)) { dstart = start.getDtval(); } else { dstart = estart.getDtval(); } if (eend.after(end)) { dend = end.getDtval(); } else { dend = eend.getDtval(); } eventPeriods.add(new EventPeriod(new DateTime(dstart), new DateTime(dend))); } /* iterate through the sorted periods combining them where they are adjacent or overlap */ Period p = null; it = eventPeriods.iterator(); while (it.hasNext()) { EventPeriod ep = (EventPeriod)it.next(); if (p == null) { p = new Period(ep.start, ep.end); } else if (ep.start.after(p.getEnd())) { // Non adjacent periods fbc.addPeriod(p); p = new Period(ep.start, ep.end); } else if (ep.end.after(p.getEnd())) { // Extend the current period p = new Period(p.getStart(), ep.end); } // else it falls within the existing period } if (p != null) { fbc.addPeriod(p); } if (fbc != null) { fb.addTime(fbc); } } catch (Throwable t) { throw new CalFacadeException(t); } return fb; }
| 1,117,957
|
public void createParticleDisplay(BasicSeismogramDisplay creator){ if(particleDisplay == null){ logger.debug("creating particle display"); particleWindow = new JFrame(); LocalSeismogramImpl seis = (((LocalSeismogramImpl)((DataSetSeismogram)creator.getSeismograms().getFirst()).getSeismogram())); particleDisplay = new ParticleMotionDisplay(seis, creator.getTimeRegistrar(), creator.getAmpRegistrar(), creator.getAmpRegistrar(), ((DataSetSeismogram)creator.getSeismograms().getFirst()).getDataSet()); particleDisplay.addAzimuthLine(15); particleDisplay.addSector(10, 20); JPanel displayPanel = new JPanel(); JButton zoomIn = new JButton("zoomIn"); JButton zoomOut = new JButton("zoomOut"); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout()); buttonPanel.add(zoomIn); buttonPanel.add(zoomOut); displayPanel.setLayout(new BorderLayout()); displayPanel.add(particleDisplay, java.awt.BorderLayout.CENTER); displayPanel.add(buttonPanel, java.awt.BorderLayout.SOUTH); java.awt.Dimension size = new java.awt.Dimension(400, 400); displayPanel.setSize(size); particleWindow.getContentPane().add(displayPanel); //particleWindow.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); particleWindow.setSize(size); zoomIn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { particleDisplay.setZoomIn(true); // particleDisplay.setZoomOut(false); } }); zoomOut.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { particleDisplay.setZoomOut(true); // particleDisplay.setZoomIn(false); } }); Toolkit tk = Toolkit.getDefaultToolkit(); particleWindow.setLocation(400 * particleDisplays, tk.getScreenSize().height); particleDisplays++; particleWindow.setVisible(true); } }
|
public void createParticleDisplay(BasicSeismogramDisplay creator){ if(particleDisplay == null){ logger.debug("creating particle display"); particleWindow = new JFrame(); LocalSeismogramImpl seis = (((LocalSeismogramImpl)((DataSetSeismogram)creator.getSeismograms().getFirst()).getSeismogram())); particleDisplay = new ParticleMotionDisplay(seis, creator.getTimeRegistrar(), creator.getAmpRegistrar(), creator.getAmpRegistrar(), ((DataSetSeismogram)creator.getSeismograms().getFirst()).getDataSet()); particleDisplay.addAzimuthLine(15); particleDisplay.addSector(10, 20); JPanel displayPanel = new JPanel(); JButton zoomIn = new JButton("zoomIn"); JButton zoomOut = new JButton("zoomOut"); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout()); buttonPanel.add(zoomIn); buttonPanel.add(zoomOut); displayPanel.setLayout(new BorderLayout()); displayPanel.add(particleDisplay, java.awt.BorderLayout.CENTER); displayPanel.add(buttonPanel, java.awt.BorderLayout.SOUTH); java.awt.Dimension size = new java.awt.Dimension(400, 400); displayPanel.setSize(size); particleWindow.getContentPane().add(displayPanel); //particleWindow.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); particleWindow.setSize(size); zoomIn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { particleDisplay.setZoomIn(true); // particleDisplay.setZoomOut(false); } }); zoomOut.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { particleDisplay.setZoomOut(true); // particleDisplay.setZoomIn(false); } }); Toolkit tk = Toolkit.getDefaultToolkit(); if(400*particleDisplays < tk.getScreenSize().width){ particleWindow.setLocation(400 * particleDisplays, tk.getScreenSize().height - 400); }else{ particleWindow.setLocation(tk.getScreenSize().width - 400, tk.getScreenSize().height - 400); } particleDisplays++; particleWindow.setVisible(true); } }
| 1,117,958
|
public void createSelectionDisplay(BasicSeismogramDisplay creator){ if(selectionDisplay == null){ logger.debug("creating selection display"); selectionWindow = new JFrame(); //selectionWindow.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); selectionWindow.setSize(400, 220); JToolBar infoBar = new JToolBar(); infoBar.add(new FilterSelection(selectionDisplay)); infoBar.setFloatable(false); selectionWindow.getContentPane().add(infoBar, BorderLayout.SOUTH); Iterator e = creator.getSeismograms().iterator(); TimeConfigRegistrar tr = creator.getCurrentSelection().getInternalConfig(); DataSetSeismogram first = ((DataSetSeismogram)e.next()); AmpConfigRegistrar ar = new AmpConfigRegistrar(new OffsetMeanAmpConfig(((LocalSeismogramImpl)first.getSeismogram()), tr.getTimeRange(first.getSeismogram()))); ar.visibleAmpCalc(tr); selectionDisplay = new VerticalSeismogramDisplay(mouseForwarder, motionForwarder); creator.getCurrentSelection().setDisplay(selectionDisplay.addDisplay(first, tr, creator.getName() + "." + creator.getCurrentSelection().getColor())); while(e.hasNext()){ selectionDisplay.addSeismogram(((DataSetSeismogram)e.next()), 0); } selectionWindow.getContentPane().add(selectionDisplay); Toolkit tk = Toolkit.getDefaultToolkit(); selectionWindow.setLocation(tk.getScreenSize().width, tk.getScreenSize().height - selectionDisplays * 250); selectionDisplays++; selectionWindow.setVisible(true); }else{ logger.debug("adding another selection"); Iterator e = creator.getSeismograms().iterator(); TimeConfigRegistrar tr = creator.getCurrentSelection().getInternalConfig(); DataSetSeismogram first = ((DataSetSeismogram)e.next()); AmpConfigRegistrar ar = new AmpConfigRegistrar(new OffsetMeanAmpConfig(((LocalSeismogramImpl)first.getSeismogram()), tr.getTimeRange(first.getSeismogram()))); ar.visibleAmpCalc(tr); creator.getCurrentSelection().setDisplay(selectionDisplay.addDisplay(first, tr, creator.getName() + "." + creator.getCurrentSelection().getColor())); while(e.hasNext()){ selectionDisplay.addSeismogram(((DataSetSeismogram)e.next()), 0); } } }
|
public void createSelectionDisplay(BasicSeismogramDisplay creator){ if(selectionDisplay == null){ logger.debug("creating selection display"); selectionWindow = new JFrame(); //selectionWindow.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); selectionWindow.setSize(400, 220); JToolBar infoBar = new JToolBar(); infoBar.add(new FilterSelection(selectionDisplay)); infoBar.setFloatable(false); selectionWindow.getContentPane().add(infoBar, BorderLayout.SOUTH); Iterator e = creator.getSeismograms().iterator(); TimeConfigRegistrar tr = creator.getCurrentSelection().getInternalConfig(); DataSetSeismogram first = ((DataSetSeismogram)e.next()); AmpConfigRegistrar ar = new AmpConfigRegistrar(new OffsetMeanAmpConfig(((LocalSeismogramImpl)first.getSeismogram()), tr.getTimeRange(first.getSeismogram()))); ar.visibleAmpCalc(tr); selectionDisplay = new VerticalSeismogramDisplay(mouseForwarder, motionForwarder); creator.getCurrentSelection().setDisplay(selectionDisplay.addDisplay(first, tr, creator.getName() + "." + creator.getCurrentSelection().getColor())); while(e.hasNext()){ selectionDisplay.addSeismogram(((DataSetSeismogram)e.next()), 0); } selectionWindow.getContentPane().add(selectionDisplay); Toolkit tk = Toolkit.getDefaultToolkit(); if((selectionDisplays + 1) * 220 < tk.getScreenSize().height){ selectionWindow.setLocation(tk.getScreenSize().width - 400, tk.getScreenSize().height - (selectionDisplays + 1) * 220); }else{ selectionWindow.setLocation(tk.getScreenSize().width - 400, 0); } selectionDisplays++; selectionWindow.setVisible(true); }else{ logger.debug("adding another selection"); Iterator e = creator.getSeismograms().iterator(); TimeConfigRegistrar tr = creator.getCurrentSelection().getInternalConfig(); DataSetSeismogram first = ((DataSetSeismogram)e.next()); AmpConfigRegistrar ar = new AmpConfigRegistrar(new OffsetMeanAmpConfig(((LocalSeismogramImpl)first.getSeismogram()), tr.getTimeRange(first.getSeismogram()))); ar.visibleAmpCalc(tr); creator.getCurrentSelection().setDisplay(selectionDisplay.addDisplay(first, tr, creator.getName() + "." + creator.getCurrentSelection().getColor())); while(e.hasNext()){ selectionDisplay.addSeismogram(((DataSetSeismogram)e.next()), 0); } } }
| 1,117,959
|
public void testDefaultAttrMap() { final String queryAttr = "uid"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", null); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(uid={0})"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr, "awp9"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("andrew.petro@yale.edu", attribs.get("mail")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
|
public void testDefaultAttrMap() { final String queryAttr = "uid"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", null); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(uid={0})"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr, "susan"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("andrew.petro@yale.edu", attribs.get("mail")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
| 1,117,961
|
public void testDefaultAttrMap() { final String queryAttr = "uid"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", null); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(uid={0})"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr, "awp9"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("andrew.petro@yale.edu", attribs.get("mail")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
|
public void testDefaultAttrMap() { final String queryAttr = "uid"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", null); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(uid={0})"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr, "awp9"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("susan.bramhall@yale.edu", attribs.get("mail")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
| 1,117,962
|
public void testInsufficientAttrQuery() { final String queryAttr1 = "uid"; final String queryAttr2 = "alias"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr1); queryAttrList.add(queryAttr2); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(&(uid={0})(alias={1}))"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr1, "awp9"); queryMap.put("email", "edalquist@unicon.net"); Map attribs = impl.getUserAttributes(queryMap); assertNull(attribs); }
|
public void testInsufficientAttrQuery() { final String queryAttr1 = "uid"; final String queryAttr2 = "alias"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr1); queryAttrList.add(queryAttr2); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(&(uid={0})(alias={1}))"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr1, "susan"); queryMap.put("email", "edalquist@unicon.net"); Map attribs = impl.getUserAttributes(queryMap); assertNull(attribs); }
| 1,117,963
|
public void testInvalidAttrMap() { final String queryAttr = "uid"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("email", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(uid={0})"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr, "awp9"); try { Map attribs = impl.getUserAttributes(queryMap); assertNull(attribs.get("email")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
|
public void testInvalidAttrMap() { final String queryAttr = "uid"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("email", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(uid={0})"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr, "susan"); try { Map attribs = impl.getUserAttributes(queryMap); assertNull(attribs.get("email")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
| 1,117,964
|
public void testMultiAttrQuery() { final String queryAttr1 = "uid"; final String queryAttr2 = "alias"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr1); queryAttrList.add(queryAttr2); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(&(uid={0})(alias={1}))"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr1, "awp9"); queryMap.put(queryAttr2, "andrew.petro"); queryMap.put("email", "edalquist@unicon.net"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("andrew.petro@yale.edu", attribs.get("email")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
|
public void testMultiAttrQuery() { final String queryAttr1 = "uid"; final String queryAttr2 = "alias"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr1); queryAttrList.add(queryAttr2); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(&(uid={0})(alias={1}))"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr1, "awp9"); queryMap.put(queryAttr2, "andrew.petro"); queryMap.put("email", "edalquist@unicon.net"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("andrew.petro@yale.edu", attribs.get("email")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
| 1,117,965
|
public void testMultiAttrQuery() { final String queryAttr1 = "uid"; final String queryAttr2 = "alias"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr1); queryAttrList.add(queryAttr2); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(&(uid={0})(alias={1}))"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr1, "awp9"); queryMap.put(queryAttr2, "andrew.petro"); queryMap.put("email", "edalquist@unicon.net"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("andrew.petro@yale.edu", attribs.get("email")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
|
public void testMultiAttrQuery() { final String queryAttr1 = "uid"; final String queryAttr2 = "alias"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr1); queryAttrList.add(queryAttr2); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(&(uid={0})(alias={1}))"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr1, "awp9"); queryMap.put(queryAttr2, "andrew.petro"); queryMap.put("email", "edalquist@unicon.net"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("susan.bramhall@yale.edu", attribs.get("email")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
| 1,117,966
|
public void testSingleAttrQuery() { final String queryAttr = "uid"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(uid={0})"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr, "awp9"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("andrew.petro@yale.edu", attribs.get("email")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
|
public void testSingleAttrQuery() { final String queryAttr = "uid"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(uid={0})"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr, "susan"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("andrew.petro@yale.edu", attribs.get("email")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
| 1,117,967
|
public void testSingleAttrQuery() { final String queryAttr = "uid"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(uid={0})"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr, "awp9"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("andrew.petro@yale.edu", attribs.get("email")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
|
public void testSingleAttrQuery() { final String queryAttr = "uid"; final List queryAttrList = new LinkedList(); queryAttrList.add(queryAttr); LdapPersonAttributeDao impl = new LdapPersonAttributeDao(); Map ldapAttribsToPortalAttribs = new HashMap(); ldapAttribsToPortalAttribs.put("mail", "email"); impl.setLdapAttributesToPortalAttributes(ldapAttribsToPortalAttribs); impl.setContextSource(this.contextSource); impl.setQuery("(uid={0})"); impl.setQueryAttributes(queryAttrList); Map queryMap = new HashMap(); queryMap.put(queryAttr, "awp9"); try { Map attribs = impl.getUserAttributes(queryMap); assertEquals("susan.bramhall@yale.edu", attribs.get("email")); } catch (DataAccessResourceFailureException darfe) { //OK, No net connection } }
| 1,117,968
|
public void parse(Node nd) throws WebdavException { /* Either empty - show everything or comp + optional (expand-recurrence-set or limit-recurrence-set) */ NamedNodeMap nnm = nd.getAttributes(); if ((nnm != null) && (nnm.getLength() > 1)) { throw new WebdavBadRequest(); } if (nnm != null) { if (nnm.getLength() == 1) { returnContentType = XmlUtil.getAttrVal(nnm, "return-content-type"); if (returnContentType == null) { throw new WebdavBadRequest(); } } else if (nnm.getLength() > 0) { // Bad attribute(s) throw new WebdavBadRequest(); } } Element[] children = getChildren(nd); try { for (int i = 0; i < children.length; i++) { Node curnode = children[i]; if (debug) { trace("calendar-data node type: " + curnode.getNodeType() + " name:" + curnode.getNodeName()); } if (MethodBase.nodeMatches(curnode, CaldavTags.comp)) { if (comp != null) { throw new WebdavBadRequest(); } comp = parseComp(curnode); } else if (MethodBase.nodeMatches(curnode, CaldavTags.expandRecurrenceSet) || MethodBase.nodeMatches(curnode, CaldavTags.expand)) { if (ers != null) { throw new WebdavBadRequest(); } ers = new ExpandRecurrenceSet(); parseTimeRange(curnode, ers); } else if (MethodBase.nodeMatches(curnode, CaldavTags.limitRecurrenceSet)) { if (lrs != null) { throw new WebdavBadRequest(); } lrs = new LimitRecurrenceSet(); parseTimeRange(curnode, lrs); } else { throw new WebdavBadRequest(); } } } catch (WebdavBadRequest wbr) { throw wbr; } catch (Throwable t) { throw new WebdavBadRequest(); } }
|
public void parse(Node nd) throws WebdavException { /* Either empty - show everything or comp + optional (expand-recurrence-set or limit-recurrence-set) */ NamedNodeMap nnm = nd.getAttributes(); if ((nnm != null) && (nnm.getLength() > 1)) { throw new WebdavBadRequest(); } if (nnm != null) { if (nnm.getLength() == 1) { returnContentType = XmlUtil.getAttrVal(nnm, "return-content-type"); if (returnContentType == null) { throw new WebdavBadRequest(); } } else if (nnm.getLength() > 0) { // Bad attribute(s) throw new WebdavBadRequest(); } } Element[] children = getChildren(nd); try { for (int i = 0; i < children.length; i++) { Node curnode = children[i]; if (debug) { trace("calendar-data node type: " + curnode.getNodeType() + " name:" + curnode.getNodeName()); } if (MethodBase.nodeMatches(curnode, CaldavTags.comp)) { if (comp != null) { throw new WebdavBadRequest(); } comp = parseComp(curnode); } else if (MethodBase.nodeMatches(curnode, CaldavTags.expandRecurrenceSet) || MethodBase.nodeMatches(curnode, CaldavTags.expand)) { if (ers != null) { throw new WebdavBadRequest(); } ers = new ExpandRecurrenceSet(); parseTimeRange(curnode, ers); } else if (MethodBase.nodeMatches(curnode, CaldavTags.limitRecurrenceSet)) { if (lrs != null) { throw new WebdavBadRequest(); } lrs = new LimitRecurrenceSet(); parseTimeRange(curnode, lrs); } else { throw new WebdavBadRequest(); } } } catch (WebdavBadRequest wbr) { throw wbr; } catch (Throwable t) { throw new WebdavBadRequest(); } }
| 1,117,969
|
public static Calendar getCalendar(String val) throws CalFacadeException { try { CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); return bldr.build(new StringReader(val), true); } catch (Throwable t) { throw new CalFacadeException(t); } }
|
public static Calendar getCalendar(String val) throws CalFacadeException { try { CalendarBuilder bldr = new CalendarBuilder(new CalendarParserImpl()); UnfoldingReader ufrdr = new UnfoldingReader(new StringReader(val), true); return bldr.build(ufrdr); } catch (Throwable t) { throw new CalFacadeException(t); } }
| 1,117,972
|
AccessUtil(boolean superUser, boolean debug) throws CalFacadeException { this.superUser = superUser; this.debug = debug; try { access = new Access(debug); } catch (Throwable t) { throw new CalFacadeException(t); } }
|
AccessUtil(boolean superUser, boolean debug) throws CalFacadeException { this.superUser = superUser; this.debug = debug; try { access = new Access(debug); } catch (Throwable t) { throw new CalFacadeException(t); } }
| 1,117,973
|
public EventProperties(CalintfImpl cal, String keyFieldName, String className, String refQuery, int minId, boolean debug) { this.cal = cal; this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; this.debug = debug; }
|
public EventProperties(Calintf cal, AccessUtil access, BwUser user, String keyFieldName, String className, String refQuery, int minId, boolean debug) { this.cal = cal; this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; this.debug = debug; }
| 1,117,974
|
public EventProperties(CalintfImpl cal, String keyFieldName, String className, String refQuery, int minId, boolean debug) { this.cal = cal; this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; this.debug = debug; }
|
public EventProperties(CalintfImpl cal, String keyFieldName, String className, String refQuery, int minId, boolean debug) { super(cal, access, user, debug); this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; this.debug = debug; }
| 1,117,975
|
public EventProperties(CalintfImpl cal, String keyFieldName, String className, String refQuery, int minId, boolean debug) { this.cal = cal; this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; this.debug = debug; }
|
public EventProperties(CalintfImpl cal, String keyFieldName, String className, String refQuery, int minId, boolean debug) { this.cal = cal; this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; }
| 1,117,976
|
CalTimezonesImpl(Calintf cal, BwStats stats, boolean publicAdmin, boolean debug) throws CalFacadeException { this.cal = cal; this.stats = (BwRWStats)stats; this.publicAdmin = publicAdmin; this.debug = debug; // Force fetch of timezones //lookup("not-a-timezone"); }
|
CalTimezonesImpl(Calintf cal, BwStats stats, boolean publicAdmin, boolean debug) throws CalFacadeException { this.cal = cal; this.stats = (BwRWStats)stats; this.publicAdmin = publicAdmin; // Force fetch of timezones //lookup("not-a-timezone"); }
| 1,117,977
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.fetchSvci(); String str = getReqPar(request, "user"); if (str == null) { return "success"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.error.nosuchuserid", str); return "notFound"; } form.setUserPreferences(svc.getUserPrefs(user)); return "success"; }
|
public String doAction(HttpServletRequest request, HttpServletResponse response, BwSession sess, BwActionFormBase form) throws Throwable { if (!form.getUserAuth().isSuperUser()) { return "noAccess"; // First line of defence } CalSvcI svc = form.fetchSvci(); String str = getReqPar(request, "user"); if (str == null) { return "notFound"; } BwUser user = svc.findUser(str); if (user == null) { form.getErr().emit("org.bedework.client.error.nosuchuserid", str); return "notFound"; } form.setUserPreferences(svc.getUserPrefs(user)); return "notFound"; }
| 1,117,978
|
public boolean init(String url, String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { boolean userAdded = super.init(url, authenticatedUser, user, publicAdmin, groups, synchId, debug); if (httpManager == null) { synchronized (this) { if (httpManager == null) { httpManager = new HttpManager("org.bedework.http.client.caldav.CaldavClient"); } } } return userAdded; }
|
public boolean init(String systemName, String url, String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { boolean userAdded = super.init(url, authenticatedUser, user, publicAdmin, groups, synchId, debug); if (httpManager == null) { synchronized (this) { if (httpManager == null) { httpManager = new HttpManager("org.bedework.http.client.caldav.CaldavClient"); } } } return userAdded; }
| 1,117,979
|
public boolean init(String url, String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { boolean userAdded = super.init(url, authenticatedUser, user, publicAdmin, groups, synchId, debug); if (httpManager == null) { synchronized (this) { if (httpManager == null) { httpManager = new HttpManager("org.bedework.http.client.caldav.CaldavClient"); } } } return userAdded; }
|
public boolean init(String url, String authenticatedUser, String user, boolean publicAdmin, Groups groups, String synchId, boolean debug) throws CalFacadeException { boolean userAdded = super.init(systemName, url, authenticatedUser, user, publicAdmin, groups, synchId, debug); if (httpManager == null) { synchronized (this) { if (httpManager == null) { httpManager = new HttpManager("org.bedework.http.client.caldav.CaldavClient"); } } } return userAdded; }
| 1,117,980
|
public BwUser getUser(int id) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); }
|
public BwUser getUser(int id) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); }
| 1,117,981
|
public void updateUser(BwUser user) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); }
|
public void updateUser(BwUser user) throws CalFacadeException { checkOpen(); throw new CalFacadeUnimplementedException(); }
| 1,117,982
|
public static void main(String[] args) { /* Initializes the corba orb, finds the naming service and other startup * tasks. See AbstractClient for the code in this method. */ init(args); try { /** This step is not required, but sometimes helps to determine if * a server is down. if this call succedes but the next fails, then * the nameing service is up and functional, but the network server * is not reachable for some reason. */ Object obj = fisName.getEventDCObject("edu/iris/dmc", "IRIS_EventDC"); logger.info("Got as corba object, the name service is ok"); /** This connectts to the actual server, as oposed to just getting * the reference to it. The naming convention is that the first * part is the reversed DNS of the organization and the second part * is the individual server name. The dmc lists their servers under * the edu/iris/dmc and their main network server is IRIS_EventDC.*/ EventDC eventDC = fisName.getEventDC("edu/iris/dmc", "IRIS_EventDC"); logger.info("got EventDC"); /** The EventFinder is one of the choices at this point. It * allows you to query for individual events, and then retrieve * information about them. */ EventFinder finder = eventDC.a_finder(); logger.info("got EventFinder"); MicroSecondDate now = new MicroSecondDate(); MicroSecondDate yesterday = now.subtract(new TimeInterval(7, UnitImpl.DAY)); TimeRange timeRange = new TimeRange(yesterday.getFissuresTime(), now.getFissuresTime()); String[] magTypes = new String[1]; magTypes[0] = "%"; String[] catalogs = new String[1]; catalogs[0] = "FINGER"; String[] contributors = new String[1]; contributors[0] = "NEIC"; EventSeqIterHolder iter = new EventSeqIterHolder(); EventAccess[] events = finder.query_events(new GlobalAreaImpl(), new QuantityImpl(0, UnitImpl.KILOMETER), new QuantityImpl(1000, UnitImpl.KILOMETER), timeRange, magTypes, 5.0f, 10.0f, catalogs, contributors, 500, iter); logger.info("Got "+events.length+" events."); for (int i = 0; i < events.length; i++) { EventAttr attr = events[i].get_attributes(); try { Origin origin = events[i].get_preferred_origin(); logger.info("Event "+i+" occurred in FE region "+attr.region.number+ " at "+origin.origin_time.date_time+ " mag="+origin.magnitudes[0].type+" "+origin.magnitudes[0].value+ " at ("+origin.my_location.latitude+", "+origin.my_location.longitude+") "+ "with depth of "+origin.my_location.depth.value+" "+origin.my_location.depth.the_units); } catch (NoPreferredOrigin e) { logger.warn("No preferred origin for event "+i, e); } } /** Here are someof the possible problems that can occur. */ }catch (org.omg.CORBA.ORBPackage.InvalidName e) { logger.error("Problem with name service: ", e); }catch (org.omg.CosNaming.NamingContextPackage.InvalidName e) { logger.error("Problem with name service: ", e); }catch (NotFound e) { logger.error("Problem with name service: ", e); }catch (CannotProceed e) { logger.error("Problem with name service: ", e); } /** All done... */ }
|
public static void main(String[] args) { /* Initializes the corba orb, finds the naming service and other startup * tasks. See AbstractClient for the code in this method. */ init(args); try { /** This step is not required, but sometimes helps to determine if * a server is down. if this call succedes but the next fails, then * the nameing service is up and functional, but the network server * is not reachable for some reason. */ Object obj = fisName.getEventDCObject("edu/iris/dmc", "IRIS_EventDC"); logger.info("Got as corba object, the name service is ok"); /** This connectts to the actual server, as oposed to just getting * the reference to it. The naming convention is that the first * part is the reversed DNS of the organization and the second part * is the individual server name. The dmc lists their servers under * the edu/iris/dmc and their main network server is IRIS_EventDC.*/ EventDC eventDC = fisName.getEventDC("edu/iris/dmc", "IRIS_EventDC"); logger.info("got EventDC"); /** The EventFinder is one of the choices at this point. It * allows you to query for individual events, and then retrieve * information about them. */ EventFinder finder = eventDC.a_finder(); logger.info("got EventFinder"); MicroSecondDate now = ClockUtil.now(); MicroSecondDate yesterday = now.subtract(new TimeInterval(7, UnitImpl.DAY)); TimeRange timeRange = new TimeRange(yesterday.getFissuresTime(), now.getFissuresTime()); String[] magTypes = new String[1]; magTypes[0] = "%"; String[] catalogs = new String[1]; catalogs[0] = "FINGER"; String[] contributors = new String[1]; contributors[0] = "NEIC"; EventSeqIterHolder iter = new EventSeqIterHolder(); EventAccess[] events = finder.query_events(new GlobalAreaImpl(), new QuantityImpl(0, UnitImpl.KILOMETER), new QuantityImpl(1000, UnitImpl.KILOMETER), timeRange, magTypes, 5.0f, 10.0f, catalogs, contributors, 500, iter); logger.info("Got "+events.length+" events."); for (int i = 0; i < events.length; i++) { EventAttr attr = events[i].get_attributes(); try { Origin origin = events[i].get_preferred_origin(); logger.info("Event "+i+" occurred in FE region "+attr.region.number+ " at "+origin.origin_time.date_time+ " mag="+origin.magnitudes[0].type+" "+origin.magnitudes[0].value+ " at ("+origin.my_location.latitude+", "+origin.my_location.longitude+") "+ "with depth of "+origin.my_location.depth.value+" "+origin.my_location.depth.the_units); } catch (NoPreferredOrigin e) { logger.warn("No preferred origin for event "+i, e); } } /** Here are someof the possible problems that can occur. */ }catch (org.omg.CORBA.ORBPackage.InvalidName e) { logger.error("Problem with name service: ", e); }catch (org.omg.CosNaming.NamingContextPackage.InvalidName e) { logger.error("Problem with name service: ", e); }catch (NotFound e) { logger.error("Problem with name service: ", e); }catch (CannotProceed e) { logger.error("Problem with name service: ", e); } /** All done... */ }
| 1,117,983
|
public int sort(DataSetSeismogram[] seismograms, String name){ int i = 0; while(i < names.size() && ((String)names.get(i)).compareToIgnoreCase(name) < 0){ i++; } names.add(i, name); return i; }
|
public int sort(DataSetSeismogram[] seismograms){ int i = 0; while(i < names.size() && ((String)names.get(i)).compareToIgnoreCase(name) < 0){ i++; } names.add(i, name); return i; }
| 1,117,984
|
public int sort(DataSetSeismogram[] seismograms, String name){ int i = 0; while(i < names.size() && ((String)names.get(i)).compareToIgnoreCase(name) < 0){ i++; } names.add(i, name); return i; }
|
public int sort(DataSetSeismogram[] seismograms, String name){ int i = 0; while(i < names.size() && ((String)names.get(i)).compareToIgnoreCase(seismograms[i].getName()) < 0){ i++; } names.add(i, name); return i; }
| 1,117,985
|
public int sort(DataSetSeismogram[] seismograms, String name){ int i = 0; while(i < names.size() && ((String)names.get(i)).compareToIgnoreCase(name) < 0){ i++; } names.add(i, name); return i; }
|
public int sort(DataSetSeismogram[] seismograms, String name){ int i = 0; while(i < names.size() && ((String)names.get(i)).compareToIgnoreCase(name) < 0){ i++; } names.add(i, seismograms[i].getName()); return i; }
| 1,117,986
|
public Font getFont(String key) { return getFont(key, Font.decode(null)); }
|
public Font getFont(String key) { return getFont(key, new Font("SansSerif", 12, Font.PLAIN)); }
| 1,117,988
|
public EventProperties(Calintf cal, AccessUtil access, BwUser user, int currentMode, boolean ignoreCreator, String keyFieldName, String className, String refQuery, int minId, boolean debug) { super(cal, access, user, currentMode, ignoreCreator, debug); this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; }
|
public EventProperties(Calintf cal, AccessUtil access, int currentMode, boolean ignoreCreator, String keyFieldName, String className, String refQuery, int minId, boolean debug) { super(cal, access, user, currentMode, ignoreCreator, debug); this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; }
| 1,117,989
|
public EventProperties(Calintf cal, AccessUtil access, BwUser user, int currentMode, boolean ignoreCreator, String keyFieldName, String className, String refQuery, int minId, boolean debug) { super(cal, access, user, currentMode, ignoreCreator, debug); this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; }
|
public EventProperties(Calintf cal, AccessUtil access, BwUser user, int currentMode, boolean ignoreCreator, String keyFieldName, String className, String refQuery, int minId, boolean debug) { super(cal, access, currentMode, ignoreCreator, debug); this.keyFieldName = keyFieldName; this.className = className; this.refQuery = refQuery; this.minId = minId; }
| 1,117,990
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.