Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2015-2016 VMware, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, without warranties or
* conditions of any kind, EITHER EXPRESS OR IMPLIED. See the License for the
* specific language governing permissions and limitations under the License.
*/
package com.vmware.photon.controller.model.adapters.azure.ea;
import static com.vmware.photon.controller.model.adapters.azure.constants
.AzureCostConstants.NO_OF_DAYS_MARGIN_FOR_AZURE_TO_UPDATE_BILL_IN_MILLIS;
import static com.vmware.photon.controller.model.adapters.azure.ea.AzureDetailedBillHandler.BillHeaders.DATE;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;
import java.util.logging.Logger;
import com.opencsv.CSVReader;
import com.opencsv.bean.HeaderColumnNameMappingStrategy;
import com.vmware.photon.controller.model.adapters.azure.model.cost.AzureService;
import com.vmware.photon.controller.model.adapters.azure.model.cost.AzureSubscription;
import com.vmware.photon.controller.model.adapters.azure.model.cost.EaDetailedBillElement;
public class AzureDetailedBillHandler {
private static final Logger logger = Logger
.getLogger(AzureDetailedBillHandler.class.getSimpleName());
public enum BillHeaders {
ACCOUNT_OWNER_ID(0),
ACCOUNT_NAME(1),
SERVICE_ADMINISTRATOR_ID(2),
SUBSCRIPTION_ID(3),
SUBSCRIPTION_GUID(4),
SUBSCRIPTION_NAME(5),
DATE(6),
MONTH(7),
DAY(8),
YEAR(9),
PRODUCT(10),
METER_ID(11),
METER_CATEGORY(12),
METER_SUB_CATEGORY(13),
METER_REGION(14),
METER_NAME(15),
CONSUMED_QUANTITY(16),
RESOURCE_RATE(17),
EXTENDED_COST(18),
RESOURCE_LOCATION(19),
CONSUMED_SERVICE(20),
INSTANCE_ID(21),
SERVICE_INFO_1(22),
SERVICE_INFO_2(23),
ADDITIONAL_INFO(24),
TAGS(25),
STORE_SERVICE_IDENTIFIER(26),
DEPARTMENT_NAME(27),
COST_CENTER(28),
UNIT_OF_MEASURE(29),
RESOURCE_GROUP(30);
public int position;
BillHeaders(int position) {
this.position = position;
}
}
public boolean parseDetailedCsv(CSVReader csvReader, long billProcessedTimeMillis,
String currency, BiConsumer