Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#558321 design general purpose interfaces to empower reporting #79

Merged
merged 2 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bundles/org.eclipse.passage.loc.yars.api/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.loc.yars.api
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.loc.yars.api
Bundle-Version: 0.1.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.passage.loc.yars.internal.api;x-internal:=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#Properties file for org.eclipse.passage.loc.yars.api
###############################################################################
# Copyright (c) 2019 ArSysOp and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# ArSysOp - initial API and implementation
###############################################################################

Bundle-Name = Passage LOC YARS API
Bundle-Vendor = Eclipse Passage
Bundle-Copyright = Copyright (c) 2019 ArSysOp and others.\n\
\n\
This program and the accompanying materials are made\n\
available under the terms of the Eclipse Public License 2.0\n\
which is available at https://www.eclipse.org/legal/epl-2.0/\n\
\n\
SPDX-License-Identifier: EPL-2.0\n\
36 changes: 36 additions & 0 deletions bundles/org.eclipse.passage.loc.yars.api/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>

<p>November 30, 2017</p>
<h3>License</h3>

<p>
The Eclipse Foundation makes available all content in this plug-in
(&quot;Content&quot;). Unless otherwise indicated below, the Content
is provided to you under the terms and conditions of the Eclipse
Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.
</p>

<p>
If you did not receive this Content directly from the Eclipse
Foundation, the Content is being redistributed by another party
(&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the
Redistributor's license that was provided with the Content. If no such
license exists, contact the Redistributor. Unless otherwise indicated
below, the terms and conditions of the EPL still apply to any source
code in the Content and such source code may be obtained at <a
href="http://www.eclipse.org/">http://www.eclipse.org</a>.
</p>

</body>
</html>
19 changes: 19 additions & 0 deletions bundles/org.eclipse.passage.loc.yars.api/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
###############################################################################
# Copyright (c) 2019 ArSysOp and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# ArSysOp - initial API and implementation
###############################################################################

source.. = src/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
OSGI-INF/,\
about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*******************************************************************************
* Copyright (c) 2019 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.loc.yars.internal.api;

/**
* <p>Represent data ready for export. </p>
* <p>Actual export can be done by {@linkplain ListMedia}</p>
*
* @since 0.1
*/
public interface ExportData<T> {

<O> void write(ListMedia<T, O> media);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*******************************************************************************
* Copyright (c) 2019 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.loc.yars.internal.api;

public interface FetchParams {
ruspl-afed marked this conversation as resolved.
Show resolved Hide resolved

final class Empty implements FetchParams{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*******************************************************************************
* Copyright (c) 2019 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.loc.yars.internal.api;

import java.util.List;

/**
* Aware of a particular {@linkplain Storage} structure, able to fetch data from
* it according to encapsulated business logic.
*
* @since 0.1
ruspl-afed marked this conversation as resolved.
Show resolved Hide resolved
*/
@SuppressWarnings("unused")
public interface FetchedData<B extends Storage<?>, R> {
ruspl-afed marked this conversation as resolved.
Show resolved Hide resolved

List<R> get();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*******************************************************************************
* Copyright (c) 2019 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.loc.yars.internal.api;

public interface ListMedia<T, C> {
ruspl-afed marked this conversation as resolved.
Show resolved Hide resolved

default ListMedia<T, C> start() {
return this;
}

default ListMedia<T, C> finish() {
return this;
}

default ListMedia<T, C> startNode(@SuppressWarnings("unused") T node) {
return this;
}

default ListMedia<T, C> finishNode(@SuppressWarnings("unused") T node) {
return this;
}

default ListMedia<T, C> inner(//
@SuppressWarnings("unused") String data, //
@SuppressWarnings("unused") String name) {
return this;
}

C content();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*******************************************************************************
* Copyright (c) 2019 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.loc.yars.internal.api;

public interface Query<S extends Storage<?>, R, P extends FetchParams> {
ruspl-afed marked this conversation as resolved.
Show resolved Hide resolved

String id();

String description();

FetchedData<S, R> data(S storage, P properties);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*******************************************************************************
* Copyright (c) 2019 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.loc.yars.internal.api;

/**
* <p>
* Base is an abstraction of an information storage.
* </p>
* <p>
* The interface is parameterized with the type of a single unit of an
* information.
* </p>
* <p>
* A base can cover user registry or set of files, or be physically organized as
* the author desires.
* </p>
* <p>
* The only contract here is the type of core entity.
* </p>
*
* @since 0.1
*/
@SuppressWarnings("unused")
public interface Storage<E> {
ruspl-afed marked this conversation as resolved.
Show resolved Hide resolved

}
3 changes: 3 additions & 0 deletions releng/org.eclipse.passage.loc.aggregator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
<module>../../releng/org.eclipse.passage.loc.repository</module>

<module>../../products/org.eclipse.passage.loc.operator.product</module>

<module>../../bundles/org.eclipse.passage.loc.yars.api</module>

</modules>

</project>