code
stringlengths
73
34.1k
label
stringclasses
1 value
@Provides @Singleton @JFunkVersion protected String providePerfLoadVersion() { ClassLoader loader = Thread.currentThread().getContextClassLoader(); InputStream is = loader.getResourceAsStream("com/mgmtp/jfunk/common/version.txt"); try { return IOUtils.toString(is, "UTF-8"); } catch (IOException ex) { t...
java
public static PairwiseAlignment create(final int threads, final SubstitutionMatrix substitutionMatrix) { return new ParallelBiojavaPairwiseAlignment(Executors.newFixedThreadPool(threads), substitutionMatrix); }
java
public static MozuUrl getStatesUrl(String profileCode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/shipping/admin/profiles/{profilecode}/shippingstates"); formatter.formatUrl("profileCode", profileCode); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl updateStatesUrl(String profilecode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/shipping/admin/profiles/{profilecode}/shippingstates"); formatter.formatUrl("profilecode", profilecode); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getPackageLabelUrl(String packageId, Boolean returnAsBase64Png, String returnId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/returns/{returnId}/packages/{packageId}/label?returnAsBase64Png={returnAsBase64Png}"); formatter.formatUrl("packageId", packageId); formatter.forma...
java
public static Iterable<HighScoringPair> read(final Readable readable) throws IOException { checkNotNull(readable); Collect collect = new Collect(); stream(readable, collect); return collect.hsps(); }
java
public static void stream(final Readable readable, final HspListener listener) throws IOException { checkNotNull(readable); checkNotNull(listener); HspLineProcessor lineProcessor = new HspLineProcessor(listener); CharStreams.readLines(readable, lineProcessor); }
java
public static MozuUrl getTreeDocumentUrl(String documentListName, String documentName, Boolean includeInactive, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/content/documentlists/{documentListName}/documentTree/{documentName}?includeInactive={includeInactive}&responseFields={responseFie...
java
public static MozuUrl updateTreeDocumentContentUrl(String documentListName, String documentName) { UrlFormatter formatter = new UrlFormatter("/api/content/documentlists/{documentListName}/documentTree/{documentName}/content?folderPath={folderPath}&folderId={folderId}"); formatter.formatUrl("documentListName", d...
java
public void manageAck(final Acknowledgment acknowledgment) { final int smid = acknowledgment.getSmsId(); final SmsStatus smsStatus = acknowledgment.getSmsStatus(); if (logger.isDebugEnabled()) { logger.debug("Manage ack with : " + " - smid : " + smid + " - ack status : " + smsStat...
java
private void putPhoneNumberInBlackList(final String phoneNumber, final Application application ) { // if phone number is not already in the bl (it should not append) put the phone number // put the phone number in the black list if (daoService.isPhoneNumberInBlackList(phoneNumber)) return; logger.de...
java
@RobotKeyword public boolean jsonElementShouldMatch(String source, String jsonPath, Object value, String method, String data, String contentType) throws Exception { boolean match = false; if (value == null) { throw new IllegalArgumentException("Given value was null"); } ...
java
@RobotKeyword public boolean jsonShouldBeEqual(String from, String to) throws Exception { return jsonShouldBeEqual(from, to, false); }
java
@RobotKeyword public boolean jsonShouldBeEqual(String from, String to, boolean useExactMatch, String method, String data, String contentType) throws Exception { System.out.println("*DEBUG* Comparing JSON sources"); boolean equal = false; String fromJson = requestUtil.readSource(from, metho...
java
@RobotKeyword public Object findJsonElement(String source, String jsonPath, String method, String data, String contentType) throws Exception { System.out.println("*DEBUG* Reading jsonPath: " + jsonPath); String json = requestUtil.readSource(source, method, data, contentType); Object value;...
java
@SuppressWarnings("unchecked") @RobotKeyword public boolean jsonShouldHaveElementCount(String source, String jsonPath, Integer count, String method, String data, String contentType) throws Exception { boolean match = false; System.out.println("*DEBUG* Reading jsonPath: " + jsonPath); S...
java
public static MozuUrl getFileUrl(String applicationKey, String fileName) { UrlFormatter formatter = new UrlFormatter("/api/platform/appdev/filebasedpackage/packages/{applicationKey}?fileName={fileName}"); formatter.formatUrl("applicationKey", applicationKey); formatter.formatUrl("fileName", fileName); ret...
java
public static MozuUrl executeUrl(String cardType, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/payments/tokens/{cardType}/execute?responseFields={responseFields}"); formatter.formatUrl("cardType", cardType); formatter.formatUrl("responseFields", responseFields); return new ...
java
public static MozuUrl getPublishSetUrl(String publishSetCode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/publishing/publishsets/{publishSetCode}?responseFields={responseFields}"); formatter.formatUrl("publishSetCode", publishSetCode); formatter.formatUrl("...
java
public static MozuUrl discardDraftsUrl() { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/publishing/discarddrafts"); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl publishDraftsUrl() { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/publishing/publishdrafts"); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl getOrderItemViaLineIdUrl(Boolean draft, Integer lineId, String orderId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/items/{lineId}?draft={draft}&responseFields={responseFields}"); formatter.formatUrl("draft", draft); formatter.forma...
java
public static MozuUrl createOrderItemUrl(String orderId, String responseFields, Boolean skipInventoryCheck, String updateMode, String version) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/items?updatemode={updateMode}&version={version}&skipInventoryCheck={skipInventoryCheck}&response...
java
public static MozuUrl updateOrderItemDiscountUrl(Integer discountId, String orderId, String orderItemId, String responseFields, String updateMode, String version) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/items/{orderItemId}/discounts/{discountId}?updatemode={updateMode}&version={...
java
public static MozuUrl updateItemProductPriceUrl(String orderId, String orderItemId, Double price, String responseFields, String updateMode, String version) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/items/{orderItemId}/price/{price}?updatemode={updateMode}&version={version}&respons...
java
public static MozuUrl updateItemQuantityUrl(String orderId, String orderItemId, Integer quantity, String responseFields, String updateMode, String version) { UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/items/{orderItemId}/quantity/{quantity}?updatemode={updateMode}&version={version}&r...
java
public static void write(final BedRecord record, final PrintWriter writer) { checkNotNull(record); checkNotNull(writer); writer.println(record.toString()); }
java
public static void write(final Iterable<BedRecord> records, final PrintWriter writer) { checkNotNull(records); checkNotNull(writer); for (BedRecord record : records) { writer.println(record.toString()); } }
java
public static MozuUrl updateAccountCardUrl(Integer accountId, String cardId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/cards/{cardId}?responseFields={responseFields}"); formatter.formatUrl("accountId", accountId); formatter.formatUrl("card...
java
public static MozuUrl deleteAccountCardUrl(Integer accountId, String cardId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/cards/{cardId}"); formatter.formatUrl("accountId", accountId); formatter.formatUrl("cardId", cardId); return new MozuUrl(formatter.getResour...
java
public <T> T get(final Object key) { @SuppressWarnings("unchecked") // cast is not safe but convenient T value = (T) additionalData.get(key); return value; }
java
public static MozuUrl getReturnNoteUrl(String noteId, String responseFields, String returnId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/returns/{returnId}/notes/{noteId}?responseFields={responseFields}"); formatter.formatUrl("noteId", noteId); formatter.formatUrl("responseFields", responseFi...
java
public static MozuUrl deleteReturnNoteUrl(String noteId, String returnId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/returns/{returnId}/notes/{noteId}"); formatter.formatUrl("noteId", noteId); formatter.formatUrl("returnId", returnId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl...
java
public static MozuUrl getAssignedDiscountsUrl(String couponSetCode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/couponsets/{couponSetCode}/assigneddiscounts"); formatter.formatUrl("couponSetCode", couponSetCode); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation....
java
public static MozuUrl unAssignDiscountUrl(String couponSetCode, Integer discountId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/couponsets/{couponSetCode}/assigneddiscounts/{discountId}"); formatter.formatUrl("couponSetCode", couponSetCode); formatter.formatUrl("discountId", disc...
java
public static MozuUrl getDiscountContentUrl(Integer discountId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/discounts/{discountId}/content?responseFields={responseFields}"); formatter.formatUrl("discountId", discountId); formatter.formatUrl("responseFields"...
java
public static MozuUrl deleteDiscountUrl(Integer discountId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/discounts/{discountId}"); formatter.formatUrl("discountId", discountId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public long initMathRandom(final Long seed) { if (seed == null) { mathRandom = new MathRandom(); } else { mathRandom = new MathRandom(seed); } return mathRandom.getSeed(); }
java
@Override protected String initValuesImpl(final FieldCase c) { double d = 0.0; String v = source.initValues(c); if (v != null && v.length() > 0) { d = 0.0; try { Number n = format.parse(v); d = n.doubleValue(); } catch (ParseException e) { log.debug("Could not parse string " + v + ...
java
public static MozuUrl getDocumentListTypeUrl(String documentListTypeFQN, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/content/documentlistTypes/{documentListTypeFQN}?responseFields={responseFields}"); formatter.formatUrl("documentListTypeFQN", documentListTypeFQN); formatter.forma...
java
public static void write(final VcfHeader header, final List<VcfSample> samples, final List<VcfRecord> records, final PrintWriter writer) { writeHeader(header, writer); writeColumnHeader(samples, writer); writ...
java
public static void writeHeader(final VcfHeader header, final PrintWriter writer) { checkNotNull(header); checkNotNull(writer); for (String meta : header.getMeta()) { writer.println(meta); } }
java
public static void writeColumnHeader(final List<VcfSample> samples, final PrintWriter writer) { checkNotNull(samples); checkNotNull(writer); StringBuilder sb = new StringBuilder("#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO"); if (!samples.isEmpty()) { sb.append("\tFORMAT")...
java
public static void writeRecords(final List<VcfSample> samples, final List<VcfRecord> records, final PrintWriter writer) { checkNotNull(samples); checkNotNull(records); checkNotNull(writer); for (VcfRecord record : r...
java
public static void writeRecord(final List<VcfSample> samples, final VcfRecord record, final PrintWriter writer) { checkNotNull(samples); checkNotNull(record); checkNotNull(writer); StringBuilder sb = new StringBuilder(); sb.append(record.getChrom()); sb.append("\t"); ...
java
public CharacterSet getInverse() { CharacterSet n = new CharacterSet(); n.forbiddenCharacters = characters; n.characters = forbiddenCharacters; return n; }
java
public char getCharacter(final int index) { if (index > characters.length) { throw new IndexOutOfBoundsException(index + "@" + characters.length + " does not fit"); } return characters[index]; }
java
public static CharacterSet createCharacterSet(final String encoding, final String goodExpression, final String badExpression, final String characterSetId) throws UnsupportedEncodingException { if (characterSets.get().containsKey(characterSetId)) { LOG.info("CharacterSet with id=" + characterSetId + " already...
java
public static MozuUrl getOptionsUrl(Integer productTypeId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options"); formatter.formatUrl("productTypeId", productTypeId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocati...
java
public static MozuUrl getOptionUrl(String attributeFQN, Integer productTypeId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options/{attributeFQN}?responseFields={responseFields}"); formatter.formatUrl("attribute...
java
public static MozuUrl addOptionUrl(Integer productTypeId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options?responseFields={responseFields}"); formatter.formatUrl("productTypeId", productTypeId); formatter....
java
public static MozuUrl deleteOptionUrl(String attributeFQN, Integer productTypeId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options/{attributeFQN}"); formatter.formatUrl("attributeFQN", attributeFQN); formatter.formatUrl("product...
java
public void addToBlacklists(final Blacklist blacklist) { if (null == getBlacklists()) { setBlacklists(new java.util.TreeSet<Blacklist>()); } getBlacklists().add(blacklist); }
java
public String get(final Object key, final boolean process) { String value = propsMap.get(key); if (process) { value = processPropertyValue(value); } return value == null && defaults != null ? defaults.get(key) : value; }
java
@Override public String put(final String key, final String value) { return propsMap.put(key, value); }
java
@Override public Set<Entry<String, String>> entrySet() { if (entrySet == null) { entrySet = new EntrySet(); } return entrySet; }
java
@Override public String remove(final Object key) { String result = propsMap.remove(key); if (defaults != null) { String s = defaults.remove(key); if (result == null) { result = s; } } return result; }
java
public void load(final InputStream is, final String encoding) throws IOException { load(new InputStreamReader(is, encoding)); }
java
public void store(final OutputStream os, final String comments, final boolean sorted, final boolean process) throws IOException { store(new OutputStreamWriter(os), comments, sorted, process); }
java
public void store(final Writer writer, final String comments, final boolean sorted, final boolean process) throws IOException { BufferedWriter bw = writer instanceof BufferedWriter ? (BufferedWriter) writer : new BufferedWriter(writer); if (comments != null) { for (Scanner scanner = new Scanner(comments); s...
java
public static MozuUrl getExtraValueLocalizedDeltaPriceUrl(String attributeFQN, String currencyCode, String productCode, String responseFields, String value) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/Extras/{attributeFQN}/Values/{value}/localizedDeltaPrice/{curr...
java
public static MozuUrl getExtraUrl(String attributeFQN, String productCode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/products/{productCode}/Extras/{attributeFQN}?responseFields={responseFields}"); formatter.formatUrl("attributeFQN", attributeFQN); formatt...
java
public static MozuUrl getCouponSetsUrl(String filter, Boolean includeCounts, Integer pageSize, String responseFields, String sortBy, Integer startIndex) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/couponsets/?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&i...
java
public static MozuUrl getCouponSetUrl(String couponSetCode, Boolean includeCounts, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/couponsets/{couponSetCode}?includeCounts={includeCounts}&responseFields={responseFields}"); formatter.formatUrl("couponSetCode", coup...
java
public static MozuUrl updateCouponSetUrl(String couponSetCode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/couponsets/{couponSetCode}?responseFields={responseFields}"); formatter.formatUrl("couponSetCode", couponSetCode); formatter.formatUrl("responseFields...
java
public static MozuUrl updateDocumentListUrl(String documentListName, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/content/documentlists/{documentListName}?responseFields={responseFields}"); formatter.formatUrl("documentListName", documentListName); formatter.formatUrl("responseFie...
java
public static MozuUrl deleteDocumentListUrl(String documentListName) { UrlFormatter formatter = new UrlFormatter("/api/content/documentlists/{documentListName}"); formatter.formatUrl("documentListName", documentListName); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
private int s2i(final byte[] bytes) { int num = 0; for (int i = 0; i < 4; i++) { num += (bytes[i] & 0xff) << ((3 - i) * 8); } return num; }
java
public FormEntry getFormEntry(final String entryKey) { FormEntry entry = entries.get(entryKey); if (entry == null) { entry = addFormEntry(entryKey, null); } return entry; }
java
private void resetValues(final Constraint constraintContainer) { log.info("Reset " + key + " form data"); for (FormEntry e : entries.values()) { e.resetValue(); } constraintContainer.resetValues(); }
java
public static MozuUrl deleteEntityListUrl(String entityListFullName) { UrlFormatter formatter = new UrlFormatter("/api/platform/entitylists/{entityListFullName}"); formatter.formatUrl("entityListFullName", entityListFullName); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; ...
java
public static VcfHeader header(final File file) throws IOException { checkNotNull(file); // could also use Files.asCharSource(file, Charsets.UTF_8).openBufferedStream() try (BufferedReader reader = new BufferedReader(new FileReader(file))) { return header(reader); } }
java
public static VcfHeader header(final URL url) throws IOException { checkNotNull(url); try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) { return header(reader); } }
java
public static VcfHeader header(final InputStream inputStream) throws IOException { checkNotNull(inputStream); try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { return header(reader); } }
java
public static Iterable<VcfSample> samples(final File file) throws IOException { checkNotNull(file); try (BufferedReader reader = new BufferedReader(new FileReader(file))) { return samples(reader); } }
java
public static Iterable<VcfSample> samples(final URL url) throws IOException { checkNotNull(url); try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) { return samples(reader); } }
java
public static Iterable<VcfSample> samples(final InputStream inputStream) throws IOException { checkNotNull(inputStream); try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { return samples(reader); } }
java
public static Iterable<VcfRecord> records(final File file) throws IOException { checkNotNull(file); try (BufferedReader reader = new BufferedReader(new FileReader(file))) { return records(reader); } }
java
public static Iterable<VcfRecord> records(final URL url) throws IOException { checkNotNull(url); try (BufferedReader reader = Resources.asCharSource(url, Charsets.UTF_8).openBufferedStream()) { return records(reader); } }
java
public static Iterable<VcfRecord> records(final InputStream inputStream) throws IOException { checkNotNull(inputStream); try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) { return records(reader); } }
java
private void cleanUp(final DataSet ds) { Set<String> indexedKeys = Sets.newHashSet(); for (String key : ds.getDataView().keySet()) { // Search for indexed entries if (key.contains("#")) { // Remember key (without index) indexedKeys.add(key.substring(0, key.indexOf("#"))); } } // Remove...
java
public static MozuUrl getChildCategoriesUrl(Integer categoryId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/{categoryId}/children?responseFields={responseFields}"); formatter.formatUrl("categoryId", categoryId); formatter.formatUrl("responseField...
java
public static MozuUrl addCategoryUrl(Boolean incrementSequence, String responseFields, Boolean useProvidedId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/?incrementSequence={incrementSequence}&useProvidedId={useProvidedId}&responseFields={responseFields}"); formatter.form...
java
public static MozuUrl addProductsToCategoryUrl(Integer categoryId) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/{categoryId}/add-products"); formatter.formatUrl("categoryId", categoryId); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; ...
java
public static MozuUrl updateCategoryUrl(Boolean cascadeVisibility, Integer categoryId, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/{categoryId}?cascadeVisibility={cascadeVisibility}&responseFields={responseFields}"); formatter.formatUrl("cascadeVisi...
java
public static MozuUrl deleteCategoryByIdUrl(Boolean cascadeDelete, Integer categoryId, Boolean forceDelete, Boolean reassignToParent) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/{categoryId}/?cascadeDelete={cascadeDelete}&forceDelete={forceDelete}&reassignToParent={reassignT...
java
public static MozuUrl getDeliveryAttemptSummaryUrl(Integer processId, String responseFields, String subscriptionId) { UrlFormatter formatter = new UrlFormatter("/api/event/push/subscriptions/{subscriptionId}/deliveryattempts/{id}?responseFields={responseFields}"); formatter.formatUrl("processId", processId); ...
java
public static void write(final Hml data, final Writer writer) throws IOException { checkNotNull(data); checkNotNull(writer); try { JAXBContext context = JAXBContext.newInstance(Hml.class); Marshaller marshaller = context.createMarshaller(); SchemaFactory sche...
java
public static void write(final Hml data, final File file) throws IOException { checkNotNull(data); checkNotNull(file); try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) { write(data, writer); } }
java
public static void write(final Hml data, final OutputStream outputStream) throws IOException { checkNotNull(data); checkNotNull(outputStream); try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(outputStream))) { write(data, writer); } }
java
public static MozuUrl getCurrencyExchangeRateUrl(String currencyCode, String responseFields, String toCurrencyCode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/currency/{currencyCode}/exchangerates/{toCurrencyCode}?responseFields={responseFields}"); formatter.formatUrl("currencyCode", ...
java
public static MozuUrl updateCurrencyLocalizationUrl(String currencyCode, String responseFields) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/currency/{currencyCode}?responseFields={responseFields}"); formatter.formatUrl("currencyCode", currencyCode); formatter.formatUrl("responseField...
java
public static MozuUrl deleteCurrencyLocalizationUrl(String currencyCode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/currency/{currencyCode}"); formatter.formatUrl("currencyCode", currencyCode); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; }
java
public static MozuUrl deleteCurrencyExchangeRateUrl(String currencyCode, String toCurrencyCode) { UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/currency/{currencyCode}/exchangerates/{toCurrencyCode}"); formatter.formatUrl("currencyCode", currencyCode); formatter.formatUrl("toCurrencyCode...
java
public MailAccount reserveMailAccount(final String accountReservationKey, final String pool) { if (pool == null && emailAddressPools.keySet().size() > 1) { throw new IllegalStateException("No pool specified but multiple pools available."); } String poolKey = pool == null ? defaultPool : pool; List<MailAccou...
java
public MailAccount lookupUsedMailAccountForCurrentThread(final String accountReservationKey) { lock.lock(); try { Map<MailAccount, ThreadReservationKeyWrapper> usedAccountsForThread = filterValues(usedAccounts, new CurrentThreadWrapperPredicate()); if (!usedAccountsForThread.isEmpty()) { for (Entry<MailAc...
java
public Set<MailAccount> getReservedMailAccountsForCurrentThread() { lock.lock(); try { Map<MailAccount, ThreadReservationKeyWrapper> accountsForThread = filterValues(usedAccounts, new CurrentThreadWrapperPredicate()); return ImmutableSet.copyOf(accountsForThread.keySet()); } finally { lock.unlock(); } ...
java
public Set<String> getRegisteredAccountReservationKeysForCurrentThread() { lock.lock(); try { Map<MailAccount, String> accountsForThread = transformValues(filterValues(usedAccounts, new CurrentThreadWrapperPredicate()), new Function<ThreadReservationKeyWrapper, String>() { @Override public Strin...
java
public void releaseAllMailAccountsForThread() { log.info("Releasing all mail accounts for the current thread..."); lock.lock(); try { for (Iterator<Entry<MailAccount, ThreadReservationKeyWrapper>> it = usedAccounts.entrySet().iterator(); it.hasNext(); ) { ThreadReservationKeyWrapper wrapper = it.next().get...
java
public void releaseMailAccountForThread(final MailAccount account) { log.info("Releasing mail account for the current thread: {}", account); lock.lock(); try { ThreadReservationKeyWrapper wrapper = usedAccounts.get(account); if (wrapper != null) { if (wrapper.thread == Thread.currentThread()) { log...
java