idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
141,900 | @ SafeVarargs private static void checkNoAnnotations ( Method method , Class < ? extends Annotation > foundAn , Class < ? extends Annotation > ... disallowedAn ) { for ( Class < ? extends Annotation > an : disallowedAn ) { if ( method . isAnnotationPresent ( an ) ) { throw new EventsException ( "Method " + Utils . methodToString ( method ) + " marked with @" + foundAn . getSimpleName ( ) + " cannot be marked with @" + an . getSimpleName ( ) ) ; } } } | Checks that no given annotations are present on given method | 121 | 11 |
141,901 | private static CacheProvider getCacheProvider ( Method javaMethod ) { if ( ! javaMethod . isAnnotationPresent ( Cache . class ) ) { return null ; } Cache an = javaMethod . getAnnotation ( Cache . class ) ; Class < ? extends CacheProvider > cacheClazz = an . value ( ) ; try { Constructor < ? extends CacheProvider > constructor = cacheClazz . getDeclaredConstructor ( ) ; constructor . setAccessible ( true ) ; return constructor . newInstance ( ) ; } catch ( Exception e ) { throw new EventsException ( "Cannot instantiate cache provider " + cacheClazz . getSimpleName ( ) + " for method " + Utils . methodToString ( javaMethod ) , e ) ; } } | Retrieves cache provider instance for method | 159 | 8 |
141,902 | protected void submit ( final double value , final boolean isIncrement ) { MetricCollector collector = MetricManager . getCollector ( ) ; if ( collector != null ) { Metric . Builder builder = Metric . newBuilder ( ) ; builder . identity ( identity ) ; builder . value ( value ) ; builder . isIncrement ( isIncrement ) ; Metric metric = builder . build ( ) ; collector . submit ( metric ) ; } } | Submits a metric to the collector | 96 | 7 |
141,903 | protected void autoReportZero ( ) { MetricCollector collector = MetricManager . getCollector ( ) ; if ( collector != null ) { collector . autoReportZero ( identity ) ; } } | Auto reports zero if the metric hasn t been modified | 42 | 10 |
141,904 | protected void autoReportLast ( ) { MetricCollector collector = MetricManager . getCollector ( ) ; if ( collector != null ) { collector . autoReportLast ( identity ) ; } } | Auto reports the last value if the metric hasn t been modified | 42 | 12 |
141,905 | public static MozuUrl updateLocalizedContentsUrl ( String attributeFQN ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/LocalizedContent" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateLocalizedContents | 113 | 9 |
141,906 | public static MozuUrl updateLocalizedContentUrl ( String attributeFQN , String localeCode , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/LocalizedContent/{localeCode}?responseFields={responseFields}" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; formatter . formatUrl ( "localeCode" , localeCode ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateLocalizedContent | 169 | 9 |
141,907 | public static MozuUrl deleteLocalizedContentUrl ( String attributeFQN , String localeCode ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/LocalizedContent/{localeCode}" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; formatter . formatUrl ( "localeCode" , localeCode ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteLocalizedContent | 138 | 9 |
141,908 | public static MozuUrl applyCouponUrl ( String checkoutId , String couponCode , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/checkouts/{checkoutId}/coupons/{couponCode}?responseFields={responseFields}" ) ; formatter . formatUrl ( "checkoutId" , checkoutId ) ; formatter . formatUrl ( "couponCode" , couponCode ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for ApplyCoupon | 155 | 9 |
141,909 | public static MozuUrl removeCouponUrl ( String checkoutId , String couponCode ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/checkouts/{checkoutId}/coupons/{couponcode}" ) ; formatter . formatUrl ( "checkoutId" , checkoutId ) ; formatter . formatUrl ( "couponCode" , couponCode ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for RemoveCoupon | 124 | 9 |
141,910 | public static MozuUrl getRandomAccessCursorUrl ( String filter , Integer pageSize , String query , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/storefront/productsearch/randomAccessCursor/?query={query}&filter={filter}&pageSize={pageSize}&responseFields={responseFields}" ) ; formatter . formatUrl ( "filter" , filter ) ; formatter . formatUrl ( "pageSize" , pageSize ) ; formatter . formatUrl ( "query" , query ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetRandomAccessCursor | 177 | 10 |
141,911 | public static MozuUrl getAccountNotesUrl ( Integer accountId , String filter , Integer pageSize , String responseFields , String sortBy , Integer startIndex ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/accounts/{accountId}/notes?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&responseFields={responseFields}" ) ; formatter . formatUrl ( "accountId" , accountId ) ; formatter . formatUrl ( "filter" , filter ) ; formatter . formatUrl ( "pageSize" , pageSize ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "sortBy" , sortBy ) ; formatter . formatUrl ( "startIndex" , startIndex ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetAccountNotes | 224 | 8 |
141,912 | public static MozuUrl addAccountNoteUrl ( Integer accountId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/accounts/{accountId}/notes?responseFields={responseFields}" ) ; formatter . formatUrl ( "accountId" , accountId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for AddAccountNote | 125 | 8 |
141,913 | public static MozuUrl updateAccountNoteUrl ( Integer accountId , Integer noteId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/accounts/{accountId}/notes/{noteId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "accountId" , accountId ) ; formatter . formatUrl ( "noteId" , noteId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateAccountNote | 149 | 8 |
141,914 | public static MozuUrl deleteAccountNoteUrl ( Integer accountId , Integer noteId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/customer/accounts/{accountId}/notes/{noteId}" ) ; formatter . formatUrl ( "accountId" , accountId ) ; formatter . formatUrl ( "noteId" , noteId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteAccountNote | 118 | 8 |
141,915 | public static MozuUrl getFacetsUrl ( String documentListName , String propertyName ) { UrlFormatter formatter = new UrlFormatter ( "/api/content/documentlists/{documentListName}/facets/{propertyName}" ) ; formatter . formatUrl ( "documentListName" , documentListName ) ; formatter . formatUrl ( "propertyName" , propertyName ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetFacets | 120 | 8 |
141,916 | public static MozuUrl getAttributeVocabularyValueLocalizedContentsUrl ( String attributeFQN , String value ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/VocabularyValues/{value}/LocalizedContent" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; formatter . formatUrl ( "value" , value ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetAttributeVocabularyValueLocalizedContents | 143 | 14 |
141,917 | public static MozuUrl addAttributeVocabularyValueUrl ( String attributeFQN , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/VocabularyValues?responseFields={responseFields}" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for AddAttributeVocabularyValue | 146 | 11 |
141,918 | public static MozuUrl updateAttributeVocabularyValueUrl ( String attributeFQN , String responseFields , String value ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/VocabularyValues/{value}?responseFields={responseFields}" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "value" , value ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateAttributeVocabularyValue | 166 | 11 |
141,919 | public static MozuUrl deleteAttributeVocabularyValueLocalizedContentUrl ( String attributeFQN , String localeCode , String value ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/attributedefinition/attributes/{attributeFQN}/VocabularyValues/{value}/LocalizedContent/{localeCode}" ) ; formatter . formatUrl ( "attributeFQN" , attributeFQN ) ; formatter . formatUrl ( "localeCode" , localeCode ) ; formatter . formatUrl ( "value" , value ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteAttributeVocabularyValueLocalizedContent | 168 | 14 |
141,920 | public static MozuUrl updateCheckoutAttributeUrl ( String checkoutId , Boolean removeMissing ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/checkouts/{checkoutId}/attributes?removeMissing={removeMissing}" ) ; formatter . formatUrl ( "checkoutId" , checkoutId ) ; formatter . formatUrl ( "removeMissing" , removeMissing ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateCheckoutAttribute | 121 | 9 |
141,921 | public static MozuUrl createDeveloperUserAuthTicketUrl ( Integer developerAccountId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/developer/authtickets/?developerAccountId={developerAccountId}&responseFields={responseFields}" ) ; formatter . formatUrl ( "developerAccountId" , developerAccountId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . HOME_POD ) ; } | Get Resource Url for CreateDeveloperUserAuthTicket | 135 | 11 |
141,922 | @ RequestMapping ( value = "/tenants" , method = RequestMethod . GET ) public String getTenants ( @ RequestParam ( "tenantId" ) Integer tenantId , Locale locale , ModelMap modelMap , Model model ) { AuthenticationProfile authenticationProfile = ( AuthenticationProfile ) modelMap . get ( "tenantAuthorization" ) ; //if there is no active user, go to the auth page. if ( authenticationProfile == null ) { setupHomePage ( locale , model ) ; return "home" ; } // if no tenant id was supplied just use the active tenantID in the user auth. if ( tenantId == null ) { tenantId = authenticationProfile . getActiveScope ( ) . getId ( ) ; } // we need to get a new auth ticket for the tenant and update the authenticationProfile in session. if ( tenantId != null && ! tenantId . equals ( authenticationProfile . getActiveScope ( ) . getId ( ) ) ) { authenticationProfile = UserAuthenticator . refreshUserAuthTicket ( authenticationProfile . getAuthTicket ( ) , tenantId ) ; model . addAttribute ( "tenantAuthorization" , authenticationProfile ) ; } // Authorize user and get tenants List < Scope > tenants = authenticationProfile . getAuthorizedScopes ( ) ; if ( tenants == null ) { tenants = new ArrayList < Scope > ( ) ; tenants . add ( authenticationProfile . getActiveScope ( ) ) ; } model . addAttribute ( "user" , authenticationProfile . getUserProfile ( ) ) ; model . addAttribute ( "availableTenants" , tenants ) ; model . addAttribute ( "tenantId" , tenantId ) ; List < Site > sites = null ; if ( tenants != null && tenants . size ( ) > 0 ) { sites = getAvailableTenantSites ( tenantId ) ; } else { sites = new ArrayList < Site > ( ) ; } model . addAttribute ( "sites" , sites ) ; return "tenants" ; } | This method is used when the application and user have been authorized | 423 | 12 |
141,923 | public static MozuUrl getTenantScopesForUserUrl ( String responseFields , String userId ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/adminuser/accounts/{userId}/tenants?responseFields={responseFields}" ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "userId" , userId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . HOME_POD ) ; } | Get Resource Url for GetTenantScopesForUser | 128 | 12 |
141,924 | public static MozuUrl getConfigurationUrl ( String carrierId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/shipping/admin/carriers/{carrierId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "carrierId" , carrierId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetConfiguration | 126 | 7 |
141,925 | public static MozuUrl deleteConfigurationUrl ( String carrierId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/shipping/admin/carriers/{carrierId}" ) ; formatter . formatUrl ( "carrierId" , carrierId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteConfiguration | 95 | 7 |
141,926 | public static MozuUrl getPackageUrl ( String applicationKey , Boolean includeChildren , String responseFields , Boolean skipDevAccountCheck ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/appdev/apppackages/{applicationKey}/?includeChildren={includeChildren}&skipDevAccountCheck={skipDevAccountCheck}&responseFields={responseFields}" ) ; formatter . formatUrl ( "applicationKey" , applicationKey ) ; formatter . formatUrl ( "includeChildren" , includeChildren ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "skipDevAccountCheck" , skipDevAccountCheck ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetPackage | 184 | 7 |
141,927 | public static MozuUrl getApplicationSummaryChildrenUrl ( String appId ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/appdev/apppackages/apps/{appId}/" ) ; formatter . formatUrl ( "appId" , appId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetApplicationSummaryChildren | 96 | 9 |
141,928 | public static MozuUrl clonePackageUrl ( String applicationKey , String packageName , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/appdev/apppackages/{applicationKey}/clone/{packageName}?responseFields={responseFields}" ) ; formatter . formatUrl ( "applicationKey" , applicationKey ) ; formatter . formatUrl ( "packageName" , packageName ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for ClonePackage | 148 | 7 |
141,929 | public static MozuUrl getAppVersionsUrl ( String nsAndAppId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/developer/applications/versions/{nsAndAppId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "nsAndAppId" , nsAndAppId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . HOME_POD ) ; } | Get Resource Url for GetAppVersions | 132 | 8 |
141,930 | public static MozuUrl getPackageFileMetadataUrl ( String applicationKey , String filepath , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/developer/packages/{applicationKey}/filemetadata/{filepath}?responseFields={responseFields}" ) ; formatter . formatUrl ( "applicationKey" , applicationKey ) ; formatter . formatUrl ( "filepath" , filepath ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . HOME_POD ) ; } | Get Resource Url for GetPackageFileMetadata | 149 | 10 |
141,931 | public static MozuUrl upsertPackageFileUrl ( String applicationKey , String filepath , String lastModifiedTime , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/developer/packages/{applicationKey}/files/{filepath}?lastModifiedTime={lastModifiedTime}&responseFields={responseFields}" ) ; formatter . formatUrl ( "applicationKey" , applicationKey ) ; formatter . formatUrl ( "filepath" , filepath ) ; formatter . formatUrl ( "lastModifiedTime" , lastModifiedTime ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . HOME_POD ) ; } | Get Resource Url for UpsertPackageFile | 183 | 9 |
141,932 | public static MozuUrl renamePackageFileUrl ( String applicationKey , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/developer/packages/{applicationKey}/files_rename?responseFields={responseFields}" ) ; formatter . formatUrl ( "applicationKey" , applicationKey ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . HOME_POD ) ; } | Get Resource Url for RenamePackageFile | 125 | 9 |
141,933 | public static MozuUrl deletePackageFileUrl ( String applicationKey , String filepath ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/developer/packages/{applicationKey}/files/{filepath}" ) ; formatter . formatUrl ( "applicationKey" , applicationKey ) ; formatter . formatUrl ( "filepath" , filepath ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . HOME_POD ) ; } | Get Resource Url for DeletePackageFile | 115 | 8 |
141,934 | public static ScoreFunction illumina ( ) { return new ScoreFunction ( ) { @ Override public double evaluate ( final double relativePosition ) { // TODO: this could use improvement; perhaps re-use quality profiles from ART if ( relativePosition < 0.05d ) { return 14400.0d * ( relativePosition * relativePosition ) ; } else if ( relativePosition < 0.8d ) { return 36.0d ; } else { return 22600.0d * Math . pow ( relativePosition - 1.0d , 4.0d ) ; } } } ; } | Illumina positional score function . | 124 | 7 |
141,935 | public static MozuUrl getFacetUrl ( Integer facetId , String responseFields , Boolean validate ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/facets/{facetId}?validate={validate}&responseFields={responseFields}" ) ; formatter . formatUrl ( "facetId" , facetId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "validate" , validate ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetFacet | 151 | 8 |
141,936 | public static MozuUrl getFacetCategoryListUrl ( Integer categoryId , Boolean includeAvailable , String responseFields , Boolean validate ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/facets/category/{categoryId}?includeAvailable={includeAvailable}&validate={validate}&responseFields={responseFields}" ) ; formatter . formatUrl ( "categoryId" , categoryId ) ; formatter . formatUrl ( "includeAvailable" , includeAvailable ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "validate" , validate ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetFacetCategoryList | 179 | 10 |
141,937 | public static MozuUrl updateFacetUrl ( Integer facetId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/facets/{facetId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "facetId" , facetId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateFacet | 127 | 8 |
141,938 | public static MozuUrl deleteFacetByIdUrl ( Integer facetId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/facets/{facetId}" ) ; formatter . formatUrl ( "facetId" , facetId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteFacetById | 97 | 9 |
141,939 | @ Override public Interval < C > intersect ( final Interval < C > that ) { if ( this == MAGIC || that == NULL ) { return that ; } if ( this == NULL ) { return NULL ; } if ( that == MAGIC ) { return new Interval ( this . dimension , this . range ) ; } if ( this . dimension == that . dimension ) { if ( this . isConnected ( that ) ) { return new Interval ( this . dimension , this . range . intersection ( that . range ) ) ; } return new Interval ( this . dimension ) ; } return NULL ; } | Find the intersection of two intervals . | 130 | 7 |
141,940 | public Interval < C > coalesce ( final Interval < C > that ) { if ( this . overlaps ( that ) ) { return new Interval ( this . dimension , this . range . span ( that . range ) ) ; } return NULL ; } | Find the coalesced result of two overlapping intervals . | 55 | 10 |
141,941 | public boolean isConnected ( final Interval < C > that ) { if ( this . hasNone ( ) || that . hasNone ( ) ) { return false ; } return this . range . isConnected ( that . range ) ; } | Test if two intervals are connected | 51 | 6 |
141,942 | @ Beta public Difference < C > minus ( final Interval < C > that ) { return new Difference ( this . intersect ( that . ahead ( ) ) , this . intersect ( that . behind ( ) ) ) ; } | Experimental method to find the difference between two intervals . | 46 | 11 |
141,943 | public Interval < C > ahead ( ) { if ( this . hasNone ( ) ) { return new Interval ( this . dimension , Range . all ( ) ) ; } if ( this . range . equals ( Range . all ( ) ) ) { return new Interval ( this . dimension ) ; } return new Interval ( this . dimension , Range . downTo ( this . range . upperEndpoint ( ) , reverse ( this . range . upperBoundType ( ) ) ) ) ; } | Find the interval that extends ahead of this one . | 104 | 10 |
141,944 | public Interval < C > behind ( ) { if ( this . hasNone ( ) ) { return new Interval ( this . dimension , Range . all ( ) ) ; } if ( this . range . equals ( Range . all ( ) ) ) { return new Interval ( this . dimension ) ; } return new Interval ( this . dimension , Range . upTo ( this . range . lowerEndpoint ( ) , reverse ( this . range . lowerBoundType ( ) ) ) ) ; } | Find the interval that extends behind this one . | 104 | 9 |
141,945 | public Interval < C > gap ( final Interval < C > that ) { if ( this . before ( that ) ) { return this . ahead ( ) . intersect ( that . behind ( ) ) ; } if ( this . after ( that ) ) { return this . behind ( ) . intersect ( that . ahead ( ) ) ; } return NULL ; } | Find the gap between two intervals . | 75 | 7 |
141,946 | public boolean before ( final Interval < C > that ) { if ( this . hasNone ( ) || that . hasNone ( ) ) { return false ; } return this . dimension == that . dimension && this . range . upperEndpoint ( ) . compareTo ( that . range . lowerEndpoint ( ) ) < 0 ; } | Test if an interval precedes another . | 70 | 8 |
141,947 | public boolean after ( final Interval < C > that ) { if ( this . hasNone ( ) || that . hasNone ( ) ) { return false ; } return that . before ( this ) ; } | Test if an interval is after another . | 43 | 8 |
141,948 | public boolean between ( final Interval < C > that , final Interval < C > other ) { checkNotNull ( this . range , that . range ) ; checkNotNull ( other . range ) ; return this . after ( that ) && this . before ( other ) ; } | Test if an interval is between two others . | 59 | 9 |
141,949 | public boolean then ( final Interval < C > that ) { checkNotNull ( this . range , that . range ) ; return this . intersect ( that ) . equals ( this ) ; } | Test if an interval implies another . | 40 | 7 |
141,950 | public boolean ends ( final Interval < C > that ) { checkNotNull ( this . range , that . range ) ; return this . dimension == that . dimension && this . range . upperEndpoint ( ) . compareTo ( that . range . upperEndpoint ( ) ) == 0 && this . range . lowerEndpoint ( ) . compareTo ( that . range . lowerEndpoint ( ) ) > 0 ; } | Test if an interval ends another . | 88 | 7 |
141,951 | public static < C extends Comparable < ? > > List < Poset < C > > singletons ( final Collection < ? extends C > collection ) { List < Poset < C >> singletons = new ArrayList ( ) ; Poset previous = NULL ; for ( C element : collection ) { List < C > set = new ArrayList <> ( ) ; set . add ( element ) ; Poset poset = new Poset ( set ) ; if ( previous != NULL && poset . isComparableTo ( previous ) ) { throw new IllegalArgumentException ( "singletons must be disjoint" ) ; } singletons . add ( poset ) ; previous = poset ; } return singletons ; } | Calculate partially ordered singletons from a totally - ordered collection . | 157 | 15 |
141,952 | public static void validateHtml ( final File validationResultDir , final Configuration props , final File file ) throws IOException { Preconditions . checkArgument ( StringUtils . isNotBlank ( props . get ( WebConstants . W3C_MARKUP_VALIDATION_URL ) ) ) ; InputStream is = null ; BufferedReader br = null ; InputStream fis = null ; try { // Post HTML file to markup validation service as multipart/form-data URL url = new URL ( props . get ( WebConstants . W3C_MARKUP_VALIDATION_URL ) ) ; URLConnection uc = url . openConnection ( ) ; MultipartPostRequest request = new MultipartPostRequest ( uc ) ; fis = new FileInputStream ( file ) ; /* * See http://validator.w3.org/docs/api.html#requestformat for a description of all * parameters */ request . setParameter ( "uploaded_file" , file . getPath ( ) , fis ) ; is = request . post ( ) ; // Summary of validation is available in the HTTP headers String status = uc . getHeaderField ( STATUS ) ; int errors = Integer . parseInt ( uc . getHeaderField ( ERRORS ) ) ; LOG . info ( "Page " + file . getName ( ) + ": Number of HTML validation errors=" + errors ) ; int warnings = Integer . parseInt ( uc . getHeaderField ( WARNINGS ) ) ; LOG . info ( "Page " + file . getName ( ) + ": Number of HTML validation warnings=" + warnings ) ; // Check if result file has to be written String level = props . get ( WebConstants . W3C_MARKUP_VALIDATION_LEVEL , "ERROR" ) ; boolean validate = false ; if ( StringUtils . equalsIgnoreCase ( level , "WARNING" ) && ( warnings > 0 || errors > 0 ) ) { validate = true ; } else if ( StringUtils . equalsIgnoreCase ( level , "ERROR" ) && errors > 0 ) { validate = true ; } else if ( StringUtils . equalsIgnoreCase ( "Invalid" , status ) ) { validate = true ; } if ( validate ) { br = new BufferedReader ( new InputStreamReader ( is ) ) ; String line = null ; StringBuffer sb = new StringBuffer ( ) ; while ( ( line = br . readLine ( ) ) != null ) { sb . append ( line ) ; sb . append ( ' ' ) ; } PrintWriter writer = null ; String fileName = file . getName ( ) . substring ( 0 , file . getName ( ) . length ( ) - 5 ) + "_validation_result.html" ; FileUtils . forceMkdir ( validationResultDir ) ; File validationResultFile = new File ( validationResultDir , fileName ) ; try { writer = new PrintWriter ( validationResultFile , "UTF-8" ) ; writer . write ( sb . toString ( ) ) ; LOG . info ( "Validation result saved in file " + validationResultFile . getName ( ) ) ; } catch ( IOException ex ) { LOG . error ( "Could not write HTML file " + validationResultFile . getName ( ) + "to directory" , ex ) ; } finally { IOUtils . closeQuietly ( writer ) ; } } } finally { IOUtils . closeQuietly ( br ) ; IOUtils . closeQuietly ( fis ) ; } } | Validates an HTML file against the W3C markup validation service . | 774 | 14 |
141,953 | static File writeSequenceToTempFile ( final Sequence sequence ) throws IOException { File tmp = File . createTempFile ( sequence . getName ( ) + "-" , ".fa" ) ; try ( FileOutputStream outputStream = new FileOutputStream ( tmp ) ) { SeqIOTools . writeFasta ( outputStream , sequence ) ; } return tmp ; } | Write the specified sequence to a temporary file in FASTA format . | 79 | 14 |
141,954 | public static Iterable < GenewiseExon > genewiseExons ( final File aminoAcidHmm2File , final File genomicDnaFastaFile ) throws IOException { checkNotNull ( aminoAcidHmm2File ) ; checkNotNull ( genomicDnaFastaFile ) ; File genewiseResult = File . createTempFile ( "genewise" , ".txt" ) ; ProcessBuilder genewise = new ProcessBuilder ( "genewise" , "-hmmer" , "-tfor" , "-genes" , "-nosplice_gtag" , aminoAcidHmm2File . getPath ( ) , genomicDnaFastaFile . getPath ( ) ) ; genewise . redirectErrorStream ( true ) ; genewise . redirectOutput ( ProcessBuilder . Redirect . to ( genewiseResult ) ) ; Process genewiseProcess = genewise . start ( ) ; try { genewiseProcess . waitFor ( ) ; } catch ( InterruptedException e ) { // ignore } int lineNumber = 0 ; BufferedReader reader = null ; List < GenewiseExon > exons = Lists . newLinkedList ( ) ; try { reader = new BufferedReader ( new FileReader ( genewiseResult ) ) ; while ( reader . ready ( ) ) { String line = reader . readLine ( ) ; if ( line == null ) { break ; } if ( line . startsWith ( " Exon" ) ) { List < String > tokens = SPLITTER . splitToList ( line ) ; if ( tokens . size ( ) < 5 ) { throw new IOException ( "invalid genewise genes format at line number " + lineNumber + ", line " + line ) ; } try { long start = Long . parseLong ( tokens . get ( 1 ) ) ; long end = Long . parseLong ( tokens . get ( 2 ) ) ; if ( start > end ) { throw new IOException ( "invalid genewise exon at line number " + lineNumber + ", start > end" ) ; } int phase = Integer . parseInt ( tokens . get ( 4 ) ) ; exons . add ( new GenewiseExon ( start , end , phase ) ) ; } catch ( NumberFormatException e ) { throw new IOException ( "invalid genewise exon at line number " + lineNumber + ", caught " + e . getMessage ( ) ) ; } } lineNumber ++ ; } } finally { try { reader . close ( ) ; } catch ( Exception e ) { // empty } try { genewiseResult . delete ( ) ; } catch ( Exception e ) { // empty } } return ImmutableList . copyOf ( exons ) ; } | Return the exons predicted from the alignment of the specified amino acid HMM file in HMMER2 format against the specified genomic DNA sequence file in FASTA format . | 586 | 35 |
141,955 | public Latitude parseLatitude ( final String latitudeString ) throws ParserException { try { final Latitude latitude = new Latitude ( parseAngle ( latitudeString ) ) ; return latitude ; } catch ( final RuntimeException e ) { throw new ParserException ( "Cannot parse latitude: " + latitudeString ) ; } } | Parses a string representation of the latitude . | 69 | 10 |
141,956 | public Longitude parseLongitude ( final String longitudeString ) throws ParserException { try { final Longitude longitude = new Longitude ( parseAngle ( longitudeString ) ) ; return longitude ; } catch ( final RuntimeException e ) { throw new ParserException ( "Cannot parse longitude: " + longitudeString ) ; } } | Parses a string representation of the longitude . | 75 | 11 |
141,957 | public File createDumpFile ( final File dir , final String extension , final String urlString , final String additionalInfo ) { URI uri = URI . create ( urlString ) ; String path = uri . getPath ( ) ; if ( path == null ) { log . warn ( "Cannot create dump file for URI: " + uri ) ; return null ; } String name = PATTERN_FIRST_LAST_SLASH . matcher ( path ) . replaceAll ( "$1" ) ; name = PATTERN_ILLEGAL_CHARS . matcher ( name ) . replaceAll ( "_" ) ; Key key = Key . get ( dir . getPath ( ) , extension ) ; MutableInt counter = countersMap . get ( key ) ; if ( counter == null ) { counter = new MutableInt ( ) ; countersMap . put ( key , counter ) ; } int counterValue = counter . intValue ( ) ; counter . increment ( ) ; StringBuilder sb = new StringBuilder ( ) ; sb . append ( String . format ( "%04d" , counterValue ) ) ; sb . append ( ' ' ) ; sb . append ( name ) ; if ( StringUtils . isNotBlank ( additionalInfo ) ) { sb . append ( "_" ) ; sb . append ( additionalInfo ) ; } sb . append ( "." ) ; sb . append ( extension ) ; return new File ( dir , sb . toString ( ) ) ; } | Computes the best file to save the response to the current page . | 322 | 14 |
141,958 | public static MozuUrl getReturnItemUrl ( String responseFields , String returnId , String returnItemId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/returns/{returnId}/items/{returnItemId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "returnId" , returnId ) ; formatter . formatUrl ( "returnItemId" , returnItemId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetReturnItem | 150 | 8 |
141,959 | public static MozuUrl getAvailablePaymentActionsForReturnUrl ( String paymentId , String returnId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/returns/{returnId}/payments/{paymentId}/actions" ) ; formatter . formatUrl ( "paymentId" , paymentId ) ; formatter . formatUrl ( "returnId" , returnId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetAvailablePaymentActionsForReturn | 124 | 13 |
141,960 | public static MozuUrl resendReturnEmailUrl ( ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/returns/email/resend" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for ResendReturnEmail | 73 | 9 |
141,961 | public static MozuUrl deleteOrderItemUrl ( String returnId , String returnItemId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/returns/{orderId}/items/{orderItemId}?updatemode={updateMode}&version={version}" ) ; formatter . formatUrl ( "returnId" , returnId ) ; formatter . formatUrl ( "returnItemId" , returnItemId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteOrderItem | 133 | 8 |
141,962 | public void setAddress ( final String address ) { // Do we have a subaddressing account? Preconditions . checkArgument ( StringUtils . startsWith ( this . address , accountId + "+" ) , "Mail address can only be changed when subaddressing is active" ) ; Preconditions . checkArgument ( StringUtils . startsWith ( address , accountId ) , "New mail address %s does not start with accountId=%s" , address , accountId ) ; log . info ( "Changing mail address from {} to {}" , this . address , address ) ; this . address = address ; } | Allows to set a new mail address . This is only possible when mail subaddressing is active and the new mail address belongs to the defined mail accountId . | 134 | 32 |
141,963 | public static MozuUrl getSynonymDefinitionCollectionUrl ( String localeCode , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/search/synonym-definitions/{localeCode}?responseFields={responseFields}" ) ; formatter . formatUrl ( "localeCode" , localeCode ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetSynonymDefinitionCollection | 134 | 10 |
141,964 | public static MozuUrl updateSearchTuningRuleUrl ( String responseFields , String searchTuningRuleCode ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/search/searchtuningrules/{searchTuningRuleCode}?responseFields={responseFields}" ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "searchTuningRuleCode" , searchTuningRuleCode ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateSearchTuningRule | 143 | 10 |
141,965 | public static MozuUrl updateSynonymDefinitionUrl ( String responseFields , Integer synonymId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/search/synonyms/{synonymId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "synonymId" , synonymId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateSynonymDefinition | 132 | 9 |
141,966 | public static MozuUrl deleteSearchTuningRuleUrl ( String searchTuningRuleCode ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/search/searchtuningrules/{searchTuningRuleCode}" ) ; formatter . formatUrl ( "searchTuningRuleCode" , searchTuningRuleCode ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteSearchTuningRule | 112 | 10 |
141,967 | public static MozuUrl deleteSynonymDefinitionUrl ( Integer synonymId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/catalog/admin/search/synonyms/{synonymId}" ) ; formatter . formatUrl ( "synonymId" , synonymId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteSynonymDefinition | 101 | 9 |
141,968 | public ApplicationContext getApplicationContext ( final JobExecutionContext context ) throws JobExecutionException { SchedulerContext schedulerContext ; try { final Scheduler scheduler = context . getScheduler ( ) ; schedulerContext = scheduler . getContext ( ) ; } catch ( SchedulerException e ) { logger . error ( "Unable to retrieve the scheduler context, cause : " , e ) ; throw new JobExecutionException ( e ) ; } final ApplicationContext applicationContext = ( ApplicationContext ) schedulerContext . get ( APPLICATION_CONTEXT_BEAN_NAME ) ; return applicationContext ; } | Retrieves the spring application context from the job execution context . | 130 | 13 |
141,969 | public QuartzExceptionHandler getQuartzExceptionHandler ( final JobExecutionContext context ) { QuartzExceptionHandler exceptionHandler = null ; try { final ApplicationContext applicationContext = getApplicationContext ( context ) ; exceptionHandler = ( QuartzExceptionHandler ) applicationContext . getBean ( QUARTZ_EXCEPTION_HANDLER_BEAN_NAME ) ; } catch ( JobExecutionException e ) { logger . error ( "An error occurs getting the Quartz exception Handler" , e ) ; } return exceptionHandler ; } | Retrieve the quartz exception handler bean . | 108 | 8 |
141,970 | public void buildAllStatistics ( ) { for ( Map < String , ? > map : daoService . getAppsAndCountsToTreat ( ) ) { // get the date of older SMS for this app and account final Application application = ( Application ) map . get ( Sms . PROP_APP ) ; final Account account = ( Account ) map . get ( Sms . PROP_ACC ) ; final Date olderSmsDate = daoService . getDateOfOlderSmsByApplicationAndAccount ( application , account ) ; // if there is not at least 1 sms in db for the specified app / account, the // previous method returns null, so we have to check it. if ( olderSmsDate != null ) { // get the list of month where stats was not computed since the date of the older SMS in DB for ( Date monthToComputeStats : getListOfMarkerDateForNonComputedStats ( application , account , olderSmsDate ) ) { // compute the stats for this specific app, account and month buildStatisticForAMonth ( application , account , monthToComputeStats ) ; } } } } | Build all non already computed statistic whatever the application account or date . | 244 | 13 |
141,971 | private void buildStatisticForAMonth ( Application application , Account account , Date month ) { buildStatistics ( application , account , getFirstDayOfMonth ( month ) , getLastDayOfMonth ( month ) , getMarkerDateOfMonth ( month ) ) ; } | Create stats in DB for the specified application and account for the month . | 57 | 14 |
141,972 | private Date getLastDayOfMonth ( final Date date ) { final Calendar calendar = toGregorianCalendar ( date ) ; calendar . set ( Calendar . DAY_OF_MONTH , calendar . getActualMaximum ( Calendar . DAY_OF_MONTH ) ) ; calendar . set ( Calendar . HOUR_OF_DAY , 23 ) ; calendar . set ( Calendar . MINUTE , 59 ) ; calendar . set ( Calendar . SECOND , 59 ) ; calendar . set ( Calendar . MILLISECOND , 999 ) ; return calendar . getTime ( ) ; } | Return the last day of month at 23h59 . | 120 | 11 |
141,973 | private List < Date > getListOfMarkerDateBetWeenTwoDates ( final Date startDate , final Date endDate ) { final List < Date > listOfMarkerDate = new LinkedList <> ( ) ; final Calendar startDateAsCal = toGregorianCalendar ( startDate ) ; final Calendar endDateAsCal = toGregorianCalendar ( endDate ) ; while ( startDateAsCal . before ( endDateAsCal ) ) { listOfMarkerDate . add ( getMarkerDateOfMonth ( startDateAsCal . getTime ( ) ) ) ; startDateAsCal . add ( Calendar . MONTH , 1 ) ; } return listOfMarkerDate ; } | Return the list of all potential marker date between two dates . | 150 | 12 |
141,974 | public EventHandlerStatus dispatchEvent ( HttpServletRequest httpRequest ) { ApiContext apiContext = new MozuApiContext ( httpRequest ) ; Event event = null ; // get the event from the request and validate try { String body = IOUtils . toString ( httpRequest . getInputStream ( ) ) ; logger . debug ( "Event body: " + body ) ; event = mapper . readValue ( body , Event . class ) ; logger . info ( "Dispatching Event. Correlation ID: " + event . getCorrelationId ( ) ) ; if ( ! Crypto . isRequestValid ( apiContext , body ) ) { StringBuilder msg = new StringBuilder ( "Event is not authorized." ) ; logger . warn ( msg . toString ( ) ) ; return ( new EventHandlerStatus ( msg . toString ( ) , HttpServletResponse . SC_UNAUTHORIZED ) ) ; } } catch ( IOException exception ) { StringBuilder msg = new StringBuilder ( "Unable to read event: " ) . append ( exception . getMessage ( ) ) ; logger . error ( msg . toString ( ) ) ; return ( new EventHandlerStatus ( msg . toString ( ) , HttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ) ; } try { invokeHandler ( event , apiContext ) ; } catch ( Exception exception ) { StringBuilder msg = new StringBuilder ( "Unable to process event with correlation id " ) . append ( event . getCorrelationId ( ) ) . append ( ". Message: " ) . append ( exception . getMessage ( ) ) ; logger . error ( msg . toString ( ) ) ; return ( new EventHandlerStatus ( msg . toString ( ) , HttpServletResponse . SC_INTERNAL_SERVER_ERROR ) ) ; } return ( new EventHandlerStatus ( null , HttpServletResponse . SC_OK ) ) ; } | Takes the event notification message parses it and dispatches the event to the registered handler for the event category and type . | 417 | 25 |
141,975 | protected void invokeHandler ( Event event , ApiContext apiContext ) throws ClassNotFoundException , NoSuchMethodException , SecurityException , IllegalAccessException , IllegalArgumentException , InvocationTargetException , InstantiationException { String topic [ ] = event . getTopic ( ) . split ( "\\." ) ; String eventCategory = topic [ 0 ] . substring ( 0 , 1 ) . toUpperCase ( ) + topic [ 0 ] . substring ( 1 ) ; String eventAction = topic [ 1 ] ; // get list of registered handlers Object handler = EventManager . getInstance ( ) . getRegisteredClassHandlers ( eventCategory ) ; if ( handler != null ) { String methodName = eventAction ; String className = handler . getClass ( ) . getName ( ) ; try { Method m ; m = handler . getClass ( ) . getMethod ( methodName , ApiContext . class , Event . class ) ; m . invoke ( handler , apiContext , event ) ; } catch ( NoSuchMethodException e ) { logger . warn ( "No " + eventAction + " method on class " + className ) ; throw e ; } catch ( SecurityException e ) { logger . warn ( "Security exception: " + e . getMessage ( ) ) ; throw e ; } catch ( IllegalAccessException e ) { logger . warn ( "Illegal access for method " + eventAction + " on class " + className ) ; throw e ; } catch ( IllegalArgumentException e ) { logger . warn ( "Illegal argument exception for method " + eventAction + " on class " + className ) ; throw e ; } catch ( InvocationTargetException e ) { logger . warn ( "Invocation target exception for method " + eventAction + " on class " + className ) ; throw e ; } } } | Dispatch the event to the handler registered for the category . The method corresponding to the event type is invoked . | 387 | 21 |
141,976 | protected final Vertex supremum ( final E proposed , Vertex generator ) { boolean max = true ; while ( max ) { max = false ; for ( Edge edge : generator . getEdges ( Direction . BOTH ) ) { Vertex target = edge . getVertex ( Direction . OUT ) ; if ( filter ( target , generator ) ) { continue ; } //Concept proposed = new Concept(new MutableBitSet(), proposed.intent); if ( filter ( target , proposed ) ) { generator = target ; max = true ; break ; } } } return generator ; } | Find the supremum or least upper bound . | 121 | 9 |
141,977 | @ Override public final boolean containsAll ( final Collection < ? extends E > collection ) { for ( E element : collection ) { if ( ! this . contains ( element ) ) { return false ; } } return true ; } | Test if the lattice contains all elements of the given collection . | 47 | 13 |
141,978 | protected final Vertex addIntent ( final E proposed , Vertex generator ) { generator = supremum ( proposed , generator ) ; if ( filter ( generator , proposed ) && filter ( proposed , generator ) ) { return generator ; } List parents = new ArrayList <> ( ) ; for ( Edge edge : generator . getEdges ( Direction . BOTH ) ) { Vertex target = edge . getVertex ( Direction . OUT ) ; if ( filter ( target , generator ) ) { continue ; } Vertex candidate = target ; if ( ! filter ( target , proposed ) && ! filter ( proposed , target ) ) { E targetElement = target . getProperty ( LABEL ) ; E intersect = ( E ) targetElement . intersect ( proposed ) ; candidate = addIntent ( intersect , candidate ) ; } boolean add = true ; List doomed = new ArrayList <> ( ) ; for ( java . util . Iterator it = parents . iterator ( ) ; it . hasNext ( ) ; ) { Vertex parent = ( Vertex ) it . next ( ) ; if ( filter ( parent , candidate ) ) { add = false ; break ; } else if ( filter ( candidate , parent ) ) { doomed . add ( parent ) ; } } for ( java . util . Iterator it = doomed . iterator ( ) ; it . hasNext ( ) ; ) { Vertex vertex = ( Vertex ) it . next ( ) ; parents . remove ( vertex ) ; } if ( add ) { parents . add ( candidate ) ; } } E generatorLabel = generator . getProperty ( LABEL ) ; Vertex child = insert ( ( E ) proposed . union ( generatorLabel ) ) ; addUndirectedEdge ( generator , child , "" ) ; bottom = filter ( bottom , proposed ) ? child : bottom ; for ( java . util . Iterator it = parents . iterator ( ) ; it . hasNext ( ) ; ) { Vertex parent = ( Vertex ) it . next ( ) ; if ( ! parent . equals ( generator ) ) { removeUndirectedEdge ( parent , generator ) ; addUndirectedEdge ( parent , child , "" ) ; } } return child ; } | Add a new element dynamically to the lattice . | 461 | 10 |
141,979 | public static MozuUrl updateOrderAttributesUrl ( String orderId , Boolean removeMissing ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/orders/{orderId}/attributes?removeMissing={removeMissing}" ) ; formatter . formatUrl ( "orderId" , orderId ) ; formatter . formatUrl ( "removeMissing" , removeMissing ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateOrderAttributes | 117 | 8 |
141,980 | public static MozuUrl updateUrl ( String cardId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/payments/commerce/payments/cards/{cardId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "cardId" , cardId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . PCI_POD ) ; } | Get Resource Url for Update | 119 | 6 |
141,981 | public static MozuUrl deleteUrl ( String cardId ) { UrlFormatter formatter = new UrlFormatter ( "/payments/commerce/payments/cards/{cardId}" ) ; formatter . formatUrl ( "cardId" , cardId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . PCI_POD ) ; } | Get Resource Url for Delete | 88 | 6 |
141,982 | public static MozuUrl getPropertyTypesUrl ( Integer pageSize , String responseFields , Integer startIndex ) { UrlFormatter formatter = new UrlFormatter ( "/api/content/propertytypes/?pageSize={pageSize}&startIndex={startIndex}&responseFields={responseFields}" ) ; formatter . formatUrl ( "pageSize" , pageSize ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "startIndex" , startIndex ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetPropertyTypes | 148 | 8 |
141,983 | public static MozuUrl getPropertyTypeUrl ( String propertyTypeName , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/content/propertytypes/{propertyTypeName}?responseFields={responseFields}" ) ; formatter . formatUrl ( "propertyTypeName" , propertyTypeName ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetPropertyType | 124 | 8 |
141,984 | public static MozuUrl deletePropertyTypeUrl ( String propertyTypeName ) { UrlFormatter formatter = new UrlFormatter ( "/api/content/propertytypes/{propertyTypeName}" ) ; formatter . formatUrl ( "propertyTypeName" , propertyTypeName ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeletePropertyType | 93 | 8 |
141,985 | public static MozuUrl storeCredentialsUrl ( ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/extensions/credentialStore/" ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for StoreCredentials | 73 | 9 |
141,986 | public static MozuUrl getQuoteItemsByQuoteNameUrl ( Integer customerAccountId , String filter , Integer pageSize , String quoteName , String responseFields , String sortBy , Integer startIndex ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/quotes/customers/{customerAccountId}/{quoteName}/items?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&responseFields={responseFields}" ) ; formatter . formatUrl ( "customerAccountId" , customerAccountId ) ; formatter . formatUrl ( "filter" , filter ) ; formatter . formatUrl ( "pageSize" , pageSize ) ; formatter . formatUrl ( "quoteName" , quoteName ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "sortBy" , sortBy ) ; formatter . formatUrl ( "startIndex" , startIndex ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetQuoteItemsByQuoteName | 257 | 11 |
141,987 | public static MozuUrl addItemToQuoteUrl ( String quoteId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/quotes/{quoteId}/items?responseFields={responseFields}" ) ; formatter . formatUrl ( "quoteId" , quoteId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for AddItemToQuote | 123 | 9 |
141,988 | public static MozuUrl updateQuoteItemUrl ( String quoteId , String quoteItemId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/quotes/{quoteId}/items/{quoteItemId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "quoteId" , quoteId ) ; formatter . formatUrl ( "quoteItemId" , quoteItemId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateQuoteItem | 150 | 8 |
141,989 | public static MozuUrl deleteQuoteItemUrl ( String quoteId , String quoteItemId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/quotes/{quoteId}/items/{quoteItemId}" ) ; formatter . formatUrl ( "quoteId" , quoteId ) ; formatter . formatUrl ( "quoteItemId" , quoteItemId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteQuoteItem | 119 | 8 |
141,990 | void signRequest ( final RSAPublicKey rsaPublicKey , final byte [ ] data ) throws IOException { // TODO (dxia) Support more than just Rsa keys final String keyType = Rsa . RSA_LABEL ; final byte [ ] publicExponent = rsaPublicKey . getPublicExponent ( ) . toByteArray ( ) ; final byte [ ] modulus = rsaPublicKey . getModulus ( ) . toByteArray ( ) ; // Four bytes indicating length of string denoting key type // Four bytes indicating length of public exponent // Four bytes indicating length of modulus final int publicKeyLength = 4 + keyType . length ( ) + 4 + publicExponent . length + 4 + modulus . length ; // The message is made of: // Four bytes indicating length in bytes of rest of message // One byte indicating SSH2_AGENTC_SIGN_REQUEST // Four bytes denoting length of public key // Bytes representing the public key // Four bytes for length of data // Bytes representing data to be signed // Four bytes of flags final ByteBuffer buff = ByteBuffer . allocate ( INT_BYTES + 1 + INT_BYTES + publicKeyLength + INT_BYTES + data . length + 4 ) ; // 13 = // One byte indicating SSH2_AGENTC_SIGN_REQUEST // Four bytes denoting length of public key // Four bytes for length of data // Four bytes of flags buff . putInt ( publicKeyLength + data . length + 13 ) ; buff . put ( ( byte ) SSH2_AGENTC_SIGN_REQUEST ) ; // Add the public key buff . putInt ( publicKeyLength ) ; buff . putInt ( keyType . length ( ) ) ; for ( final byte b : keyType . getBytes ( ) ) { buff . put ( b ) ; } buff . putInt ( publicExponent . length ) ; buff . put ( publicExponent ) ; buff . putInt ( modulus . length ) ; buff . put ( modulus ) ; // Add the data to be signed buff . putInt ( data . length ) ; buff . put ( data ) ; // Add empty flags buff . put ( new byte [ ] { 0 , 0 , 0 , 0 } ) ; out . write ( buff . array ( ) ) ; out . flush ( ) ; log . debug ( "Sent SSH2_AGENTC_SIGN_REQUEST message to ssh-agent." ) ; } | Send a SSH2_AGENTC_SIGN_REQUEST message to ssh - agent . | 524 | 19 |
141,991 | public static MozuUrl splitItemUrl ( String checkoutId , String itemId , Integer quantity , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/checkouts/{checkoutId}/items/{itemId}/split?quantity={quantity}&responseFields={responseFields}" ) ; formatter . formatUrl ( "checkoutId" , checkoutId ) ; formatter . formatUrl ( "itemId" , itemId ) ; formatter . formatUrl ( "quantity" , quantity ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for SplitItem | 173 | 7 |
141,992 | public static MozuUrl updateItemDestinationUrl ( String checkoutId , String destinationId , String itemId , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/checkouts/{checkoutId}/items/{itemId}/destination/{destinationId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "checkoutId" , checkoutId ) ; formatter . formatUrl ( "destinationId" , destinationId ) ; formatter . formatUrl ( "itemId" , itemId ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for UpdateItemDestination | 178 | 9 |
141,993 | public static MozuUrl deleteCheckoutItemUrl ( String checkoutId , String itemId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/checkouts/{checkoutId}/items/{itemId}" ) ; formatter . formatUrl ( "checkoutId" , checkoutId ) ; formatter . formatUrl ( "itemId" , itemId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteCheckoutItem | 118 | 9 |
141,994 | public static MozuUrl getViewEntityContainerUrl ( String entityId , String entityListFullName , String responseFields , String viewName ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/entitylists/{entityListFullName}/views/{viewName}/entityContainers/{entityId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "entityId" , entityId ) ; formatter . formatUrl ( "entityListFullName" , entityListFullName ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "viewName" , viewName ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetViewEntityContainer | 183 | 9 |
141,995 | public static MozuUrl getViewEntityContainersUrl ( String entityListFullName , String filter , Integer pageSize , String responseFields , Integer startIndex , String viewName ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/entitylists/{entityListFullName}/views/{viewName}/entityContainers?pageSize={pageSize}&startIndex={startIndex}&filter={filter}&responseFields={responseFields}" ) ; formatter . formatUrl ( "entityListFullName" , entityListFullName ) ; formatter . formatUrl ( "filter" , filter ) ; formatter . formatUrl ( "pageSize" , pageSize ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "startIndex" , startIndex ) ; formatter . formatUrl ( "viewName" , viewName ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetViewEntityContainers | 233 | 10 |
141,996 | public static MozuUrl getEntityListViewUrl ( String entityListFullName , String responseFields , String viewName ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/entitylists/{entityListFullName}/views/{viewName}?responseFields={responseFields}" ) ; formatter . formatUrl ( "entityListFullName" , entityListFullName ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "viewName" , viewName ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetEntityListView | 155 | 9 |
141,997 | public static MozuUrl getEntityListViewsUrl ( String entityListFullName , String responseFields ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/entitylists/{entityListFullName}/views?responseFields={responseFields}" ) ; formatter . formatUrl ( "entityListFullName" , entityListFullName ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetEntityListViews | 132 | 10 |
141,998 | public static MozuUrl deleteEntityListViewUrl ( String entityListFullName , String viewName ) { UrlFormatter formatter = new UrlFormatter ( "/api/platform/entitylists/{entityListFullName}/views/{viewName}" ) ; formatter . formatUrl ( "entityListFullName" , entityListFullName ) ; formatter . formatUrl ( "viewName" , viewName ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for DeleteEntityListView | 124 | 9 |
141,999 | public static MozuUrl getWishlistItemUrl ( String responseFields , String wishlistId , String wishlistItemId ) { UrlFormatter formatter = new UrlFormatter ( "/api/commerce/wishlists/{wishlistId}/items/{wishlistItemId}?responseFields={responseFields}" ) ; formatter . formatUrl ( "responseFields" , responseFields ) ; formatter . formatUrl ( "wishlistId" , wishlistId ) ; formatter . formatUrl ( "wishlistItemId" , wishlistItemId ) ; return new MozuUrl ( formatter . getResourceUrl ( ) , MozuUrl . UrlLocation . TENANT_POD ) ; } | Get Resource Url for GetWishlistItem | 165 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.