--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc;
+
+import java.io.Serializable;
+
+/** @deprecated use {@link DefaultNameVersion} instead. */
+@Deprecated
+public class BasicNameVersion extends DefaultNameVersion implements
+ Serializable {
+ private static final long serialVersionUID = -5127304279136195127L;
+
+ public BasicNameVersion() {
+ }
+
+ /** Interprets string in OSGi-like format my.module.name;version=0.0.0 */
+ public BasicNameVersion(String nameVersion) {
+ int index = nameVersion.indexOf(";version=");
+ if (index < 0) {
+ setName(nameVersion);
+ setVersion(null);
+ } else {
+ setName(nameVersion.substring(0, index));
+ setVersion(nameVersion.substring(index + ";version=".length()));
+ }
+ }
+
+ public BasicNameVersion(String name, String version) {
+ super(name, version);
+ }
+
+ public BasicNameVersion(NameVersion nameVersion) {
+ super(nameVersion);
+ }
+}
--- /dev/null
+package org.argeo.slc;
+
+/**
+ * Adds a dimension to {@link NameVersion} by adding an arbitrary category (e.g.
+ * Maven groupId, yum repository ID, etc.)
+ */
+public interface CategorizedNameVersion extends NameVersion {
+ /** The category of the component. */
+ public String getCategory();
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc;
+
+/** Binary check on an arbitrary object. */
+public interface Condition<T> {
+ /**
+ * Checks the condition.
+ *
+ * @return true, if the condition is verified, false if not.
+ */
+ public Boolean check(T obj);
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc;
+
+
+/** Canonical implementation of {@link NameVersion} */
+public class DefaultNameVersion implements NameVersion,
+ Comparable<NameVersion> {
+ private String name;
+ private String version;
+
+ public DefaultNameVersion() {
+ }
+
+ public DefaultNameVersion(String name, String version) {
+ this.name = name;
+ this.version = version;
+ }
+
+ public DefaultNameVersion(NameVersion nameVersion) {
+ this.name = nameVersion.getName();
+ this.version = nameVersion.getVersion();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof NameVersion) {
+ NameVersion nameVersion = (NameVersion) obj;
+ return name.equals(nameVersion.getName())
+ && version.equals(nameVersion.getVersion());
+ } else
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return name.hashCode() + version.hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return name + ":" + version;
+ }
+
+ public int compareTo(NameVersion o) {
+ if (o.getName().equals(name))
+ return version.compareTo(o.getVersion());
+ else
+ return name.compareTo(o.getName());
+ }
+}
--- /dev/null
+package org.argeo.slc;
+
+import java.util.Iterator;
+
+/** A set of {@link NameVersion}. */
+public interface ModuleSet {
+ Iterator<? extends NameVersion> nameVersions();
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc;
+
+/**
+ * Abstraction of a name / version pair, typically used as coordinates for a
+ * software module either deployed or packaged as an archive.
+ */
+public interface NameVersion {
+ /** The name of the component. */
+ public String getName();
+
+ /** The version of the component. */
+ public String getVersion();
+}
--- /dev/null
+package org.argeo.slc;
+
+/** Constants useful across all SLC components */
+public interface SlcConstants {
+ /** Read-write role. */
+ public final static String ROLE_SLC = "ROLE_SLC";
+
+ /** Read only unlogged user */
+ public final static String USER_ANONYMOUS = "anonymous";
+}
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc;\r
+\r
+/** Basis for all SLC exceptions. This is an unchecked exception. */\r
+public class SlcException extends RuntimeException {\r
+ private static final long serialVersionUID = 6373738619304106445L;\r
+\r
+ /** Constructor. */\r
+ public SlcException(String message) {\r
+ super(message);\r
+ }\r
+\r
+ /** Constructor. */\r
+ public SlcException(String message, Throwable e) {\r
+ super(message, e);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc;
+
+import java.io.InputStream;
+
+public interface StreamReadable {
+ public InputStream getInputStream();
+}
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc;\r
+\r
+/** Exception for unsupported features or actions. */\r
+public class UnsupportedException extends SlcException {\r
+ static final long serialVersionUID = 1l;\r
+\r
+ /** Action not supported. */\r
+ public UnsupportedException() {\r
+ this("Action not supported");\r
+ }\r
+\r
+ /** Constructor with a message. */\r
+ public UnsupportedException(String message) {\r
+ super(message);\r
+ }\r
+\r
+ /**\r
+ * Constructor generating a message.\r
+ * \r
+ * @param nature\r
+ * the nature of the unsupported object\r
+ * @param obj\r
+ * the object itself (its class name will be used in message)\r
+ */\r
+ public UnsupportedException(String nature, Object obj) {\r
+ super("Unsupported " + nature + ": "\r
+ + (obj != null ? obj.getClass() : "[object is null]"));\r
+ }\r
+\r
+ /**\r
+ * Constructor generating a message.\r
+ * \r
+ * @param nature\r
+ * the nature of the unsupported object\r
+ * @param clss\r
+ * the class itself (will be used in message)\r
+ */\r
+ public UnsupportedException(String nature, Class<?> clss) {\r
+ super("Unsupported " + nature + ": " + clss);\r
+ }\r
+\r
+ /**\r
+ * Constructor generating a message.\r
+ * \r
+ * @param nature\r
+ * the nature of the unsupported object\r
+ * @param value\r
+ * the problematic value itself\r
+ */\r
+ public UnsupportedException(String nature, String value) {\r
+ super("Unsupported " + nature + ": " + value);\r
+ }\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.build;\r
+\r
+/** A packaged software component */\r
+public interface Distribution {\r
+ public String getDistributionId();\r
+\r
+}\r
--- /dev/null
+package org.argeo.slc.build;
+
+/** A software license */
+public interface License {
+ public String getName();
+
+ public String getUri();
+
+ public String getLink();
+
+ public String getText();
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.build;
+
+import org.argeo.slc.ModuleSet;
+import org.argeo.slc.NameVersion;
+
+/**
+ * A distribution of modules, that is components that can be identified by a
+ * name / version couple.
+ *
+ * @see NameVersion
+ */
+public interface ModularDistribution extends Distribution, NameVersion,
+ ModuleSet {
+ public Distribution getModuleDistribution(String moduleName,
+ String moduleVersion);
+
+ /** A descriptor such as P2, OBR or yum metadata. */
+ public Object getModulesDescriptor(String descriptorType);
+}
--- /dev/null
+<html>\r
+<head></head>\r
+<body>\r
+SLC Build: building of software systems.\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.deploy;
+
+import org.argeo.slc.UnsupportedException;
+import org.argeo.slc.build.Distribution;
+
+public abstract class AbstractDeployedSystem implements DeployedSystem {
+ public String getDeployedSystemId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public DeploymentData getDeploymentData() {
+ throw new UnsupportedException("Method not supported");
+ }
+
+ public Distribution getDistribution() {
+ throw new UnsupportedException("Method not supported");
+ }
+
+ public TargetData getTargetData() {
+ throw new UnsupportedException("Method not supported");
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.deploy;
+
+import java.io.File;
+import java.util.Map;
+
+public interface DeployEnvironment {
+ public void unpackTo(Object packg, File targetLocation,
+ Map<String, String> filter);
+}
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.deploy;\r
+\r
+import org.argeo.slc.build.Distribution;\r
+\r
+/** An instance of a software system. */\r
+public interface DeployedSystem extends TargetData {\r
+ /** Unique ID for this system instance. */\r
+ public String getDeployedSystemId();\r
+\r
+ /** Underlying packages */\r
+ public Distribution getDistribution();\r
+\r
+ /** Data required to initialize the instance (e.g. DB dump, etc.). */\r
+ public DeploymentData getDeploymentData();\r
+\r
+ /** Resources required by the system (ports, disk location, etc.) */\r
+ public TargetData getTargetData();\r
+}\r
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.deploy;
+
+public interface DeployedSystemManager<T extends DeployedSystem> {
+ public void setDeployedSystem(T deployedSystem);
+}
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.deploy;\r
+\r
+import org.argeo.slc.build.Distribution;\r
+\r
+public interface Deployment extends Runnable{\r
+ public DeployedSystem getDeployedSystem();\r
+\r
+ public void setTargetData(TargetData targetData);\r
+\r
+ public void setDeploymentData(DeploymentData deploymentData);\r
+\r
+ public void setDistribution(Distribution distribution);\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.deploy;\r
+\r
+public interface DeploymentData {\r
+\r
+}\r
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.deploy;
+
+import org.argeo.slc.NameVersion;
+import org.argeo.slc.build.Distribution;
+
+public interface DynamicRuntime<M extends Module> extends
+ ModularDeployedSystem<M> {
+ public void shutdown();
+
+ public M installModule(Distribution distribution);
+
+ public void uninstallModule(NameVersion nameVersion);
+
+ public void updateModule(NameVersion nameVersion);
+
+ public void startModule(NameVersion nameVersion);
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.deploy;
+
+public interface InstalledExecutables extends DeployedSystem {
+ public String getExecutablePath(String key);
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.deploy;
+
+import java.util.List;
+
+public interface ModularDeployedSystem<M extends Module> extends DeployedSystem {
+ /** List the underlying deployed modules (in real time) */
+ public List<M> listModules();
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.deploy;
+
+import org.argeo.slc.NameVersion;
+
+/**
+ * Represents a deployed module of a broader deployed system. A module is
+ * uniquely identifiable via a name / version.
+ */
+public interface Module extends DeployedSystem, NameVersion {
+ /** A serializable stateless description of the module */
+ public ModuleDescriptor getModuleDescriptor();
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.deploy;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.argeo.slc.BasicNameVersion;
+
+/** The description of a versioned module. */
+public class ModuleDescriptor extends BasicNameVersion implements Serializable {
+ private static final long serialVersionUID = 4310820315478645419L;
+ private String title;
+ private String description;
+ private Map<String, String> metadata = new HashMap<String, String>();
+ private Boolean started = false;
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /** @deprecated use {@link #getTitle()} instead */
+ public String getLabel() {
+ return title;
+ }
+
+ /** @deprecated use {@link #setTitle(String)} instead */
+ public void setLabel(String label) {
+ this.title = label;
+ }
+
+ public Map<String, String> getMetadata() {
+ return metadata;
+ }
+
+ public void setMetadata(Map<String, String> metadata) {
+ this.metadata = metadata;
+ }
+
+ public Boolean getStarted() {
+ return started;
+ }
+
+ public void setStarted(Boolean started) {
+ this.started = started;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.deploy;
+
+import java.util.List;
+
+import org.argeo.slc.NameVersion;
+
+/** Provides access to deployed modules */
+public interface ModulesManager {
+ /** @return a full fledged module descriptor. */
+ public ModuleDescriptor getModuleDescriptor(String moduleName,
+ String version);
+
+ /**
+ * @return a list of minimal module descriptors of the deployed modules
+ */
+ public List<ModuleDescriptor> listModules();
+
+ /** Synchronously upgrades the module referenced by this name version */
+ public void upgrade(NameVersion nameVersion);
+
+ /** Starts the module */
+ public void start(NameVersion nameVersion);
+
+ /** Stops the module */
+ public void stop(NameVersion nameVersion);
+}
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.deploy;\r
+\r
+public interface TargetData {\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.deploy;\r
+\r
+import java.io.File;\r
+import java.io.OutputStream;\r
+import java.util.List;\r
+\r
+/** Abstracts common versioning operations */\r
+public interface VersioningDriver {\r
+ public void getFileFromRepository(String repositoryBaseUrl,\r
+ String location, OutputStream out);\r
+\r
+ public List<String> getChangedPaths(File repositoryRoot, Long revision);\r
+\r
+ public String getRepositoryRoot(String repositoryUrl);\r
+\r
+ public String getRelativePath(String repositoryUrl);\r
+\r
+ public void updateToHead(File fileOrDir);\r
+\r
+ public void importFileOrDir(String repositoryUrl, File fileOrDir);\r
+\r
+ /**\r
+ * Checks out or update this versioned directory\r
+ * \r
+ * @return true if the content has changed, false otherwise\r
+ */\r
+ public Boolean checkout(String repositoryUrl, File destDir,\r
+ Boolean recursive);\r
+\r
+ public void createRepository(String filePath);\r
+\r
+ public void commit(File fileOrDir, String commitMessage);\r
+}\r
--- /dev/null
+<html>\r
+<head></head>\r
+<body>\r
+SLC Deploy: deployment of software systems.\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.execution;\r
+\r
+/** Variables or references attached to an execution (typically thread bounded).*/\r
+public interface ExecutionContext {\r
+ public final static String VAR_EXECUTION_CONTEXT_ID = "slcVar.executionContext.id";\r
+ public final static String VAR_EXECUTION_CONTEXT_CREATION_DATE = "slcVar.executionContext.creationDate";\r
+ public final static String VAR_FLOW_ID = "slcVar.flow.id";\r
+ public final static String VAR_FLOW_NAME = "slcVar.flow.name";\r
+\r
+ public String getUuid();\r
+\r
+ /** @return the variable value, or <code>null</code> if not found. */\r
+ public Object getVariable(String key);\r
+\r
+ public void setVariable(String key, Object value);\r
+}\r
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+import java.util.Iterator;
+
+/** Abstraction of an execution that can be identified and configured. */
+public interface ExecutionFlow extends Runnable {
+ /** Retrieve an immutable parameter */
+ public Object getParameter(String key);
+
+ /** Whether this immutable parameter is set */
+ public Boolean isSetAsParameter(String key);
+
+ /** The specifications of the execution flow. */
+ public ExecutionSpec getExecutionSpec();
+
+ /**
+ * List sub-runnables that would be executed if run() method would be
+ * called.
+ */
+ public Iterator<Runnable> runnables();
+
+ /**
+ * If there is one and only one runnable wrapped return it, throw an
+ * exeception otherwise.
+ */
+ public Runnable getRunnable();
+
+ /**
+ * The name of this execution flow. Can contains '/' which will be
+ * interpreted by UIs as a hierarchy;
+ */
+ public String getName();
+
+ /**
+ * @deprecated will be removed in SLC 2.0, the path should be the part of
+ * the name with '/'
+ */
+ public String getPath();
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ *
+ * Implements both archetype and implementation of a given process.
+ *
+ * At specification time, <code>executionSpec</code> represents the spec of the
+ * parameters accepted by the process, with, among others: type, default value
+ * and, optionally, possible values for each parameter. Thus ExecutionSpec might
+ * be a huge object. Note that when marshalling only a reference to a specific
+ * ExecutionSpec is stored in the XML to optimize performance and avoid
+ * redundancy between various ExecutionFlowDesciptor that might have the same
+ * ExecutionSpec.
+ *
+ * At runtime, we build a RealizedFlow which references an
+ * ExecutionFlowDescriptor. As it happens AFTER marshalling / unmarshalling
+ * process, the ExecutionSpec is null but we manage to retrieve the
+ * ExecutionSpec and store it in the RealizedFlow, whereas set values of the
+ * parameters are stored in the <code>values</code> map.
+ *
+ * Generally, values object are either a <code>PrimitiveAccessor</code> or a
+ * <code>RefValue</code> but can be other objects.
+ */
+public class ExecutionFlowDescriptor implements Serializable, Cloneable {
+ private static final long serialVersionUID = 7101944857038041216L;
+ private String name;
+ private String description;
+ private String path;
+ private Map<String, Object> values;
+ private ExecutionSpec executionSpec;
+
+ public ExecutionFlowDescriptor() {
+ }
+
+ public ExecutionFlowDescriptor(String name, String description,
+ Map<String, Object> values, ExecutionSpec executionSpec) {
+ this.name = name;
+ this.values = values;
+ this.executionSpec = executionSpec;
+ }
+
+ /** The referenced {@link ExecutionSpec} is NOT cloned. */
+ @Override
+ protected Object clone() throws CloneNotSupportedException {
+ return new ExecutionFlowDescriptor(name, description,
+ new HashMap<String, Object>(values), executionSpec);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * @deprecated will be removed in SLC 2.x, the path should be the part of
+ * the name with '/'
+ */
+ public String getPath() {
+ return path;
+ }
+
+ /**
+ * @deprecated will be removed in SLC 2.0, the path should be the part of
+ * the name with '/'
+ */
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public Map<String, Object> getValues() {
+ return values;
+ }
+
+ public ExecutionSpec getExecutionSpec() {
+ return executionSpec;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setValues(Map<String, Object> values) {
+ this.values = values;
+ }
+
+ public void setExecutionSpec(ExecutionSpec executionSpec) {
+ this.executionSpec = executionSpec;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj instanceof ExecutionFlowDescriptor)
+ return name.equals(((ExecutionFlowDescriptor) obj).getName());
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return name.hashCode();
+ }
+
+ @Override
+ public String toString() {
+ return (path != null && !path.trim().equals("") ? path + "/" : "")
+ + name;
+ }
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+import java.util.Map;
+
+/**
+ * Maps back and forth between {@link ExecutionFlowDescriptor} and
+ * {@link ExecutionFlow}
+ */
+public interface ExecutionFlowDescriptorConverter {
+ public Map<String, Object> convertValues(
+ ExecutionFlowDescriptor executionFlowDescriptor);
+
+ public void addFlowsToDescriptor(ExecutionModuleDescriptor md,
+ Map<String, ExecutionFlow> executionFlows);
+
+ public ExecutionFlowDescriptor getExecutionFlowDescriptor(
+ ExecutionFlow executionFlow);
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+@Deprecated
+public interface ExecutionModule {
+/* public String getName();
+
+ public String getVersion();
+
+ public ExecutionModuleDescriptor getDescriptor();
+
+ public void execute(ExecutionFlowDescriptor descriptor);*/
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.deploy.ModuleDescriptor;
+
+/** Describes the information required to launch a flow */
+public class ExecutionModuleDescriptor extends ModuleDescriptor {
+ /** Metadata header identifying an SLC execution module */
+ public final static String SLC_EXECUTION_MODULE = "SLC-ExecutionModule";
+
+ private static final long serialVersionUID = -2394473464513029512L;
+ private List<ExecutionSpec> executionSpecs = new ArrayList<ExecutionSpec>();
+ private List<ExecutionFlowDescriptor> executionFlows = new ArrayList<ExecutionFlowDescriptor>();
+
+ public List<ExecutionSpec> getExecutionSpecs() {
+ return executionSpecs;
+ }
+
+ public List<ExecutionFlowDescriptor> getExecutionFlows() {
+ return executionFlows;
+ }
+
+ /**
+ * Returns a new {@link ExecutionModuleDescriptor} that can be used to build
+ * a {@link RealizedFlow}.
+ */
+ public ExecutionFlowDescriptor cloneFlowDescriptor(String name) {
+ ExecutionFlowDescriptor res = null;
+ for (ExecutionFlowDescriptor efd : executionFlows) {
+ if (efd.getName().equals(name)
+ || ("/" + efd.getName()).equals(name)) {
+ try {
+ res = (ExecutionFlowDescriptor) efd.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new SlcException("Cannot clone " + efd, e);
+ }
+ }
+ }
+ if (res == null)
+ throw new SlcException("Flow " + name + " not found.");
+ return res;
+ }
+
+ public RealizedFlow asRealizedFlow(String flow, Map<String, Object> values) {
+ RealizedFlow realizedFlow = new RealizedFlow();
+ realizedFlow.setFlowDescriptor(cloneFlowDescriptor(flow));
+ realizedFlow.setModuleName(getName());
+ realizedFlow.setModuleVersion(getVersion());
+ realizedFlow.getFlowDescriptor().getValues().putAll(values);
+ return realizedFlow;
+ }
+
+ public void setExecutionSpecs(List<ExecutionSpec> executionSpecs) {
+ this.executionSpecs = executionSpecs;
+ }
+
+ public void setExecutionFlows(List<ExecutionFlowDescriptor> executionFlows) {
+ this.executionFlows = executionFlows;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+import org.argeo.slc.deploy.ModuleDescriptor;
+
+/** Listen to events on execution modules. */
+public interface ExecutionModulesListener {
+ public void executionModuleAdded(ModuleDescriptor moduleDescriptor);
+
+ public void executionModuleRemoved(ModuleDescriptor moduleDescriptor);
+
+ public void executionFlowAdded(ModuleDescriptor moduleDescriptor,
+ ExecutionFlowDescriptor executionFlowDescriptor);
+
+ public void executionFlowRemoved(ModuleDescriptor moduleDescriptor,
+ ExecutionFlowDescriptor executionFlowDescriptor);
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+import java.util.List;
+
+import org.argeo.slc.deploy.ModulesManager;
+
+/** Provides access to the execution modules */
+public interface ExecutionModulesManager extends ModulesManager {
+ /** Used to filter event notified to an execution notifier. */
+ public static String SLC_PROCESS_ID = "slc.process.id";
+
+ /** Unique launch module */
+ public static String UNIQUE_LAUNCH_MODULE_PROPERTY = "slc.launch.module";
+
+ /** Unique launch flow */
+ public static String UNIQUE_LAUNCH_FLOW_PROPERTY = "slc.launch.flow";
+
+ /** @return a full fledged module descriptor. */
+ public ExecutionModuleDescriptor getExecutionModuleDescriptor(
+ String moduleName, String version);
+
+ /**
+ * @return a list of minimal execution module descriptors (only the module
+ * meta data, not the flows)
+ */
+ public List<ExecutionModuleDescriptor> listExecutionModules();
+
+ /** Synchronously finds and executes an {@link ExecutionFlow}. */
+ public void execute(RealizedFlow realizedFlow);
+
+ // /** Notify of a status update status of the {@link ExecutionProcess} */
+// public void dispatchUpdateStatus(ExecutionProcess process,
+// String oldStatus, String newStatus);
+ //
+ // /** Notify that a step was added in an {@link ExecutionProcess} */
+ // public void dispatchAddSteps(ExecutionProcess process,
+ // List<ExecutionStep> steps);
+ //
+ // /**
+ // * Register a notifier which will be notified based on the provided
+ // * properties.
+ // */
+ // public void registerProcessNotifier(ExecutionProcessNotifier notifier,
+ // Map<String, String> properties);
+ //
+ // /** Unregisters a notifier */
+ // public void unregisterProcessNotifier(ExecutionProcessNotifier notifier,
+ // Map<String, String> properties);
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+import java.util.List;
+
+/**
+ * A process is the functional representation of a combination of executions.
+ * While an execution is the actual java code running, a process exists before,
+ * during and after the execution actually took place, providing an entry point
+ * for the definition of executions, their monitoring (e.g. logging) and
+ * tracking. A process can be distributed or parallelized. <br/>
+ * NEW => INITIALIZED => SCHEDULED => RUNNING<br/>
+ * RUNNING => {COMPLETED | ERROR | KILLED}<br/>
+ * {COMPLETED | ERROR | KILLED} => PURGED<br/>
+ * UNKOWN : this is a bug if this status occurs<br/>
+ */
+public interface ExecutionProcess {
+ /** The process is not yet usable. */
+ public final static String NEW = "NEW";
+ /** The process is usable but not yet scheduled to run. */
+ public final static String INITIALIZED = "INITIALIZED";
+ /** The process is usable and scheduled to run, but not yet running. */
+ public final static String SCHEDULED = "SCHEDULED";
+ /** The process is currently running. */
+ public final static String RUNNING = "RUNNING";
+ /** The process has properly completed. */
+ public final static String COMPLETED = "COMPLETED";
+ /** The process failed because of an unexpected error. */
+ public final static String ERROR = "ERROR";
+ /** The process was killed explicitly or through a crash. */
+ public final static String KILLED = "KILLED";
+ /** The status cannot be retrieved (probably because of unexpected errors). */
+ public final static String UNKOWN = "UNKOWN";
+
+ /**
+ * Only a reference to the process has been kept, all monitoring data such
+ * as logs have been purged.
+ */
+ public final static String PURGED = "PURGED";
+
+ /** The UUID of this process. */
+ public String getUuid();
+
+ /** The current status of this process. */
+ public String getStatus();
+
+ /** Sets the current status of this process */
+ public void setStatus(String status);
+
+ public void addSteps(List<ExecutionStep> steps);
+
+ public List<RealizedFlow> getRealizedFlows();
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+import java.util.Map;
+
+/**
+ * The class implementing this interface defines the map of attributes that are
+ * necessary for the corresponding ExecutionFlow.
+ */
+public interface ExecutionSpec {
+ /**
+ * The name for an internal spec (for backward compatibility where a
+ * non-null name is expected)
+ */
+ public final static String INTERNAL_NAME = "__SLC_EXECUTION_SPEC_INTERNAL";
+
+ /**
+ * The name identifying the execution spec within its application context.
+ * Can be null. An execution spec can be referenced only if its name is not
+ * null or different from {@link #INTERNAL_NAME}
+ */
+ public String getName();
+
+ /** An optional description. Can be null. */
+ public String getDescription();
+
+ /** The attributes managed by this execution spec */
+ public Map<String, ExecutionSpecAttribute> getAttributes();
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+/**
+ * Possible attribute of an execution flow.
+ *
+ * There are mainly two implementations :<br>
+ * + Primitive attributes (no predefined choice, the end user must compute a
+ * String, a Float, an Integer...)<br>
+ * + RefSpecAttribute which enable two things<br>
+ * ++ a reference to another object of the application context<br>
+ * ++ the display of some choices among which the end user can choose.<br>
+ *
+ * @see org.argeo.slc.core.execution.PrimitiveSpecAttribute
+ * @see org.argeo.slc.core.execution.RefSpecAttribute
+ * @see org.argeo.slc.core.execution.PrimitiveUtils : this class offers some
+ * helper, among others to cast the various type of primitive attribute.
+ */
+public interface ExecutionSpecAttribute {
+ /**
+ * Whether this attribute has to be set at instantiation of the flow and
+ * cannot be modified afterwards. If the attribute is not immutable (that
+ * is, this method returns false), it can be set at execution time.
+ */
+ public Boolean getIsImmutable();
+
+ /**
+ * Whether this attribute must be explicitly set and cannot be modified.
+ * This attribute is then basically a constant within a given application
+ * context. {@link #getValue()} cannot return null if the attribute is a
+ * constant.
+ */
+ public Boolean getIsConstant();
+
+ /** Whether this attribute will be hidden to end users. */
+ public Boolean getIsHidden();
+
+ /**
+ * The default value for this attribute. Can be null, except if
+ * {@link #getIsFrozen()} is <code>true</code>, in which case it represents
+ * the constant value of this attribute.
+ */
+ public Object getValue();
+
+ /** Description of this attribute, can be null */
+ public String getDescription();
+
+ /** @deprecated use {@link #getIsImmutable()} instead */
+ public Boolean getIsParameter();
+
+ /** @deprecated use {@link #getIsConstant()} instead */
+ public Boolean getIsFrozen();
+
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+/** Deal with nested level of executions using different vartiables. */
+public interface ExecutionStack {
+ /**
+ * @param name
+ * @return null if no object is found
+ */
+ public Object findScopedObject(String name);
+
+ public void addScopedObject(String name, Object obj);
+
+ public void enterFlow(ExecutionFlow executionFlow);
+
+ /** @return internal stack level UUID. */
+ public String getCurrentStackLevelUuid();
+
+ public Integer getStackSize();
+
+ public void leaveFlow(ExecutionFlow executionFlow);
+
+ Object findLocalVariable(String key);
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+import java.util.Map;
+
+public interface ExecutionStackLevel {
+ public ExecutionFlow getExecutionFlow();
+
+ public Map<String, Object> getScopedObjects();
+
+ public String getUuid();
+
+ public Map<String, Object> getLocalVariables();
+
+}
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.execution;\r
+\r
+import java.io.Serializable;\r
+import java.util.Date;\r
+\r
+/**\r
+ * An atomic step to be notified in during an {@link ExecutionProcess}. Can be a\r
+ * log or the start/end of a phase, etc.\r
+ */\r
+public class ExecutionStep implements Serializable {\r
+ private static final long serialVersionUID = 798640526532912161L;\r
+\r
+ public final static String PHASE_START = "PHASE_START";\r
+ public final static String PHASE_END = "PHASE_END";\r
+ public final static String ERROR = "ERROR";\r
+ public final static String WARNING = "WARNING";\r
+ public final static String INFO = "INFO";\r
+ public final static String DEBUG = "DEBUG";\r
+ public final static String TRACE = "TRACE";\r
+\r
+ /** @deprecated */\r
+ public final static String START = "START";\r
+ /** @deprecated */\r
+ public final static String END = "END";\r
+\r
+ // TODO make the fields final and private when we don't need POJO support\r
+ // anymore (that\r
+ // is when SlcExecutionStep is removed)\r
+ protected String type;\r
+ protected String thread;\r
+ protected Date timestamp;\r
+ protected String log;\r
+\r
+ private String location;\r
+\r
+ /** Empty constructor */\r
+ public ExecutionStep() {\r
+ Thread currentThread = Thread.currentThread();\r
+ thread = currentThread.getName();\r
+ }\r
+\r
+ /** Creates a step at the current date */\r
+ public ExecutionStep(String location, String type, String log) {\r
+ this(location, new Date(), type, log);\r
+ }\r
+\r
+ /** Creates a step of the given type. */\r
+ public ExecutionStep(String location, Date timestamp, String type,\r
+ String log) {\r
+ this(location, timestamp, type, log, Thread.currentThread().getName());\r
+ }\r
+\r
+ public ExecutionStep(String location, Date timestamp, String type,\r
+ String log, String thread) {\r
+ this.location = location;\r
+ this.type = type;\r
+ this.timestamp = timestamp;\r
+ this.thread = thread;\r
+ this.log = addLog(log);\r
+ }\r
+\r
+ public String getType() {\r
+ return type;\r
+ }\r
+\r
+ public Date getTimestamp() {\r
+ return timestamp;\r
+ }\r
+\r
+ public String getThread() {\r
+ return thread;\r
+ }\r
+\r
+ /**\r
+ * Return the string that should be stored in the log field. Can be null if\r
+ * another mechanism is used to store log lines.\r
+ */\r
+ protected String addLog(String log) {\r
+ return log;\r
+ }\r
+\r
+ public String getLog() {\r
+ return log;\r
+ }\r
+\r
+ @Override\r
+ public String toString() {\r
+ return "Execution step, thread=" + thread + ", type=" + type;\r
+ }\r
+\r
+ /** Typically the logging category */\r
+ public String getLocation() {\r
+ return location;\r
+ }\r
+\r
+}\r
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.argeo.slc.BasicNameVersion;
+import org.argeo.slc.NameVersion;
+
+/** A fully configured execution flow, ready to be executed. */
+public class RealizedFlow implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private String moduleName;
+ private String moduleVersion;
+ private ExecutionFlowDescriptor flowDescriptor;
+
+ public String getModuleName() {
+ return moduleName;
+ }
+
+ public void setModuleName(String moduleName) {
+ this.moduleName = moduleName;
+ }
+
+ public NameVersion getModuleNameVersion() {
+ return new BasicNameVersion(getModuleName(), getModuleVersion());
+ }
+
+ public String getModuleVersion() {
+ return moduleVersion;
+ }
+
+ public void setModuleVersion(String moduleVersion) {
+ this.moduleVersion = moduleVersion;
+ }
+
+ public ExecutionFlowDescriptor getFlowDescriptor() {
+ return flowDescriptor;
+ }
+
+ public void setFlowDescriptor(ExecutionFlowDescriptor flowDescriptor) {
+ this.flowDescriptor = flowDescriptor;
+ }
+
+ /** Create a simple realized flow */
+ public static RealizedFlow create(String module, String version,
+ String flowName, Map<String, String> args) {
+ final RealizedFlow realizedFlow = new RealizedFlow();
+ realizedFlow.setModuleName(module);
+ // TODO deal with version
+ if (version == null)
+ version = "0.0.0";
+ realizedFlow.setModuleVersion(version);
+ ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor();
+ efd.setName(flowName);
+
+ // arguments
+ if (args != null && args.size() > 0) {
+ Map<String, Object> values = new HashMap<String, Object>();
+ for (String key : args.keySet()) {
+ String value = args.get(key);
+ values.put(key, value);
+ }
+ efd.setValues(values);
+ }
+
+ realizedFlow.setFlowDescriptor(efd);
+ return realizedFlow;
+ }
+}
--- /dev/null
+/*
+ * Copyright (C) 2007-2012 Argeo GmbH
+ *
+ * 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 org.argeo.slc.execution;
+
+import java.net.URI;
+import java.util.List;
+
+/**
+ * A local agent can run SLC processes. It is responsible for creating their
+ * threads and integrating them with various UIs. It typically wraps
+ * {@link ExecutionModulesManager} which is used to run flows synchronously at a
+ * lower level.
+ */
+public interface SlcAgent {
+ /** Agent unique identifier */
+ public String getAgentUuid();
+
+ /** Execute / take part to this process */
+ public void process(ExecutionProcess process);
+
+ /**
+ * Asynchronously processes the flows defined as URIs, or interpret a single
+ * UUID URN as a scheduled or template process.
+ *
+ * @return the UUID of the process launched.
+ */
+ public String process(List<URI> uris);
+
+ /** Kills this process */
+ public void kill(String processUuid);
+
+ /**
+ * Wait for this process to finish. returns immediately if it does not
+ * exist.
+ *
+ * @param millis
+ * can be null
+ */
+ public void waitFor(String processUuid, Long millis);
+
+ /**
+ * Describe all the flows provided by this execution module. Typically
+ * called in order to build a realized flow.
+ */
+ public ExecutionModuleDescriptor getExecutionModuleDescriptor(
+ String moduleName, String version);
+
+ /** List all execution modules which can be processed by this agent. */
+ public List<ExecutionModuleDescriptor> listExecutionModuleDescriptors();
+
+ /** @return true if still alive. */
+ public boolean ping();
+}
--- /dev/null
+package org.argeo.slc.execution;
+
+/**
+ * Interpret a command line and run it in the underlying agent, with the proper
+ * authentication.
+ */
+public interface SlcAgentCli {
+ /**
+ * Synchronously executes.
+ *
+ * @return the UUID of the process
+ */
+ public String process(String[] args);
+}
--- /dev/null
+<html>\r
+<head></head>\r
+<body>\r
+Common classes of teh SLC framework.\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+\r
+/** A test run that can be executed */\r
+public interface ExecutableTestRun extends TestRun, Runnable {\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+import org.argeo.slc.SlcException;\r
+\r
+/**\r
+ * Exception to throw when a test definition cannot interpret the provided test\r
+ * data.\r
+ */\r
+public class IncompatibleTestDataException extends SlcException {\r
+ static final long serialVersionUID = 1l;\r
+\r
+ public IncompatibleTestDataException(TestData testData,\r
+ TestDefinition testDefinition) {\r
+ super("TestData " + testData.getClass()\r
+ + " is not compatible with TestDefinition "\r
+ + testDefinition.getClass());\r
+ }\r
+\r
+ public IncompatibleTestDataException(TestRun testRun) {\r
+ super("TestData " + ((TestData) testRun.getTestData()).getClass()\r
+ + " is not compatible with TestDefinition "\r
+ + ((TestDefinition) testRun.getTestDefinition()).getClass());\r
+ }\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+/**\r
+ * Any data required by a test in order to run: configuration, expected,\r
+ * reached, etc.\r
+ */\r
+public interface TestData {\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+public interface TestDataProvider {\r
+ public <T extends TestData> T getTestData(Class<T> clss, String key);\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+/**\r
+ * The programmatic definition of a test, which will be associated with\r
+ * transient objects within a test run.\r
+ */\r
+public interface TestDefinition extends TestStatus {\r
+ /** Performs the test. */\r
+ public void execute(TestRun testRun);\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+import java.util.Date;\r
+import java.util.Map;\r
+\r
+/** The result of a test */\r
+public interface TestResult extends TestStatus, TestRunAware {\r
+ public String getUuid();\r
+\r
+ /** Adds a part of the result. */\r
+ public void addResultPart(TestResultPart part);\r
+\r
+ /**\r
+ * Marks that the collection of test results is completed and free the\r
+ * related resources (also closing listeners).\r
+ */\r
+ public void close();\r
+\r
+ /**\r
+ * The date when this test result was closed. Can be null, which means the\r
+ * result is not closed.\r
+ */\r
+ public Date getCloseDate();\r
+\r
+ /** Additional arbitrary meta data */\r
+ public Map<String, String> getAttributes();\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+/** Listener to the operations on a test result. */\r
+public interface TestResultListener<T extends TestResult> {\r
+ /** Notified when a part was added to a test result. */\r
+ public void resultPartAdded(T testResult, TestResultPart testResultPart);\r
+\r
+ /** Stops listening and release the related resources. */\r
+ public void close(T testResult);\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+/**\r
+ * Part of a test result.\r
+ * \r
+ * @see TestResult\r
+ */\r
+public interface TestResultPart {\r
+ /** The status, as defined in {@link TestStatus}. */\r
+ public Integer getStatus();\r
+\r
+ /** The related message. */\r
+ public String getMessage();\r
+\r
+ /** The underlying <code>Exception</code>. Can be null. */\r
+ public String getExceptionMessage();\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+import org.argeo.slc.deploy.DeployedSystem;\r
+\r
+/** The actual run of a test */\r
+public interface TestRun {\r
+ /** Gets UUID */\r
+ public String getUuid();\r
+\r
+ /** Gets the related test definition. */\r
+ public <T extends TestDefinition> T getTestDefinition();\r
+\r
+ /** Gets the related test data */\r
+ public <T extends TestData> T getTestData();\r
+\r
+ /** Gets the related deployed system. */\r
+ public <T extends DeployedSystem> T getDeployedSystem();\r
+\r
+ /** Gets the related result where to record results. */\r
+ public <T extends TestResult> T getTestResult();\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+/** Allows a test run to notify other objects. */\r
+public interface TestRunAware {\r
+ /** Notifies the current test run. */\r
+ public void notifyTestRun(TestRun testRun);\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+/**\r
+ * Simple statuses. Ordering of the flags can be relied upon in aggregation: if\r
+ * one element is failed, the aggregation is failed. Is one element is in ERROR,\r
+ * the aggregation is in ERROR.\r
+ * <p>\r
+ * <ul>\r
+ * <li>{@link #PASSED}: the test succeeded</li>\r
+ * <li>{@link #FAILED}: the test could run, but did not reach the expected\r
+ * result</li>\r
+ * <li>{@link #ERROR}: an error during the test run prevented to get a\r
+ * significant information on the tested system.</li>\r
+ * </ul>\r
+ * </p>\r
+ */\r
+public interface TestStatus {\r
+ /** The flag for a passed test: 0 */\r
+ public final static Integer PASSED = 0;\r
+ /** The flag for a failed test: 1 */\r
+ public final static Integer FAILED = 1;\r
+ /**\r
+ * The flag for a test which could not properly run because of an error\r
+ * (there is no feedback on the behavior of the tested component): 2\r
+ */\r
+ public final static Integer ERROR = 2;\r
+ public final static String STATUSSTR_PASSED = "PASSED";\r
+ public final static String STATUSSTR_FAILED = "FAILED";\r
+ public final static String STATUSSTR_ERROR = "ERROR";\r
+\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test;\r
+\r
+import org.argeo.slc.deploy.DeployedSystem;\r
+\r
+/** Test run whose various components can be externally set. */\r
+public interface WritableTestRun extends ExecutableTestRun {\r
+ public void setDeployedSystem(DeployedSystem deployedSystem);\r
+\r
+ public void setTestData(TestData testData);\r
+\r
+ public void setTestDefinition(TestDefinition testDefinition);\r
+\r
+ public void setTestResult(TestResult testResult);\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test.context;\r
+\r
+import java.util.Map;\r
+\r
+/** Access to an SLC test context that is, maps of reached and expected values. */\r
+public interface ContextAware {\r
+ public final static String DEFAULT_SKIP_FLAG = "!";\r
+ public final static String DEFAULT_ANY_FLAG = "*";\r
+\r
+ /** Retrieves reached values. */\r
+ public Map<String, Object> getValues();\r
+\r
+ /** Set reached values. */\r
+ public void setValues(Map<String, Object> values);\r
+\r
+ /** Retrieves expected values. */\r
+ public Map<String, Object> getExpectedValues();\r
+\r
+ public String getContextSkipFlag();\r
+\r
+ public String getContextAnyFlag();\r
+}\r
--- /dev/null
+/*\r
+ * Copyright (C) 2007-2012 Argeo GmbH\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+package org.argeo.slc.test.context;\r
+\r
+import java.util.Collection;\r
+\r
+public interface ParentContextAware extends ContextAware {\r
+ public Collection<ContextAware> getChildContexts();\r
+\r
+ public void addChildContext(ContextAware contextAware);\r
+}\r
--- /dev/null
+<html>\r
+<head></head>\r
+<body>\r
+Context variables to be passed between parts of tests.\r
+</body>\r
+</html>
\ No newline at end of file
--- /dev/null
+<html>\r
+<head></head>\r
+<body>\r
+SLC Test: test of software systems.\r
+</body>\r
+</html>
\ No newline at end of file
<parent>
<groupId>org.argeo.commons</groupId>
<artifactId>argeo-commons</artifactId>
- <version>1.2.3</version>
+ <version>2.1.17-SNAPSHOT</version>
</parent>
<groupId>org.argeo.slc</groupId>
<artifactId>argeo-slc</artifactId>
<packaging>pom</packaging>
<name>Argeo SLC</name>
- <description>SLC is a framework integrating various build, deployment and testing technologies in order to build specific application life cycle management systems.</description>
<version>2.1.1-SNAPSHOT</version>
<properties>
<developmentCycle.slc>2.1</developmentCycle.slc>
<version.slc>2.1.1-SNAPSHOT</version.slc>
</properties>
<modules>
- <module>runtime</module>
- <module>modules</module>
- <module>plugins</module>
- <module>lib</module>
- <module>dep</module>
- <module>archetypes</module>
- <module>dist</module>
- <module>demo</module>
+ <module>org.argeo.slc.api</module>
+
+<!-- <module>runtime</module> -->
+<!-- <module>modules</module> -->
+<!-- <module>plugins</module> -->
+<!-- <module>archetypes</module> -->
+
+<!-- <module>lib</module> -->
+<!-- <module>dep</module> -->
+<!-- <module>dist</module> -->
+<!-- <module>demo</module> -->
</modules>
<url>http://projects.argeo.org/slc/</url>
<scm>
<repositories>
<repository>
<id>argeo-commons</id>
- <url>http://repo.argeo.org/data/public/java/argeo-commons-1.2</url>
+ <url>http://repo.argeo.org/data/public/java/argeo-commons-2.1</url>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc;
-
-import java.io.Serializable;
-
-/** @deprecated use {@link DefaultNameVersion} instead. */
-@Deprecated
-public class BasicNameVersion extends DefaultNameVersion implements
- Serializable {
- private static final long serialVersionUID = -5127304279136195127L;
-
- public BasicNameVersion() {
- }
-
- /** Interprets string in OSGi-like format my.module.name;version=0.0.0 */
- public BasicNameVersion(String nameVersion) {
- int index = nameVersion.indexOf(";version=");
- if (index < 0) {
- setName(nameVersion);
- setVersion(null);
- } else {
- setName(nameVersion.substring(0, index));
- setVersion(nameVersion.substring(index + ";version=".length()));
- }
- }
-
- public BasicNameVersion(String name, String version) {
- super(name, version);
- }
-
- public BasicNameVersion(NameVersion nameVersion) {
- super(nameVersion);
- }
-}
+++ /dev/null
-package org.argeo.slc;
-
-/**
- * Adds a dimension to {@link NameVersion} by adding an arbitrary category (e.g.
- * Maven groupId, yum repository ID, etc.)
- */
-public interface CategorizedNameVersion extends NameVersion {
- /** The category of the component. */
- public String getCategory();
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc;
-
-/** Binary check on an arbitrary object. */
-public interface Condition<T> {
- /**
- * Checks the condition.
- *
- * @return true, if the condition is verified, false if not.
- */
- public Boolean check(T obj);
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc;
-
-
-/** Canonical implementation of {@link NameVersion} */
-public class DefaultNameVersion implements NameVersion,
- Comparable<NameVersion> {
- private String name;
- private String version;
-
- public DefaultNameVersion() {
- }
-
- public DefaultNameVersion(String name, String version) {
- this.name = name;
- this.version = version;
- }
-
- public DefaultNameVersion(NameVersion nameVersion) {
- this.name = nameVersion.getName();
- this.version = nameVersion.getVersion();
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof NameVersion) {
- NameVersion nameVersion = (NameVersion) obj;
- return name.equals(nameVersion.getName())
- && version.equals(nameVersion.getVersion());
- } else
- return false;
- }
-
- @Override
- public int hashCode() {
- return name.hashCode() + version.hashCode();
- }
-
- @Override
- public String toString() {
- return name + ":" + version;
- }
-
- public int compareTo(NameVersion o) {
- if (o.getName().equals(name))
- return version.compareTo(o.getVersion());
- else
- return name.compareTo(o.getName());
- }
-}
+++ /dev/null
-package org.argeo.slc;
-
-import java.util.Iterator;
-
-/** A set of {@link NameVersion}. */
-public interface ModuleSet {
- Iterator<? extends NameVersion> nameVersions();
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc;
-
-/**
- * Abstraction of a name / version pair, typically used as coordinates for a
- * software module either deployed or packaged as an archive.
- */
-public interface NameVersion {
- /** The name of the component. */
- public String getName();
-
- /** The version of the component. */
- public String getVersion();
-}
+++ /dev/null
-package org.argeo.slc;
-
-/** Constants useful across all SLC components */
-public interface SlcConstants {
- /** Read-write role. */
- public final static String ROLE_SLC = "ROLE_SLC";
-
- /** Read only unlogged user */
- public final static String USER_ANONYMOUS = "anonymous";
-}
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc;\r
-\r
-/** Basis for all SLC exceptions. This is an unchecked exception. */\r
-public class SlcException extends RuntimeException {\r
- private static final long serialVersionUID = 6373738619304106445L;\r
-\r
- /** Constructor. */\r
- public SlcException(String message) {\r
- super(message);\r
- }\r
-\r
- /** Constructor. */\r
- public SlcException(String message, Throwable e) {\r
- super(message, e);\r
- }\r
-\r
-}\r
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc;
-
-import java.io.InputStream;
-
-public interface StreamReadable {
- public InputStream getInputStream();
-}
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc;\r
-\r
-/** Exception for unsupported features or actions. */\r
-public class UnsupportedException extends SlcException {\r
- static final long serialVersionUID = 1l;\r
-\r
- /** Action not supported. */\r
- public UnsupportedException() {\r
- this("Action not supported");\r
- }\r
-\r
- /** Constructor with a message. */\r
- public UnsupportedException(String message) {\r
- super(message);\r
- }\r
-\r
- /**\r
- * Constructor generating a message.\r
- * \r
- * @param nature\r
- * the nature of the unsupported object\r
- * @param obj\r
- * the object itself (its class name will be used in message)\r
- */\r
- public UnsupportedException(String nature, Object obj) {\r
- super("Unsupported " + nature + ": "\r
- + (obj != null ? obj.getClass() : "[object is null]"));\r
- }\r
-\r
- /**\r
- * Constructor generating a message.\r
- * \r
- * @param nature\r
- * the nature of the unsupported object\r
- * @param clss\r
- * the class itself (will be used in message)\r
- */\r
- public UnsupportedException(String nature, Class<?> clss) {\r
- super("Unsupported " + nature + ": " + clss);\r
- }\r
-\r
- /**\r
- * Constructor generating a message.\r
- * \r
- * @param nature\r
- * the nature of the unsupported object\r
- * @param value\r
- * the problematic value itself\r
- */\r
- public UnsupportedException(String nature, String value) {\r
- super("Unsupported " + nature + ": " + value);\r
- }\r
-\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.build;\r
-\r
-/** A packaged software component */\r
-public interface Distribution {\r
- public String getDistributionId();\r
-\r
-}\r
+++ /dev/null
-package org.argeo.slc.build;
-
-/** A software license */
-public interface License {
- public String getName();
-
- public String getUri();
-
- public String getLink();
-
- public String getText();
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.build;
-
-import org.argeo.slc.ModuleSet;
-import org.argeo.slc.NameVersion;
-
-/**
- * A distribution of modules, that is components that can be identified by a
- * name / version couple.
- *
- * @see NameVersion
- */
-public interface ModularDistribution extends Distribution, NameVersion,
- ModuleSet {
- public Distribution getModuleDistribution(String moduleName,
- String moduleVersion);
-
- /** A descriptor such as P2, OBR or yum metadata. */
- public Object getModulesDescriptor(String descriptorType);
-}
+++ /dev/null
-<html>\r
-<head></head>\r
-<body>\r
-SLC Build: building of software systems.\r
-</body>\r
-</html>
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.deploy;
-
-import org.argeo.slc.UnsupportedException;
-import org.argeo.slc.build.Distribution;
-
-public abstract class AbstractDeployedSystem implements DeployedSystem {
- public String getDeployedSystemId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public DeploymentData getDeploymentData() {
- throw new UnsupportedException("Method not supported");
- }
-
- public Distribution getDistribution() {
- throw new UnsupportedException("Method not supported");
- }
-
- public TargetData getTargetData() {
- throw new UnsupportedException("Method not supported");
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.deploy;
-
-import java.io.File;
-import java.util.Map;
-
-public interface DeployEnvironment {
- public void unpackTo(Object packg, File targetLocation,
- Map<String, String> filter);
-}
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.deploy;\r
-\r
-import org.argeo.slc.build.Distribution;\r
-\r
-/** An instance of a software system. */\r
-public interface DeployedSystem extends TargetData {\r
- /** Unique ID for this system instance. */\r
- public String getDeployedSystemId();\r
-\r
- /** Underlying packages */\r
- public Distribution getDistribution();\r
-\r
- /** Data required to initialize the instance (e.g. DB dump, etc.). */\r
- public DeploymentData getDeploymentData();\r
-\r
- /** Resources required by the system (ports, disk location, etc.) */\r
- public TargetData getTargetData();\r
-}\r
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.deploy;
-
-public interface DeployedSystemManager<T extends DeployedSystem> {
- public void setDeployedSystem(T deployedSystem);
-}
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.deploy;\r
-\r
-import org.argeo.slc.build.Distribution;\r
-\r
-public interface Deployment extends Runnable{\r
- public DeployedSystem getDeployedSystem();\r
-\r
- public void setTargetData(TargetData targetData);\r
-\r
- public void setDeploymentData(DeploymentData deploymentData);\r
-\r
- public void setDistribution(Distribution distribution);\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.deploy;\r
-\r
-public interface DeploymentData {\r
-\r
-}\r
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.deploy;
-
-import org.argeo.slc.NameVersion;
-import org.argeo.slc.build.Distribution;
-
-public interface DynamicRuntime<M extends Module> extends
- ModularDeployedSystem<M> {
- public void shutdown();
-
- public M installModule(Distribution distribution);
-
- public void uninstallModule(NameVersion nameVersion);
-
- public void updateModule(NameVersion nameVersion);
-
- public void startModule(NameVersion nameVersion);
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.deploy;
-
-public interface InstalledExecutables extends DeployedSystem {
- public String getExecutablePath(String key);
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.deploy;
-
-import java.util.List;
-
-public interface ModularDeployedSystem<M extends Module> extends DeployedSystem {
- /** List the underlying deployed modules (in real time) */
- public List<M> listModules();
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.deploy;
-
-import org.argeo.slc.NameVersion;
-
-/**
- * Represents a deployed module of a broader deployed system. A module is
- * uniquely identifiable via a name / version.
- */
-public interface Module extends DeployedSystem, NameVersion {
- /** A serializable stateless description of the module */
- public ModuleDescriptor getModuleDescriptor();
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.deploy;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.argeo.slc.BasicNameVersion;
-
-/** The description of a versioned module. */
-public class ModuleDescriptor extends BasicNameVersion implements Serializable {
- private static final long serialVersionUID = 4310820315478645419L;
- private String title;
- private String description;
- private Map<String, String> metadata = new HashMap<String, String>();
- private Boolean started = false;
-
- public String getTitle() {
- return title;
- }
-
- public void setTitle(String title) {
- this.title = title;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- /** @deprecated use {@link #getTitle()} instead */
- public String getLabel() {
- return title;
- }
-
- /** @deprecated use {@link #setTitle(String)} instead */
- public void setLabel(String label) {
- this.title = label;
- }
-
- public Map<String, String> getMetadata() {
- return metadata;
- }
-
- public void setMetadata(Map<String, String> metadata) {
- this.metadata = metadata;
- }
-
- public Boolean getStarted() {
- return started;
- }
-
- public void setStarted(Boolean started) {
- this.started = started;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.deploy;
-
-import java.util.List;
-
-import org.argeo.slc.NameVersion;
-
-/** Provides access to deployed modules */
-public interface ModulesManager {
- /** @return a full fledged module descriptor. */
- public ModuleDescriptor getModuleDescriptor(String moduleName,
- String version);
-
- /**
- * @return a list of minimal module descriptors of the deployed modules
- */
- public List<ModuleDescriptor> listModules();
-
- /** Synchronously upgrades the module referenced by this name version */
- public void upgrade(NameVersion nameVersion);
-
- /** Starts the module */
- public void start(NameVersion nameVersion);
-
- /** Stops the module */
- public void stop(NameVersion nameVersion);
-}
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.deploy;\r
-\r
-public interface TargetData {\r
-\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.deploy;\r
-\r
-import java.io.File;\r
-import java.io.OutputStream;\r
-import java.util.List;\r
-\r
-/** Abstracts common versioning operations */\r
-public interface VersioningDriver {\r
- public void getFileFromRepository(String repositoryBaseUrl,\r
- String location, OutputStream out);\r
-\r
- public List<String> getChangedPaths(File repositoryRoot, Long revision);\r
-\r
- public String getRepositoryRoot(String repositoryUrl);\r
-\r
- public String getRelativePath(String repositoryUrl);\r
-\r
- public void updateToHead(File fileOrDir);\r
-\r
- public void importFileOrDir(String repositoryUrl, File fileOrDir);\r
-\r
- /**\r
- * Checks out or update this versioned directory\r
- * \r
- * @return true if the content has changed, false otherwise\r
- */\r
- public Boolean checkout(String repositoryUrl, File destDir,\r
- Boolean recursive);\r
-\r
- public void createRepository(String filePath);\r
-\r
- public void commit(File fileOrDir, String commitMessage);\r
-}\r
+++ /dev/null
-<html>\r
-<head></head>\r
-<body>\r
-SLC Deploy: deployment of software systems.\r
-</body>\r
-</html>
\ No newline at end of file
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.execution;\r
-\r
-/** Variables or references attached to an execution (typically thread bounded).*/\r
-public interface ExecutionContext {\r
- public final static String VAR_EXECUTION_CONTEXT_ID = "slcVar.executionContext.id";\r
- public final static String VAR_EXECUTION_CONTEXT_CREATION_DATE = "slcVar.executionContext.creationDate";\r
- public final static String VAR_FLOW_ID = "slcVar.flow.id";\r
- public final static String VAR_FLOW_NAME = "slcVar.flow.name";\r
-\r
- public String getUuid();\r
-\r
- /** @return the variable value, or <code>null</code> if not found. */\r
- public Object getVariable(String key);\r
-\r
- public void setVariable(String key, Object value);\r
-}\r
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-import java.util.Iterator;
-
-/** Abstraction of an execution that can be identified and configured. */
-public interface ExecutionFlow extends Runnable {
- /** Retrieve an immutable parameter */
- public Object getParameter(String key);
-
- /** Whether this immutable parameter is set */
- public Boolean isSetAsParameter(String key);
-
- /** The specifications of the execution flow. */
- public ExecutionSpec getExecutionSpec();
-
- /**
- * List sub-runnables that would be executed if run() method would be
- * called.
- */
- public Iterator<Runnable> runnables();
-
- /**
- * If there is one and only one runnable wrapped return it, throw an
- * exeception otherwise.
- */
- public Runnable getRunnable();
-
- /**
- * The name of this execution flow. Can contains '/' which will be
- * interpreted by UIs as a hierarchy;
- */
- public String getName();
-
- /**
- * @deprecated will be removed in SLC 2.0, the path should be the part of
- * the name with '/'
- */
- public String getPath();
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- *
- * Implements both archetype and implementation of a given process.
- *
- * At specification time, <code>executionSpec</code> represents the spec of the
- * parameters accepted by the process, with, among others: type, default value
- * and, optionally, possible values for each parameter. Thus ExecutionSpec might
- * be a huge object. Note that when marshalling only a reference to a specific
- * ExecutionSpec is stored in the XML to optimize performance and avoid
- * redundancy between various ExecutionFlowDesciptor that might have the same
- * ExecutionSpec.
- *
- * At runtime, we build a RealizedFlow which references an
- * ExecutionFlowDescriptor. As it happens AFTER marshalling / unmarshalling
- * process, the ExecutionSpec is null but we manage to retrieve the
- * ExecutionSpec and store it in the RealizedFlow, whereas set values of the
- * parameters are stored in the <code>values</code> map.
- *
- * Generally, values object are either a <code>PrimitiveAccessor</code> or a
- * <code>RefValue</code> but can be other objects.
- */
-public class ExecutionFlowDescriptor implements Serializable, Cloneable {
- private static final long serialVersionUID = 7101944857038041216L;
- private String name;
- private String description;
- private String path;
- private Map<String, Object> values;
- private ExecutionSpec executionSpec;
-
- public ExecutionFlowDescriptor() {
- }
-
- public ExecutionFlowDescriptor(String name, String description,
- Map<String, Object> values, ExecutionSpec executionSpec) {
- this.name = name;
- this.values = values;
- this.executionSpec = executionSpec;
- }
-
- /** The referenced {@link ExecutionSpec} is NOT cloned. */
- @Override
- protected Object clone() throws CloneNotSupportedException {
- return new ExecutionFlowDescriptor(name, description,
- new HashMap<String, Object>(values), executionSpec);
- }
-
- public String getName() {
- return name;
- }
-
- /**
- * @deprecated will be removed in SLC 2.x, the path should be the part of
- * the name with '/'
- */
- public String getPath() {
- return path;
- }
-
- /**
- * @deprecated will be removed in SLC 2.0, the path should be the part of
- * the name with '/'
- */
- public void setPath(String path) {
- this.path = path;
- }
-
- public Map<String, Object> getValues() {
- return values;
- }
-
- public ExecutionSpec getExecutionSpec() {
- return executionSpec;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setValues(Map<String, Object> values) {
- this.values = values;
- }
-
- public void setExecutionSpec(ExecutionSpec executionSpec) {
- this.executionSpec = executionSpec;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof ExecutionFlowDescriptor)
- return name.equals(((ExecutionFlowDescriptor) obj).getName());
- return false;
- }
-
- @Override
- public int hashCode() {
- return name.hashCode();
- }
-
- @Override
- public String toString() {
- return (path != null && !path.trim().equals("") ? path + "/" : "")
- + name;
- }
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-import java.util.Map;
-
-/**
- * Maps back and forth between {@link ExecutionFlowDescriptor} and
- * {@link ExecutionFlow}
- */
-public interface ExecutionFlowDescriptorConverter {
- public Map<String, Object> convertValues(
- ExecutionFlowDescriptor executionFlowDescriptor);
-
- public void addFlowsToDescriptor(ExecutionModuleDescriptor md,
- Map<String, ExecutionFlow> executionFlows);
-
- public ExecutionFlowDescriptor getExecutionFlowDescriptor(
- ExecutionFlow executionFlow);
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-@Deprecated
-public interface ExecutionModule {
-/* public String getName();
-
- public String getVersion();
-
- public ExecutionModuleDescriptor getDescriptor();
-
- public void execute(ExecutionFlowDescriptor descriptor);*/
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.argeo.slc.SlcException;
-import org.argeo.slc.deploy.ModuleDescriptor;
-
-/** Describes the information required to launch a flow */
-public class ExecutionModuleDescriptor extends ModuleDescriptor {
- /** Metadata header identifying an SLC execution module */
- public final static String SLC_EXECUTION_MODULE = "SLC-ExecutionModule";
-
- private static final long serialVersionUID = -2394473464513029512L;
- private List<ExecutionSpec> executionSpecs = new ArrayList<ExecutionSpec>();
- private List<ExecutionFlowDescriptor> executionFlows = new ArrayList<ExecutionFlowDescriptor>();
-
- public List<ExecutionSpec> getExecutionSpecs() {
- return executionSpecs;
- }
-
- public List<ExecutionFlowDescriptor> getExecutionFlows() {
- return executionFlows;
- }
-
- /**
- * Returns a new {@link ExecutionModuleDescriptor} that can be used to build
- * a {@link RealizedFlow}.
- */
- public ExecutionFlowDescriptor cloneFlowDescriptor(String name) {
- ExecutionFlowDescriptor res = null;
- for (ExecutionFlowDescriptor efd : executionFlows) {
- if (efd.getName().equals(name)
- || ("/" + efd.getName()).equals(name)) {
- try {
- res = (ExecutionFlowDescriptor) efd.clone();
- } catch (CloneNotSupportedException e) {
- throw new SlcException("Cannot clone " + efd, e);
- }
- }
- }
- if (res == null)
- throw new SlcException("Flow " + name + " not found.");
- return res;
- }
-
- public RealizedFlow asRealizedFlow(String flow, Map<String, Object> values) {
- RealizedFlow realizedFlow = new RealizedFlow();
- realizedFlow.setFlowDescriptor(cloneFlowDescriptor(flow));
- realizedFlow.setModuleName(getName());
- realizedFlow.setModuleVersion(getVersion());
- realizedFlow.getFlowDescriptor().getValues().putAll(values);
- return realizedFlow;
- }
-
- public void setExecutionSpecs(List<ExecutionSpec> executionSpecs) {
- this.executionSpecs = executionSpecs;
- }
-
- public void setExecutionFlows(List<ExecutionFlowDescriptor> executionFlows) {
- this.executionFlows = executionFlows;
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-import org.argeo.slc.deploy.ModuleDescriptor;
-
-/** Listen to events on execution modules. */
-public interface ExecutionModulesListener {
- public void executionModuleAdded(ModuleDescriptor moduleDescriptor);
-
- public void executionModuleRemoved(ModuleDescriptor moduleDescriptor);
-
- public void executionFlowAdded(ModuleDescriptor moduleDescriptor,
- ExecutionFlowDescriptor executionFlowDescriptor);
-
- public void executionFlowRemoved(ModuleDescriptor moduleDescriptor,
- ExecutionFlowDescriptor executionFlowDescriptor);
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-import java.util.List;
-
-import org.argeo.slc.deploy.ModulesManager;
-
-/** Provides access to the execution modules */
-public interface ExecutionModulesManager extends ModulesManager {
- /** Used to filter event notified to an execution notifier. */
- public static String SLC_PROCESS_ID = "slc.process.id";
-
- /** Unique launch module */
- public static String UNIQUE_LAUNCH_MODULE_PROPERTY = "slc.launch.module";
-
- /** Unique launch flow */
- public static String UNIQUE_LAUNCH_FLOW_PROPERTY = "slc.launch.flow";
-
- /** @return a full fledged module descriptor. */
- public ExecutionModuleDescriptor getExecutionModuleDescriptor(
- String moduleName, String version);
-
- /**
- * @return a list of minimal execution module descriptors (only the module
- * meta data, not the flows)
- */
- public List<ExecutionModuleDescriptor> listExecutionModules();
-
- /** Synchronously finds and executes an {@link ExecutionFlow}. */
- public void execute(RealizedFlow realizedFlow);
-
- // /** Notify of a status update status of the {@link ExecutionProcess} */
-// public void dispatchUpdateStatus(ExecutionProcess process,
-// String oldStatus, String newStatus);
- //
- // /** Notify that a step was added in an {@link ExecutionProcess} */
- // public void dispatchAddSteps(ExecutionProcess process,
- // List<ExecutionStep> steps);
- //
- // /**
- // * Register a notifier which will be notified based on the provided
- // * properties.
- // */
- // public void registerProcessNotifier(ExecutionProcessNotifier notifier,
- // Map<String, String> properties);
- //
- // /** Unregisters a notifier */
- // public void unregisterProcessNotifier(ExecutionProcessNotifier notifier,
- // Map<String, String> properties);
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-import java.util.List;
-
-/**
- * A process is the functional representation of a combination of executions.
- * While an execution is the actual java code running, a process exists before,
- * during and after the execution actually took place, providing an entry point
- * for the definition of executions, their monitoring (e.g. logging) and
- * tracking. A process can be distributed or parallelized. <br/>
- * NEW => INITIALIZED => SCHEDULED => RUNNING<br/>
- * RUNNING => {COMPLETED | ERROR | KILLED}<br/>
- * {COMPLETED | ERROR | KILLED} => PURGED<br/>
- * UNKOWN : this is a bug if this status occurs<br/>
- */
-public interface ExecutionProcess {
- /** The process is not yet usable. */
- public final static String NEW = "NEW";
- /** The process is usable but not yet scheduled to run. */
- public final static String INITIALIZED = "INITIALIZED";
- /** The process is usable and scheduled to run, but not yet running. */
- public final static String SCHEDULED = "SCHEDULED";
- /** The process is currently running. */
- public final static String RUNNING = "RUNNING";
- /** The process has properly completed. */
- public final static String COMPLETED = "COMPLETED";
- /** The process failed because of an unexpected error. */
- public final static String ERROR = "ERROR";
- /** The process was killed explicitly or through a crash. */
- public final static String KILLED = "KILLED";
- /** The status cannot be retrieved (probably because of unexpected errors). */
- public final static String UNKOWN = "UNKOWN";
-
- /**
- * Only a reference to the process has been kept, all monitoring data such
- * as logs have been purged.
- */
- public final static String PURGED = "PURGED";
-
- /** The UUID of this process. */
- public String getUuid();
-
- /** The current status of this process. */
- public String getStatus();
-
- /** Sets the current status of this process */
- public void setStatus(String status);
-
- public void addSteps(List<ExecutionStep> steps);
-
- public List<RealizedFlow> getRealizedFlows();
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-import java.util.Map;
-
-/**
- * The class implementing this interface defines the map of attributes that are
- * necessary for the corresponding ExecutionFlow.
- */
-public interface ExecutionSpec {
- /**
- * The name for an internal spec (for backward compatibility where a
- * non-null name is expected)
- */
- public final static String INTERNAL_NAME = "__SLC_EXECUTION_SPEC_INTERNAL";
-
- /**
- * The name identifying the execution spec within its application context.
- * Can be null. An execution spec can be referenced only if its name is not
- * null or different from {@link #INTERNAL_NAME}
- */
- public String getName();
-
- /** An optional description. Can be null. */
- public String getDescription();
-
- /** The attributes managed by this execution spec */
- public Map<String, ExecutionSpecAttribute> getAttributes();
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-/**
- * Possible attribute of an execution flow.
- *
- * There are mainly two implementations :<br>
- * + Primitive attributes (no predefined choice, the end user must compute a
- * String, a Float, an Integer...)<br>
- * + RefSpecAttribute which enable two things<br>
- * ++ a reference to another object of the application context<br>
- * ++ the display of some choices among which the end user can choose.<br>
- *
- * @see org.argeo.slc.core.execution.PrimitiveSpecAttribute
- * @see org.argeo.slc.core.execution.RefSpecAttribute
- * @see org.argeo.slc.core.execution.PrimitiveUtils : this class offers some
- * helper, among others to cast the various type of primitive attribute.
- */
-public interface ExecutionSpecAttribute {
- /**
- * Whether this attribute has to be set at instantiation of the flow and
- * cannot be modified afterwards. If the attribute is not immutable (that
- * is, this method returns false), it can be set at execution time.
- */
- public Boolean getIsImmutable();
-
- /**
- * Whether this attribute must be explicitly set and cannot be modified.
- * This attribute is then basically a constant within a given application
- * context. {@link #getValue()} cannot return null if the attribute is a
- * constant.
- */
- public Boolean getIsConstant();
-
- /** Whether this attribute will be hidden to end users. */
- public Boolean getIsHidden();
-
- /**
- * The default value for this attribute. Can be null, except if
- * {@link #getIsFrozen()} is <code>true</code>, in which case it represents
- * the constant value of this attribute.
- */
- public Object getValue();
-
- /** Description of this attribute, can be null */
- public String getDescription();
-
- /** @deprecated use {@link #getIsImmutable()} instead */
- public Boolean getIsParameter();
-
- /** @deprecated use {@link #getIsConstant()} instead */
- public Boolean getIsFrozen();
-
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-/** Deal with nested level of executions using different vartiables. */
-public interface ExecutionStack {
- /**
- * @param name
- * @return null if no object is found
- */
- public Object findScopedObject(String name);
-
- public void addScopedObject(String name, Object obj);
-
- public void enterFlow(ExecutionFlow executionFlow);
-
- /** @return internal stack level UUID. */
- public String getCurrentStackLevelUuid();
-
- public Integer getStackSize();
-
- public void leaveFlow(ExecutionFlow executionFlow);
-
- Object findLocalVariable(String key);
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-import java.util.Map;
-
-public interface ExecutionStackLevel {
- public ExecutionFlow getExecutionFlow();
-
- public Map<String, Object> getScopedObjects();
-
- public String getUuid();
-
- public Map<String, Object> getLocalVariables();
-
-}
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.execution;\r
-\r
-import java.io.Serializable;\r
-import java.util.Date;\r
-\r
-/**\r
- * An atomic step to be notified in during an {@link ExecutionProcess}. Can be a\r
- * log or the start/end of a phase, etc.\r
- */\r
-public class ExecutionStep implements Serializable {\r
- private static final long serialVersionUID = 798640526532912161L;\r
-\r
- public final static String PHASE_START = "PHASE_START";\r
- public final static String PHASE_END = "PHASE_END";\r
- public final static String ERROR = "ERROR";\r
- public final static String WARNING = "WARNING";\r
- public final static String INFO = "INFO";\r
- public final static String DEBUG = "DEBUG";\r
- public final static String TRACE = "TRACE";\r
-\r
- /** @deprecated */\r
- public final static String START = "START";\r
- /** @deprecated */\r
- public final static String END = "END";\r
-\r
- // TODO make the fields final and private when we don't need POJO support\r
- // anymore (that\r
- // is when SlcExecutionStep is removed)\r
- protected String type;\r
- protected String thread;\r
- protected Date timestamp;\r
- protected String log;\r
-\r
- private String location;\r
-\r
- /** Empty constructor */\r
- public ExecutionStep() {\r
- Thread currentThread = Thread.currentThread();\r
- thread = currentThread.getName();\r
- }\r
-\r
- /** Creates a step at the current date */\r
- public ExecutionStep(String location, String type, String log) {\r
- this(location, new Date(), type, log);\r
- }\r
-\r
- /** Creates a step of the given type. */\r
- public ExecutionStep(String location, Date timestamp, String type,\r
- String log) {\r
- this(location, timestamp, type, log, Thread.currentThread().getName());\r
- }\r
-\r
- public ExecutionStep(String location, Date timestamp, String type,\r
- String log, String thread) {\r
- this.location = location;\r
- this.type = type;\r
- this.timestamp = timestamp;\r
- this.thread = thread;\r
- this.log = addLog(log);\r
- }\r
-\r
- public String getType() {\r
- return type;\r
- }\r
-\r
- public Date getTimestamp() {\r
- return timestamp;\r
- }\r
-\r
- public String getThread() {\r
- return thread;\r
- }\r
-\r
- /**\r
- * Return the string that should be stored in the log field. Can be null if\r
- * another mechanism is used to store log lines.\r
- */\r
- protected String addLog(String log) {\r
- return log;\r
- }\r
-\r
- public String getLog() {\r
- return log;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- return "Execution step, thread=" + thread + ", type=" + type;\r
- }\r
-\r
- /** Typically the logging category */\r
- public String getLocation() {\r
- return location;\r
- }\r
-\r
-}\r
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.argeo.slc.BasicNameVersion;
-import org.argeo.slc.NameVersion;
-
-/** A fully configured execution flow, ready to be executed. */
-public class RealizedFlow implements Serializable {
- private static final long serialVersionUID = 1L;
-
- private String moduleName;
- private String moduleVersion;
- private ExecutionFlowDescriptor flowDescriptor;
-
- public String getModuleName() {
- return moduleName;
- }
-
- public void setModuleName(String moduleName) {
- this.moduleName = moduleName;
- }
-
- public NameVersion getModuleNameVersion() {
- return new BasicNameVersion(getModuleName(), getModuleVersion());
- }
-
- public String getModuleVersion() {
- return moduleVersion;
- }
-
- public void setModuleVersion(String moduleVersion) {
- this.moduleVersion = moduleVersion;
- }
-
- public ExecutionFlowDescriptor getFlowDescriptor() {
- return flowDescriptor;
- }
-
- public void setFlowDescriptor(ExecutionFlowDescriptor flowDescriptor) {
- this.flowDescriptor = flowDescriptor;
- }
-
- /** Create a simple realized flow */
- public static RealizedFlow create(String module, String version,
- String flowName, Map<String, String> args) {
- final RealizedFlow realizedFlow = new RealizedFlow();
- realizedFlow.setModuleName(module);
- // TODO deal with version
- if (version == null)
- version = "0.0.0";
- realizedFlow.setModuleVersion(version);
- ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor();
- efd.setName(flowName);
-
- // arguments
- if (args != null && args.size() > 0) {
- Map<String, Object> values = new HashMap<String, Object>();
- for (String key : args.keySet()) {
- String value = args.get(key);
- values.put(key, value);
- }
- efd.setValues(values);
- }
-
- realizedFlow.setFlowDescriptor(efd);
- return realizedFlow;
- }
-}
+++ /dev/null
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * 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 org.argeo.slc.execution;
-
-import java.net.URI;
-import java.util.List;
-
-/**
- * A local agent can run SLC processes. It is responsible for creating their
- * threads and integrating them with various UIs. It typically wraps
- * {@link ExecutionModulesManager} which is used to run flows synchronously at a
- * lower level.
- */
-public interface SlcAgent {
- /** Agent unique identifier */
- public String getAgentUuid();
-
- /** Execute / take part to this process */
- public void process(ExecutionProcess process);
-
- /**
- * Asynchronously processes the flows defined as URIs, or interpret a single
- * UUID URN as a scheduled or template process.
- *
- * @return the UUID of the process launched.
- */
- public String process(List<URI> uris);
-
- /** Kills this process */
- public void kill(String processUuid);
-
- /**
- * Wait for this process to finish. returns immediately if it does not
- * exist.
- *
- * @param millis
- * can be null
- */
- public void waitFor(String processUuid, Long millis);
-
- /**
- * Describe all the flows provided by this execution module. Typically
- * called in order to build a realized flow.
- */
- public ExecutionModuleDescriptor getExecutionModuleDescriptor(
- String moduleName, String version);
-
- /** List all execution modules which can be processed by this agent. */
- public List<ExecutionModuleDescriptor> listExecutionModuleDescriptors();
-
- /** @return true if still alive. */
- public boolean ping();
-}
+++ /dev/null
-package org.argeo.slc.execution;
-
-/**
- * Interpret a command line and run it in the underlying agent, with the proper
- * authentication.
- */
-public interface SlcAgentCli {
- /**
- * Synchronously executes.
- *
- * @return the UUID of the process
- */
- public String process(String[] args);
-}
+++ /dev/null
-<html>\r
-<head></head>\r
-<body>\r
-Common classes of teh SLC framework.\r
-</body>\r
-</html>
\ No newline at end of file
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-\r
-/** A test run that can be executed */\r
-public interface ExecutableTestRun extends TestRun, Runnable {\r
-\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-import org.argeo.slc.SlcException;\r
-\r
-/**\r
- * Exception to throw when a test definition cannot interpret the provided test\r
- * data.\r
- */\r
-public class IncompatibleTestDataException extends SlcException {\r
- static final long serialVersionUID = 1l;\r
-\r
- public IncompatibleTestDataException(TestData testData,\r
- TestDefinition testDefinition) {\r
- super("TestData " + testData.getClass()\r
- + " is not compatible with TestDefinition "\r
- + testDefinition.getClass());\r
- }\r
-\r
- public IncompatibleTestDataException(TestRun testRun) {\r
- super("TestData " + ((TestData) testRun.getTestData()).getClass()\r
- + " is not compatible with TestDefinition "\r
- + ((TestDefinition) testRun.getTestDefinition()).getClass());\r
- }\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-/**\r
- * Any data required by a test in order to run: configuration, expected,\r
- * reached, etc.\r
- */\r
-public interface TestData {\r
-\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-public interface TestDataProvider {\r
- public <T extends TestData> T getTestData(Class<T> clss, String key);\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-/**\r
- * The programmatic definition of a test, which will be associated with\r
- * transient objects within a test run.\r
- */\r
-public interface TestDefinition extends TestStatus {\r
- /** Performs the test. */\r
- public void execute(TestRun testRun);\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-import java.util.Date;\r
-import java.util.Map;\r
-\r
-/** The result of a test */\r
-public interface TestResult extends TestStatus, TestRunAware {\r
- public String getUuid();\r
-\r
- /** Adds a part of the result. */\r
- public void addResultPart(TestResultPart part);\r
-\r
- /**\r
- * Marks that the collection of test results is completed and free the\r
- * related resources (also closing listeners).\r
- */\r
- public void close();\r
-\r
- /**\r
- * The date when this test result was closed. Can be null, which means the\r
- * result is not closed.\r
- */\r
- public Date getCloseDate();\r
-\r
- /** Additional arbitrary meta data */\r
- public Map<String, String> getAttributes();\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-/** Listener to the operations on a test result. */\r
-public interface TestResultListener<T extends TestResult> {\r
- /** Notified when a part was added to a test result. */\r
- public void resultPartAdded(T testResult, TestResultPart testResultPart);\r
-\r
- /** Stops listening and release the related resources. */\r
- public void close(T testResult);\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-/**\r
- * Part of a test result.\r
- * \r
- * @see TestResult\r
- */\r
-public interface TestResultPart {\r
- /** The status, as defined in {@link TestStatus}. */\r
- public Integer getStatus();\r
-\r
- /** The related message. */\r
- public String getMessage();\r
-\r
- /** The underlying <code>Exception</code>. Can be null. */\r
- public String getExceptionMessage();\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-import org.argeo.slc.deploy.DeployedSystem;\r
-\r
-/** The actual run of a test */\r
-public interface TestRun {\r
- /** Gets UUID */\r
- public String getUuid();\r
-\r
- /** Gets the related test definition. */\r
- public <T extends TestDefinition> T getTestDefinition();\r
-\r
- /** Gets the related test data */\r
- public <T extends TestData> T getTestData();\r
-\r
- /** Gets the related deployed system. */\r
- public <T extends DeployedSystem> T getDeployedSystem();\r
-\r
- /** Gets the related result where to record results. */\r
- public <T extends TestResult> T getTestResult();\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-/** Allows a test run to notify other objects. */\r
-public interface TestRunAware {\r
- /** Notifies the current test run. */\r
- public void notifyTestRun(TestRun testRun);\r
-\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-/**\r
- * Simple statuses. Ordering of the flags can be relied upon in aggregation: if\r
- * one element is failed, the aggregation is failed. Is one element is in ERROR,\r
- * the aggregation is in ERROR.\r
- * <p>\r
- * <ul>\r
- * <li>{@link #PASSED}: the test succeeded</li>\r
- * <li>{@link #FAILED}: the test could run, but did not reach the expected\r
- * result</li>\r
- * <li>{@link #ERROR}: an error during the test run prevented to get a\r
- * significant information on the tested system.</li>\r
- * </ul>\r
- * </p>\r
- */\r
-public interface TestStatus {\r
- /** The flag for a passed test: 0 */\r
- public final static Integer PASSED = 0;\r
- /** The flag for a failed test: 1 */\r
- public final static Integer FAILED = 1;\r
- /**\r
- * The flag for a test which could not properly run because of an error\r
- * (there is no feedback on the behavior of the tested component): 2\r
- */\r
- public final static Integer ERROR = 2;\r
- public final static String STATUSSTR_PASSED = "PASSED";\r
- public final static String STATUSSTR_FAILED = "FAILED";\r
- public final static String STATUSSTR_ERROR = "ERROR";\r
-\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test;\r
-\r
-import org.argeo.slc.deploy.DeployedSystem;\r
-\r
-/** Test run whose various components can be externally set. */\r
-public interface WritableTestRun extends ExecutableTestRun {\r
- public void setDeployedSystem(DeployedSystem deployedSystem);\r
-\r
- public void setTestData(TestData testData);\r
-\r
- public void setTestDefinition(TestDefinition testDefinition);\r
-\r
- public void setTestResult(TestResult testResult);\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test.context;\r
-\r
-import java.util.Map;\r
-\r
-/** Access to an SLC test context that is, maps of reached and expected values. */\r
-public interface ContextAware {\r
- public final static String DEFAULT_SKIP_FLAG = "!";\r
- public final static String DEFAULT_ANY_FLAG = "*";\r
-\r
- /** Retrieves reached values. */\r
- public Map<String, Object> getValues();\r
-\r
- /** Set reached values. */\r
- public void setValues(Map<String, Object> values);\r
-\r
- /** Retrieves expected values. */\r
- public Map<String, Object> getExpectedValues();\r
-\r
- public String getContextSkipFlag();\r
-\r
- public String getContextAnyFlag();\r
-}\r
+++ /dev/null
-/*\r
- * Copyright (C) 2007-2012 Argeo GmbH\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-package org.argeo.slc.test.context;\r
-\r
-import java.util.Collection;\r
-\r
-public interface ParentContextAware extends ContextAware {\r
- public Collection<ContextAware> getChildContexts();\r
-\r
- public void addChildContext(ContextAware contextAware);\r
-}\r
+++ /dev/null
-<html>\r
-<head></head>\r
-<body>\r
-Context variables to be passed between parts of tests.\r
-</body>\r
-</html>
\ No newline at end of file
+++ /dev/null
-<html>\r
-<head></head>\r
-<body>\r
-SLC Test: test of software systems.\r
-</body>\r
-</html>
\ No newline at end of file