Package: ScratchCodeFactoryImpl
ScratchCodeFactoryImpl
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ScratchCodeFactoryImpl() |
|
|
|
|
|
||||||||||||||||||||
clone(ScratchCode) |
|
|
|
|
|
||||||||||||||||||||
newCreator(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
newCreator(KapuaId, KapuaId, String) |
|
|
|
|
|
||||||||||||||||||||
newEntity(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
newListResult() |
|
|
|
|
|
||||||||||||||||||||
newQuery(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
newScratchCode(KapuaId, KapuaId, String) |
|
|
|
|
|
Coverage
1: /*******************************************************************************
2: * Copyright (c) 2020, 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.mfa.shiro;
14:
15: import org.eclipse.kapua.KapuaEntityCloneException;
16: import org.eclipse.kapua.locator.KapuaProvider;
17: import org.eclipse.kapua.model.id.KapuaId;
18: import org.eclipse.kapua.service.authentication.credential.mfa.ScratchCode;
19: import org.eclipse.kapua.service.authentication.credential.mfa.ScratchCodeCreator;
20: import org.eclipse.kapua.service.authentication.credential.mfa.ScratchCodeFactory;
21: import org.eclipse.kapua.service.authentication.credential.mfa.ScratchCodeListResult;
22: import org.eclipse.kapua.service.authentication.credential.mfa.ScratchCodeQuery;
23:
24: /**
25: * {@link ScratchCodeFactory} implementation.
26: */
27: @KapuaProvider
28: public class ScratchCodeFactoryImpl implements ScratchCodeFactory {
29:
30: @Override
31: public ScratchCodeCreatorImpl newCreator(KapuaId scopeId, KapuaId mfaOptionId, String code) {
32: return new ScratchCodeCreatorImpl(scopeId, mfaOptionId, code);
33: }
34:
35: @Override
36: public ScratchCodeListResult newListResult() {
37: return new ScratchCodeListResultImpl();
38: }
39:
40: @Override
41: public ScratchCode newEntity(KapuaId scopeId) {
42: return new ScratchCodeImpl(scopeId);
43: }
44:
45: @Override
46: public ScratchCode newScratchCode(KapuaId scopeId, KapuaId mfaOptionId, String code) {
47: return new ScratchCodeImpl(scopeId, mfaOptionId, code);
48: }
49:
50: @Override
51: public ScratchCodeQuery newQuery(KapuaId scopeId) {
52: return new ScratchCodeQueryImpl(scopeId);
53: }
54:
55: @Override
56: public ScratchCodeCreator newCreator(KapuaId scopeId) {
57: return new ScratchCodeCreatorImpl(scopeId);
58: }
59:
60: @Override
61: public ScratchCode clone(ScratchCode scratchCode) {
62: try {
63: return new ScratchCodeImpl(scratchCode);
64: } catch (Exception e) {
65: throw new KapuaEntityCloneException(e, ScratchCode.TYPE, scratchCode);
66: }
67: }
68: }