From 5c62fc1253cd1d20ade9c99038147190eefd2509 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Dietisheim?= Date: Mon, 25 Feb 2013 19:24:20 +0100 Subject: [PATCH] [JBIDE-13652] removed typed cartridge types * JBossCartridge * JenkinsCartridge * RubyCartridge * NodeJSCartrdige --- .../com/openshift/client/JBossCartridge.java | 33 ----------------- .../openshift/client/JenkinsCartridge.java | 28 --------------- .../com/openshift/client/NodeJSCartridge.java | 28 --------------- .../com/openshift/client/RubyCartridge.java | 28 --------------- .../openshift/internal/client/Cartridge.java | 36 ------------------- 5 files changed, 153 deletions(-) delete mode 100755 src/main/java/com/openshift/client/JBossCartridge.java delete mode 100755 src/main/java/com/openshift/client/JenkinsCartridge.java delete mode 100755 src/main/java/com/openshift/client/NodeJSCartridge.java delete mode 100644 src/main/java/com/openshift/client/RubyCartridge.java diff --git a/src/main/java/com/openshift/client/JBossCartridge.java b/src/main/java/com/openshift/client/JBossCartridge.java deleted file mode 100755 index 94f97f87..00000000 --- a/src/main/java/com/openshift/client/JBossCartridge.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Red Hat, Inc. - * Distributed under license by Red Hat, Inc. All rights reserved. - * This program is made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - ******************************************************************************/ -package com.openshift.client; - -import com.openshift.internal.client.Cartridge; - - -/** - * A cartridge that is available on the openshift server. This class is no enum - * since we dont know all available types and they may change at any time. - * - * @author André Dietisheim - */ -public class JBossCartridge extends Cartridge { - - public JBossCartridge(String name) { - super(name); - } - - @Override - public String getLogLocation() { - return "/" + getName() + "/"; - } - -} \ No newline at end of file diff --git a/src/main/java/com/openshift/client/JenkinsCartridge.java b/src/main/java/com/openshift/client/JenkinsCartridge.java deleted file mode 100755 index 4e6d6f54..00000000 --- a/src/main/java/com/openshift/client/JenkinsCartridge.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Red Hat, Inc. - * Distributed under license by Red Hat, Inc. All rights reserved. - * This program is made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - ******************************************************************************/ -package com.openshift.client; - -import com.openshift.internal.client.Cartridge; - - -/** - * A cartridge that is available on the openshift server. This class is no enum - * since we dont know all available types and they may change at any time. - * - * @author André Dietisheim - */ -public class JenkinsCartridge extends Cartridge { - - public JenkinsCartridge(String name) { - super(name); - } - -} \ No newline at end of file diff --git a/src/main/java/com/openshift/client/NodeJSCartridge.java b/src/main/java/com/openshift/client/NodeJSCartridge.java deleted file mode 100755 index e41dc79a..00000000 --- a/src/main/java/com/openshift/client/NodeJSCartridge.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Red Hat, Inc. - * Distributed under license by Red Hat, Inc. All rights reserved. - * This program is made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - ******************************************************************************/ -package com.openshift.client; - -import com.openshift.internal.client.Cartridge; - - -/** - * A cartridge that is available on the openshift server. This class is no enum - * since we dont know all available types and they may change at any time. - * - * @author André Dietisheim - */ -public class NodeJSCartridge extends Cartridge { - - public NodeJSCartridge(String name) { - super(name); - } - -} \ No newline at end of file diff --git a/src/main/java/com/openshift/client/RubyCartridge.java b/src/main/java/com/openshift/client/RubyCartridge.java deleted file mode 100644 index a34aa30b..00000000 --- a/src/main/java/com/openshift/client/RubyCartridge.java +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 Red Hat, Inc. - * Distributed under license by Red Hat, Inc. All rights reserved. - * This program is made available under the terms of the - * Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Red Hat, Inc. - initial API and implementation - ******************************************************************************/ -package com.openshift.client; - -import com.openshift.internal.client.Cartridge; - - -/** - * A cartridge that is available on the openshift server. This class is no enum - * since we dont know all available types and they may change at any time. - * - * @author André Dietisheim - */ -public class RubyCartridge extends Cartridge { - - public RubyCartridge(String name) { - super(name); - } - -} \ No newline at end of file diff --git a/src/main/java/com/openshift/internal/client/Cartridge.java b/src/main/java/com/openshift/internal/client/Cartridge.java index f81da809..5eea9f96 100755 --- a/src/main/java/com/openshift/internal/client/Cartridge.java +++ b/src/main/java/com/openshift/internal/client/Cartridge.java @@ -11,9 +11,6 @@ package com.openshift.internal.client; import com.openshift.client.ICartridge; -import com.openshift.client.JBossCartridge; -import com.openshift.client.OpenShiftException; -import com.openshift.internal.client.utils.Assert; /** @@ -24,16 +21,6 @@ */ public class Cartridge implements ICartridge { - protected static final String JBOSS = "jboss"; - protected static final String RUBY = "ruby"; - protected static final String PYTHON = "python"; - protected static final String PHP = "php"; - protected static final String PERL = "perl"; - protected static final String NODEJS = "nodejs"; - protected static final String JENKINS = "jenkins"; - protected static final String HAPROXY = "haproxy"; - protected static final String RAW = "diy"; - private final String name; public Cartridge(String name) { @@ -48,14 +35,6 @@ public String getLogLocation() { return "/"; } - public static ICartridge valueOf(String name) { - Assert.notNull(name); - - if (name.contains(JBOSS)) - return new JBossCartridge(name); - else return new Cartridge(name); - } - public int hashCode() { final int prime = 31; int result = 1; @@ -82,19 +61,4 @@ public boolean equals(Object obj) { public String toString() { return "Cartridge [name=" + name + "]"; } - - protected String getCartridgeName(String cartridgeType) throws OpenShiftException { - throw new UnsupportedOperationException(); -// List cartridges = service.getCartridges(user); -// -// Iterator i = cartridges.iterator(); -// while (i.hasNext()){ -// ICartridge cartridge = i.next(); -// if (cartridge.getName().contains(cartridgeType)) -// return cartridge.getName(); -// } -// -// throw new OpenShiftException("No cartridge found for type " + cartridgeType); - } - } \ No newline at end of file