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

com.memority.citadel.shared.api.am.ApiAccessCode Maven / Gradle / Ivy

Go to download

This artifact provides the API classes that are necessary to implement general configuration Rules on the Memority IM platform.

There is a newer version: 3.43.1
Show newest version
/*
 * Copyright (c) 2016-2023 Memority. All Rights Reserved.
 *
 * This file is part of Memority Citadel API , a Memority project.
 *
 * This file is released under the Memority Public Artifacts End-User License Agreement,
 * see 
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 */
package com.memority.citadel.shared.api.am;

import java.time.Instant;
import java.util.List;
import java.util.Map;

/**
 * Represents an AccessCode
 */
public interface ApiAccessCode {

    /**
     * @return the access code unique identifier
     */
    String getId();

    /**
     * @return the target identity identifier
     */
    String getIdentityId();

    /**
     * @return the expiration date of the access code
     */
    Instant getUntil();

    /**
     * The intents describe the task the code gives access to. They usually map to feature identifiers.
     *
     * @return the list of intents the code gives access to
     */
    List getIntents();

    /**
     * The type of access code acts as a marker. Policies can be applied on types.
     *
     * @return the access code type.
     */
    String getType();

    /**
     * Additional data that may be used in the context of the access code task executions.
     * @return additional data
     */
    Map getData();

    /**
     * @return the current access code use count
     */
    int getUseCount();

    /**
     * @return true if the access code has already been used, false otherwise
     */
    boolean isUsed();

    /**
     * Only when the strategy is TASK should the access code use count be managed in an Action.
     *
     * @return the access code use strategy
     */
    AccessCodeUseStrategy getUseStrategy();

    /**
     * Use the current access count, incrementing its use count by one.
     *
     * @return the access code, with an incremented use count
     */
    ApiAccessCode use();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy