Skip to content

Package: CredentialFactory

CredentialFactory

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2016, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.authentication.credential;
14:
15: import org.eclipse.kapua.model.KapuaEntityFactory;
16: import org.eclipse.kapua.model.id.KapuaId;
17:
18: import java.util.Date;
19:
20: /**
21: * {@link CredentialFactory} definition.
22: *
23: * @see org.eclipse.kapua.model.KapuaEntityFactory
24: * @since 1.0.0
25: */
26: public interface CredentialFactory extends KapuaEntityFactory<Credential, CredentialCreator, CredentialQuery, CredentialListResult> {
27:
28: /**
29: * Instantiates a new {@link Credential}.
30: *
31: * @param scopeId The scope {@link KapuaId} to set into the {@link Credential}.
32: * @param userId The {@link org.eclipse.kapua.service.user.User} {@link KapuaId} to set into the {@link Credential}.
33: * @param credentialType The {@link CredentialType} to set into the {@link Credential}.
34: * @param credentialKey The key to set into the {@link Credential}.
35: * @param credentialStatus The {@link CredentialStatus} to set into the {@link Credential}.
36: * @param expirationDate The expiration date to set into the {@link Credential}.
37: * @return The newly instantiated {@link Credential}
38: * @since 1.0.0
39: */
40: Credential newCredential(KapuaId scopeId, KapuaId userId, CredentialType credentialType, String credentialKey, CredentialStatus credentialStatus, Date expirationDate);
41:
42: /**
43: * Instantiates a new {@link CredentialCreator}.
44: *
45: * @param scopeId The scope {@link KapuaId} to set into the {@link CredentialCreator}.
46: * @param userId The {@link org.eclipse.kapua.service.user.User} {@link KapuaId} to set into the {@link CredentialCreator}.
47: * @param credentialType The {@link CredentialType} to set into the {@link CredentialCreator}.
48: * @param credentialKey The key to set into the {@link CredentialCreator}.
49: * @param credentialStatus The {@link CredentialStatus} to set into the {@link CredentialCreator}.
50: * @param expirationDate The expiration date to set into the {@link CredentialCreator}.
51: * @return The newly instantiated {@link CredentialCreator}
52: * @since 1.0.0
53: */
54: CredentialCreator newCreator(KapuaId scopeId, KapuaId userId, CredentialType credentialType, String credentialKey, CredentialStatus credentialStatus, Date expirationDate);
55: }