private IcannReportingStager createStager() { IcannReportingStager action = new IcannReportingStager(); ActivityReportingQueryBuilder activityBuilder = new ActivityReportingQueryBuilder(); activityBuilder.projectId = "test-project"; activityBuilder.yearMonth = new YearMonth(2017, 6); action.activityQueryBuilder = activityBuilder; TransactionsReportingQueryBuilder transactionsBuilder = new TransactionsReportingQueryBuilder(); transactionsBuilder.projectId = "test-project"; transactionsBuilder.yearMonth = new YearMonth(2017, 6); action.transactionsQueryBuilder = transactionsBuilder; action.reportingBucket = "test-bucket"; action.yearMonth = new YearMonth(2017, 6); action.subdir = "icann/monthly/2017-06"; action.bigquery = bigquery; action.gcsUtils = new GcsUtils(gcsService, 1024); return action; }
@Before public void setUp() throws IOException { dataflow = mock(Dataflow.class); projects = mock(Projects.class); templates = mock(Templates.class); launch = mock(Launch.class); when(dataflow.projects()).thenReturn(projects); when(projects.templates()).thenReturn(templates); when(templates.launch(any(String.class), any(LaunchTemplateParameters.class))) .thenReturn(launch); when(launch.setGcsPath(any(String.class))).thenReturn(launch); response = new FakeResponse(); Job job = new Job(); job.setId("12345"); when(launch.execute()).thenReturn(new LaunchTemplateResponse().setJob(job)); action = new GenerateInvoicesAction( "test-project", "gs://test-project-beam", new YearMonth(2017, 10), dataflow, response); }
public static ColumnsListFragment newInstance(@ValueType final int type, @NonNull final String guid, @NonNull final String ministryId, @NonNull final Mcc mcc, @NonNull final YearMonth period, final boolean favoritesOnly) { final ColumnsListFragment fragment = new ColumnsListFragment(); final Bundle args = new Bundle(); args.putInt(ARG_TYPE, type); args.putString(ARG_GUID, guid); args.putString(ARG_MINISTRY_ID, ministryId); args.putString(ARG_MCC, mcc.toString()); args.putString(ARG_PERIOD, period.toString()); args.putBoolean(ARG_FAVORITES_ONLY, favoritesOnly); fragment.setArguments(args); return fragment; }
@NonNull public static MeasurementsPagerFragment newInstance(@ValueType final int type, @NonNull final String guid, @NonNull final String ministryId, @NonNull final Ministry.Mcc mcc, @NonNull final YearMonth period, @NonNull final MeasurementType.Column column, final boolean favoritesOnly) { final MeasurementsPagerFragment fragment = new MeasurementsPagerFragment(); final Bundle args = new Bundle(); args.putInt(ARG_TYPE, type); args.putString(ARG_GUID, guid); args.putString(ARG_MINISTRY_ID, ministryId); args.putString(ARG_MCC, mcc.toString()); args.putString(ARG_PERIOD, period.toString()); args.putString(ARG_COLUMN, column.toString()); args.putBoolean(ARG_FAVORITES_ONLY, favoritesOnly); fragment.setArguments(args); return fragment; }
@NonNull public static MeasurementDetailsFragment newInstance(@NonNull final String guid, @NonNull final String ministryId, @NonNull final Ministry.Mcc mcc, @NonNull final String permLink, @NonNull final YearMonth period) { final MeasurementDetailsFragment fragment = new MeasurementDetailsFragment(); final Bundle args = new Bundle(); args.putString(ARG_GUID, guid); args.putString(ARG_MINISTRY_ID, ministryId); args.putString(ARG_MCC, mcc.toString()); args.putString(ARG_PERMLINK, permLink); args.putString(ARG_PERIOD, period.toString()); fragment.setArguments(args); return fragment; }
@Override public void onCreate(@Nullable final Bundle savedState) { super.onCreate(savedState); setHasOptionsMenu(true); // process arguments final Bundle args = this.getArguments(); mGuid = args.getString(ARG_GUID); mMinistryId = args.getString(ARG_MINISTRY_ID); mMcc = Ministry.Mcc.fromRaw(args.getString(ARG_MCC)); mPermLink = args.getString(ARG_PERMLINK); mPeriod = YearMonth.parse(args.getString(ARG_PERIOD)); // start an initial data sync syncData(false); }
public MeasurementDetailsLoader(@NonNull final Context context, @Nullable final Bundle args) { super(context); mDao = GmaDao.getInstance(context); if (args != null) { mGuid = args.getString(ARG_GUID); mMinistryId = BundleCompat.getString(args, ARG_MINISTRY_ID, Ministry.INVALID_ID); mMcc = Mcc.fromRaw(args.getString(ARG_MCC)); mPermLink = args.getString(ARG_PERMLINK); final String rawPeriod = args.getString(ARG_PERIOD); mPeriod = rawPeriod != null ? YearMonth.parse(rawPeriod) : YearMonth.now(); addIntentFilter( BroadcastUtils.updateMeasurementDetailsFilter(mMinistryId, mMcc, mPeriod, mGuid, mPermLink)); } else { mGuid = null; mMinistryId = Ministry.INVALID_ID; mMcc = Mcc.UNKNOWN; mPermLink = null; mPeriod = YearMonth.now(); } }
@Override protected void onCreate(@Nullable final Bundle savedState) { super.onCreate(savedState); setContentView(R.layout.activity_measurement_details); mGoogleAnalytics = GoogleAnalyticsManager.getInstance(this); final Intent intent = this.getIntent(); mGuid = intent.getStringExtra(EXTRA_GUID); mMinistryId = intent.getStringExtra(EXTRA_MINISTRY_ID); mMcc = Ministry.Mcc.fromRaw(intent.getStringExtra(EXTRA_MCC)); mPermLink = intent.getStringExtra(EXTRA_PERMLINK); mPeriod = YearMonth.parse(intent.getStringExtra(EXTRA_PERIOD)); createDetailsFragmentsIfNeeded(); }
private void onChangePeriod(@NonNull YearMonth period) { // don't allow navigating into the future if (period.isAfter(NOW)) { period = NOW; } // check if the period is changing final boolean changing = !mPeriod.isEqual(period); // update period mPeriod = period; if (changing) { // start a data sync syncAdjacentPeriods(false); // update Period views updateViews(); // reload the measurement columns fragment for the current period loadMeasurementColumnsFragmentIfNeeded(); } }
@NonNull private static List<MeasurementValue> getDirtyMeasurements(@NonNull final GmaDao dao, @NonNull final Assignment assignment, @NonNull final Mcc mcc, @NonNull final YearMonth period) { final List<MeasurementValue> dirty = new ArrayList<>(); if (assignment.can(UPDATE_PERSONAL_MEASUREMENTS)) { dirty.addAll(dao.get(PersonalMeasurement.class, Contract.PersonalMeasurement.SQL_WHERE_DIRTY + " AND " + Contract.PersonalMeasurement.SQL_WHERE_GUID_MINISTRY_MCC_PERIOD, bindValues(assignment.getGuid(), assignment.getMinistryId(), mcc, period))); } if (assignment.can(UPDATE_MINISTRY_MEASUREMENTS)) { dirty.addAll(dao.get(MinistryMeasurement.class, Contract.MinistryMeasurement.SQL_WHERE_DIRTY + " AND " + Contract.MinistryMeasurement.SQL_WHERE_MINISTRY_MCC_PERIOD, bindValues(assignment.getMinistryId(), mcc, period))); } return dirty; }
@NonNull public static Measurement fromJson(@NonNull final JSONObject json, @NonNull final String guid, @NonNull final String ministryId, @NonNull final Ministry.Mcc mcc, @NonNull final YearMonth period) throws JSONException { final Measurement measurement = new Measurement(); measurement.type = MeasurementType.fromJson(json, ministryId); if (json.has(MinistryMeasurement.JSON_VALUE)) { measurement.ministryMeasurement = MinistryMeasurement.fromJson(json, ministryId, mcc, period); } if (json.has(PersonalMeasurement.JSON_VALUE)) { measurement.personalMeasurement = PersonalMeasurement.fromJson(json, guid, ministryId, mcc, period); } return measurement; }
@Test public void testCreate() throws IOException, OmiseException { Token token = resource().create(new Token.Create().card(new Card.Create() .name("JOHN DOE") .number("4242424242424242") .expiration(YearMonth.now().withPeriodAdded(Period.years(1), 1)) .securityCode("123") .city("Bangkok") .postalCode("10240")) ); assertRequested("POST", "/tokens", 200); assertVaultRequest(); assertEquals(TOKEN_ID, token.getId()); assertFalse(token.isLiveMode()); assertEquals("card_test_4yq6tuucl9h4erukfl0", token.getCard().getId()); }
@RequestMapping(value = "/{selectedYearMonth}", method = RequestMethod.GET) public String index(@PathVariable final String selectedYearMonth, Model model) { YearMonth yearMonth = parseYearMonth(selectedYearMonth); ReportIntervalView selectedInterval = new ReportIntervalView(yearMonth.toInterval()); List<ReportIntervalView> intervals = determineReportIntervals(AMOUNT_OF_REPORT_PERIODS); if (!intervals.contains(selectedInterval)) { intervals.add(selectedInterval); } model.addAttribute("intervalList", intervals); model.addAttribute("baseReportIntervalUrl", getPageUrl()); model.addAttribute("selectedInterval", selectedInterval); model.addAttribute("report", determineReport(selectedInterval.getInterval())); model.addAttribute("graphUrlPart", "graph/" + selectedInterval.getId()); return getPageUrl(); }
@RequestMapping(value = "/data/{selectedYearMonth}", method = RequestMethod.GET) @ResponseBody public String graphData(HttpServletResponse response, @PathVariable String selectedYearMonth) { response.setContentType("text/plain;charset=ISO-8859-1"); StringBuffer responseBuffer = new StringBuffer("Month,Create,Create_f,Cancel,Cancel_f,NSI,NSI_f").append("\n"); YearMonth yearMonth = parseYearMonth(selectedYearMonth); for (int i = MONTHS_IN_GRAPH; i > 0; i--) { final YearMonth month = yearMonth.minusMonths(i - 1); ReservationReportView report = determineReport(month.toInterval()); addReport(responseBuffer, report, month.toString("MMM")); } return responseBuffer.toString(); }
@VisibleForTesting protected void sendReports(YearMonth period) { logger.info(String.format("Sending reports to VERS for '%s'", period.toString("yyyy-MM"))); Map<Optional<String>, ReservationReportView> reportViews = getAllReservationReportViews(period); for (Entry<Optional<String>, ReservationReportView> reservationReportViewEntry : reportViews.entrySet()) { Optional<String> institute = reservationReportViewEntry.getKey(); ReservationReportView reportView = reservationReportViewEntry.getValue(); Collection<ErInsertReportDocument> reports = createAllReports(period, institute, reportView); logger.info(String.format("Sending %d reports for institute '%s'", reports.size(), institute.orElse("Null/Not set"))); submitReports(reports); } }
Collection<ErInsertReportDocument> createRequestsCancelSucceededPki(YearMonth previousMonth, Optional<String> institute, ReservationReportView reportView) { final String pkiName = "Reservations cancelled"; List<ErInsertReportDocument> reports = new ArrayList<>(); reports.add( getVersRequest( pkiName, reportView.getAmountRequestsCancelSucceeded(), previousMonth, institute, "Succeeded")); reports.add( getVersRequest( pkiName, reportView.getAmountRequestsCancelFailed(), previousMonth, institute, "Failed")); return reports; }
Collection<ErInsertReportDocument> createRequestsModifiedSucceededPki(YearMonth previousMonth, Optional<String> institute, ReservationReportView reportView) { final String pkiName = "Reservations modified"; List<ErInsertReportDocument> reports = new ArrayList<>(); reports.add( getVersRequest( pkiName, reportView.getAmountRequestsModifiedSucceeded(), previousMonth, institute, "Succeeded")); reports.add( getVersRequest( pkiName, reportView.getAmountRequestsModifiedFailed(), previousMonth, institute, "Failed")); return reports; }
Collection<ErInsertReportDocument> createRunningReservationsSucceededPki(YearMonth previousMonth, Optional<String> institute, ReservationReportView reportView) { final String pkiName = "Reservations created"; List<ErInsertReportDocument> reports = new ArrayList<>(); reports.add( getVersRequest( pkiName, reportView.getAmountRequestsCreatedSucceeded(), previousMonth, institute, "Succeeded")); reports.add( getVersRequest( pkiName, reportView.getAmountRequestsCreatedFailed(), previousMonth, institute, "Failed")); return reports; }
Collection<ErInsertReportDocument> createReservationsProtectionTypePki(YearMonth period, Optional<String> institute, ReservationReportView reservationReportView) { final String pkiName = "Reservation protection type"; List<ErInsertReportDocument> reports = new ArrayList<>(); reports.add( getVersRequest( pkiName, reservationReportView.getAmountReservationsProtected(), period, institute, "Protected")); reports.add( getVersRequest( pkiName, reservationReportView.getAmountReservationsUnprotected(), period, institute, "Unprotected")); reports.add( getVersRequest( pkiName, reservationReportView.getAmountReservationsRedundant(), period, institute, "Redundant")); return reports; }
protected Map<Optional<String>, ReservationReportView> getAllReservationReportViews(YearMonth period) { Map<Optional<String>, ReservationReportView> reportViews = new HashMap<>(); Collection<PhysicalResourceGroup> prgWithPorts = physicalResourceGroupService.findAllWithPorts(); for (PhysicalResourceGroup physicalResourceGroup : prgWithPorts) { Optional<String> orgName = Optional.of(physicalResourceGroup.getOrganization().getShortName()); ReservationReportView report = reportingService.determineReportForAdmin(period.toInterval(), BodRole .createManager(physicalResourceGroup)); reportViews.put(orgName, report); } reportViews.put(Optional.empty(), reportingService.determineReportForNoc(period.toInterval())); return reportViews; }
protected ErInsertReportDocument getVersRequest( String type, long value, YearMonth period, Optional<String> instituteShortName, String instance) { InsertReportInput insertReportInput = InsertReportInput.Factory.newInstance(); insertReportInput.setNormComp("="); insertReportInput.setNormValue(Long.toString(value)); insertReportInput.setDepartmentList(DEPARTMENT_NETWERK_DIENSTEN); insertReportInput.setIsKPI(true); insertReportInput.setValue(Long.toString(value)); insertReportInput.setPeriod(period.toString("yyyy-MM")); insertReportInput.setType(type); insertReportInput.setInstance(instance); if (instituteShortName.isPresent()) { insertReportInput.setOrganisation(instituteShortName.get()); insertReportInput.setIsHidden(false); } else { insertReportInput.setIsHidden(true); } ErInsertReportDocument versRequest = ErInsertReportDocument.Factory.newInstance(); versRequest.setErInsertReport(getErInsertReport(insertReportInput)); return versRequest; }
@Test public void shouldHaveIntervalsUtilNow() { final List<ReportIntervalView> intervals = subject .determineReportIntervals(TestReportController.AMOUNT_OF_REPORT_PERIODS); assertThat(intervals, hasSize(TestReportController.AMOUNT_OF_REPORT_PERIODS)); DateTime firstDay; for (int i = 0; i < TestReportController.AMOUNT_OF_REPORT_PERIODS; i++) { firstDay = YearMonth.now().toLocalDate(1).toDateTimeAtStartOfDay().minusMonths(i); assertThat("Month start: " + i, intervals.get(i).getInterval().getStart(), is(firstDay)); assertThat("Month end: " + i, intervals.get(i).getInterval().getEnd(), is(firstDay.plusMonths(1))); assertThat("Month id: " + i, String.valueOf(intervals.get(i).getId()), is(String.valueOf(firstDay.getYear()) + (firstDay.getMonthOfYear() < 10 ? "0" : "") + String.valueOf(firstDay.getMonthOfYear()))); } }
@Test public void createVersReportForInstitution() { YearMonth period = new YearMonth(2009, 2); long reportValue = 10L; String reportType = "Reservation modified"; String reportInstance = "Failed"; ErInsertReportDocument versRequest = subject.getVersRequest(reportType, reportValue, period, Optional.of("RUG"), reportInstance); ErInsertReport insertReport = versRequest.getErInsertReport(); assertThat(insertReport.getUsername(), is(VERS_USERNAME)); assertThat(insertReport.getPassword(), is(VERS_USER_PASSWORD)); InsertReportInput reportInput = insertReport.getParameters(); assertThat(reportInput.getIsHidden(), is(false)); assertThat(reportInput.getOrganisation(), is("RUG")); assertThat(reportInput.getPeriod(), is("2009-02")); assertThat(reportInput.getNormComp(), is("=")); assertThat(reportInput.getNormValue(), is("" + reportValue)); assertThat(reportInput.getDepartmentList(), is("NWD")); assertThat(reportInput.getValue(), is("" + reportValue)); assertThat(reportInput.getInstance(), is(reportInstance)); assertThat(reportInput.getType(), is(reportType)); }
@Test @Ignore("Only for testing uploading a real report, don't do it every run") public void insertReporting() throws Exception { YearMonth period = new YearMonth(2006, 3); Organization organization = new OrganizationFactory().setShortName("RUG").setName("Rijks Universiteit Groningen").create(); PhysicalResourceGroup group = new PhysicalResourceGroupFactory().setOrganization(organization).create(); ReservationReportView adminReport = new ReservationReportView(period.toInterval().getStart(), period.toInterval().getEnd()); adminReport.setAmountRunningReservationsFailed(1); adminReport.setAmountRequestsCreatedSucceeded(5); adminReport.setAmountRunningReservationsStillRunning(4); ReservationReportView nocReport = new ReservationReportView(period.toInterval().getStart(), period.toInterval().getEnd()); nocReport.setAmountRunningReservationsFailed(2); nocReport.setAmountRequestsCreatedSucceeded(10); nocReport.setAmountRunningReservationsStillRunning(8); when(physicalResourceGroupServiceMock.findAllWithPorts()).thenReturn(Lists.newArrayList(group)); when(reportingServiceMock.determineReportForAdmin(eq(period.toInterval()), any(BodRole.class))).thenReturn(adminReport); when(reportingServiceMock.determineReportForNoc(period.toInterval())).thenReturn(nocReport); subject.sendReports(period); }
public static String miniReport(Contracts contracts, BillingReportPrinter printer, int year, int monthStart, int months) throws Exception { StringBuffer sb = new StringBuffer(); Contracts contAll = contracts.getView(AccountFilter.PAID_CONTRACT); Contracts contCont = contracts.getView(AccountFilter.CONTRACT); YearMonth ym = (new YearMonth()).minusMonths(1); sb.append(printer.line() + "ALL (CONTRACTS + PROJECTS)\n\n"); sb.append(Reporting.displayLastMRR(contAll, year, monthStart, months, ym) + "\n"); sb.append(printer.line() + "CONTRACTS only (projects removed):\n\n"); sb.append(Reporting.displayLastMRR(contCont, year, monthStart, months, ym) + "\n"); sb.append(printer.line()); return sb.toString(); }
private String makeUrl(String filename) { // Filename is in the format tld-reportType-yearMonth.csv String tld = getTld(filename); // Remove the tld- prefix and csv suffix String remainder = filename.substring(tld.length() + 1, filename.length() - 4); List<String> elements = Splitter.on('-').splitToList(remainder); ReportType reportType = ReportType.valueOf(Ascii.toUpperCase(elements.get(0))); // Re-add hyphen between year and month, because ICANN is inconsistent between filename and URL String yearMonth = YearMonth.parse(elements.get(1), DateTimeFormat.forPattern("yyyyMM")).toString("yyyy-MM"); return String.format("%s/%s/%s", getUrlPrefix(reportType), tld, yearMonth); }
/** Provides the subdirectory to store/upload reports to, defaults to icann/monthly/yearMonth. */ @Provides @ReportingSubdir static String provideSubdir( @Parameter(PARAM_SUBDIR) Optional<String> subdirOptional, YearMonth yearMonth) { String subdir = subdirOptional.orElse( String.format( "%s/%s", DEFAULT_SUBDIR, DateTimeFormat.forPattern("yyyy-MM").print(yearMonth))); if (subdir.startsWith("/") || subdir.endsWith("/")) { throw new BadRequestException( String.format("subdir must not start or end with a \"/\", got %s instead.", subdir)); } return subdir; }
/** Extracts an optional YearMonth in yyyy-MM format from the request. */ @Provides @Parameter(PARAM_YEAR_MONTH) static Optional<YearMonth> provideYearMonthOptional(HttpServletRequest req) { DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-MM"); Optional<String> optionalYearMonthStr = extractOptionalParameter(req, PARAM_YEAR_MONTH); try { return optionalYearMonthStr.map(s -> YearMonth.parse(s, formatter)); } catch (IllegalArgumentException e) { throw new BadRequestException( String.format( "yearMonth must be in yyyy-MM format, got %s instead", optionalYearMonthStr.orElse("UNSPECIFIED YEARMONTH"))); } }
@Inject GenerateInvoicesAction( @Config("projectId") String projectId, @Config("apacheBeamBucketUrl") String beamBucketUrl, YearMonth yearMonth, Dataflow dataflow, Response response) { this.projectId = projectId; this.beamBucketUrl = beamBucketUrl; this.yearMonth = yearMonth; this.dataflow = dataflow; this.response = response; }
@Inject BillingEmailUtils( SendEmailService emailService, YearMonth yearMonth, @Config("alertSenderEmailAddress") String alertSenderAddress, @Config("invoiceEmailRecipients") ImmutableList<String> invoiceEmailRecipients, @Config("apacheBeamBucketUrl") String beamBucketUrl) { this.emailService = emailService; this.yearMonth = yearMonth; this.alertSenderAddress = alertSenderAddress; this.invoiceEmailRecipients = invoiceEmailRecipients; this.beamBucketUrl = beamBucketUrl; }
private IcannReportingStagingAction createAction(ImmutableList<ReportType> reportingMode) { IcannReportingStagingAction action = new IcannReportingStagingAction(); action.yearMonth = new YearMonth(2017, 6); action.subdir = "default/dir"; action.reportTypes = reportingMode; action.response = response; action.stager = stager; action.retrier = new Retrier(new FakeSleeper(new FakeClock()), 3); action.emailUtils = emailUtils; return action; }
@Test public void testInvalidSubdir_throwsException() { BadRequestException thrown = expectThrows( BadRequestException.class, () -> IcannReportingModule.provideSubdir(Optional.of("/whoops"), new YearMonth(2017, 6))); assertThat(thrown) .hasMessageThat() .contains("subdir must not start or end with a \"/\", got /whoops instead."); }
@Override @SuppressWarnings("ResourceType") public void onCreate(final Bundle savedState) { super.onCreate(savedState); // process arguments final Bundle args = this.getArguments(); mType = args.getInt(ARG_TYPE, mType); mGuid = args.getString(ARG_GUID); mMinistryId = BundleCompat.getString(args, ARG_MINISTRY_ID, Ministry.INVALID_ID); mMcc = Mcc.fromRaw(args.getString(ARG_MCC)); mPeriod = YearMonth.parse(args.getString(ARG_PERIOD)); mFavoritesOnly = args.getBoolean(ARG_FAVORITES_ONLY, false); }
@Override @SuppressWarnings("ResourceType") public void onCreate(@Nullable final Bundle savedState) { super.onCreate(savedState); // process arguments final Bundle args = this.getArguments(); mType = args.getInt(ARG_TYPE, TYPE_NONE); mGuid = args.getString(ARG_GUID); mMinistryId = BundleCompat.getString(args, ARG_MINISTRY_ID, Ministry.INVALID_ID); mMcc = Ministry.Mcc.fromRaw(args.getString(ARG_MCC)); mPeriod = YearMonth.parse(args.getString(ARG_PERIOD)); mColumn = MeasurementType.Column.fromRaw(args.getString(ARG_COLUMN)); mFavoritesOnly = args.getBoolean(ARG_FAVORITES_ONLY, false); }
@Nullable @Override public Entry apply(@Nullable final Map.Entry<YearMonth, Integer> input) { if (input != null) { return new Entry(input.getValue(), mPeriods.indexOf(input.getKey())); } return null; }
public MeasurementPagerAdapter(@NonNull final Context context, @ValueType final int type, @NonNull final String guid, @NonNull final String ministryId, @NonNull final Mcc mcc, @NonNull final YearMonth period) { mContext = context; mDao = GmaDao.getInstance(context); mType = type; mGuid = guid; mMinistryId = ministryId; mMcc = mcc; mPeriod = period; }
public void sendMeasurementDetailsScreen(@NonNull final String guid, @NonNull final String ministryId, @NonNull final Mcc mcc, @NonNull final String permLink, @NonNull final YearMonth period) { mTracker.setScreenName(SCREEN_NAME_MEASUREMENT_DETAILS); mTracker.send(screen(guid, ministryId, mcc).setCustomDimension(DIMEN_PERM_LINK, permLink) .setCustomDimension(DIMEN_PERIOD, period.toString()).build()); }
public static void start(@NonNull final Context context, @NonNull final String guid, @NonNull final String ministryId, @NonNull final Ministry.Mcc mcc, @NonNull final String permLink, @NonNull final YearMonth period) { final Intent intent = new Intent(context, MeasurementDetailsActivity.class); populateIntent(intent, guid, ministryId, mcc, permLink, period); context.startActivity(intent); }
public static void populateIntent(@NonNull final Intent intent, @NonNull final String guid, @NonNull final String ministryId, @NonNull final Ministry.Mcc mcc, @NonNull final String permLink, @NonNull final YearMonth period) { intent.putExtra(EXTRA_GUID, guid); intent.putExtra(EXTRA_MINISTRY_ID, ministryId); intent.putExtra(EXTRA_MCC, mcc.toString()); intent.putExtra(EXTRA_PERMLINK, permLink); intent.putExtra(EXTRA_PERIOD, period.toString()); }