-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #543 from eclipse-passage/568632-3
Bug 568632 Implement feature grant acquire/release
- Loading branch information
Showing
6 changed files
with
142 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...pse.passage.lic.api/src/org/eclipse/passage/lic/internal/api/acquire/GrantAcqisition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.internal.api.acquire; | ||
|
||
import java.util.Date; | ||
|
||
public interface GrantAcqisition { | ||
|
||
String identifier(); | ||
|
||
String grant(); | ||
|
||
String feature(); | ||
|
||
String user(); | ||
|
||
Date created(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...sage.lic.base/src/org/eclipse/passage/lic/internal/base/acquire/BaseGrantAcquisition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.internal.base.acquire; | ||
|
||
import java.util.Date; | ||
import java.util.Objects; | ||
|
||
import org.eclipse.passage.lic.internal.api.acquire.GrantAcqisition; | ||
|
||
public final class BaseGrantAcquisition implements GrantAcqisition { | ||
|
||
private final String id; | ||
private final String grant; | ||
private final String feature; | ||
private final String user; | ||
private final Date created; | ||
|
||
public BaseGrantAcquisition(String id, String grant, String feature, String user, Date created) { | ||
Objects.requireNonNull(id, "BaseGrantAcquisition::id"); //$NON-NLS-1$ | ||
Objects.requireNonNull(grant, "BaseGrantAcquisition::grant"); //$NON-NLS-1$ | ||
Objects.requireNonNull(feature, "BaseGrantAcquisition::feature"); //$NON-NLS-1$ | ||
Objects.requireNonNull(user, "BaseGrantAcquisition::user"); //$NON-NLS-1$ | ||
Objects.requireNonNull(created, "BaseGrantAcquisition::created"); //$NON-NLS-1$ | ||
this.id = id; | ||
this.grant = grant; | ||
this.feature = feature; | ||
this.user = user; | ||
this.created = created; | ||
} | ||
|
||
@Override | ||
public String identifier() { | ||
return id; | ||
} | ||
|
||
@Override | ||
public String grant() { | ||
return grant; | ||
} | ||
|
||
@Override | ||
public String feature() { | ||
return feature; | ||
} | ||
|
||
@Override | ||
public String user() { | ||
return user; | ||
} | ||
|
||
@Override | ||
public Date created() { | ||
return created; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
....floating.model/src/org/eclipse/passage/lic/floating/model/convert/PGrantAcquisition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2020 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.floating.model.convert; | ||
|
||
import java.util.Objects; | ||
import java.util.function.Supplier; | ||
|
||
import org.eclipse.passage.lic.floating.model.api.GrantAcqisition; | ||
import org.eclipse.passage.lic.internal.base.acquire.BaseGrantAcquisition; | ||
|
||
public final class PGrantAcquisition implements Supplier<org.eclipse.passage.lic.internal.api.acquire.GrantAcqisition> { | ||
|
||
private final GrantAcqisition source; | ||
|
||
public PGrantAcquisition(GrantAcqisition source) { | ||
Objects.requireNonNull(source, "PGrantAcquisition::source"); //$NON-NLS-1$ | ||
this.source = source; | ||
} | ||
|
||
@Override | ||
public org.eclipse.passage.lic.internal.api.acquire.GrantAcqisition get() { | ||
return new BaseGrantAcquisition(// | ||
source.getIdentifier(), // | ||
source.getGrant(), // | ||
source.getFeature(), // | ||
source.getUser(), // | ||
source.getCreated()); | ||
} | ||
|
||
} |