All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dynatrace.openkit.AppMonOpenKitBuilder Maven / Gradle / Ivy

There is a newer version: 3.3.0
Show newest version
/**
 * Copyright 2018-2019 Dynatrace LLC
 *
 * 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.dynatrace.openkit;

import com.dynatrace.openkit.core.Device;
import com.dynatrace.openkit.core.configuration.BeaconCacheConfiguration;
import com.dynatrace.openkit.core.configuration.BeaconConfiguration;
import com.dynatrace.openkit.core.configuration.Configuration;
import com.dynatrace.openkit.core.configuration.OpenKitType;
import com.dynatrace.openkit.providers.DefaultSessionIDProvider;

/**
 * Concrete builder that creates an {@code OpenKit} instance for AppMon
 */
public class AppMonOpenKitBuilder extends AbstractOpenKitBuilder {

    private final String applicationName;

    /**
     * Creates a new instance of type AppMonOpenKitBuilder
     *
     * @param endpointURL     endpoint OpenKit connects to
     * @param applicationName unique application id
     * @param deviceID        unique device id
     */
    public AppMonOpenKitBuilder(String endpointURL, String applicationName, long deviceID) {
        super(endpointURL, deviceID);
        this.applicationName = applicationName;
    }

    /**
     * Creates a new instance of type AppMonOpenKitBuilder
     *
     * 

* If the given {@code deviceID} does not correspond to a numeric value it will be hashed accordingly to a * 64 bit number. *

* * @param endpointURL endpoint OpenKit connects to * @param applicationName unique application id * @param deviceID unique device id * * @deprecated use {@link #AppMonOpenKitBuilder(String, String, long)} instead */ @Deprecated public AppMonOpenKitBuilder(String endpointURL, String applicationName, String deviceID) { super(endpointURL, deviceID); this.applicationName = applicationName; } @Override Configuration buildConfiguration() { Device device = new Device(getOperatingSystem(), getManufacturer(), getModelID()); BeaconCacheConfiguration beaconCacheConfiguration = new BeaconCacheConfiguration(getBeaconCacheMaxRecordAge(), getBeaconCacheLowerMemoryBoundary(), getBeaconCacheUpperMemoryBoundary()); BeaconConfiguration beaconConfiguration = new BeaconConfiguration(BeaconConfiguration.DEFAULT_MULITPLICITY, getDataCollectionLevel(), getCrashReportLevel()); return new Configuration( OpenKitType.APPMON, applicationName, applicationName, getDeviceID(), getOrigDeviceID(), getEndpointURL(), new DefaultSessionIDProvider(), getTrustManager(), device, getApplicationVersion(), beaconCacheConfiguration, beaconConfiguration); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy