code stringlengths 73 34.1k | label stringclasses 1 value |
|---|---|
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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);
}
}
};
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
@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;
} | java |
public Interval<C> coalesce(final Interval<C> that) {
if(this.overlaps(that)) {
return new Interval(this.dimension, this.range.span(that.range));
}
return NULL;
} | java |
public boolean isConnected(final Interval<C> that) {
if(this.hasNone() || that.hasNone()) {
return false;
}
return this.range.isConnected(that.range);
} | java |
@Beta
public Difference<C> minus(final Interval<C> that) {
return new Difference(this.intersect(that.ahead()),
this.intersect(that.behind()));
} | java |
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())));
} | java |
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())));
} | java |
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;
} | java |
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;
} | java |
public boolean after(final Interval<C> that) {
if(this.hasNone() || that.hasNone()) {
return false;
}
return that.before(this);
} | java |
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);
} | java |
public boolean then(final Interval<C> that) {
checkNotNull(this.range, that.range);
return this.intersect(that).equals(this);
} | java |
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;
} | java |
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;
} | java |
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('\n');
}
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);
}
} | java |
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;
} | java |
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);
} | java |
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);
}
} | java |
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);
}
} | java |
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());
} | java |
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) ;
} | java |
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) ;
} | java |
public static MozuUrl resendReturnEmailUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/returns/email/resend");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
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) ;
} | java |
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;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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;
} | java |
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;
} | java |
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);
}
}
}
} | java |
private void buildStatisticForAMonth(Application application, Account account, Date month) {
buildStatistics(
application, account,
getFirstDayOfMonth(month),
getLastDayOfMonth(month),
getMarkerDateOfMonth(month));
} | java |
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();
} | java |
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;
} | java |
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));
} | java |
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;
}
}
} | java |
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;
} | java |
@Override
public final boolean containsAll(final Collection<? extends E> collection) {
for(E element : collection) {
if(!this.contains(element)) {
return false;
}
}
return true;
} | java |
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;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
public static MozuUrl storeCredentialsUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/platform/extensions/credentialStore/");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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.");
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
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) ;
} | java |
public static MozuUrl getWishlistItemsByWishlistNameUrl(Integer customerAccountId, String filter, Integer pageSize, String responseFields, String sortBy, Integer startIndex, String wishlistName)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/wishlists/customers/{customerAccountId}/{wishlistName}/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("responseFields", responseFields);
formatter.formatUrl("sortBy", sortBy);
formatter.formatUrl("startIndex", startIndex);
formatter.formatUrl("wishlistName", wishlistName);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl updateWishlistItemQuantityUrl(Integer quantity, String responseFields, String wishlistId, String wishlistItemId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/wishlists/{wishlistId}/items/{wishlistItemId}/{quantity}?responseFields={responseFields}");
formatter.formatUrl("quantity", quantity);
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("wishlistId", wishlistId);
formatter.formatUrl("wishlistItemId", wishlistItemId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl removeAllWishlistItemsUrl(String wishlistId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/wishlists/{wishlistId}/items");
formatter.formatUrl("wishlistId", wishlistId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl deleteWishlistItemUrl(String wishlistId, String wishlistItemId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/wishlists/{wishlistId}/items/{wishlistItemId}");
formatter.formatUrl("wishlistId", wishlistId);
formatter.formatUrl("wishlistItemId", wishlistItemId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl getCreditUrl(String code, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/credits/{code}?responseFields={responseFields}");
formatter.formatUrl("code", code);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl resendCreditCreatedEmailUrl(String code, String userId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/credits/{code}/Resend-Email?userId={userId}");
formatter.formatUrl("code", code);
formatter.formatUrl("userId", userId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static void main(final String[] args) {
SLF4JBridgeHandler.install();
boolean exitWithError = true;
StopWatch stopWatch = new StopWatch();
try {
RESULT_LOG.info("jFunk started");
stopWatch.start();
int threadCount = 1;
boolean parallel = false;
Properties scriptProperties = new Properties();
List<File> scripts = Lists.newArrayList();
for (String arg : args) {
if (arg.startsWith("-threadcount")) {
String[] split = arg.split("=");
Preconditions.checkArgument(split.length == 2,
"The number of threads must be specified as follows: -threadcount=<value>");
threadCount = Integer.parseInt(split[1]);
RESULT_LOG.info("Using " + threadCount + (threadCount == 1 ? " thread" : " threads"));
} else if (arg.startsWith("-S")) {
arg = arg.substring(2);
String[] split = arg.split("=");
Preconditions
.checkArgument(split.length == 2, "Script parameters must be given in the form -S<name>=<value>");
scriptProperties.setProperty(split[0], normalizeScriptParameterValue(split[1]));
RESULT_LOG.info("Using script parameter " + split[0] + " with value " + split[1]);
} else if (arg.equals("-parallel")) {
parallel = true;
RESULT_LOG.info("Using parallel mode");
} else {
scripts.add(new File(arg));
}
}
if (scripts.isEmpty()) {
scripts.addAll(requestScriptsViaGui());
if (scripts.isEmpty()) {
RESULT_LOG.info("Execution finished (took " + stopWatch + " H:mm:ss.SSS)");
System.exit(0);
}
}
String propsFileName = System.getProperty("jfunk.props.file", "jfunk.properties");
Module module = ModulesLoader.loadModulesFromProperties(new JFunkDefaultModule(), propsFileName);
Injector injector = Guice.createInjector(module);
JFunkFactory factory = injector.getInstance(JFunkFactory.class);
JFunkBase jFunk = factory.create(threadCount, parallel, scripts, scriptProperties);
jFunk.execute();
exitWithError = false;
} catch (JFunkExecutionException ex) {
// no logging necessary
} catch (Exception ex) {
Logger.getLogger(JFunk.class).error("jFunk terminated unexpectedly.", ex);
} finally {
stopWatch.stop();
RESULT_LOG.info("Execution finished (took " + stopWatch + " H:mm:ss.SSS)");
}
System.exit(exitWithError ? -1 : 0);
} | java |
public Element findElementById(final Element element) {
Attribute a = element.getAttribute(idAttributeName);
if (a == null) {
return null;
}
return findElementById(a.getValue());
} | java |
public Element findElementById(final String id) {
Element element = cache.get(id);
if (element == null) {
if (log.isDebugEnabled()) {
log.debug("Search for element with ID {}", id);
}
Element root = document.getRootElement();
element = search(root, elementName, idAttributeName, id);
if (element != null) {
cache.put(id, element);
}
}
return element;
} | java |
public static Element search(final Element root, final String elementName, final String idAttributeName, final String id) {
Element element = null;
@SuppressWarnings("unchecked")
List<Element> children = root.getChildren();
for (Element e : children) {
if (elementName == null || e.getName().equals(elementName)) {
Attribute a = e.getAttribute(idAttributeName);
if (a != null && id.equals(a.getValue())) {
element = e;
} else {
element = search(e, elementName, idAttributeName, id);
}
}
if (element != null) {
break;
}
}
return element;
} | java |
public static Element getChild(final String name, final Element root) {
@SuppressWarnings("unchecked")
List<Element> allChildren = root.getChildren();
for (Element child : allChildren) {
if (child.getName().equals(name)) {
return child;
}
}
return null;
} | java |
public static MozuUrl getVisitUrl(String responseFields, String visitId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/visits/{visitId}?responseFields={responseFields}");
formatter.formatUrl("responseFields", responseFields);
formatter.formatUrl("visitId", visitId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public boolean executeScript(final File script, final Properties scriptProperties) {
checkState(script.exists(), "Script file does not exist: %s", script);
checkState(script.canRead(), "Script file is not readable: %s", script);
Reader reader = null;
boolean success = false;
Throwable throwable = null;
scriptScope.enterScope();
ScriptContext ctx = scriptContextProvider.get();
try {
reader = Files.newReader(script, charset);
ScriptEngine scriptEngine = new ScriptEngineManager().getEngineByExtension("groovy");
ctx.setScript(script);
ctx.load(JFunkConstants.SCRIPT_PROPERTIES, false);
ctx.registerReporter(new SimpleReporter());
initGroovyCommands(scriptEngine, ctx);
initScriptProperties(scriptEngine, scriptProperties);
ScriptMetaData scriptMetaData = scriptMetaDataProvider.get();
scriptMetaData.setScriptName(script.getPath());
Date startDate = new Date();
scriptMetaData.setStartDate(startDate);
ctx.set(JFunkConstants.SCRIPT_START_MILLIS, String.valueOf(startDate.getTime()));
eventBus.post(scriptEngine);
eventBus.post(new BeforeScriptEvent(script.getAbsolutePath()));
scriptEngine.eval(reader);
success = true;
} catch (IOException ex) {
throwable = ex;
log.error("Error loading script: " + script, ex);
} catch (ScriptException ex) {
throwable = ex;
// Look up the cause hierarchy if we find a ModuleExecutionException.
// We only need to log exceptions other than ModuleExecutionException because they
// have already been logged and we don't want to pollute the log file any further.
// In fact, other exception cannot normally happen.
Throwable th = ex;
while (!(th instanceof ModuleExecutionException)) {
if (th == null) {
// log original exception
log.error("Error executing script: " + script, ex);
success = false;
break;
}
th = th.getCause();
}
} finally {
try {
ScriptMetaData scriptMetaData = scriptMetaDataProvider.get();
Date endDate = new Date();
scriptMetaData.setEndDate(endDate);
ctx.set(JFunkConstants.SCRIPT_END_MILLIS, String.valueOf(endDate.getTime()));
scriptMetaData.setThrowable(throwable);
eventBus.post(new AfterScriptEvent(script.getAbsolutePath(), success));
} finally {
scriptScope.exitScope();
closeQuietly(reader);
}
}
return success;
} | java |
@Override
public void exitScope() {
Map<Key<?>, Object> scopeMap = checkNotNull(getScopeMapForCurrentThread(),
"No scope map found for the current thread. Forgot to call enterScope()?");
performDisposal(scopeMap);
nonInheritableScopeCache.remove();
inheritableScopeCache.remove();
log.debug("Exited scope.");
} | java |
public static MozuUrl getLocationsInUsageTypeUrl(String filter, Boolean includeAttributeDefinition, String locationUsageType, Integer pageSize, String responseFields, String sortBy, Integer startIndex)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/storefront/locationUsageTypes/{locationUsageType}/locations?startIndex={startIndex}&pageSize={pageSize}&sortBy={sortBy}&filter={filter}&includeAttributeDefinition={includeAttributeDefinition}&responseFields={responseFields}");
formatter.formatUrl("filter", filter);
formatter.formatUrl("includeAttributeDefinition", includeAttributeDefinition);
formatter.formatUrl("locationUsageType", locationUsageType);
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) ;
} | java |
public static MozuUrl getDirectShipLocationUrl(Boolean includeAttributeDefinition, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/storefront/locationUsageTypes/DS/location?includeAttributeDefinition={includeAttributeDefinition}&responseFields={responseFields}");
formatter.formatUrl("includeAttributeDefinition", includeAttributeDefinition);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl getInStorePickupLocationUrl(Boolean includeAttributeDefinition, String locationCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/storefront/locationUsageTypes/SP/locations/{locationCode}?includeAttributeDefinition={includeAttributeDefinition}&responseFields={responseFields}");
formatter.formatUrl("includeAttributeDefinition", includeAttributeDefinition);
formatter.formatUrl("locationCode", locationCode);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl getProductReservationUrl(Integer productReservationId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/productreservations/{productReservationId}?responseFields={responseFields}");
formatter.formatUrl("productReservationId", productReservationId);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl commitReservationsUrl()
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/productreservations/commit");
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl updateProductReservationsUrl(Boolean skipInventoryCheck)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/productreservations/?skipInventoryCheck={skipInventoryCheck}");
formatter.formatUrl("skipInventoryCheck", skipInventoryCheck);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl deleteProductReservationUrl(Integer productReservationId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/productreservations/{productReservationId}");
formatter.formatUrl("productReservationId", productReservationId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl getSegmentUrl(Integer id, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/segments/{id}?responseFields={responseFields}");
formatter.formatUrl("id", id);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl addSegmentAccountsUrl(Integer id)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/segments/{id}/accounts");
formatter.formatUrl("id", id);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl removeSegmentAccountUrl(Integer accountId, Integer id)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/segments/{id}/accounts/{accountId}");
formatter.formatUrl("accountId", accountId);
formatter.formatUrl("id", id);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl getAvailablePaymentActionsUrl(String orderId, String paymentId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/payments/{paymentId}/actions");
formatter.formatUrl("orderId", orderId);
formatter.formatUrl("paymentId", paymentId);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl performPaymentActionUrl(String orderId, String paymentId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/orders/{orderId}/payments/{paymentId}/actions?responseFields={responseFields}");
formatter.formatUrl("orderId", orderId);
formatter.formatUrl("paymentId", paymentId);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
public static MozuUrl getMultiRatesUrl(Boolean includeRawResponse)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/shipping/request-multi-rates");
formatter.formatUrl("includeRawResponse", includeRawResponse);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.