| 1 | /** | 
| 2 |  * | 
| 3 |  * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com> | 
| 4 |  * | 
| 5 |  * ==================================================================== | 
| 6 |  * Licensed under the Apache License, Version 2.0 (the "License"); | 
| 7 |  * you may not use this file except in compliance with the License. | 
| 8 |  * You may obtain a copy of the License at | 
| 9 |  * | 
| 10 |  * http://www.apache.org/licenses/LICENSE-2.0 | 
| 11 |  * | 
| 12 |  * Unless required by applicable law or agreed to in writing, software | 
| 13 |  * distributed under the License is distributed on an "AS IS" BASIS, | 
| 14 |  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
| 15 |  * See the License for the specific language governing permissions and | 
| 16 |  * limitations under the License. | 
| 17 |  * ==================================================================== | 
| 18 |  */ | 
| 19 | package org.jclouds.compute.reference; | 
| 20 |   | 
| 21 | import javax.inject.Named; | 
| 22 | import javax.inject.Singleton; | 
| 23 |   | 
| 24 | import com.google.inject.Inject; | 
| 25 |   | 
| 26 | /** | 
| 27 |  *  | 
| 28 |  * @author Adrian Cole | 
| 29 |  */ | 
| 30 | public interface ComputeServiceConstants { | 
| 31 |   | 
| 32 |    public static final String COMPUTE_LOGGER = "jclouds.compute"; | 
| 33 |    public static final String LOCAL_PARTITION_GB_PATTERN = "disk_drive/%s/gb"; | 
| 34 |    public static final String PROPERTY_TIMEOUT_NODE_TERMINATED = "jclouds.compute.timeout.node-terminated"; | 
| 35 |    public static final String PROPERTY_TIMEOUT_NODE_RUNNING = "jclouds.compute.timeout.node-running"; | 
| 36 |    public static final String PROPERTY_TIMEOUT_NODE_SUSPENDED = "jclouds.compute.timeout.node-suspended"; | 
| 37 |    public static final String PROPERTY_TIMEOUT_SCRIPT_COMPLETE = "jclouds.compute.timeout.script-complete"; | 
| 38 |    public static final String PROPERTY_TIMEOUT_PORT_OPEN = "jclouds.compute.timeout.port-open"; | 
| 39 |    /** | 
| 40 |     * comma-separated nodes that we shouldn't attempt to list as they are dead in the provider for | 
| 41 |     * some reason. | 
| 42 |     */ | 
| 43 |    public static final String PROPERTY_BLACKLIST_NODES = "jclouds.compute.blacklist-nodes"; | 
| 44 |   | 
| 45 |    /** | 
| 46 |     * os to map of version input string to output string | 
| 47 |     * <p/> | 
| 48 |     * ex. | 
| 49 |     *  | 
| 50 |     * <pre> | 
| 51 |     * {"centos":{"5.4":"5.4","5.5":"5.5"},"rhel":{"5.4":"5.4","5.5":"5.5"},"ubuntu":{"karmic":"9.10","lucid":"10.04","maverick":"10.10","natty":"11.04"},"windows":{"2008":"2008","Server 2008":"2008","2008 R2":"2008 R2","Server 2008 R2":"2008 R2","2008 SP2":"2008 SP2","Server 2008 SP2":"2008 SP2"}} | 
| 52 |     * </pre> | 
| 53 |     */ | 
| 54 |    public static final String PROPERTY_OS_VERSION_MAP_JSON = "jclouds.compute.os-version-map-json"; | 
| 55 |   | 
| 56 |    @Singleton | 
| 57 |    public static class ReferenceData { | 
| 58 |       @Inject(optional = true) | 
| 59 |       @Named(PROPERTY_OS_VERSION_MAP_JSON) | 
| 60 |       public String osVersionMapJson = "{\"centos\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\"},\"rhel\":{\"\":\"\",\"5\":\"5.0\",\"5.2\":\"5.2\",\"5.3\":\"5.3\",\"5.4\":\"5.4\",\"5.5\":\"5.5\"},\"solaris\":{\"\":\"\",\"10\":\"10\"},\"ubuntu\":{\"\":\"\",\"hardy\":\"8.04\",\"karmic\":\"9.10\",\"lucid\":\"10.04\",\"maverick\":\"10.10\",\"natty\":\"11.04\"},\"windows\":{\"\":\"\",\"2003\":\"2003\",\"2003 Standard\":\"2003\",\"2003 R2\":\"2003 R2\",\"2008\":\"2008\",\"2008 Web\":\"2008\",\"2008 Server\":\"2008\",\"Server 2008\":\"2008\",\"2008 R2\":\"2008 R2\",\"Server 2008 R2\":\"2008 R2\",\"2008 Server R2\":\"2008 R2\",\"2008 SP2\":\"2008 SP2\",\"Server 2008 SP2\":\"2008 SP2\"}}"; | 
| 61 |    } | 
| 62 |   | 
| 63 |    @Singleton | 
| 64 |    public static class Timeouts { | 
| 65 |       @Inject(optional = true) | 
| 66 |       @Named(PROPERTY_TIMEOUT_NODE_TERMINATED) | 
| 67 |       public long nodeTerminated = 30 * 1000; | 
| 68 |   | 
| 69 |       @Inject(optional = true) | 
| 70 |       @Named(PROPERTY_TIMEOUT_NODE_RUNNING) | 
| 71 |       public long nodeRunning = 1200 * 1000; | 
| 72 |   | 
| 73 |       @Inject(optional = true) | 
| 74 |       @Named(PROPERTY_TIMEOUT_NODE_SUSPENDED) | 
| 75 |       public long nodeSuspended = 30 * 1000; | 
| 76 |   | 
| 77 |       @Inject(optional = true) | 
| 78 |       @Named(PROPERTY_TIMEOUT_SCRIPT_COMPLETE) | 
| 79 |       public long scriptComplete = 600 * 1000; | 
| 80 |   | 
| 81 |       @Inject(optional = true) | 
| 82 |       @Named(PROPERTY_TIMEOUT_PORT_OPEN) | 
| 83 |       public long portOpen = 600 * 1000; | 
| 84 |   | 
| 85 |    } | 
| 86 | } |