-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
90 changed files
with
4,275 additions
and
211 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
79 changes: 79 additions & 0 deletions
79
api/src/main/java/net/adamcin/oakpal/api/EmbeddedPackageInstallable.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,79 @@ | ||
/* | ||
* Copyright 2020 Mark Adamcin | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.adamcin.oakpal.api; | ||
|
||
import org.apache.jackrabbit.vault.packaging.JcrPackage; | ||
import org.apache.jackrabbit.vault.packaging.PackageId; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* An installable path identified as an embedded package. | ||
*/ | ||
public final class EmbeddedPackageInstallable implements SlingInstallable<JcrPackage> { | ||
private final @NotNull PackageId parentId; | ||
private final @NotNull String jcrPath; | ||
private final @NotNull PackageId embeddedId; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param parentId the parent package id | ||
* @param jcrPath the embedded jcr path | ||
* @param embeddedId the embedded package id | ||
*/ | ||
public EmbeddedPackageInstallable(final @NotNull PackageId parentId, | ||
final @NotNull String jcrPath, | ||
final @NotNull PackageId embeddedId) { | ||
this.parentId = parentId; | ||
this.jcrPath = jcrPath; | ||
this.embeddedId = embeddedId; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public PackageId getParentId() { | ||
return parentId; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public String getJcrPath() { | ||
return jcrPath; | ||
} | ||
|
||
@NotNull | ||
public PackageId getEmbeddedId() { | ||
return embeddedId; | ||
} | ||
|
||
@Override | ||
public boolean equals(final Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
final EmbeddedPackageInstallable that = (EmbeddedPackageInstallable) o; | ||
return parentId.equals(that.parentId) && | ||
jcrPath.equals(that.jcrPath) && | ||
embeddedId.equals(that.embeddedId); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(parentId, jcrPath, embeddedId); | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
api/src/main/java/net/adamcin/oakpal/api/OsgiConfigInstallable.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,75 @@ | ||
/* | ||
* Copyright 2020 Mark Adamcin | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.adamcin.oakpal.api; | ||
|
||
import org.apache.jackrabbit.vault.packaging.PackageId; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* Sling Installable representing an OSGi config node. | ||
*/ | ||
public final class OsgiConfigInstallable implements SlingInstallable<Map<String, Object>> { | ||
private final @NotNull PackageId parentId; | ||
private final @NotNull String jcrPath; | ||
private final @NotNull Map<String, Object> properties; | ||
private final @NotNull String servicePid; | ||
private final @Nullable String factoryPid; | ||
|
||
public OsgiConfigInstallable(@NotNull final PackageId parentId, | ||
@NotNull final String jcrPath, | ||
@NotNull final Map<String, Object> properties, | ||
@NotNull final String servicePid, | ||
@Nullable final String factoryPid) { | ||
this.parentId = parentId; | ||
this.jcrPath = jcrPath; | ||
this.properties = Collections.unmodifiableMap(new HashMap<>(properties)); | ||
this.servicePid = servicePid; | ||
this.factoryPid = factoryPid; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public PackageId getParentId() { | ||
return parentId; | ||
} | ||
|
||
@NotNull | ||
@Override | ||
public String getJcrPath() { | ||
return jcrPath; | ||
} | ||
|
||
@NotNull | ||
public Map<String, Object> getProperties() { | ||
return properties; | ||
} | ||
|
||
@NotNull | ||
public String getServicePid() { | ||
return servicePid; | ||
} | ||
|
||
@Nullable | ||
public String getFactoryPid() { | ||
return factoryPid; | ||
} | ||
} |
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
55 changes: 55 additions & 0 deletions
55
api/src/main/java/net/adamcin/oakpal/api/RepoInitScriptsInstallable.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,55 @@ | ||
/* | ||
* Copyright 2020 Mark Adamcin | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.adamcin.oakpal.api; | ||
|
||
import org.apache.jackrabbit.vault.packaging.PackageId; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Locates a jcr path that should be treated as an installable provider of repoinit scripts. | ||
*/ | ||
public final class RepoInitScriptsInstallable implements SlingInstallable<Iterable<String>> { | ||
private final @NotNull PackageId parentId; | ||
private final @NotNull String jcrPath; | ||
private final @NotNull List<String> scripts; | ||
|
||
public RepoInitScriptsInstallable(final @NotNull PackageId parentId, | ||
final @NotNull String jcrPath, | ||
final @NotNull List<String> scripts) { | ||
this.parentId = parentId; | ||
this.jcrPath = jcrPath; | ||
this.scripts = scripts; | ||
} | ||
|
||
@Override | ||
public @NotNull PackageId getParentId() { | ||
return parentId; | ||
} | ||
|
||
@Override | ||
public @NotNull String getJcrPath() { | ||
return jcrPath; | ||
} | ||
|
||
@NotNull | ||
public List<String> getScripts() { | ||
return scripts; | ||
} | ||
|
||
} |
36 changes: 36 additions & 0 deletions
36
api/src/main/java/net/adamcin/oakpal/api/SilenceableCheck.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,36 @@ | ||
/* | ||
* Copyright 2020 Mark Adamcin | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package net.adamcin.oakpal.api; | ||
|
||
import org.osgi.annotation.versioning.ConsumerType; | ||
|
||
/** | ||
* Extended interface marking progress checks that respect a mid-scan mode that expects oakpal to temporarily silence | ||
* violations triggered by scan events. {@link ProgressCheck}s that do not implement this interface are simply blocked | ||
* from receiving scan events for the duration of the silent period. | ||
*/ | ||
@ConsumerType | ||
public interface SilenceableCheck extends ProgressCheck { | ||
|
||
/** | ||
* If silenced is true, this check must DISABLE the collection of violations until this method is called again | ||
* with silenced=false. | ||
* | ||
* @param silenced true to silence violation reporting | ||
*/ | ||
void setSilenced(boolean silenced); | ||
} |
Oops, something went wrong.