0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna/*
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna* The contents of this file are subject to the terms of the Common Development and
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna* Distribution License (the License). You may not use this file except in compliance with the
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna* License.
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna*
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna* specific language governing permission and limitations under the License.
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna*
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna* When distributing Covered Software, include this CDDL Header Notice in each file and include
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna* Header, with the fields enclosed by brackets [] replaced by your own identifying
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna* information: "Portions copyright [year] [name of copyright owner]".
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna*
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna* Copyright 2014 ForgeRock AS.
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna*/
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Lunapackage com.iplanet.dpro.session.monitoring;
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Lunaimport org.forgerock.openam.shared.monitoring.TimingEntry;
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna/**
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna * An implementation of {@link TimingEntry} for the Session monitoring component.
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna *
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna * This simple implementation simply stores and then provides the duration again.
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna */
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Lunapublic class SessionTimingEntry implements TimingEntry {
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna private final long duration;
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna /**
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna * Constructor, generating a new SessionTimingEntry with the provided duration
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna *
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna * @param duration length of time the operation took (in ms)
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna */
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna public SessionTimingEntry(long duration) {
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna this.duration = duration;
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna }
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna /**
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna *{@inheritDoc}
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna */
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna @Override
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna public long getDuration() {
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna return duration;
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna }
0f7c5b88fd04e25bea6113dfc783a05e4e2045f8David Luna}