Skip to content

Commit

Permalink
Merge pull request #543 from eclipse-passage/568632-3
Browse files Browse the repository at this point in the history
Bug 568632 Implement feature grant acquire/release
  • Loading branch information
eparovyshnaya authored Nov 12, 2020
2 parents 278b794 + 1144a9f commit 174d026
Show file tree
Hide file tree
Showing 6 changed files with 142 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bundles/org.eclipse.passage.lic.api/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Export-Package: org.eclipse.passage.lic.internal.api;
org.eclipse.passage.lbc.base.tests,
org.eclipse.passage.loc.licenses.core,
org.eclipse.passage.lic.net",
org.eclipse.passage.lic.internal.api.acquire;x-friends:="org.eclipse.passage.lic.hc",
org.eclipse.passage.lic.internal.api.acquire;x-friends:="org.eclipse.passage.lic.hc,org.eclipse.passage.lic.floating.model,org.eclipse.passage.lic.base",
org.eclipse.passage.lic.internal.api.conditions;
x-friends:="org.eclipse.passage.lbc.api,
org.eclipse.passage.lbc.base,
Expand Down
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();
}
1 change: 1 addition & 0 deletions bundles/org.eclipse.passage.lic.base/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Export-Package: org.eclipse.passage.lic.internal.base;
org.eclipse.passage.loc.licenses.core,
org.eclipse.passage.lic.net",
org.eclipse.passage.lic.internal.base.access;x-internal:=true,
org.eclipse.passage.lic.internal.base.acquire;x-friends:="org.eclipse.passage.lic.floating.model",
org.eclipse.passage.lic.internal.base.conditions;
x-friends:="org.eclipse.passage.lbc.base,
org.eclipse.passage.lic.json,
Expand Down
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;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,27 @@ Bundle-Vendor: %providerName
Bundle-Copyright: %Bundle-Copyright
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0";x-installation:=greedy;resolution:=optional,
Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0";resolution:=optional;x-installation:=greedy,
org.eclipse.emf.ecore;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.passage.lic.emf.meta;bundle-version="0.6.0",
org.eclipse.passage.lic.floating;bundle-version="0.0.0";visibility:=reexport
org.eclipse.passage.lic.floating;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.passage.lic.api;bundle-version="1.0.100",
org.eclipse.passage.lic.base;bundle-version="1.0.100"
Export-Package: org.eclipse.passage.lic.floating.model.api;
x-friends:="org.eclipse.passage.lic.floating.edit,
org.eclipse.passage.loc.dashboard.ui,
org.eclipse.passage.loc.api,
org.eclipse.passage.loc.licenses.core,
org.eclipse.passage.lic.hc,
org.eclipse.passage.lic.net",
org.eclipse.passage.lic.floating.model.convert;x-friends:="org.eclipse.passage.lic.hc",
org.eclipse.passage.lic.floating.model.impl;x-internal:=true,
org.eclipse.passage.lic.floating.model.meta;
x-friends:="org.eclipse.passage.lic.floating.e4.ui,
org.eclipse.passage.lic.floating.edit,
org.eclipse.passage.loc.licenses.core,
org.eclipse.passage.loc.floating.emfforms,
org.eclipse.passage.loc.dashboard.ui",
org.eclipse.passage.lic.floating.model.util;
x-friends:="org.eclipse.passage.lic.floating.edit"
org.eclipse.passage.lic.floating.model.util;x-friends:="org.eclipse.passage.lic.floating.edit"
Bundle-ClassPath: .
Bundle-ActivationPolicy: lazy
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());
}

}

0 comments on commit 174d026

Please sign in to comment.