diff options
Diffstat (limited to 'context/context-management/src/main')
2 files changed, 23 insertions, 1 deletions
diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/ContextAlbum.java b/context/context-management/src/main/java/org/onap/policy/apex/context/ContextAlbum.java index 73ef668a0..559139321 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/ContextAlbum.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/ContextAlbum.java @@ -112,6 +112,13 @@ public interface ContextAlbum extends Map<String, Object> { void unlockForWriting(String key) throws ContextException; /** + * Get the stack of artifact keys currently using this context item. + * + * @return the keys of the artifacts using the context album at the moment + */ + AxConcept[] getUserArtifactStack(); + + /** * Set the stack of artifact keys currently using this context item. * * @param userArtifactStack the keys of the artifacts using the context album at the moment diff --git a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java index a68271609..fbaeb2c91 100644 --- a/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java +++ b/context/context-management/src/main/java/org/onap/policy/apex/context/impl/ContextAlbumImpl.java @@ -79,6 +79,10 @@ public final class ContextAlbumImpl implements ContextAlbum { */ public ContextAlbumImpl(final AxContextAlbum albumDefinition, final Distributor distributor, final Map<String, Object> albumMap) throws ContextException { + Assertions.argumentNotNull(albumDefinition, "Context album definition may not be null"); + Assertions.argumentNotNull(distributor, "Distributor may not be null"); + Assertions.argumentNotNull(albumMap, "Album map may not be null"); + this.albumDefinition = albumDefinition; // Use the context distributor passed to us @@ -194,6 +198,17 @@ public final class ContextAlbumImpl implements ContextAlbum { * (non-Javadoc) * * @see + * org.onap.policy.apex.context.ContextAlbum#getUserArtifactStack() + */ + @Override + public AxConcept[] getUserArtifactStack() { + return userArtifactStack; + } + + /* + * (non-Javadoc) + * + * @see * org.onap.policy.apex.context.ContextAlbum#setUserArtifactStack(org.onap.policy.apex.model.basicmodel.concepts. * AxConcept []) */ @@ -440,7 +455,7 @@ public final class ContextAlbumImpl implements ContextAlbum { public Object remove(final Object key) { if (!albumDefinition.isWritable()) { final String returnString = "album \"" + albumDefinition.getID() - + "\" remove() not allowed on read only albums for key=\"" + key; + + "\" remove() not allowed on read only albums for key=\"" + key + "\""; LOGGER.warn(returnString); throw new ContextRuntimeException(returnString); } |