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

io.imunity.idp.IdPClientData Maven / Gradle / Ivy

/*
 * Copyright (c) 2021 Bixbit - Krzysztof Benedyczak. All rights reserved.
 * See LICENCE.txt file for licensing information.
 */

package io.imunity.idp;

import java.time.Instant;
import java.util.Collections;
import java.util.List;
import java.util.Optional;

public class IdPClientData
{
	public enum AccessStatus
	{
		allow, allowWithoutAsking, disallowWithoutAsking
	}

	public final ApplicationId applicationId;
	public final Optional applicationName;
	public final AccessStatus accessStatus;
	public final AccessProtocol accessProtocol;
	public final Optional> accessScopes;
	public final Optional accessGrantTime;
	public final Optional lastAccessTime;
	public final Optional applicationDomain;
	public final Optional logo;

	public final List technicalInformations;

	private IdPClientData(Builder builder)
	{
		this.applicationId = builder.applicationId;
		this.applicationName = builder.applicationName;
		this.accessStatus = builder.accessStatus;
		this.accessProtocol = builder.accessProtocol;
		this.accessScopes = builder.accessScopes;
		this.accessGrantTime = builder.accessGrantTime;
		this.lastAccessTime = builder.lastAccessTime;
		this.applicationDomain = builder.applicationDomain;
		this.logo = builder.logo;
		this.technicalInformations = builder.technicalInformations;
	}

	public static Builder builder()
	{
		return new Builder();
	}

	public static final class Builder
	{
		private ApplicationId applicationId;
		private Optional applicationName;
		private AccessStatus accessStatus;
		private AccessProtocol accessProtocol;
		private Optional> accessScopes = Optional.empty();
		private Optional accessGrantTime = Optional.empty();
		private Optional lastAccessTime = Optional.empty();
		private Optional applicationDomain = Optional.empty();
		private Optional logo = Optional.empty();
		private List technicalInformations = Collections.emptyList();

		private Builder()
		{
		}

		public Builder withApplicationId(ApplicationId applicationId)
		{
			this.applicationId = applicationId;
			return this;
		}

		public Builder withApplicationName(Optional applicationName)
		{
			this.applicationName = applicationName;
			return this;
		}

		public Builder withAccessStatus(AccessStatus accessStatus)
		{
			this.accessStatus = accessStatus;
			return this;
		}

		public Builder withAccessProtocol(AccessProtocol accessProtocol)
		{
			this.accessProtocol = accessProtocol;
			return this;
		}

		public Builder withAccessScopes(Optional> accessScopes)
		{
			this.accessScopes = accessScopes;
			return this;
		}

		public Builder withAccessGrantTime(Optional accessGrantTime)
		{
			this.accessGrantTime = accessGrantTime;
			return this;
		}

		public Builder withLastAccessTime(Optional lastAccessTime)
		{
			this.lastAccessTime = lastAccessTime;
			return this;
		}

		public Builder withApplicationDomain(Optional applicationDomain)
		{
			this.applicationDomain = applicationDomain;
			return this;
		}

		public Builder withLogo(Optional logo)
		{
			this.logo = logo;
			return this;
		}

		public Builder withTechnicalInformations(List technicalInformations)
		{
			this.technicalInformations = technicalInformations;
			return this;
		}

		public IdPClientData build()
		{
			return new IdPClientData(this);
		}
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy