diff --git a/LICENSE b/LICENSE index 37efb18e558..f8d3f4b3a59 100644 --- a/LICENSE +++ b/LICENSE @@ -275,6 +275,40 @@ Within the console-proxy/js directory jquery.js +Within the deps directory + licensed under the BSD (2-clause) for XenServerJava http://www.opensource.org/licenses/BSD-2-Clause (as follows) + + Copyright (c) Citrix Systems, Inc. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + from Citrix Systems, Inc http://www.citrix.com/ + XenServerJava http://community.citrix.com/cdn/xs/sdks/ + + Within the deps/awsapi-lib directory licensed under the ANTLR 2 License http://www.antlr2.org/license.html (as follows) diff --git a/README.md b/README.md index e4f1bd2eb60..2ac663c233e 100644 --- a/README.md +++ b/README.md @@ -41,4 +41,18 @@ http://cloudstack.org/download.html [Users Mailing list](mailto:cloudstack-users-subscribe@incubator.apache.org) [Commits mailing list](mailto:cloudstack-commits-subscribe@incubator.apache.org) +#Maven build +Some third parties jars are non available in Maven central. +So install it with: cd deps&&sh ./install-non-oss.sh +Now you are able to activate nonoss build with adding -Dnonoss to maven cli. +to run webapp client: +mvn org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-beta-1:run -pl :cloud-client-ui -am -Pclient -Dnonoss +then hit: http://localhost:8080/cloud-client-ui/ +or add in your ~/.m2/settings.xml + + org.apache.tomcat.maven + +and save your fingers with mvn tomcat7:run -pl :cloud-client-ui -am -Pclient -Dnonoss + +If you want to use ide debug: replace mvn with mvnDebug and attach your ide debugger to port 8000 diff --git a/agent/pom.xml b/agent/pom.xml index 1db03165747..a5595805042 100644 --- a/agent/pom.xml +++ b/agent/pom.xml @@ -17,52 +17,50 @@ under the License. --> - 4.0.0 - cloud-agent - Apache CloudStack Agents - - com.cloud - cloud-parent - 4.0.0-SNAPSHOT - ../parent/pom.xml - - - - com.cloud - cloud-core - ${project.version} - - - org.mortbay.jetty - jetty - 6.1.26 - - - com.cloud - cloud-utils - ${project.version} - tests - test - - - - install - src - test - - - org.apache.maven.plugins - maven-jar-plugin - 2.2 - - - - test-jar - - - - - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-agent + Apache CloudStack Agents + + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + + + + org.apache.cloudstack + cloud-core + ${project.version} + + + org.mortbay.jetty + jetty + 6.1.26 + + + org.apache.cloudstack + cloud-utils + ${project.version} + tests + test + + + + install + src + test + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + diff --git a/api/pom.xml b/api/pom.xml index c2ffa814111..db147758ff3 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -17,30 +17,29 @@ under the License. --> - 4.0.0 - cloud-api - Apache CloudStack API - - com.cloud - cloud-parent - 4.0.0-SNAPSHOT - ../parent/pom.xml - - - - com.cloud - cloud-utils - ${project.version} - - - com.google.code.gson - gson - ${cs.gson.version} - - - - install - src - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-api + Apache CloudStack API + + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + + + + org.apache.cloudstack + cloud-utils + ${project.version} + + + com.google.code.gson + gson + ${cs.gson.version} + + + + install + src + diff --git a/api/src/com/cloud/api/response/ExceptionResponse.java b/api/src/com/cloud/api/response/ExceptionResponse.java index 8d1e3de2958..9ff2cf12437 100644 --- a/api/src/com/cloud/api/response/ExceptionResponse.java +++ b/api/src/com/cloud/api/response/ExceptionResponse.java @@ -16,15 +16,17 @@ // under the License. package com.cloud.api.response; -import com.cloud.utils.IdentityProxy; -import com.cloud.serializer.Param; -import com.google.gson.annotations.SerializedName; import java.util.ArrayList; +import com.cloud.serializer.Param; +import com.cloud.utils.IdentityProxy; +import com.google.gson.annotations.SerializedName; + public class ExceptionResponse extends BaseResponse { - @SerializedName("uuidList") @Param(description="List of uuids associated with this error") - private ArrayList idList = new ArrayList(); - + + @SerializedName("uuidList") @Param(description="List of uuids associated with this error") + private ArrayList idList = new ArrayList(); + @SerializedName("errorcode") @Param(description="numeric code associated with this error") private Integer errorCode; @@ -49,17 +51,22 @@ public class ExceptionResponse extends BaseResponse { public void setErrorText(String errorText) { this.errorText = errorText; } - - public void addProxyObject(String tableName, Long id, String idFieldName) { - idList.add(new IdentityProxy(tableName, id, idFieldName)); - return; - } - - public ArrayList getIdProxyList() { - return idList; - } - - public void setCSErrorCode(int cserrcode) { - this.csErrorCode = cserrcode; - } + + public void addProxyObject(String tableName, Long id, String idFieldName) { + idList.add(new IdentityProxy(tableName, id, idFieldName)); + return; + } + + public ArrayList getIdProxyList() { + return idList; + } + + public void setCSErrorCode(int cserrcode) { + this.csErrorCode = cserrcode; + } + + @Override + public String toString() { + return ("Error Code: " + errorCode + " Error text: " + errorText); + } } diff --git a/api/src/com/cloud/api/response/UserVmResponse.java b/api/src/com/cloud/api/response/UserVmResponse.java index 652e026d72c..f74c07254c7 100755 --- a/api/src/com/cloud/api/response/UserVmResponse.java +++ b/api/src/com/cloud/api/response/UserVmResponse.java @@ -158,6 +158,9 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp @SerializedName(ApiConstants.TAGS) @Param(description="the list of resource tags associated with vm", responseObject = ResourceTagResponse.class) private List tags; + @SerializedName(ApiConstants.SSH_KEYPAIR) @Param(description="ssh key-pair") + private String keyPairName; + public void setHypervisor(String hypervisor) { this.hypervisor = hypervisor; } @@ -348,4 +351,8 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp public void setTags(List tags) { this.tags = tags; } + + public void setKeyPairName(String keyPairName) { + this.keyPairName = keyPairName; + } } diff --git a/api/src/com/cloud/storage/GuestOsCategory.java b/api/src/com/cloud/storage/GuestOsCategory.java index 96123e47108..42320d9eec8 100644 --- a/api/src/com/cloud/storage/GuestOsCategory.java +++ b/api/src/com/cloud/storage/GuestOsCategory.java @@ -17,6 +17,8 @@ package com.cloud.storage; public interface GuestOsCategory { + // Used by OS preference, 'None' for no OS preference + public static final String CATEGORY_NONE ="None"; long getId(); String getName(); diff --git a/awsapi-setup/setup/cloudstack-aws-api-register b/awsapi-setup/setup/cloudstack-aws-api-register index 19b53fd26c5..ea57d0b9dcf 100644 --- a/awsapi-setup/setup/cloudstack-aws-api-register +++ b/awsapi-setup/setup/cloudstack-aws-api-register @@ -1,4 +1,4 @@ -#!/cygdrive/c/python26/python +#!/usr/bin/python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file diff --git a/awsapi/.classpath b/awsapi/.classpath index 298eba2cda9..c5e598f9f43 100644 --- a/awsapi/.classpath +++ b/awsapi/.classpath @@ -1,20 +1,68 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/awsapi/conf/hibernate.cfg.xml b/awsapi/conf/hibernate.cfg.xml deleted file mode 100644 index d484849fd07..00000000000 --- a/awsapi/conf/hibernate.cfg.xml +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - com.mysql.jdbc.Driver - 20 - false - - - 2 - - true - org.hibernate.dialect.MySQLDialect - - false - - - - - - - - - - - - - - diff --git a/awsapi/pom.xml b/awsapi/pom.xml index 2555d9f2b88..cf9103359a7 100644 --- a/awsapi/pom.xml +++ b/awsapi/pom.xml @@ -17,99 +17,111 @@ under the License. --> - 4.0.0 - cloud-awsapi - 4.0.0-SNAPSHOT - Apache CloudStack AWS API Bridge - - com.cloud - cloud-parent - 4.0.0-SNAPSHOT - ../parent/pom.xml - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-awsapi + 4.0.0-SNAPSHOT + Apache CloudStack AWS API Bridge + + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + + + + org.apache.cloudstack + cloud-utils + ${project.version} + org.apache.axis2 axis2 ${cs.axis2.version} - - org.apache.ws.commons.axiom - axiom-api - ${cs.axiom.version} - - - org.hibernate - hibernate-core - ${cs.hibernate.version} - - - org.hibernate - hibernate-annotations - ${cs.hibernate.version} - - - org.hibernate - hibernate-entitymanager - ${cs.hibernate.version} - - - log4j - log4j - ${cs.log4j.version} - - - org.apache.neethi - neethi - ${cs.neethi.version} - - -com.google.code.gson -gson -${cs.gson.version} - - -commons-codec -commons-codec -${cs.codec.version} - - - javax.servlet - servlet-api - ${cs.servlet.version} - provided - - - com.googlecode.json-simple - json-simple - 1.1 - - -org.jasypt -jasypt -${cs.jasypt.version} - - - - install - src - - + + org.apache.ws.commons.axiom + axiom-api + ${cs.axiom.version} + + + org.hibernate + hibernate-core + ${cs.hibernate.version} + + + org.hibernate + hibernate-annotations + ${cs.hibernate.version} + + + org.hibernate + hibernate-entitymanager + ${cs.hibernate.version} + + + log4j + log4j + ${cs.log4j.version} + + + org.apache.neethi + neethi + ${cs.neethi.version} + + + com.google.code.gson + gson + ${cs.gson.version} + + + commons-codec + commons-codec + ${cs.codec.version} + + + javax.servlet + servlet-api + ${cs.servlet.version} + provided + + + com.googlecode.json-simple + json-simple + 1.1 + + + org.jasypt + jasypt + ${cs.jasypt.version} + + + + install + src + + + src + + **/*.java + + + + + diff --git a/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationHandler.java b/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationHandler.java index 3b28c001b7d..f79feaad5bc 100644 --- a/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationHandler.java +++ b/awsapi/src/com/cloud/bridge/auth/ec2/AuthenticationHandler.java @@ -37,15 +37,16 @@ import java.io.InputStream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; -import com.cloud.bridge.model.UserCredentials; -import com.cloud.bridge.persist.dao.UserCredentialsDao; +import com.cloud.bridge.model.UserCredentialsVO; +import com.cloud.bridge.persist.dao.UserCredentialsDaoImpl; import com.cloud.bridge.service.UserContext; import com.cloud.bridge.util.AuthenticationUtils; +import com.cloud.utils.component.ComponentLocator; public class AuthenticationHandler implements Handler { protected final static Logger logger = Logger.getLogger(AuthenticationHandler.class); - + protected final UserCredentialsDaoImpl ucDao = ComponentLocator.inject(UserCredentialsDaoImpl.class); private DocumentBuilderFactory dbf = null; protected HandlerDescription handlerDesc = new HandlerDescription( "EC2AuthenticationHandler" ); @@ -111,13 +112,15 @@ public class AuthenticationHandler implements Handler { logger.debug( "X509 cert's uniqueId: " + uniqueId ); // -> find the Cloud API key and the secret key from the cert's uniqueId - UserCredentialsDao credentialDao = new UserCredentialsDao(); +/* UserCredentialsDao credentialDao = new UserCredentialsDao(); UserCredentials cloudKeys = credentialDao.getByCertUniqueId( uniqueId ); - if ( null == cloudKeys ) { - logger.error( "Cert does not map to Cloud API keys: " + uniqueId ); - throw new AxisFault( "User not properly registered: Certificate does not map to Cloud API Keys", "Client.Blocked" ); - } - else UserContext.current().initContext( cloudKeys.getAccessKey(), cloudKeys.getSecretKey(), cloudKeys.getAccessKey(), "SOAP Request", null ); +*/ + UserCredentialsVO cloudKeys = ucDao.getByCertUniqueId(uniqueId); + if ( null == cloudKeys ) { + logger.error( "Cert does not map to Cloud API keys: " + uniqueId ); + throw new AxisFault( "User not properly registered: Certificate does not map to Cloud API Keys", "Client.Blocked" ); + } + else UserContext.current().initContext( cloudKeys.getAccessKey(), cloudKeys.getSecretKey(), cloudKeys.getAccessKey(), "SOAP Request", null ); //System.out.println( "end of cert match: " + UserContext.current().getSecretKey()); } } diff --git a/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationHandler.java b/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationHandler.java index f7a1a7e8c6e..b9519169632 100644 --- a/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationHandler.java +++ b/awsapi/src/com/cloud/bridge/auth/s3/AuthenticationHandler.java @@ -29,10 +29,11 @@ import org.apache.axis2.AxisFault; import org.apache.axis2.description.HandlerDescription; import org.apache.axis2.description.Parameter; -import com.cloud.bridge.model.UserCredentials; -import com.cloud.bridge.persist.dao.UserCredentialsDao; +import com.cloud.bridge.model.UserCredentialsVO; +import com.cloud.bridge.persist.dao.UserCredentialsDaoImpl; import com.cloud.bridge.service.UserContext; import com.cloud.bridge.util.S3SoapAuth; +import com.cloud.utils.component.ComponentLocator; /* * For SOAP compatibility. @@ -40,7 +41,7 @@ import com.cloud.bridge.util.S3SoapAuth; public class AuthenticationHandler implements Handler { protected final static Logger logger = Logger.getLogger(AuthenticationHandler.class); - + protected final UserCredentialsDaoImpl ucDao = ComponentLocator.inject(UserCredentialsDaoImpl.class); protected HandlerDescription handlerDesc = new HandlerDescription( "default handler" ); private String name = "S3AuthenticationHandler"; @@ -190,8 +191,7 @@ public class AuthenticationHandler implements Handler { private String lookupSecretKey( String accessKey ) throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - UserCredentialsDao credentialDao = new UserCredentialsDao(); - UserCredentials cloudKeys = credentialDao.getByAccessKey( accessKey ); + UserCredentialsVO cloudKeys = ucDao.getByAccessKey( accessKey ); if ( null == cloudKeys ) { logger.debug( accessKey + " is not defined in the S3 service - call SetUserKeys" ); return null; diff --git a/awsapi/src/com/cloud/bridge/lifecycle/ServiceEngineLifecycle.java b/awsapi/src/com/cloud/bridge/lifecycle/ServiceEngineLifecycle.java index 88c8729d902..73cb801cec4 100644 --- a/awsapi/src/com/cloud/bridge/lifecycle/ServiceEngineLifecycle.java +++ b/awsapi/src/com/cloud/bridge/lifecycle/ServiceEngineLifecycle.java @@ -21,8 +21,8 @@ import org.apache.axis2.description.AxisService; import org.apache.axis2.engine.ServiceLifeCycle; import org.apache.log4j.Logger; -import com.cloud.bridge.persist.dao.UserCredentialsDao; import com.cloud.bridge.service.controller.s3.ServiceProvider; +import com.cloud.utils.db.Transaction; /** @@ -38,7 +38,7 @@ public class ServiceEngineLifecycle implements ServiceLifeCycle { public void startUp(ConfigurationContext config, AxisService service) { // initialize service provider during Axis engine startup try{ - UserCredentialsDao.preCheckTableExistence(); + //UserCredentialsDao.preCheckTableExistence(); ServiceProvider.getInstance(); ServiceEngineLifecycle.initialized = true; }catch(Exception e){ diff --git a/awsapi/src/com/cloud/bridge/model/BucketPolicyVO.java b/awsapi/src/com/cloud/bridge/model/BucketPolicyVO.java new file mode 100644 index 00000000000..c4be142d5c7 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/model/BucketPolicyVO.java @@ -0,0 +1,59 @@ +package com.cloud.bridge.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name="bucket_policies") +public class BucketPolicyVO { + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") + private long id; + + @Column(name="BucketName") + private String bucketName; + + @Column(name="OwnerCanonicalID") + private String ownerCanonicalID; + + @Column(name="Policy") + private String policy; + + public BucketPolicyVO() { } + public BucketPolicyVO(String bucketName, String client, String policy) { + this.bucketName = bucketName; + this.ownerCanonicalID = client; + this.policy = policy; + } + + public long getId() { + return id; + } + public void setId(long id) { + this.id = id; + } + public String getBucketName() { + return bucketName; + } + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + public String getOwnerCanonicalID() { + return ownerCanonicalID; + } + public void setOwnerCanonicalID(String ownerCanonicalID) { + this.ownerCanonicalID = ownerCanonicalID; + } + public String getPolicy() { + return policy; + } + public void setPolicy(String policy) { + this.policy = policy; + } +} diff --git a/awsapi/src/com/cloud/bridge/model/CloudStackAccountVO.java b/awsapi/src/com/cloud/bridge/model/CloudStackAccountVO.java new file mode 100644 index 00000000000..5737abb9e79 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/model/CloudStackAccountVO.java @@ -0,0 +1,34 @@ +package com.cloud.bridge.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Table; + +@Entity +@Table(name="account") +public class CloudStackAccountVO { + + @Column(name="uuid") + private String uuid; + + @Column(name="default_zone_id") + private Long defaultZoneId = null; + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } + + public Long getDefaultZoneId() { + return defaultZoneId; + } + + public void setDefaultZoneId(Long defaultZoneId) { + this.defaultZoneId = defaultZoneId; + } + + +} diff --git a/awsapi/src/com/cloud/bridge/model/CloudStackConfigurationVO.java b/awsapi/src/com/cloud/bridge/model/CloudStackConfigurationVO.java new file mode 100644 index 00000000000..982969f73dd --- /dev/null +++ b/awsapi/src/com/cloud/bridge/model/CloudStackConfigurationVO.java @@ -0,0 +1,30 @@ +package com.cloud.bridge.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Table; + +import com.cloud.utils.db.DB; + +@Entity +@Table(name="configuration") +public class CloudStackConfigurationVO { + @Id + @Column(name="name") + private String name; + + @Column(name="value", length=4095) + private String value; + + @DB + public String getValue() { + return value; + } + + public String getName() { + return name; + } + + +} diff --git a/awsapi/src/com/cloud/bridge/model/CloudStackServiceOfferingVO.java b/awsapi/src/com/cloud/bridge/model/CloudStackServiceOfferingVO.java new file mode 100644 index 00000000000..23e0cc850d2 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/model/CloudStackServiceOfferingVO.java @@ -0,0 +1,51 @@ +package com.cloud.bridge.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name="disk_offering") +public class CloudStackServiceOfferingVO { + + @Id + @Column(name="id") + private String id; + + @Column(name="name") + private String name; + + @Column(name="domain_id") + private String domainId; + + + public String getId() { + return id; + } + + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public String getDomainId() { + return domainId; + } + + + public void setDomainId(String domainId) { + this.domainId = domainId; + } + + + +} diff --git a/awsapi/src/com/cloud/bridge/model/MHost.hbm.xml b/awsapi/src/com/cloud/bridge/model/MHost.hbm.xml deleted file mode 100644 index e151171ee9a..00000000000 --- a/awsapi/src/com/cloud/bridge/model/MHost.hbm.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/bridge/model/MHostMount.hbm.xml b/awsapi/src/com/cloud/bridge/model/MHostMount.hbm.xml deleted file mode 100644 index c186de56cc4..00000000000 --- a/awsapi/src/com/cloud/bridge/model/MHostMount.hbm.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/bridge/model/MHostMount.java b/awsapi/src/com/cloud/bridge/model/MHostMountVO.java similarity index 56% rename from awsapi/src/com/cloud/bridge/model/MHostMount.java rename to awsapi/src/com/cloud/bridge/model/MHostMountVO.java index 771ed8b6aab..a008658a1be 100644 --- a/awsapi/src/com/cloud/bridge/model/MHostMount.java +++ b/awsapi/src/com/cloud/bridge/model/MHostMountVO.java @@ -19,18 +19,46 @@ package com.cloud.bridge.model; import java.io.Serializable; import java.util.Date; -public class MHostMount implements Serializable { - private static final long serialVersionUID = -1119494563131099642L; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; +@Entity +@Table(name="mhost_mount") +public class MHostMountVO implements Serializable { + private static final long serialVersionUID = -1119494563131099642L; + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") private Long id; - private MHost mhost; - private SHost shost; + @Column(name="MHostID") + private long mHostID; + @Column(name="SHostID") + private long sHostID; + + @Transient + private MHostVO mhost; + + @Transient + private SHostVO shost; + + @Column(name="MountPath") private String mountPath; + + @Column(name="LastMountTime") + @Temporal(value=TemporalType.TIMESTAMP) private Date lastMountTime; - public MHostMount() { + public MHostMountVO() { } public Long getId() { @@ -41,19 +69,35 @@ public class MHostMount implements Serializable { this.id = id; } - public MHost getMhost() { + public long getmHostID() { + return mHostID; + } + + public void setmHostID(long mHostID) { + this.mHostID = mHostID; + } + + public long getsHostID() { + return sHostID; + } + + public void setsHostID(long sHostID) { + this.sHostID = sHostID; + } + + public MHostVO getMhost() { return mhost; } - public void setMhost(MHost mhost) { + public void setMhost(MHostVO mhost) { this.mhost = mhost; } - public SHost getShost() { + public SHostVO getShost() { return shost; } - public void setShost(SHost shost) { + public void setShost(SHostVO shost) { this.shost = shost; } @@ -78,11 +122,11 @@ public class MHostMount implements Serializable { if(this == other) return true; - if(!(other instanceof MHostMount)) + if(!(other instanceof MHostMountVO)) return false; - return getMhost().equals(((MHostMount)other).getMhost()) && - getShost().equals(((MHostMount)other).getShost()); + return getMhost().equals(((MHostMountVO)other).getMhost()) && + getShost().equals(((MHostMountVO)other).getShost()); } @Override diff --git a/awsapi/src/com/cloud/bridge/model/MHost.java b/awsapi/src/com/cloud/bridge/model/MHostVO.java similarity index 65% rename from awsapi/src/com/cloud/bridge/model/MHost.java rename to awsapi/src/com/cloud/bridge/model/MHostVO.java index 2187c7ee546..0be74b7fe90 100644 --- a/awsapi/src/com/cloud/bridge/model/MHost.java +++ b/awsapi/src/com/cloud/bridge/model/MHostVO.java @@ -21,20 +21,46 @@ import java.util.Date; import java.util.HashSet; import java.util.Set; -public class MHost implements Serializable { - private static final long serialVersionUID = 4848254624679753930L; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; +@Entity +@Table(name="mhost") +public class MHostVO implements Serializable { + private static final long serialVersionUID = 4848254624679753930L; + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") private Long id; + @Column(name="MHostKey", nullable=false) private String hostKey; + + @Column(name="Host") private String host; + + @Column(name="Version") private String version; + + @Column(name="LastHeartbeatTime") + @Temporal(value=TemporalType.TIMESTAMP) private Date lastHeartbeatTime; + + @Transient + private Set localSHosts = new HashSet(); + + @Transient + private Set mounts = new HashSet(); - private Set localSHosts = new HashSet(); - private Set mounts = new HashSet(); - - public MHost() { + public MHostVO() { } public Long getId() { @@ -77,19 +103,19 @@ public class MHost implements Serializable { this.lastHeartbeatTime = lastHeartbeatTime; } - public Set getLocalSHosts() { + public Set getLocalSHosts() { return localSHosts; } - public void setLocalSHosts(Set localSHosts) { + public void setLocalSHosts(Set localSHosts) { this.localSHosts = localSHosts; } - public Set getMounts() { + public Set getMounts() { return mounts; } - public void setMounts(Set mounts) { + public void setMounts(Set mounts) { this.mounts = mounts; } @@ -98,10 +124,10 @@ public class MHost implements Serializable { if(this == other) return true; - if(!(other instanceof MHost)) + if(!(other instanceof MHostVO)) return false; - return hostKey == ((MHost)other).getHostKey(); + return hostKey == ((MHostVO)other).getHostKey(); } @Override diff --git a/awsapi/src/com/cloud/bridge/model/MultiPartPartsVO.java b/awsapi/src/com/cloud/bridge/model/MultiPartPartsVO.java new file mode 100644 index 00000000000..d622e47a691 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/model/MultiPartPartsVO.java @@ -0,0 +1,108 @@ +package com.cloud.bridge.model; + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@Table(name="multipart_parts") +public class MultiPartPartsVO { + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") + private Long id; + + @Column(name="UploadID") + private Long uploadid; + + @Column(name="partNumber") + private int partNumber; + + @Column(name="MD5") + private String md5; + + @Column(name="StoredPath") + private String storedPath; + + @Column(name="StoredSize") + private Long storedSize; + + @Column(name="CreateTime") + @Temporal(value=TemporalType.TIMESTAMP) + private Date createTime; + + public MultiPartPartsVO() { } + + public MultiPartPartsVO(int uploadId, int partNumber, String md5, + String storedPath, int size, Date date) { + this.uploadid = new Long(uploadId); + this.partNumber = partNumber; + this.md5 = md5; + this.storedPath = storedPath; + this.storedSize = new Long(size); + this.createTime = date; + } + + public Long getUploadid() { + return uploadid; + } + + public void setUploadid(Long uploadid) { + this.uploadid = uploadid; + } + + public int getPartNumber() { + return partNumber; + } + + public void setPartNumber(int partNumber) { + this.partNumber = partNumber; + } + + public String getMd5() { + return md5; + } + + public void setMd5(String md5) { + this.md5 = md5; + } + + public String getStoredPath() { + return storedPath; + } + + public void setStoredPath(String storedPath) { + this.storedPath = storedPath; + } + + public Long getStoredSize() { + return storedSize; + } + + public void setStoredSize(Long storedSize) { + this.storedSize = storedSize; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Long getId() { + return id; + } + + + +} diff --git a/awsapi/src/com/cloud/bridge/model/MultiPartUploadsVO.java b/awsapi/src/com/cloud/bridge/model/MultiPartUploadsVO.java new file mode 100644 index 00000000000..fd0bb42f4c2 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/model/MultiPartUploadsVO.java @@ -0,0 +1,94 @@ +package com.cloud.bridge.model; + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +@Entity +@Table(name="multipart_uploads") + +public class MultiPartUploadsVO { + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") + private Long id; + + @Column(name="AccessKey") + private String accessKey; + + @Column(name="BucketName") + private String bucketName; + + @Column(name="NameKey") + private String nameKey; + + @Column(name="x_amz_acl") + private String amzAcl; + + @Column(name="CreateTime") + @Temporal(value=TemporalType.TIMESTAMP) + private Date createTime; + + public MultiPartUploadsVO() {} + + public MultiPartUploadsVO(String accessKey, String bucketName, String key, String cannedAccess, Date tod) { + this.accessKey = accessKey; + this.bucketName = bucketName; + this.nameKey = key; + this.amzAcl = cannedAccess; + this.createTime = tod; + } + + public Long getId() { + return id; + } + + public String getAccessKey() { + return accessKey; + } + + public void setAccessKey(String accessKey) { + this.accessKey = accessKey; + } + + public String getBucketName() { + return bucketName; + } + + public void setBucketName(String bucketName) { + this.bucketName = bucketName; + } + + public String getNameKey() { + return nameKey; + } + + public void setNameKey(String nameKey) { + this.nameKey = nameKey; + } + + public String getAmzAcl() { + return amzAcl; + } + + public void setAmzAcl(String amzAcl) { + this.amzAcl = amzAcl; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + +} \ No newline at end of file diff --git a/awsapi/src/com/cloud/bridge/model/MultipartMetaVO.java b/awsapi/src/com/cloud/bridge/model/MultipartMetaVO.java new file mode 100644 index 00000000000..ca2b69ee64f --- /dev/null +++ b/awsapi/src/com/cloud/bridge/model/MultipartMetaVO.java @@ -0,0 +1,59 @@ +package com.cloud.bridge.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name="multipart_meta") + +public class MultipartMetaVO { + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") + private Long id; + + @Column(name="UploadID") + private long uploadID; + + @Column(name="Name") + private String name; + + @Column(name="Value") + private String value; + + public long getID() { + return id; + } + + public long getUploadID() { + return uploadID; + } + + public void setUploadID(long uploadID) { + this.uploadID = uploadID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + + +} diff --git a/awsapi/src/com/cloud/bridge/model/OfferingBundleVO.java b/awsapi/src/com/cloud/bridge/model/OfferingBundleVO.java new file mode 100644 index 00000000000..4c41cff451a --- /dev/null +++ b/awsapi/src/com/cloud/bridge/model/OfferingBundleVO.java @@ -0,0 +1,46 @@ +package com.cloud.bridge.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + + +@Entity +@Table(name="offering_bundle") +public class OfferingBundleVO { + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") + private long id; + + @Column(name="AmazonEC2Offering") + private String amazonOffering; + + @Column(name="CloudStackOffering") + private String cloudstackOffering; + + public long getID() { + return id; + } + + public String getAmazonOffering() { + return amazonOffering; + } + + public void setAmazonOffering(String amazonOffering) { + this.amazonOffering = amazonOffering; + } + + public String getCloudstackOffering() { + return cloudstackOffering; + } + + public void setCloudstackOffering(String cloudstackOffering) { + this.cloudstackOffering = cloudstackOffering; + } + + +} diff --git a/awsapi/src/com/cloud/bridge/model/SAcl.hbm.xml b/awsapi/src/com/cloud/bridge/model/SAcl.hbm.xml deleted file mode 100644 index 175e1a7808d..00000000000 --- a/awsapi/src/com/cloud/bridge/model/SAcl.hbm.xml +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/bridge/model/SAcl.java b/awsapi/src/com/cloud/bridge/model/SAcl.java index 7cbcabee316..af0bb5eee91 100644 --- a/awsapi/src/com/cloud/bridge/model/SAcl.java +++ b/awsapi/src/com/cloud/bridge/model/SAcl.java @@ -37,8 +37,7 @@ import com.cloud.bridge.util.Triple; * < permission1, permission2, symbol > * when given an aclRequestString, a target (i.e. bucket or object) and the ID of the owner. */ -public class SAcl implements Serializable { - private static final long serialVersionUID = 7900837117165018850L; +public interface SAcl { public static final int GRANTEE_USER = 0; public static final int GRANTEE_ALLUSERS = 1; @@ -52,95 +51,6 @@ public class SAcl implements Serializable { public static final int PERMISSION_WRITE_ACL = 8; public static final int PERMISSION_FULL = (PERMISSION_READ | PERMISSION_WRITE | PERMISSION_READ_ACL | PERMISSION_WRITE_ACL); - private Long id; - - private String target; - private long targetId; - - private int granteeType; - private String granteeCanonicalId; - - private int permission; - private int grantOrder; - - private Date createTime; - private Date lastModifiedTime; - - public SAcl() { - } - - public Long getId() { - return id; - } - - private void setId(Long id) { - this.id = id; - } - - public String getTarget() { - return target; - } - - public void setTarget(String target) { - this.target = target; - } - - public long getTargetId() { - return targetId; - } - - public void setTargetId(long targetId) { - this.targetId = targetId; - } - - public int getGranteeType() { - return granteeType; - } - - public void setGranteeType(int granteeType) { - this.granteeType = granteeType; - } - - public String getGranteeCanonicalId() { - return granteeCanonicalId; - } - - public void setGranteeCanonicalId(String granteeCanonicalId) { - this.granteeCanonicalId = granteeCanonicalId; - } - - public int getPermission() { - return permission; - } - - public void setPermission(int permission) { - this.permission = permission; - } - - public int getGrantOrder() { - return grantOrder; - } - - public void setGrantOrder(int grantOrder) { - this.grantOrder = grantOrder; - } - - public Date getCreateTime() { - return createTime; - } - - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - public Date getLastModifiedTime() { - return lastModifiedTime; - } - - public void setLastModifiedTime(Date lastModifiedTime) { - this.lastModifiedTime = lastModifiedTime; - } - /** Return an OrderedPair * < permission, grantee > * comprising @@ -153,9 +63,9 @@ public class SAcl implements Serializable { * @param aclRequestString - The requested ACL from the set of AWS S3 canned ACLs * @param target - Either "SBucket" or otherwise assumed to be for a single object item */ - public static OrderedPair getCannedAccessControls ( String aclRequestString, String target ) - throws UnsupportedException - { + //public static OrderedPair getCannedAccessControls ( String aclRequestString, String target ); + +/* { if ( aclRequestString.equalsIgnoreCase( "public-read" )) // All users granted READ access. return new OrderedPair (PERMISSION_READ,GRANTEE_ALLUSERS); @@ -184,7 +94,7 @@ public class SAcl implements Serializable { } else throw new UnsupportedException( "Unknown Canned Access Policy: " + aclRequestString + " is not supported" ); } - +*/ /** Return a Triple * < permission1, permission2, symbol > * comprising @@ -200,8 +110,8 @@ public class SAcl implements Serializable { * @param target - Either "SBucket" or otherwise assumed to be for a single object item * @param ownerID - An ID for the owner, if used in place of symbols "A" or "*" */ - public static Triple getCannedAccessControls ( String aclRequestString, String target, String ownerID ) - throws UnsupportedException + //public static Triple getCannedAccessControls ( String aclRequestString, String target, String ownerID ); +/* throws UnsupportedException { if ( aclRequestString.equalsIgnoreCase( "public-read" )) // Owner gets FULL_CONTROL and the anonymous principal (the 'A' symbol here) is granted READ access. @@ -235,5 +145,5 @@ public class SAcl implements Serializable { } else throw new UnsupportedException( "Unknown Canned Access Policy: " + aclRequestString + " is not supported" ); } - +*/ } diff --git a/awsapi/src/com/cloud/bridge/model/SAclVO.java b/awsapi/src/com/cloud/bridge/model/SAclVO.java new file mode 100644 index 00000000000..96a252f42da --- /dev/null +++ b/awsapi/src/com/cloud/bridge/model/SAclVO.java @@ -0,0 +1,254 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.model; + +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; + +import com.cloud.bridge.service.exception.UnsupportedException; +import com.cloud.bridge.util.OrderedPair; +import com.cloud.bridge.util.Triple; + +/** + * A model of stored ACLs to remember the ACL permissions per canonicalUserID per grantee + * Hold the AWS S3 grantee and permission constants. + * + * This class implements two forms of getCannedAccessControls mappings, as static methods, + * + * (a) an OrderedPair which provides a maplet across + * < permission, grantee > + * when given an aclRequestString and a target (i.e. bucket or object), + * + * (b) a Triplet + * < permission1, permission2, symbol > + * when given an aclRequestString, a target (i.e. bucket or object) and the ID of the owner. + */ +@Entity +@Table(name="acl") +public class SAclVO implements SAcl { + private static final long serialVersionUID = 7900837117165018850L; + + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") + private Long id; + @Column(name="Target") + private String target; + + @Column(name="TargetID") + private long targetId; + + @Column(name="GranteeType") + private int granteeType; + + @Column(name="GranteeCanonicalID") + private String granteeCanonicalId; + + @Column(name="Permission") + private int permission; + + @Column(name="GrantOrder") + private int grantOrder; + + @Column(name="CreateTime") + @Temporal(value=TemporalType.TIMESTAMP) + private Date createTime; + + @Column(name="LastModifiedTime") + @Temporal(value=TemporalType.TIMESTAMP) + private Date lastModifiedTime; + + public SAclVO() { + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public String getTarget() { + return target; + } + + public void setTarget(String target) { + this.target = target; + } + + public long getTargetId() { + return targetId; + } + + public void setTargetId(long targetId) { + this.targetId = targetId; + } + + public int getGranteeType() { + return granteeType; + } + + public void setGranteeType(int granteeType) { + this.granteeType = granteeType; + } + + public String getGranteeCanonicalId() { + return granteeCanonicalId; + } + + public void setGranteeCanonicalId(String granteeCanonicalId) { + this.granteeCanonicalId = granteeCanonicalId; + } + + public int getPermission() { + return permission; + } + + public void setPermission(int permission) { + this.permission = permission; + } + + public int getGrantOrder() { + return grantOrder; + } + + public void setGrantOrder(int grantOrder) { + this.grantOrder = grantOrder; + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getLastModifiedTime() { + return lastModifiedTime; + } + + public void setLastModifiedTime(Date lastModifiedTime) { + this.lastModifiedTime = lastModifiedTime; + } + + /** Return an OrderedPair + * < permission, grantee > + * comprising + * a permission - which is one of SAcl.PERMISSION_PASS, SAcl.PERMISSION_NONE, SAcl.PERMISSION_READ, + * SAcl.PERMISSION_WRITE, SAcl.PERMISSION_READ_ACL, SAcl.PERMISSION_WRITE_ACL, SAcl.PERMISSION_FULL + * a grantee - which is one of GRANTEE_ALLUSERS, GRANTEE_AUTHENTICATED, GRANTEE_USER + * + * Access controls that are specified via the "x-amz-acl:" headers in REST requests for buckets. + * The ACL request string is treated as a request for a known cannedAccessPolicy + * @param aclRequestString - The requested ACL from the set of AWS S3 canned ACLs + * @param target - Either "SBucket" or otherwise assumed to be for a single object item + */ + public static OrderedPair getCannedAccessControls ( String aclRequestString, String target ) + throws UnsupportedException + { + if ( aclRequestString.equalsIgnoreCase( "public-read" )) + // All users granted READ access. + return new OrderedPair (PERMISSION_READ,GRANTEE_ALLUSERS); + else if (aclRequestString.equalsIgnoreCase( "public-read-write" )) + // All users granted READ and WRITE access + return new OrderedPair ((PERMISSION_READ | PERMISSION_WRITE),GRANTEE_ALLUSERS); + else if (aclRequestString.equalsIgnoreCase( "authenticated-read" )) + // Authenticated users have READ access + return new OrderedPair (PERMISSION_READ,GRANTEE_AUTHENTICATED); + else if (aclRequestString.equalsIgnoreCase( "private" )) + // Only Owner gets FULL_CONTROL + return new OrderedPair (PERMISSION_FULL,GRANTEE_USER); + else if (aclRequestString.equalsIgnoreCase( "bucket-owner-read" )) + { + // Object Owner gets FULL_CONTROL, Bucket Owner gets READ + if ( target.equalsIgnoreCase( "SBucket" )) + return new OrderedPair (PERMISSION_READ, GRANTEE_USER); + else + return new OrderedPair (PERMISSION_FULL, GRANTEE_USER); + } + else if (aclRequestString.equalsIgnoreCase( "bucket-owner-full-control" )) + { + // Object Owner gets FULL_CONTROL, Bucket Owner gets FULL_CONTROL + // This is equivalent to private when used with PUT Bucket + return new OrderedPair (PERMISSION_FULL,GRANTEE_USER); + } + else throw new UnsupportedException( "Unknown Canned Access Policy: " + aclRequestString + " is not supported" ); + } + + /** Return a Triple + * < permission1, permission2, symbol > + * comprising + * two permissions - which is one of SAcl.PERMISSION_PASS, SAcl.PERMISSION_NONE, SAcl.PERMISSION_READ, + * SAcl.PERMISSION_WRITE, SAcl.PERMISSION_READ_ACL, SAcl.PERMISSION_WRITE_ACL, SAcl.PERMISSION_FULL + * permission1 applies to objects, permission2 applies to buckets. + * a symbol to indicate whether the principal is anonymous (i.e. string "A") or authenticated user (i.e. + * string "*") - otherwise null indicates a single ACL for all users. + * + * Access controls that are specified via the "x-amz-acl:" headers in REST requests for buckets. + * The ACL request string is treated as a request for a known cannedAccessPolicy + * @param aclRequestString - The requested ACL from the set of AWS S3 canned ACLs + * @param target - Either "SBucket" or otherwise assumed to be for a single object item + * @param ownerID - An ID for the owner, if used in place of symbols "A" or "*" + */ + public static Triple getCannedAccessControls ( String aclRequestString, String target, String ownerID ) + throws UnsupportedException + { + if ( aclRequestString.equalsIgnoreCase( "public-read" )) + // Owner gets FULL_CONTROL and the anonymous principal (the 'A' symbol here) is granted READ access. + return new Triple (PERMISSION_FULL, PERMISSION_READ,"A"); + else if (aclRequestString.equalsIgnoreCase( "public-read-write" )) + // Owner gets FULL_CONTROL and the anonymous principal (the 'A' symbol here) is granted READ and WRITE access + return new Triple (PERMISSION_FULL, (PERMISSION_READ | PERMISSION_WRITE),"A"); + else if (aclRequestString.equalsIgnoreCase( "authenticated-read" )) + // Owner gets FULL_CONTROL and ANY principal authenticated as a registered S3 user (the '*' symbol here) is granted READ access + return new Triple (PERMISSION_FULL, PERMISSION_READ,"*"); + else if (aclRequestString.equalsIgnoreCase( "private" )) + // This is termed the "private" or default ACL, "Owner gets FULL_CONTROL" + return new Triple (PERMISSION_FULL, PERMISSION_FULL,null); + else if (aclRequestString.equalsIgnoreCase( "bucket-owner-read" )) + { + // Object Owner gets FULL_CONTROL, Bucket Owner gets READ + // This is equivalent to private when used with PUT Bucket + if ( target.equalsIgnoreCase( "SBucket" )) + return new Triple (PERMISSION_FULL,PERMISSION_FULL ,null); + else + return new Triple (PERMISSION_FULL,PERMISSION_READ,ownerID); + } + else if (aclRequestString.equalsIgnoreCase( "bucket-owner-full-control" )) + { + // Object Owner gets FULL_CONTROL, Bucket Owner gets FULL_CONTROL + // This is equivalent to private when used with PUT Bucket + if ( target.equalsIgnoreCase( "SBucket" )) + return new Triple (PERMISSION_FULL, PERMISSION_FULL, null); + else + return new Triple (PERMISSION_FULL,PERMISSION_FULL, ownerID); + } + else throw new UnsupportedException( "Unknown Canned Access Policy: " + aclRequestString + " is not supported" ); + } + +} diff --git a/awsapi/src/com/cloud/bridge/model/SBucket.hbm.xml b/awsapi/src/com/cloud/bridge/model/SBucket.hbm.xml deleted file mode 100644 index 83f495d9ad9..00000000000 --- a/awsapi/src/com/cloud/bridge/model/SBucket.hbm.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/bridge/model/SBucket.java b/awsapi/src/com/cloud/bridge/model/SBucket.java index 720907fa529..7703ae72962 100644 --- a/awsapi/src/com/cloud/bridge/model/SBucket.java +++ b/awsapi/src/com/cloud/bridge/model/SBucket.java @@ -31,14 +31,13 @@ import java.util.Set; * VersioningStatus * For ORM see "com/cloud/bridge/model/SHost.hbm.xml" */ -public class SBucket implements Serializable { - private static final long serialVersionUID = 7430267766019671273L; - - public static final int VERSIONING_NULL = 0; +public interface SBucket { + + public static final int VERSIONING_NULL = 0; public static final int VERSIONING_ENABLED = 1; public static final int VERSIONING_SUSPENDED = 2; - private Long id; +/* private Long id; private String name; private String ownerCanonicalId; @@ -124,5 +123,5 @@ public class SBucket implements Serializable { @Override public int hashCode() { return getName().hashCode(); - } + }*/ } diff --git a/awsapi/src/com/cloud/bridge/model/SBucketVO.java b/awsapi/src/com/cloud/bridge/model/SBucketVO.java new file mode 100644 index 00000000000..ca47bf7b3ca --- /dev/null +++ b/awsapi/src/com/cloud/bridge/model/SBucketVO.java @@ -0,0 +1,169 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.model; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashSet; +import java.util.Set; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; + +/** + * Holds the relation + * Id, + * Name, + * OwnerCanonicalId, + * SHost, + * CreateTime, + * VersioningStatus + * For ORM see "com/cloud/bridge/model/SHost.hbm.xml" + */ + +@Entity +@Table(name="sbucket") +public class SBucketVO implements SBucket { + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") + private Long id; + + @Column(name="Name") + private String name; + + @Column(name="OwnerCanonicalID") + private String ownerCanonicalId; + + @Column(name="SHostID") + private long shostID; + + @Column(name="CreateTime") + @Temporal(value=TemporalType.TIMESTAMP) + private Date createTime; + + @Column(name="VersioningStatus") + private int versioningStatus; + + @Transient + private SHostVO shost; + + @Transient + private Set objectsInBucket = new HashSet(); + + public SBucketVO() { + versioningStatus = VERSIONING_NULL; + this.createTime = new Date(); + } + + + public SBucketVO(String bucketName, Date currentGMTTime, + String canonicalUserId, SHostVO first) { + this.versioningStatus = VERSIONING_NULL; + this.name = bucketName; + this.createTime = new Date(); + this.ownerCanonicalId = canonicalUserId; + this.shost = first; + this.shostID = shost.getId(); + } + + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getOwnerCanonicalId() { + return ownerCanonicalId; + } + + public void setOwnerCanonicalId(String ownerCanonicalId) { + this.ownerCanonicalId = ownerCanonicalId; + } + + public long getShostID() { + return shostID; + } + + public void setShostID(long shostID) { + this.shostID = shostID; + } + + public SHostVO getShost() { + return shost; + } + + public void setShost(SHostVO shost) { + this.shost = shost; + } + + public Date getCreateTime() { + return createTime; + } + + + public int getVersioningStatus() { + return versioningStatus; + } + + public void setVersioningStatus( int versioningStatus ) { + this.versioningStatus = versioningStatus; + } + + public Set getObjectsInBucket() { + return objectsInBucket; + } + + public void setObjectsInBucket(Set objectsInBucket) { + this.objectsInBucket = objectsInBucket; + } + + @Override + public boolean equals(Object other) { + if(this == other) + return true; + + if(!(other instanceof SBucketVO)) + return false; + + return getName().equals(((SBucketVO)other).getName()); + } + + @Override + public int hashCode() { + return getName().hashCode(); + } +} diff --git a/awsapi/src/com/cloud/bridge/model/SHost.hbm.xml b/awsapi/src/com/cloud/bridge/model/SHost.hbm.xml deleted file mode 100644 index 5308a0837fd..00000000000 --- a/awsapi/src/com/cloud/bridge/model/SHost.hbm.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/bridge/model/SHost.java b/awsapi/src/com/cloud/bridge/model/SHost.java index 758cbbf0930..4ed5b7e45c9 100644 --- a/awsapi/src/com/cloud/bridge/model/SHost.java +++ b/awsapi/src/com/cloud/bridge/model/SHost.java @@ -20,17 +20,19 @@ import java.io.Serializable; import java.util.HashSet; import java.util.Set; -public class SHost implements Serializable { - private static final long serialVersionUID = 213346565810468018L; +public interface SHost { public static final int STORAGE_HOST_TYPE_LOCAL = 0; public static final int STORAGE_HOST_TYPE_NFS = 1; - - private Long id; + public static enum StorageHostType { + STORAGE_HOST_TYPE_LOCAL, //0 + STORAGE_HOST_TYPE_NFS //1 + } +/* private Long id; private String host; private int hostType; - private MHost mhost; + private MHostVO mhost; private String exportRoot; private String userOnHost; private String userPassword; @@ -89,11 +91,11 @@ public class SHost implements Serializable { this.userPassword = userPassword; } - public MHost getMhost() { + public MHostVO getMhost() { return mhost; } - public void setMhost(MHost mhost) { + public void setMhost(MHostVO mhost) { this.mhost = mhost; } @@ -111,5 +113,5 @@ public class SHost implements Serializable { public void setMounts(Set mounts) { this.mounts = mounts; - } + }*/ } diff --git a/awsapi/src/com/cloud/bridge/model/SHostVO.java b/awsapi/src/com/cloud/bridge/model/SHostVO.java new file mode 100644 index 00000000000..f3d2a5801b6 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/model/SHostVO.java @@ -0,0 +1,152 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.model; + +import java.util.HashSet; +import java.util.Set; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Transient; + +@Entity +@Table(name="shost") +public class SHostVO implements SHost{ + private static final long serialVersionUID = 213346565810468018L; + + public static final int STORAGE_HOST_TYPE_LOCAL = 0; + public static final int STORAGE_HOST_TYPE_NFS = 1; + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") + private Long id; + + @Column(name="Host") + private String host; + + @Column(name="HostType") + private int hostType; + + @Column(name="MHostID") + private long mhostid; + + @Column(name="ExportRoot") + private String exportRoot; + + @Column(name="UserOnHost") + private String userOnHost; + + @Column(name="UserPassword") + private String userPassword; + + @Transient + private MHostVO mhost; + + @Transient + private Set buckets = new HashSet(); + + @Transient + private Set mounts = new HashSet(); + + public SHostVO() { + } + + public Long getId() { + return id; + } + + private void setId(Long id) { + this.id = id; + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public int getHostType() { + return hostType; + } + + public void setHostType(int hostType) { + this.hostType = hostType; + } + + public long getMhostid() { + return mhostid; + } + + public void setMhostid(long mhostid) { + this.mhostid = mhostid; + } + + public String getExportRoot() { + return exportRoot; + } + + public void setExportRoot(String exportRoot) { + this.exportRoot = exportRoot; + } + + public String getUserOnHost() { + return userOnHost; + } + + public void setUserOnHost(String userOnHost) { + this.userOnHost = userOnHost; + } + + public String getUserPassword() { + return userPassword; + } + + public void setUserPassword(String userPassword) { + this.userPassword = userPassword; + } + + public MHostVO getMhost() { + return mhost; + } + + public void setMhost(MHostVO mhost) { + this.mhost = mhost; + } + + public Set getBuckets() { + return buckets; + } + + public void setBuckets(Set buckets) { + this.buckets = buckets; + } + + public Set getMounts() { + return mounts; + } + + public void setMounts(Set mounts) { + this.mounts = mounts; + } +} diff --git a/awsapi/src/com/cloud/bridge/model/SMeta.hbm.xml b/awsapi/src/com/cloud/bridge/model/SMeta.hbm.xml deleted file mode 100644 index 0f3b12be7f7..00000000000 --- a/awsapi/src/com/cloud/bridge/model/SMeta.hbm.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/bridge/model/SMeta.java b/awsapi/src/com/cloud/bridge/model/SMetaVO.java similarity index 74% rename from awsapi/src/com/cloud/bridge/model/SMeta.java rename to awsapi/src/com/cloud/bridge/model/SMetaVO.java index 2c985710ae4..537310fc8f7 100644 --- a/awsapi/src/com/cloud/bridge/model/SMeta.java +++ b/awsapi/src/com/cloud/bridge/model/SMetaVO.java @@ -18,18 +18,36 @@ package com.cloud.bridge.model; import java.io.Serializable; -public class SMeta implements Serializable { +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name="meta") +public class SMetaVO implements Serializable { private static final long serialVersionUID = 7459503272337054283L; + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") private Long id; + + @Column(name="Target") private String target; + + @Column(name="TargetID") private long targetId; + @Column(name="Name") private String name; - private String value; - public SMeta() { - } + @Column(name="Value") + private String value; + + public SMetaVO() {} public Long getId() { return id; @@ -76,11 +94,11 @@ public class SMeta implements Serializable { if(this == other) return true; - if(!(other instanceof SMeta)) + if(!(other instanceof SMetaVO)) return false; - return getTarget().equals(((SMeta)other).getTarget()) && getTargetId() == ((SMeta)other).getTargetId() - && getName().equals(((SMeta)other).getName()); + return getTarget().equals(((SMetaVO)other).getTarget()) && getTargetId() == ((SMetaVO)other).getTargetId() + && getName().equals(((SMetaVO)other).getName()); } @Override diff --git a/awsapi/src/com/cloud/bridge/model/SObject.hbm.xml b/awsapi/src/com/cloud/bridge/model/SObject.hbm.xml deleted file mode 100644 index 3929bcddad7..00000000000 --- a/awsapi/src/com/cloud/bridge/model/SObject.hbm.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/bridge/model/SObjectItem.hbm.xml b/awsapi/src/com/cloud/bridge/model/SObjectItem.hbm.xml deleted file mode 100644 index 02297a2afff..00000000000 --- a/awsapi/src/com/cloud/bridge/model/SObjectItem.hbm.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/bridge/model/SObjectItem.java b/awsapi/src/com/cloud/bridge/model/SObjectItemVO.java similarity index 67% rename from awsapi/src/com/cloud/bridge/model/SObjectItem.java rename to awsapi/src/com/cloud/bridge/model/SObjectItemVO.java index bbff2679109..8d86103d90b 100644 --- a/awsapi/src/com/cloud/bridge/model/SObjectItem.java +++ b/awsapi/src/com/cloud/bridge/model/SObjectItemVO.java @@ -19,22 +19,56 @@ package com.cloud.bridge.model; import java.io.Serializable; import java.util.Date; -public class SObjectItem implements Serializable { - private static final long serialVersionUID = -7351173256185687851L; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; +@Entity +@Table(name="sobject_item") +public class SObjectItemVO { + private static final long serialVersionUID = -7351173256185687851L; + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") private Long id; - private SObject theObject; + @Column(name="SObjectID") + private long sObjectID; + + @Column(name="Version") private String version; + + @Column(name="MD5") private String md5; + + @Column(name="StoredPath") private String storedPath; + + @Column(name="StoredSize") private long storedSize; + @Column(name="CreateTime") + @Temporal(value=TemporalType.TIMESTAMP) private Date createTime; + + @Column(name="LastModifiedTime") + @Temporal(value=TemporalType.TIMESTAMP) private Date lastModifiedTime; + + @Column(name="LastAccessTime") + @Temporal(value=TemporalType.TIMESTAMP) private Date lastAccessTime; - public SObjectItem() { + @Transient + private SObjectVO theObject; + public SObjectItemVO() { } public Long getId() { @@ -45,14 +79,22 @@ public class SObjectItem implements Serializable { this.id = id; } - public SObject getTheObject() { + public SObjectVO getTheObject() { return theObject; } - public void setTheObject(SObject theObject) { + public void setTheObject(SObjectVO theObject) { this.theObject = theObject; } + public long getsObjectID() { + return sObjectID; + } + + public void setsObjectID(long sObjectID) { + this.sObjectID = sObjectID; + } + public String getVersion() { return version; } @@ -114,22 +156,22 @@ public class SObjectItem implements Serializable { if(this == other) return true; - if(!(other instanceof SObjectItem)) + if(!(other instanceof SObjectItemVO)) return false; if(version != null) { - if(!version.equals(((SObjectItem)other).getVersion())) + if(!version.equals(((SObjectItemVO)other).getVersion())) return false; } else { - if(((SObjectItem)other).getVersion() != null) + if(((SObjectItemVO)other).getVersion() != null) return false; } if(theObject.getId() != null) { - if(!theObject.getId().equals(((SObjectItem)other).getTheObject())) + if(!theObject.getId().equals(((SObjectItemVO)other).getTheObject())) return false; } else { - if(((SObjectItem)other).getTheObject() != null) + if(((SObjectItemVO)other).getTheObject() != null) return false; } return true; diff --git a/awsapi/src/com/cloud/bridge/model/SObject.java b/awsapi/src/com/cloud/bridge/model/SObjectVO.java similarity index 68% rename from awsapi/src/com/cloud/bridge/model/SObject.java rename to awsapi/src/com/cloud/bridge/model/SObjectVO.java index 1692b685295..02f576a8b73 100644 --- a/awsapi/src/com/cloud/bridge/model/SObject.java +++ b/awsapi/src/com/cloud/bridge/model/SObjectVO.java @@ -16,30 +16,58 @@ // under the License. package com.cloud.bridge.model; -import java.io.Serializable; import java.util.Date; import java.util.HashSet; import java.util.Iterator; import java.util.Set; -public class SObject implements Serializable { - private static final long serialVersionUID = 8566744941395660486L; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Transient; + +@Entity +@Table(name="sobject") +public class SObjectVO { + //private static final long serialVersionUID = 8566744941395660486L; + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") private Long id; + @Column(name="SBucketID") + private long bucketID; + + @Column(name="NameKey") private String nameKey; + + @Column(name="OwnerCanonicalID") private String ownerCanonicalId; + @Column(name="NextSequence") private int nextSequence; - private String deletionMark; // This must also a unique ID to give to the REST client + @Column(name="DeletionMark") + private String deletionMark; // This must also a unique ID to give to the REST client + + @Column(name="CreateTime") + @Temporal(value=TemporalType.TIMESTAMP) private Date createTime; + @Transient private SBucket bucket; - private Set items = new HashSet(); - - public SObject() { + @Transient + private Set items = new HashSet(); + + public SObjectVO() { deletionMark = null; } @@ -51,6 +79,14 @@ public class SObject implements Serializable { this.id = id; } + public long getBucketID() { + return bucketID; + } + + public void setBucketID(long bucketID) { + this.bucketID = bucketID; + } + public String getNameKey() { return nameKey; } @@ -99,20 +135,20 @@ public class SObject implements Serializable { this.bucket = bucket; } - public Set getItems() { + public Set getItems() { return items; } - public void setItems(Set items) { + public void setItems(Set items) { this.items = items; } public void deleteItem( long id ) { - Iterator it = getItems().iterator(); + Iterator it = getItems().iterator(); while( it.hasNext()) { - SObjectItem oneItem = it.next(); + SObjectItemVO oneItem = it.next(); if (id == oneItem.getId()) { boolean bRemoved = items.remove( oneItem ); System.out.println( "deleteItem from sobject: " + bRemoved ); @@ -121,15 +157,15 @@ public class SObject implements Serializable { } } - public SObjectItem getLatestVersion( boolean versioningOff ) { - Iterator it = getItems().iterator(); + public SObjectItemVO getLatestVersion( boolean versioningOff ) { + Iterator it = getItems().iterator(); int maxVersion = 0; int curVersion = 0; - SObjectItem latestItem = null; + SObjectItemVO latestItem = null; while( it.hasNext()) { - SObjectItem item = it.next(); + SObjectItemVO item = it.next(); // If versioning is off then return the item with the null version string (if exists) // For example, the bucket could have allowed versioning and then it was suspended @@ -160,12 +196,12 @@ public class SObject implements Serializable { * @param wantVersion * @return */ - public SObjectItem getVersion( String wantVersion ) + public SObjectItemVO getVersion( String wantVersion ) { - Iterator it = getItems().iterator(); + Iterator it = getItems().iterator(); while( it.hasNext()) { - SObjectItem item = it.next(); + SObjectItemVO item = it.next(); String curVersion = item.getVersion(); if (null != curVersion && wantVersion.equalsIgnoreCase( curVersion )) return item; } @@ -177,17 +213,17 @@ public class SObject implements Serializable { if(this == other) return true; - if(!(other instanceof SObject)) + if(!(other instanceof SObjectVO)) return false; - if(!getNameKey().equals(((SObject)other).getNameKey())) + if(!getNameKey().equals(((SObjectVO)other).getNameKey())) return false; if(getBucket() != null) { - if(!getBucket().equals(((SObject)other).getBucket())) + if(!getBucket().equals(((SObjectVO)other).getBucket())) return false; } else { - if(((SObject)other).getBucket() != null) + if(((SObjectVO)other).getBucket() != null) return false; } diff --git a/awsapi/src/com/cloud/bridge/model/UserCredentials.hbm.xml b/awsapi/src/com/cloud/bridge/model/UserCredentials.hbm.xml deleted file mode 100644 index d2f39190556..00000000000 --- a/awsapi/src/com/cloud/bridge/model/UserCredentials.hbm.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/bridge/model/UserCredentials.java b/awsapi/src/com/cloud/bridge/model/UserCredentialsVO.java similarity index 72% rename from awsapi/src/com/cloud/bridge/model/UserCredentials.java rename to awsapi/src/com/cloud/bridge/model/UserCredentialsVO.java index b674f40c191..dae5fd91fbc 100644 --- a/awsapi/src/com/cloud/bridge/model/UserCredentials.java +++ b/awsapi/src/com/cloud/bridge/model/UserCredentialsVO.java @@ -18,17 +18,39 @@ package com.cloud.bridge.model; import java.io.Serializable; -public class UserCredentials implements Serializable { +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + +@Entity +@Table(name="usercredentials") +public class UserCredentialsVO{ private static final long serialVersionUID = 7459503272337054299L; + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="ID") private Long id; + + @Column(name="AccessKey") private String accessKey; + + @Column(name="SecretKey") private String secretKey; + + @Column(name="CertUniqueId") private String certUniqueId; - public UserCredentials() { - } + public UserCredentialsVO() { } + public UserCredentialsVO(String accessKey, String secretKey) { + this.accessKey = accessKey; + this.secretKey = secretKey; + } + public Long getId() { return id; } @@ -65,14 +87,14 @@ public class UserCredentials implements Serializable { public boolean equals(Object other) { if (this == other) return true; - if (!(other instanceof UserCredentials)) return false; + if (!(other instanceof UserCredentialsVO)) return false; // The cert id can be null. The cert is unused in the REST API. - if ( getAccessKey().equals(((UserCredentials)other).getAccessKey()) && - getSecretKey().equals(((UserCredentials)other).getSecretKey())) + if ( getAccessKey().equals(((UserCredentialsVO)other).getAccessKey()) && + getSecretKey().equals(((UserCredentialsVO)other).getSecretKey())) { String thisCertId = getCertUniqueId(); - String otherCertId = ((UserCredentials)other).getCertUniqueId(); + String otherCertId = ((UserCredentialsVO)other).getCertUniqueId(); if (null == thisCertId && null == otherCertId) return true; diff --git a/awsapi/src/com/cloud/bridge/persist/EntityDao.java b/awsapi/src/com/cloud/bridge/persist/EntityDao.java deleted file mode 100644 index cc4a8c7d818..00000000000 --- a/awsapi/src/com/cloud/bridge/persist/EntityDao.java +++ /dev/null @@ -1,118 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist; - -import java.io.Serializable; -import java.util.List; - -import org.hibernate.Query; -import org.hibernate.Session; - -import com.cloud.bridge.util.QueryHelper; - -/** - * Provide methods for getting, saving, deleting or updating state per session or, in a given session, returnin a List in - * response to queryEntities for a particular instantation of the EntityDao generic class, as defined here. - * Any instantation of EntityDao passes in the class for which it is instantiating. For example a new instance of SBucketDao - * passes in com.cloud.bridge.model.SBucket as its clazz. - * Instantiators, providing an Entity definition, are the classes - * MHostDao, - * MHostMountDao, - * SAclDao, - * SBucketDao, - * SHostDao, - * SMetaDao, - * SObjectDao, - * SObjectItemDao, - * CloudStackSvcOfferingDao - */ - -public class EntityDao { - private Class clazz; - - private boolean isCloudStackSession = false; - - // Constructor to implement CloudStackSvcOffering: see class CloudStackSvcOfferingDao - public EntityDao(Class clazz){ - this(clazz, false); - } - - public EntityDao(Class clazz, boolean isCloudStackSession) { - this.clazz = clazz; - this.isCloudStackSession = isCloudStackSession; - // Note : beginTransaction can be called multiple times - // "If a new underlying transaction is required, begin the transaction. Otherwise continue the new work in the - // context of the existing underlying transaction." from the Hibernate spec - PersistContext.beginTransaction(isCloudStackSession); - } - - @SuppressWarnings("unchecked") - public T get(Serializable id) { - Session session = PersistContext.getSession(isCloudStackSession); - return (T)session.get(clazz, id); - } - - public T save(T entity) { - Session session = PersistContext.getSession(isCloudStackSession); - session.saveOrUpdate(entity); - return entity; - } - - public T update(T entity) { - Session session = PersistContext.getSession(isCloudStackSession); - session.saveOrUpdate(entity); - return entity; - } - - public void delete(T entity) { - Session session = PersistContext.getSession(isCloudStackSession); - session.delete(entity); - } - - public T queryEntity(String hql, Object[] params) { - Session session = PersistContext.getSession(isCloudStackSession); - Query query = session.createQuery(hql); - query.setMaxResults(1); - QueryHelper.bindParameters(query, params); - return (T)query.uniqueResult(); - } - - public List queryEntities(String hql, Object[] params) { - Session session = PersistContext.getSession(isCloudStackSession); - Query query = session.createQuery(hql); - QueryHelper.bindParameters(query, params); - - return (List)query.list(); - } - - public List queryEntities(String hql, int offset, int limit, Object[] params) { - Session session = PersistContext.getSession(isCloudStackSession); - Query query = session.createQuery(hql); - QueryHelper.bindParameters(query, params); - query.setFirstResult(offset); - query.setMaxResults(limit); - return (List)query.list(); - } - - public int executeUpdate(String hql, Object[] params) { - Session session = PersistContext.getSession(isCloudStackSession); - Query query = session.createQuery(hql); - QueryHelper.bindParameters(query, params); - - return query.executeUpdate(); - } -} diff --git a/awsapi/src/com/cloud/bridge/persist/GMTDateTimeUserType.java b/awsapi/src/com/cloud/bridge/persist/GMTDateTimeUserType.java deleted file mode 100644 index cf16233b680..00000000000 --- a/awsapi/src/com/cloud/bridge/persist/GMTDateTimeUserType.java +++ /dev/null @@ -1,102 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist; - -import java.io.Serializable; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Types; -import java.util.Date; - -import org.hibernate.HibernateException; -import org.hibernate.usertype.UserType; - -import com.cloud.bridge.util.DateHelper; - -/** - * GMTDateTimeUserType implements a Hibernate user type, it deals with GMT date/time conversion - * between Java Date/Calendar and MySQL DATE types - */ -public class GMTDateTimeUserType implements UserType { - - private static final int[] SQL_TYPES = { Types.VARBINARY }; - - public Class returnedClass() { return Date.class; } - - public boolean equals(Object x, Object y) { - if (x == y) - return true; - - if (x == null || y == null) - return false; - - return x.equals(y); - } - - public int hashCode(Object x) { - if(x != null) - return x.hashCode(); - - return 0; - } - - public Object deepCopy(Object value) { - if(value != null) - return ((Date)value).clone(); - return null; - } - - public boolean isMutable() { - return true; - } - - public Object nullSafeGet(ResultSet resultSet, String[] names, Object owner) - throws HibernateException, SQLException { - - String dateString = resultSet.getString(names[0]); - if(dateString != null) - return DateHelper.parseDateString(DateHelper.GMT_TIMEZONE, dateString); - return null; - } - - public void nullSafeSet(PreparedStatement statement, Object value, int index) - throws HibernateException, SQLException { - if (value == null) { - statement.setNull(index, Types.TIMESTAMP); - } else { - Date dt = (Date)value; - statement.setString(index, DateHelper.getDateDisplayString(DateHelper.GMT_TIMEZONE, dt)); - } - } - - public Object assemble(Serializable cached, Object owner) throws HibernateException { - return DateHelper.parseDateString(DateHelper.GMT_TIMEZONE, (String)cached); - } - - public Serializable disassemble(Object value) throws HibernateException { - return DateHelper.getDateDisplayString(DateHelper.GMT_TIMEZONE, (Date)value); - } - - public Object replace(Object original, Object target, Object owner) throws HibernateException { - return ((Date)original).clone(); - } - - public int[] sqlTypes() { - return SQL_TYPES; - } -} diff --git a/awsapi/src/com/cloud/bridge/persist/PersistContext.java b/awsapi/src/com/cloud/bridge/persist/PersistContext.java deleted file mode 100644 index 8e5e0de8884..00000000000 --- a/awsapi/src/com/cloud/bridge/persist/PersistContext.java +++ /dev/null @@ -1,359 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; - -import org.apache.log4j.Logger; -import org.hibernate.HibernateException; -import org.hibernate.Session; -import org.hibernate.Transaction; - -import com.cloud.bridge.util.CloudSessionFactory; -import com.cloud.bridge.util.CloudStackSessionFactory; -import com.cloud.bridge.util.OrderedPair; - -/** - * - * We use Per-thread based hibernate session and transaction pattern. Transaction will be - * started implicitly by EntityDao instances and be committed implicitly in the end of - * request-process cycle. All requests are guarded by a dynamic proxy. - * - * We will try to keep transaction management as implicit as we can, so that - * most of service layer implementation contains business-logic only, all business logic are - * built on top of domain object model, and all persistent layer handling lie within persist layer - * in Dao classes. - * - * PersistContext class also provides per-thread based registry service and global named-lock service - */ -public class PersistContext { - protected final static Logger logger = Logger.getLogger(PersistContext.class); - - private static final CloudSessionFactory sessionFactory; - - private static final ThreadLocal threadSession = new ThreadLocal(); - private static final ThreadLocal threadTransaction = new ThreadLocal(); - private static final ThreadLocal> threadStore = new ThreadLocal>(); - - private static final CloudStackSessionFactory cloudStackSessionFactory; - private static final ThreadLocal threadCloudStackSession = new ThreadLocal(); - private static final ThreadLocal threadCloudStackTransaction = new ThreadLocal(); - - static { - try { - sessionFactory = CloudSessionFactory.getInstance(); - cloudStackSessionFactory = CloudStackSessionFactory.getInstance(); - } catch(HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - throw new PersistException(e); - } - } - - public static Session getSession(boolean cloudStackSession) { - Session s = null; - try { - if(cloudStackSession){ - s = threadCloudStackSession.get(); - if(s == null) { - s = cloudStackSessionFactory.openSession(); - threadCloudStackSession.set(s); - } - }else{ - s = threadSession.get(); - if(s == null) { - s = sessionFactory.openSession(); - threadSession.set(s); - } - } - } catch(HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - throw new PersistException(e); - } - return s; - } - - public static Session getSession() { - return getSession(false); - } - - public static void closeSession() { - closeSession(false); - } - - public static void closeSession(boolean cloudStackSession) { - try { - if(cloudStackSession){ - Session s = (Session) threadCloudStackSession.get(); - threadCloudStackSession.set(null); - if (s != null && s.isOpen()) - s.close(); - }else{ - Session s = (Session) threadSession.get(); - threadSession.set(null); - - if (s != null && s.isOpen()) - s.close(); - } - }catch(HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - throw new PersistException(e); - } - } - - public static void beginTransaction(boolean cloudStackTxn) { - Transaction tx = null; - try { - if(cloudStackTxn){ - tx = threadCloudStackTransaction.get(); - }else{ - tx = threadTransaction.get(); - } - - if (tx == null) { - tx = getSession(cloudStackTxn).beginTransaction(); - if(cloudStackTxn){ - threadCloudStackTransaction.set(tx); - }else{ - threadTransaction.set(tx); - } - } - } catch(HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - throw new PersistException(e); - } - } - - public static void beginTransaction() { - beginTransaction(false); - } - - public static void commitTransaction(boolean cloudStackTxn) { - Transaction tx = null; - - if(cloudStackTxn){ - tx = threadCloudStackTransaction.get(); - }else{ - tx = threadTransaction.get(); - } - - try { - if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() ){ - tx.commit(); - } - if(cloudStackTxn){ - threadCloudStackTransaction.set(null); - }else{ - threadTransaction.set(null); - } - } catch (HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - - rollbackTransaction(cloudStackTxn); - throw new PersistException(e); - } - } - - public static void commitTransaction() { - commitTransaction(false); - } - - public static void rollbackTransaction(boolean cloudStackTxn) { - Transaction tx = null; - - if(cloudStackTxn){ - tx = (Transaction)threadCloudStackTransaction.get(); - threadCloudStackTransaction.set(null); - }else{ - tx = (Transaction)threadTransaction.get(); - threadTransaction.set(null); - } - try { - if ( tx != null && !tx.wasCommitted() && !tx.wasRolledBack() ) { - tx.rollback(); - } - } catch (HibernateException e) { - logger.error("Exception " + e.getMessage(), e); - throw new PersistException(e); - } finally { - closeSession(cloudStackTxn); - } - } - - public static void rollbackTransaction() { - rollbackTransaction(false); - } - - public static void flush() { - commitTransaction(); - beginTransaction(); - } - - /** - * acquireNamedLock/releaseNamedLock must be called in pairs and within the same thread - * they can not be called recursively neither - * - * @param name - * @param timeoutSeconds - * @return - */ - public static boolean acquireNamedLock(String name, int timeoutSeconds) { - Connection jdbcConnection = getJDBCConnection(name, true); - if(jdbcConnection == null) { - logger.warn("Unable to acquire named lock connection for named lock: " + name); - return false; - } - - PreparedStatement pstmt = null; - try { - pstmt = jdbcConnection.prepareStatement("SELECT COALESCE(GET_LOCK(?, ?),0)"); - - pstmt.setString(1, name); - pstmt.setInt(2, timeoutSeconds); - - ResultSet rs = pstmt.executeQuery(); - if (rs != null && rs.first()) { - if(rs.getInt(1) > 0) { - return true; - } else { - logger.error("GET_LOCK() timed out on lock : " + name); - } - } - } catch (SQLException e) { - logger.error("GET_LOCK() throws exception ", e); - } catch (Throwable e) { - logger.error("GET_LOCK() throws exception ", e); - } finally { - if (pstmt != null) { - try { - pstmt.close(); - } catch (SQLException e) { - logger.error("Unexpected exception " + e.getMessage(), e); - } - } - } - - releaseJDBCConnection(name); - return false; - } - - public static boolean releaseNamedLock(String name) { - Connection jdbcConnection = getJDBCConnection(name, false); - if(jdbcConnection == null) { - logger.error("Unable to acquire DB connection for global lock system"); - return false; - } - - PreparedStatement pstmt = null; - try { - pstmt = jdbcConnection.prepareStatement("SELECT COALESCE(RELEASE_LOCK(?), 0)"); - pstmt.setString(1, name); - ResultSet rs = pstmt.executeQuery(); - if(rs != null && rs.first()) - return rs.getInt(1) > 0; - logger.error("RELEASE_LOCK() returns unexpected result : " + rs.getInt(1)); - } catch (SQLException e) { - logger.error("RELEASE_LOCK() throws exception ", e); - } catch (Throwable e) { - logger.error("RELEASE_LOCK() throws exception ", e); - } finally { - releaseJDBCConnection(name); - } - return false; - } - - @SuppressWarnings("deprecation") - private static Connection getJDBCConnection(String name, boolean allocNew) { - String registryKey = "JDBC-Connection." + name; - OrderedPair info = (OrderedPair)getThreadStoreObject(registryKey); - if(info == null && allocNew) { - Session session = sessionFactory.openSession(); - Connection connection = session.connection(); - if(connection == null) { - session.close(); - return null; - } - - try { - connection.setAutoCommit(true); - } catch(SQLException e) { - logger.warn("Unexpected exception " + e.getMessage(), e); - try { - connection.close(); - session.close(); - } catch(Throwable ex) { - logger.warn("Unexpected exception " + e.getMessage(), e); - } - return null; - } - - registerThreadStoreObject(registryKey, new OrderedPair(session, connection)); - return connection; - } - - if(info != null) - return info.getSecond(); - - return null; - } - - private static void releaseJDBCConnection(String name) { - String registryKey = "JDBC-Connection." + name; - OrderedPair info = (OrderedPair)unregisterThreadStoreObject(registryKey); - if(info != null) { - try { - info.getSecond().close(); - info.getFirst().close(); - } catch(Throwable e) { - logger.warn("Unexpected exception " + e.getMessage(), e); - } - } - } - - public static void registerThreadStoreObject(String name, Object object) { - Map store = getThreadStore(); - store.put(name, object); - } - - public static Object getThreadStoreObject(String name) { - Map store = getThreadStore(); - return store.get(name); - } - - public static Object unregisterThreadStoreObject(String name) { - Map store = getThreadStore(); - if(store.containsKey(name)) { - Object value = store.get(name); - store.remove(name); - return value; - } - return null; - } - - private static Map getThreadStore() { - Map store = threadStore.get(); - if(store == null) { - store = new HashMap(); - threadStore.set(store); - } - return store; - } -} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDao.java b/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDao.java index dda0e2d7128..f23db439203 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDao.java @@ -1,159 +1,12 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Properties; +import com.cloud.bridge.model.BucketPolicyVO; +import com.cloud.utils.db.GenericDao; -import org.apache.log4j.Logger; +public interface BucketPolicyDao extends GenericDao { -import com.cloud.bridge.util.ConfigurationHelper; + void deletePolicy(String bucketName); -public class BucketPolicyDao { - public static final Logger logger = Logger.getLogger(BucketPolicyDao.class); + BucketPolicyVO getByName(String bucketName); - private Connection conn = null; - private String dbName = null; - private String dbUser = null; - private String dbPassword = null; - private String dbHost = null; - private String dbPort = null; - - public BucketPolicyDao() - { - File propertiesFile = ConfigurationHelper.findConfigurationFile("db.properties"); - Properties EC2Prop = null; - - if (null != propertiesFile) { - EC2Prop = new Properties(); - try { - EC2Prop.load( new FileInputStream( propertiesFile )); - } catch (FileNotFoundException e) { - logger.warn("Unable to open properties file: " + propertiesFile.getAbsolutePath(), e); - } catch (IOException e) { - logger.warn("Unable to read properties file: " + propertiesFile.getAbsolutePath(), e); - } - dbHost = EC2Prop.getProperty( "db.cloud.host" ); - dbName = EC2Prop.getProperty( "db.awsapi.name" ); - dbUser = EC2Prop.getProperty( "db.cloud.username" ); - dbPassword = EC2Prop.getProperty( "db.cloud.password" ); - dbPort = EC2Prop.getProperty( "db.cloud.port" ); - } - } - - public void addPolicy( String bucketName, String owner, String policy ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - - openConnection(); - try { - statement = conn.prepareStatement ( "INSERT INTO bucket_policies (BucketName, OwnerCanonicalID, Policy) VALUES (?,?,?)" ); - statement.setString( 1, bucketName ); - statement.setString( 2, owner ); - statement.setString( 3, policy ); - int count = statement.executeUpdate(); - statement.close(); - - } finally { - closeConnection(); - } - } - - /** - * Since a bucket policy can exist before its bucket we also need to keep the policy's owner - * so we can restrict who modifies it (because of the "s3:CreateBucket" action). - */ - public String getPolicyOwner( String bucketName ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - String owner = null; - - openConnection(); - try { - statement = conn.prepareStatement ( "SELECT OwnerCanonicalID FROM bucket_policies WHERE BucketName=?" ); - statement.setString( 1, bucketName ); - ResultSet rs = statement.executeQuery(); - if (rs.next()) owner = rs.getString( "OwnerCanonicalID" ); - statement.close(); - return owner; - - } finally { - closeConnection(); - } - } - - public String getPolicy( String bucketName ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - String policy = null; - - openConnection(); - try { - statement = conn.prepareStatement ( "SELECT Policy FROM bucket_policies WHERE BucketName=?" ); - statement.setString( 1, bucketName ); - ResultSet rs = statement.executeQuery(); - if (rs.next()) policy = rs.getString( "Policy" ); - statement.close(); - return policy; - - } finally { - closeConnection(); - } - } - - public void deletePolicy( String bucketName ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - - openConnection(); - try { - statement = conn.prepareStatement ( "DELETE FROM bucket_policies WHERE BucketName=?" ); - statement.setString( 1, bucketName ); - int count = statement.executeUpdate(); - statement.close(); - - } finally { - closeConnection(); - } - } - - private void openConnection() - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - if (null == conn) { - Class.forName( "com.mysql.jdbc.Driver" ).newInstance(); - conn = DriverManager.getConnection( "jdbc:mysql://" + dbHost + ":" + dbPort + "/" + dbName, dbUser, dbPassword ); - } - } - - private void closeConnection() throws SQLException { - if (null != conn) conn.close(); - conn = null; - } } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDaoImpl.java new file mode 100644 index 00000000000..41bf3117d0f --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/BucketPolicyDaoImpl.java @@ -0,0 +1,72 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; + + +import javax.ejb.Local; + +import org.apache.log4j.Logger; +import com.cloud.bridge.model.BucketPolicyVO; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={BucketPolicyDao.class}) +public class BucketPolicyDaoImpl extends GenericDaoBase implements BucketPolicyDao{ + public static final Logger logger = Logger.getLogger(BucketPolicyDaoImpl.class); + public BucketPolicyDaoImpl(){ } + + /** + * Since a bucket policy can exist before its bucket we also need to keep the policy's owner + * so we can restrict who modifies it (because of the "s3:CreateBucket" action). + */ + @Override + public BucketPolicyVO getByName( String bucketName ) { + SearchBuilder searchByBucket = createSearchBuilder(); + searchByBucket.and("BucketName", searchByBucket.entity().getBucketName(), SearchCriteria.Op.EQ); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = searchByBucket.create(); + sc.setParameters("BucketName", bucketName); + return findOneBy(sc); + + }finally { + txn.close(); + } + + } + + @Override + public void deletePolicy( String bucketName ) { + SearchBuilder deleteByBucket = createSearchBuilder(); + deleteByBucket.and("BucketName", deleteByBucket.entity().getBucketName(), SearchCriteria.Op.EQ); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = deleteByBucket.create(); + sc.setParameters("BucketName", bucketName); + remove(sc); + + }finally { + txn.close(); + } + + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java index 31a5be873e7..bf8c97a2db7 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDao.java @@ -1,35 +1,11 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import org.apache.log4j.Logger; +import com.cloud.bridge.model.CloudStackAccountVO; +import com.cloud.utils.db.GenericDao; -import com.cloud.bridge.persist.EntityDao; -import com.cloud.stack.models.CloudStackAccount; +public interface CloudStackAccountDao extends + GenericDao { + String getDefaultZoneId(String accountId); + -public class CloudStackAccountDao extends EntityDao { - public static final Logger logger = Logger.getLogger(CloudStackAccountDao.class); - - public CloudStackAccountDao() { - super(CloudStackAccount.class, true); - } - - public CloudStackAccount getdefaultZoneId( String id ) { - return queryEntity("from CloudStackAccount where id=?", new Object[] {id}); - } } - diff --git a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDaoImpl.java new file mode 100644 index 00000000000..be3cd778e40 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackAccountDaoImpl.java @@ -0,0 +1,39 @@ +package com.cloud.bridge.persist.dao; + +import javax.ejb.Local; + +import com.cloud.bridge.model.CloudStackAccountVO; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={CloudStackAccountDao.class}) +public class CloudStackAccountDaoImpl extends GenericDaoBase implements CloudStackAccountDao { + + @Override + public String getDefaultZoneId(String accountId) { + + SearchBuilder SearchByUUID = createSearchBuilder(); + Transaction txn = Transaction.open(Transaction.CLOUD_DB); + try { + txn.start(); + SearchByUUID.and("uuid", SearchByUUID.entity().getUuid(), + SearchCriteria.Op.EQ); + SearchByUUID.done(); + SearchCriteria sc = SearchByUUID.create(); + sc.setParameters("uuid", accountId); + CloudStackAccountVO account = findOneBy(sc); + if (null != account) + if(null != account.getDefaultZoneId()) + return Long.toString(account.getDefaultZoneId()); + return null; + } finally { + txn.commit(); + txn.close(); + } + + } + + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDao.java b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDao.java index ed16974dbf1..8c2c1850247 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDao.java @@ -1,42 +1,9 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import org.apache.log4j.Logger; - -import com.cloud.bridge.persist.EntityDao; -import com.cloud.stack.models.CloudStackConfiguration; - - -public class CloudStackConfigurationDao extends EntityDao { - public static final Logger logger = Logger.getLogger(CloudStackConfigurationDao.class); - - public CloudStackConfigurationDao() { - super(CloudStackConfiguration.class, true); - } - - - public String getConfigValue( String configName ){ - CloudStackConfiguration config = queryEntity("from CloudStackConfiguration where name=?", new Object[] {configName}); - if(config != null){ - return config.getValue(); - } - return null; - } +import com.cloud.bridge.model.CloudStackConfigurationVO; +import com.cloud.utils.db.GenericDao; +public interface CloudStackConfigurationDao extends GenericDao { + public String getConfigValue(String name); } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDaoImpl.java new file mode 100644 index 00000000000..1e7a70fdba2 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackConfigurationDaoImpl.java @@ -0,0 +1,45 @@ +package com.cloud.bridge.persist.dao; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import javax.ejb.Local; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.model.CloudStackConfigurationVO; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.db.DB; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + + +@Local(value={CloudStackConfigurationDao.class}) +public class CloudStackConfigurationDaoImpl extends GenericDaoBase implements CloudStackConfigurationDao { + private static final Logger s_logger = Logger.getLogger(CloudStackConfigurationDaoImpl.class); + + final SearchBuilder NameSearch= createSearchBuilder(); + + public CloudStackConfigurationDaoImpl() { } + + + @Override + @DB + public String getConfigValue(String name) { + NameSearch.and("name", NameSearch.entity().getName(), SearchCriteria.Op.EQ); + Transaction txn = Transaction.currentTxn(); + try { + txn.start(); + SearchCriteria sc = NameSearch.create(); + sc.setParameters("name", name); + return findOneBy(sc).getValue(); + }finally { + + } + } + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDao.java b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDao.java index 5013eac88d7..4b0c9e16a56 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDao.java @@ -1,42 +1,13 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import org.apache.log4j.Logger; +import com.cloud.bridge.model.CloudStackServiceOfferingVO; +import com.cloud.utils.db.GenericDao; -import com.cloud.bridge.persist.EntityDao; -import com.cloud.stack.models.CloudStackConfiguration; -import com.cloud.stack.models.CloudStackServiceOffering; +public interface CloudStackSvcOfferingDao extends GenericDao{ + public CloudStackServiceOfferingVO getSvcOfferingByName(String name); -public class CloudStackSvcOfferingDao extends EntityDao { - public static final Logger logger = Logger.getLogger(CloudStackSvcOfferingDao.class); + public CloudStackServiceOfferingVO getSvcOfferingById(String id); - public CloudStackSvcOfferingDao() { - super(CloudStackServiceOffering.class, true); - } - - - public CloudStackServiceOffering getSvcOfferingByName( String name ){ - return queryEntity("from CloudStackServiceOffering where name=?", new Object[] {name}); - } - - public CloudStackServiceOffering getSvcOfferingById( String id ){ - return queryEntity("from CloudStackServiceOffering where id=?", new Object[] {id}); - } } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDaoImpl.java new file mode 100644 index 00000000000..dca38912aa5 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/CloudStackSvcOfferingDaoImpl.java @@ -0,0 +1,75 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; + +import javax.ejb.Local; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.model.CloudStackServiceOfferingVO; +import com.cloud.bridge.model.SHostVO; +import com.cloud.stack.models.CloudStackConfiguration; +import com.cloud.stack.models.CloudStackServiceOffering; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={CloudStackSvcOfferingDao.class}) +public class CloudStackSvcOfferingDaoImpl extends GenericDaoBase implements CloudStackSvcOfferingDao { + public static final Logger logger = Logger.getLogger(CloudStackSvcOfferingDaoImpl.class); + + public CloudStackSvcOfferingDaoImpl() { } + + @Override + public CloudStackServiceOfferingVO getSvcOfferingByName( String name ){ + SearchBuilder searchByName = createSearchBuilder(); + searchByName.and("name", searchByName.entity().getName(), SearchCriteria.Op.EQ); + searchByName.done(); + Transaction txn = Transaction.open(Transaction.CLOUD_DB); + try { + txn.start(); + SearchCriteria sc = searchByName.create(); + sc.setParameters("name", name); + return findOneBy(sc); + + }finally { + txn.close(); + } + + + } + @Override + public CloudStackServiceOfferingVO getSvcOfferingById( String id ){ + SearchBuilder searchByID = createSearchBuilder(); + searchByID.and("id", searchByID.entity().getName(), SearchCriteria.Op.EQ); + searchByID.done(); + Transaction txn = Transaction.open(Transaction.CLOUD_DB); + try { + txn.start(); + SearchCriteria sc = searchByID.create(); + sc.setParameters("id", id); + return findOneBy(sc); + + }finally { + txn.close(); + } + + + } + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MHostDao.java b/awsapi/src/com/cloud/bridge/persist/dao/MHostDao.java index 72501311003..a4b65d757f2 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/MHostDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/MHostDao.java @@ -1,30 +1,12 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import com.cloud.bridge.model.MHost; -import com.cloud.bridge.persist.EntityDao; +import com.cloud.bridge.model.MHostVO; +import com.cloud.utils.db.GenericDao; + +public interface MHostDao extends GenericDao { + + MHostVO getByHostKey(String hostKey); + + public void updateHeartBeat(MHostVO mhost); -public class MHostDao extends EntityDao { - public MHostDao() { - super(MHost.class); - } - - public MHost getByHostKey(String hostKey) { - return queryEntity("from MHost where hostKey=?", new Object[] {hostKey}); - } } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MHostDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/MHostDaoImpl.java new file mode 100644 index 00000000000..aff6f810068 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/MHostDaoImpl.java @@ -0,0 +1,61 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; +import javax.ejb.Local; + +import com.cloud.bridge.model.MHostVO; +import com.cloud.utils.db.DB; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={MHostDao.class}) +public class MHostDaoImpl extends GenericDaoBase implements MHostDao{ + final SearchBuilder NameSearch= createSearchBuilder(); + + public MHostDaoImpl() { + } + + @DB + @Override + public MHostVO getByHostKey(String hostKey) { + NameSearch.and("MHostKey", NameSearch.entity().getHostKey(), SearchCriteria.Op.EQ); + Transaction txn = Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); + try { + txn.start(); + SearchCriteria sc = NameSearch.create(); + sc.setParameters("MHostKey", hostKey); + return findOneBy(sc); + + }finally { + txn.close(); + } + } + + @Override + public void updateHeartBeat(MHostVO mhost) { + Transaction txn = Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); + try { + txn.start(); + update(mhost.getId(), mhost); + txn.commit(); + }finally { + txn.close(); + } + } +} \ No newline at end of file diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDao.java b/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDao.java index efee98c3f65..7a02c4e884d 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDao.java @@ -1,30 +1,11 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import com.cloud.bridge.model.MHostMount; -import com.cloud.bridge.persist.EntityDao; +import com.cloud.bridge.model.MHostMountVO; +import com.cloud.utils.db.GenericDao; + +public interface MHostMountDao extends GenericDao { + + MHostMountVO getHostMount(long mHostId, long sHostId); + -public class MHostMountDao extends EntityDao { - public MHostMountDao() { - super(MHostMount.class); - } - - public MHostMount getHostMount(long mHostId, long sHostId) { - return queryEntity("from MHostMount where mhost=? and shost=?", new Object[] { mHostId, sHostId } ); - } } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDaoImpl.java new file mode 100644 index 00000000000..4450da844a7 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/MHostMountDaoImpl.java @@ -0,0 +1,48 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; + +import javax.ejb.Local; + +import com.cloud.bridge.model.MHostMountVO; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={MHostMountDao.class}) +public class MHostMountDaoImpl extends GenericDaoBase implements MHostMountDao { + final SearchBuilder SearchByMHostID = createSearchBuilder(); + public MHostMountDaoImpl() { + } + + @Override + public MHostMountVO getHostMount(long mHostId, long sHostId) { + SearchByMHostID.and("MHostID", SearchByMHostID.entity().getmHostID(), SearchCriteria.Op.EQ); + SearchByMHostID.and("SHostID", SearchByMHostID.entity().getsHostID(), SearchCriteria.Op.EQ); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = SearchByMHostID.create(); + sc.setParameters("MHostID", mHostId); + sc.setParameters("SHostID", sHostId); + return findOneBy(sc); + }finally { + txn.close(); + } + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MultiPartPartsDao.java b/awsapi/src/com/cloud/bridge/persist/dao/MultiPartPartsDao.java new file mode 100644 index 00000000000..399e820731d --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/MultiPartPartsDao.java @@ -0,0 +1,18 @@ +package com.cloud.bridge.persist.dao; + +import java.util.List; + +import com.cloud.bridge.model.MultiPartPartsVO; +import com.cloud.utils.db.GenericDao; + +public interface MultiPartPartsDao extends GenericDao { + + List getParts(int uploadId, int maxParts, int startAt); + + int getnumParts(int uploadId, int endMarker); + + MultiPartPartsVO findByUploadID(int uploadId, int partNumber); + + void updateParts(MultiPartPartsVO partVO, int uploadId, int partNumber); + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MultiPartPartsDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/MultiPartPartsDaoImpl.java new file mode 100644 index 00000000000..91e43984d4d --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/MultiPartPartsDaoImpl.java @@ -0,0 +1,101 @@ +package com.cloud.bridge.persist.dao; + +import java.util.List; + +import javax.ejb.Local; + +import com.cloud.bridge.model.MultiPartPartsVO; +import com.cloud.utils.db.Filter; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={MultiPartPartsDao.class}) +public class MultiPartPartsDaoImpl extends GenericDaoBase implements MultiPartPartsDao { + + @Override + public List getParts(int uploadId, int maxParts, int startAt ) { + + SearchBuilder ByUploadID = createSearchBuilder(); + ByUploadID.and("UploadID", ByUploadID.entity().getUploadid(), SearchCriteria.Op.EQ); + ByUploadID.and("partNumber", ByUploadID.entity().getPartNumber(), SearchCriteria.Op.GT); + ByUploadID.and("partNumber", ByUploadID.entity().getPartNumber(), SearchCriteria.Op.LT); + Filter filter = new Filter(MultiPartPartsVO.class, "partNumber", Boolean.TRUE, null, null); + + Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); + try { + txn.start(); + SearchCriteria sc = ByUploadID.create(); + sc.setParameters("UploadID", new Long(uploadId)); + sc.setParameters("partNumber", startAt); + sc.setParameters("partNumber", maxParts); + return listBy(sc, filter); + + } finally { + txn.close(); + } + } + + @Override + public int getnumParts( int uploadId, int endMarker ) { + SearchBuilder byUploadID = createSearchBuilder(); + byUploadID.and("UploadID", byUploadID.entity().getUploadid(), SearchCriteria.Op.EQ); + byUploadID.and("partNumber", byUploadID.entity().getPartNumber(), SearchCriteria.Op.GT); + Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); + try { + txn.start(); + SearchCriteria sc = byUploadID.create(); + sc.setParameters("UploadID", new Long(uploadId)); + sc.setParameters("partNumber", endMarker); + return listBy(sc).size(); + + } finally { + txn.close(); + } + + + } + + @Override + public MultiPartPartsVO findByUploadID(int uploadId, int partNumber) { + + SearchBuilder byUploadID = createSearchBuilder(); + byUploadID.and("UploadID", byUploadID.entity().getUploadid(), SearchCriteria.Op.EQ); + byUploadID.and("partNumber", byUploadID.entity().getPartNumber(), SearchCriteria.Op.EQ); + Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); + try { + txn.start(); + SearchCriteria sc = byUploadID.create(); + sc.setParameters("UploadID", new Long(uploadId)); + sc.setParameters("partNumber", partNumber); + return findOneBy(sc); + + } finally { + txn.close(); + } + + } + + @Override + public void updateParts(MultiPartPartsVO partVO, int uploadId, int partNumber) { + + SearchBuilder byUploadID = createSearchBuilder(); + byUploadID.and("UploadID", byUploadID.entity().getUploadid(), SearchCriteria.Op.EQ); + byUploadID.and("partNumber", byUploadID.entity().getPartNumber(), SearchCriteria.Op.EQ); + Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); + try { + txn.start(); + SearchCriteria sc = byUploadID.create(); + sc.setParameters("UploadID", new Long(uploadId)); + sc.setParameters("partNumber", partNumber); + update(partVO, sc); + txn.commit(); + + } finally { + txn.close(); + } + } + +} + diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MultiPartUploadsDao.java b/awsapi/src/com/cloud/bridge/persist/dao/MultiPartUploadsDao.java new file mode 100644 index 00000000000..4c52958290b --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/MultiPartUploadsDao.java @@ -0,0 +1,21 @@ +package com.cloud.bridge.persist.dao; + +import java.util.List; + +import com.cloud.bridge.model.MultiPartUploadsVO; +import com.cloud.bridge.util.OrderedPair; +import com.cloud.utils.db.GenericDao; + +public interface MultiPartUploadsDao extends + GenericDao { + + OrderedPair multipartExits(int uploadId); + + void deleteUpload(int uploadId); + + String getAtrributeValue(String attribute, int uploadid); + + List getInitiatedUploads(String bucketName, + int maxParts, String prefix, String keyMarker, String uploadIdMarker); + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MultiPartUploadsDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/MultiPartUploadsDaoImpl.java new file mode 100644 index 00000000000..b6ad611b28a --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/MultiPartUploadsDaoImpl.java @@ -0,0 +1,108 @@ +package com.cloud.bridge.persist.dao; + +import java.util.ArrayList; +import java.util.List; + +import javax.ejb.Local; + +import com.cloud.bridge.model.MultiPartPartsVO; +import com.cloud.bridge.model.MultiPartUploadsVO; +import com.cloud.bridge.model.SBucketVO; +import com.cloud.bridge.util.OrderedPair; +import com.cloud.utils.db.Attribute; +import com.cloud.utils.db.Filter; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={MultiPartUploadsDao.class}) +public class MultiPartUploadsDaoImpl extends GenericDaoBase implements MultiPartUploadsDao { + + @Override + public OrderedPair multipartExits( int uploadId ) { + MultiPartUploadsVO uploadvo = null; + + Transaction txn = null; + try { + txn = Transaction.open(Transaction.AWSAPI_DB); + uploadvo = findById(new Long(uploadId)); + if (null != uploadvo) + return new OrderedPair(uploadvo.getAccessKey(), uploadvo.getNameKey()); + + return null; + } finally { + txn.close(); + } + } + + @Override + public void deleteUpload(int uploadId) { + + Transaction txn = null; + try { + txn = Transaction.open(Transaction.AWSAPI_DB); + remove(new Long(uploadId)); + txn.commit(); + }finally { + txn.close(); + } + } + + @Override + public String getAtrributeValue(String attribute, int uploadid) { + Transaction txn = null; + MultiPartUploadsVO uploadvo = null; + try { + txn = Transaction.open(Transaction.AWSAPI_DB); + uploadvo = findById(new Long(uploadid)); + if (null != uploadvo) { + if ( attribute.equalsIgnoreCase("AccessKey") ) + return uploadvo.getAccessKey(); + else if ( attribute.equalsIgnoreCase("x_amz_acl") ) + return uploadvo.getAmzAcl(); + } + return null; + } finally { + txn.close(); + } + } + + @Override + public List getInitiatedUploads(String bucketName, int maxParts, String prefix, String keyMarker, String uploadIdMarker) { + + List uploadList = new ArrayList(); + + SearchBuilder byBucket = createSearchBuilder(); + byBucket.and("BucketName", byBucket.entity().getBucketName() , SearchCriteria.Op.EQ); + + if (null != prefix) + byBucket.and("NameKey", byBucket.entity().getNameKey(), SearchCriteria.Op.LIKE); + if (null != uploadIdMarker) + byBucket.and("NameKey", byBucket.entity().getNameKey(), SearchCriteria.Op.GT); + if (null != uploadIdMarker) + byBucket.and("ID", byBucket.entity().getId(), SearchCriteria.Op.GT); + + Filter filter = new Filter(MultiPartUploadsVO.class, "nameKey", Boolean.TRUE, null, null); + filter.addOrderBy(MultiPartUploadsVO.class, "createTime", Boolean.TRUE); + + Transaction txn = Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); + try { + txn.start(); + SearchCriteria sc = byBucket.create(); + sc.setParameters("BucketName", bucketName); + if (null != prefix) + sc.setParameters("NameKey", prefix); + if (null != uploadIdMarker) + sc.setParameters("NameKey", keyMarker); + if (null != uploadIdMarker) + sc.setParameters("ID", uploadIdMarker); + listBy(sc, filter); + + }finally { + txn.close(); + } + return null; + } + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MultipartLoadDao.java b/awsapi/src/com/cloud/bridge/persist/dao/MultipartLoadDao.java index 0ab83ebcf69..c9b5ec75b5f 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/MultipartLoadDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/MultipartLoadDao.java @@ -34,42 +34,25 @@ import java.util.Properties; import org.apache.log4j.Logger; +import com.cloud.bridge.model.MultiPartPartsVO; +import com.cloud.bridge.model.MultiPartUploadsVO; +import com.cloud.bridge.model.MultipartMetaVO; import com.cloud.bridge.service.core.s3.S3MetaDataEntry; import com.cloud.bridge.service.core.s3.S3MultipartPart; import com.cloud.bridge.service.core.s3.S3MultipartUpload; import com.cloud.bridge.util.ConfigurationHelper; import com.cloud.bridge.util.OrderedPair; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.db.Transaction; public class MultipartLoadDao { public static final Logger logger = Logger.getLogger(MultipartLoadDao.class); - - private Connection conn = null; - private String dbName = null; - private String dbUser = null; - private String dbPassword = null; - private String dbHost = null; - private String dbPort = null; - public MultipartLoadDao() { - File propertiesFile = ConfigurationHelper.findConfigurationFile("db.properties"); - Properties EC2Prop = null; - - if (null != propertiesFile) { - EC2Prop = new Properties(); - try { - EC2Prop.load( new FileInputStream( propertiesFile )); - } catch (FileNotFoundException e) { - logger.warn("Unable to open properties file: " + propertiesFile.getAbsolutePath(), e); - } catch (IOException e) { - logger.warn("Unable to read properties file: " + propertiesFile.getAbsolutePath(), e); - } - dbHost = EC2Prop.getProperty( "db.cloud.host" ); - dbName = EC2Prop.getProperty( "db.awsapi.name" ); - dbUser = EC2Prop.getProperty( "db.cloud.username" ); - dbPassword = EC2Prop.getProperty( "db.cloud.password" ); - dbPort = EC2Prop.getProperty( "db.cloud.port" ); - } - } + protected final MultipartMetaDao mpartMetaDao = ComponentLocator.inject(MultipartMetaDaoImpl.class); + protected final MultiPartPartsDao mpartPartsDao = ComponentLocator.inject(MultiPartPartsDaoImpl.class); + protected final MultiPartUploadsDao mpartUploadDao = ComponentLocator.inject(MultiPartUploadsDaoImpl.class); + + public MultipartLoadDao() {} /** * If a multipart upload exists with the uploadId value then return the non-null creators @@ -77,30 +60,13 @@ public class MultipartLoadDao { * * @param uploadId * @return creator of the multipart upload, and NameKey of upload - * @throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException */ + + public OrderedPair multipartExits( int uploadId ) throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - PreparedStatement statement = null; - String accessKey = null; - String nameKey = null; - - openConnection(); - try { - statement = conn.prepareStatement ( "SELECT AccessKey, NameKey FROM multipart_uploads WHERE ID=?" ); - statement.setInt( 1, uploadId ); - ResultSet rs = statement.executeQuery(); - if ( rs.next()) { - accessKey = rs.getString( "AccessKey" ); - nameKey = rs.getString( "NameKey" ); - return new OrderedPair( accessKey, nameKey ); - } - else return null; - - } finally { - closeConnection(); - } + return mpartUploadDao.multipartExits(uploadId); } /** @@ -110,23 +76,9 @@ public class MultipartLoadDao { * * @param uploadId * - * @throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException */ - public void deleteUpload( int uploadId ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - - openConnection(); - try { - statement = conn.prepareStatement ( "DELETE FROM multipart_uploads WHERE ID=?" ); - statement.setInt( 1, uploadId ); - int count = statement.executeUpdate(); - statement.close(); - - } finally { - closeConnection(); - } + public void deleteUpload( int uploadId ) { + mpartUploadDao.deleteUpload(uploadId); } /** @@ -134,26 +86,9 @@ public class MultipartLoadDao { * * @param uploadId * @return the access key value defining the initiator - * @throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException */ - public String getInitiator( int uploadId ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - String initiator = null; - - openConnection(); - try { - statement = conn.prepareStatement ( "SELECT AccessKey FROM multipart_uploads WHERE ID=?" ); - statement.setInt( 1, uploadId ); - ResultSet rs = statement.executeQuery(); - if (rs.next()) initiator = rs.getString( "AccessKey" ); - statement.close(); - return initiator; - - } finally { - closeConnection(); - } + public String getInitiator( int uploadId ) { + return mpartUploadDao.getAtrributeValue("AccessKey", uploadId); } /** @@ -165,47 +100,38 @@ public class MultipartLoadDao { * @param cannedAccess * * @return if positive its the uploadId to be returned to the client - * - * @throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException + * */ - public int initiateUpload( String accessKey, String bucketName, String key, String cannedAccess, S3MetaDataEntry[] meta ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; + public int initiateUpload( String accessKey, String bucketName, String key, String cannedAccess, S3MetaDataEntry[] meta ) { int uploadId = -1; - - openConnection(); + Transaction txn = null; try { - Date tod = new Date(); - java.sql.Timestamp dateTime = new Timestamp( tod.getTime()); + txn = Transaction.open(Transaction.AWSAPI_DB); + Date tod = new Date(); + MultiPartUploadsVO uploadVO = new MultiPartUploadsVO(accessKey, + bucketName, key, cannedAccess, tod); + uploadVO = mpartUploadDao.persist(uploadVO); - statement = conn.prepareStatement ( "INSERT INTO multipart_uploads (AccessKey, BucketName, NameKey, x_amz_acl, CreateTime) VALUES (?,?,?,?,?)" ); - statement.setString( 1, accessKey ); - statement.setString( 2, bucketName ); - statement.setString( 3, key ); - statement.setString( 4, cannedAccess ); - statement.setTimestamp( 5, dateTime ); - int count = statement.executeUpdate(); - statement.close(); + if (null != uploadVO) { + uploadId = uploadVO.getId().intValue(); + if (null != meta) { + for (int i = 0; i < meta.length; i++) { + MultipartMetaVO mpartMeta = new MultipartMetaVO(); + mpartMeta.setUploadID(uploadId); + S3MetaDataEntry entry = meta[i]; + mpartMeta.setName(entry.getName()); + mpartMeta.setValue(entry.getValue()); + mpartMetaDao.persist(mpartMeta); + } + txn.commit(); + } + } - // -> we need the newly entered ID - statement = conn.prepareStatement ( "SELECT ID FROM multipart_uploads WHERE AccessKey=? AND BucketName=? AND NameKey=? AND CreateTime=?" ); - statement.setString( 1, accessKey ); - statement.setString( 2, bucketName ); - statement.setString( 3, key ); - statement.setTimestamp( 4, dateTime ); - ResultSet rs = statement.executeQuery(); - if (rs.next()) { - uploadId = rs.getInt( "ID" ); - saveMultipartMeta( uploadId, meta ); - } - statement.close(); return uploadId; - } finally { - closeConnection(); + txn.close(); } - } + } /** * Remember all the individual parts that make up the entire multipart upload so that once @@ -219,49 +145,28 @@ public class MultipartLoadDao { * @param size * @throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException */ - public void savePart( int uploadId, int partNumber, String md5, String storedPath, int size ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - int id = -1; - int count = 0; - - openConnection(); + public void savePart( int uploadId, int partNumber, String md5, String storedPath, int size ) { + try { - Date tod = new Date(); - java.sql.Timestamp dateTime = new java.sql.Timestamp( tod.getTime()); + MultiPartPartsVO partVO = null; - // -> are we doing an update or an insert? (are we over writting an existing entry?) - statement = conn.prepareStatement ( "SELECT ID FROM multipart_parts WHERE UploadID=? AND partNumber=?" ); - statement.setInt( 1, uploadId ); - statement.setInt( 2, partNumber ); - ResultSet rs = statement.executeQuery(); - if (rs.next()) id = rs.getInt( "ID" ); - statement.close(); + partVO = mpartPartsDao.findByUploadID(uploadId, partNumber); + // -> are we doing an update or an insert? (are we over writting an + // existing entry?) - if ( -1 == id ) - { - statement = conn.prepareStatement ( "INSERT INTO multipart_parts (UploadID, partNumber, MD5, StoredPath, StoredSize, CreateTime) VALUES (?,?,?,?,?,?)" ); - statement.setInt( 1, uploadId ); - statement.setInt( 2, partNumber ); - statement.setString( 3, md5 ); - statement.setString( 4, storedPath ); - statement.setInt( 5, size ); - statement.setTimestamp( 6, dateTime ); + if (null == partVO) { + MultiPartPartsVO part = new MultiPartPartsVO(uploadId, + partNumber, md5, storedPath, size, new Date()); + mpartPartsDao.persist(part); + } else { + partVO.setMd5(md5); + partVO.setStoredSize(new Long(size)); + partVO.setCreateTime(new Date()); + partVO.setUploadid(new Long(uploadId)); + partVO.setPartNumber(partNumber); + mpartPartsDao.updateParts(partVO, uploadId, partNumber); } - else - { statement = conn.prepareStatement ( "UPDATE multipart_parts SET MD5=?, StoredSize=?, CreateTime=? WHERE UploadId=? AND partNumber=?" ); - statement.setString( 1, md5 ); - statement.setInt( 2, size ); - statement.setTimestamp( 3, dateTime ); - statement.setInt( 4, uploadId ); - statement.setInt( 5, partNumber ); - } - count = statement.executeUpdate(); - statement.close(); - } finally { - closeConnection(); } } @@ -270,24 +175,8 @@ public class MultipartLoadDao { * @param uploadId * @return the value defined in the x-amz-acl header or null */ - public String getCannedAccess( int uploadId ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - String access = null; - - openConnection(); - try { - statement = conn.prepareStatement ( "SELECT x_amz_acl FROM multipart_uploads WHERE ID=?" ); - statement.setInt( 1, uploadId ); - ResultSet rs = statement.executeQuery(); - if (rs.next()) access = rs.getString( "x_amz_acl" ); - statement.close(); - return access; - - } finally { - closeConnection(); - } + public String getCannedAccess( int uploadId ) { + return mpartUploadDao.getAtrributeValue("x_amz_acl", uploadId); } /** @@ -302,31 +191,25 @@ public class MultipartLoadDao { throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { List metaList = new ArrayList(); - PreparedStatement statement = null; int count = 0; - - openConnection(); + List metaVO; try { - statement = conn.prepareStatement ( "SELECT Name, Value FROM multipart_meta WHERE UploadID=?" ); - statement.setInt( 1, uploadId ); - ResultSet rs = statement.executeQuery(); - - while (rs.next()) - { - S3MetaDataEntry oneMeta = new S3MetaDataEntry(); - oneMeta.setName( rs.getString( "Name" )); - oneMeta.setValue( rs.getString( "Value" )); - metaList.add( oneMeta ); - count++; - } - statement.close(); + + metaVO = mpartMetaDao.getByUploadID(uploadId); + for (MultipartMetaVO multipartMetaVO : metaVO) { + S3MetaDataEntry oneMeta = new S3MetaDataEntry(); + oneMeta.setName( multipartMetaVO.getName()); + oneMeta.setValue( multipartMetaVO.getValue()); + metaList.add( oneMeta ); + count++; + } if ( 0 == count ) - return null; + return null; else return metaList.toArray(new S3MetaDataEntry[0]); } finally { - closeConnection(); + } } @@ -346,52 +229,33 @@ public class MultipartLoadDao { throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { S3MultipartUpload[] inProgress = new S3MultipartUpload[maxParts]; - PreparedStatement statement = null; boolean isTruncated = false; int i = 0; int pos = 1; - + List uploadList; // -> SQL like condition requires the '%' as a wildcard marker if (null != prefix) prefix = prefix + "%"; - StringBuffer queryStr = new StringBuffer(); - queryStr.append( "SELECT ID, AccessKey, NameKey, CreateTime FROM multipart_uploads WHERE BucketName=? " ); - if (null != prefix ) queryStr.append( "AND NameKey like ? " ); - if (null != keyMarker ) queryStr.append( "AND NameKey > ? "); - if (null != uploadIdMarker) queryStr.append( "AND ID > ? " ); - queryStr.append( "ORDER BY NameKey, CreateTime" ); - - openConnection(); - try { - statement = conn.prepareStatement ( queryStr.toString()); - statement.setString( pos++, bucketName ); - if (null != prefix ) statement.setString( pos++, prefix ); - if (null != keyMarker ) statement.setString( pos++, keyMarker ); - if (null != uploadIdMarker) statement.setString( pos, uploadIdMarker ); - ResultSet rs = statement.executeQuery(); - - while (rs.next() && i < maxParts) - { - Calendar tod = Calendar.getInstance(); - tod.setTime( rs.getTimestamp( "CreateTime" )); - inProgress[i] = new S3MultipartUpload(); - inProgress[i].setId( rs.getInt( "ID" )); - inProgress[i].setAccessKey( rs.getString( "AccessKey" )); - inProgress[i].setLastModified( tod ); - inProgress[i].setBucketName( bucketName ); - inProgress[i].setKey( rs.getString( "NameKey" )); - i++; - } - - if (rs.next()) isTruncated = true; - statement.close(); - - if (i < maxParts) inProgress = (S3MultipartUpload[])resizeArray(inProgress,i); - return new OrderedPair(inProgress, isTruncated); - - } finally { - closeConnection(); + try { + uploadList = mpartUploadDao.getInitiatedUploads(bucketName, maxParts, prefix, keyMarker, uploadIdMarker); + for (MultiPartUploadsVO uploadsVO : uploadList) { + Calendar tod = Calendar.getInstance(); + tod.setTime(uploadsVO.getCreateTime()); + inProgress[i] = new S3MultipartUpload(); + inProgress[i].setId( uploadsVO.getId().intValue()); + inProgress[i].setAccessKey(uploadsVO.getAccessKey()); + inProgress[i].setLastModified( tod ); + inProgress[i].setBucketName( bucketName ); + inProgress[i].setKey(uploadsVO.getNameKey()); + i++; + } + + if (i < maxParts) + inProgress = (S3MultipartUpload[]) resizeArray(inProgress, i); + return new OrderedPair(inProgress, + isTruncated); + }finally { } } @@ -411,41 +275,30 @@ public class MultipartLoadDao { throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { S3MultipartPart[] parts = new S3MultipartPart[maxParts]; - PreparedStatement statement = null; int i = 0; - - openConnection(); - try { - statement = conn.prepareStatement ( "SELECT partNumber, MD5, StoredSize, StoredPath, CreateTime " + - "FROM multipart_parts " + - "WHERE UploadID=? " + - "AND partNumber > ? AND partNumber < ? " + - "ORDER BY partNumber" ); - statement.setInt( 1, uploadId ); - statement.setInt( 2, startAt ); - statement.setInt( 3, startAt + maxParts + 1 ); - ResultSet rs = statement.executeQuery(); - - while (rs.next() && i < maxParts) - { - Calendar tod = Calendar.getInstance(); - tod.setTime( rs.getTimestamp( "CreateTime" )); - - parts[i] = new S3MultipartPart(); - parts[i].setPartNumber( rs.getInt( "partNumber" )); - parts[i].setEtag( rs.getString( "MD5" ).toLowerCase()); - parts[i].setLastModified( tod ); - parts[i].setSize( rs.getInt( "StoredSize" )); - parts[i].setPath( rs.getString( "StoredPath" )); - i++; - } - statement.close(); - + List partsVO; + try { + + partsVO = mpartPartsDao.getParts(uploadId, startAt + maxParts + 1, startAt); + + for (MultiPartPartsVO partVO : partsVO) { + Calendar tod = Calendar.getInstance(); + tod.setTime(partVO.getCreateTime()); + + parts[i] = new S3MultipartPart(); + parts[i].setPartNumber(partVO.getPartNumber()); + parts[i].setEtag(partVO.getMd5()); + parts[i].setLastModified(tod); + parts[i].setSize(partVO.getStoredSize().intValue()); + parts[i].setPath(partVO.getStoredPath()); + i++; + } + if (i < maxParts) parts = (S3MultipartPart[])resizeArray(parts,i); return parts; } finally { - closeConnection(); + } } @@ -457,25 +310,8 @@ public class MultipartLoadDao { * @return number of parts with partNumber greater than endMarker * @throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException */ - public int numParts( int uploadId, int endMarker ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - int count = 0; - - openConnection(); - try { - statement = conn.prepareStatement ( "SELECT count(*) FROM multipart_parts WHERE UploadID=? AND partNumber > ?" ); - statement.setInt( 1, uploadId ); - statement.setInt( 2, endMarker ); - ResultSet rs = statement.executeQuery(); - if (rs.next()) count = rs.getInt( 1 ); - statement.close(); - return count; - - } finally { - closeConnection(); - } + public int numParts( int uploadId, int endMarker ) { + return mpartPartsDao.getnumParts(uploadId, endMarker); } /** @@ -485,46 +321,30 @@ public class MultipartLoadDao { * @param uploadId - defines an in-process multipart upload * @param meta - an array of meta data to be assocated with the uploadId value * - * @throws SQLException, ClassNotFoundException, IllegalAccessException, InstantiationException */ - private void saveMultipartMeta( int uploadId, S3MetaDataEntry[] meta ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - if (null == meta) return; - PreparedStatement statement = null; + private void saveMultipartMeta( int uploadId, S3MetaDataEntry[] meta ) { + if (null == meta) return; - openConnection(); + Transaction txn = null; try { + txn = Transaction.open(Transaction.AWSAPI_DB); for( int i=0; i < meta.length; i++ ) { S3MetaDataEntry entry = meta[i]; - statement = conn.prepareStatement ( "INSERT INTO multipart_meta (UploadID, Name, Value) VALUES (?,?,?)" ); - statement.setInt( 1, uploadId ); - statement.setString( 2, entry.getName()); - statement.setString( 3, entry.getValue()); - int count = statement.executeUpdate(); - statement.close(); + MultipartMetaVO metaVO = new MultipartMetaVO(); + metaVO.setUploadID(uploadId); + metaVO.setName(entry.getName()); + metaVO.setValue(entry.getValue()); + metaVO=mpartMetaDao.persist(metaVO); } - + txn.commit(); } finally { - closeConnection(); + txn.close(); } } - private void openConnection() - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - if (null == conn) { - Class.forName( "com.mysql.jdbc.Driver" ).newInstance(); - conn = DriverManager.getConnection( "jdbc:mysql://" + dbHost + ":" + dbPort + "/" + dbName, dbUser, dbPassword ); - } - } - private void closeConnection() throws SQLException { - if (null != conn) conn.close(); - conn = null; - } - - /** + /** * Reallocates an array with a new size, and copies the contents * of the old array to the new array. * diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MultipartMetaDao.java b/awsapi/src/com/cloud/bridge/persist/dao/MultipartMetaDao.java new file mode 100644 index 00000000000..449ce442dc6 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/MultipartMetaDao.java @@ -0,0 +1,12 @@ +package com.cloud.bridge.persist.dao; + +import java.util.List; + +import com.cloud.bridge.model.MultipartMetaVO; +import com.cloud.utils.db.GenericDao; + +public interface MultipartMetaDao extends GenericDao { + + List getByUploadID(long uploadID); + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/MultipartMetaDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/MultipartMetaDaoImpl.java new file mode 100644 index 00000000000..cfe56c0dc08 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/MultipartMetaDaoImpl.java @@ -0,0 +1,34 @@ +package com.cloud.bridge.persist.dao; + +import java.util.List; + +import javax.ejb.Local; + +import com.cloud.bridge.model.MultipartMetaVO; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={MultipartMetaDao.class}) +public class MultipartMetaDaoImpl extends GenericDaoBase implements MultipartMetaDao { + + @Override + public List getByUploadID (long uploadID) { + SearchBuilder searchByUID = createSearchBuilder(); + searchByUID.and("UploadID", searchByUID.entity().getUploadID(), SearchCriteria.Op.EQ); + searchByUID.done(); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = searchByUID.create(); + sc.setParameters("UploadID", uploadID); + return listBy(sc); + + }finally { + txn.close(); + } + + } +} + diff --git a/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java b/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java index 358ce3d797f..c46b015deb7 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/OfferingDao.java @@ -1,169 +1,18 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.util.Properties; +import com.cloud.bridge.model.OfferingBundleVO; +import com.cloud.utils.db.GenericDao; -import org.apache.log4j.Logger; +public interface OfferingDao extends GenericDao { -import com.cloud.bridge.util.ConfigurationHelper; + int getOfferingCount(); + String getCloudOffering(String amazonEC2Offering); -public class OfferingDao extends BaseDao { - public static final Logger logger = Logger.getLogger(OfferingDao.class); + String getAmazonOffering(String cloudStackOffering); - private Connection conn = null; - - public OfferingDao() - { - } - - public int getOfferingCount() - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - int result = 0; - - openConnection(); - try { - statement = conn.prepareStatement ( "SELECT count(*) FROM offering_bundle" ); - ResultSet rs = statement.executeQuery(); - if (rs.next()) result = rs.getInt(1); - statement.close(); - return result; - } finally { - closeConnection(); - } - } - - public String getCloudOffering( String amazonEC2Offering ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - String result = null; - - openConnection(); - try { - statement = conn.prepareStatement ( "SELECT CloudStackOffering FROM offering_bundle WHERE AmazonEC2Offering=?" ); - statement.setString( 1, amazonEC2Offering ); - ResultSet rs = statement.executeQuery(); - if (rs.next()) result = rs.getString( "CloudStackOffering" ); - statement.close(); - return result; - - } finally { - closeConnection(); - } - } - - public String getAmazonOffering( String cloudStackOffering ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - String result = null; - - openConnection(); - try { - statement = conn.prepareStatement ( "SELECT AmazonEC2Offering FROM offering_bundle WHERE CloudStackOffering=?" ); - statement.setString( 1, cloudStackOffering ); - ResultSet rs = statement.executeQuery(); - if (rs.next()) result = rs.getString( "AmazonEC2Offering" ); - statement.close(); - return result; - - } finally { - closeConnection(); - } - } - - public void setOfferMapping( String amazonEC2Offering, String cloudStackOffering ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - int id = -1; - int count = 0; + void setOfferMapping(String amazonEC2Offering, String cloudStackOffering); - openConnection(); - try { - // -> are we doing an update or an insert? (are we over writing an existing entry?) - statement = conn.prepareStatement ( "SELECT ID FROM offering_bundle WHERE AmazonEC2Offering=?" ); - statement.setString( 1, amazonEC2Offering ); - ResultSet rs = statement.executeQuery(); - if (rs.next()) id = rs.getInt( "ID" ); - statement.close(); + void deleteOfferMapping(String amazonEC2Offering); - if ( -1 == id ) - { - statement = conn.prepareStatement ( "INSERT INTO offering_bundle (AmazonEC2Offering, CloudStackOffering) VALUES (?,?)" ); - statement.setString( 1, amazonEC2Offering ); - statement.setString( 2, cloudStackOffering ); - } - else - { statement = conn.prepareStatement ( "UPDATE offering_bundle SET CloudStackOffering=? WHERE AmazonEC2Offering=?" ); - statement.setString( 1, cloudStackOffering ); - statement.setString( 2, amazonEC2Offering ); - } - count = statement.executeUpdate(); - statement.close(); - - } finally { - closeConnection(); - } - } - - public void deleteOfferMapping( String amazonEC2Offering ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - PreparedStatement statement = null; - - openConnection(); - try { - statement = conn.prepareStatement ( "DELETE FROM offering_bundle WHERE AmazonEC2Offering=?" ); - statement.setString( 1, amazonEC2Offering ); - int count = statement.executeUpdate(); - statement.close(); - - } finally { - closeConnection(); - } - } - - private void openConnection() - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException - { - if (null == conn) { - Class.forName( "com.mysql.jdbc.Driver" ).newInstance(); - conn = DriverManager.getConnection( "jdbc:mysql://" + dbHost + ":" + dbPort + "/" + awsapi_dbName, dbUser, dbPassword ); - } - } - - private void closeConnection() throws SQLException - { - if (null != conn) conn.close(); - conn = null; - } } - diff --git a/awsapi/src/com/cloud/bridge/persist/dao/OfferingDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/OfferingDaoImpl.java new file mode 100644 index 00000000000..5a9a6250665 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/OfferingDaoImpl.java @@ -0,0 +1,135 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; + + +import javax.ejb.Local; +import javax.persistence.Entity; +import javax.persistence.Table; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.model.OfferingBundleVO; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={OfferingDao.class}) +public class OfferingDaoImpl extends GenericDaoBase implements OfferingDao { + public static final Logger logger = Logger.getLogger(OfferingDaoImpl.class); + + public OfferingDaoImpl() {} + + @Override + public int getOfferingCount() { + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + return listAll().size(); + }finally { + txn.close(); + } + + } + + @Override + public String getCloudOffering( String amazonEC2Offering ) { + + SearchBuilder searchByAmazon = createSearchBuilder(); + searchByAmazon.and("AmazonEC2Offering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ); + searchByAmazon.done(); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = searchByAmazon.create(); + sc.setParameters("AmazonEC2Offering", amazonEC2Offering); + return findOneBy(sc).getCloudstackOffering(); + + } finally { + txn.close(); + } + } + + @Override + public String getAmazonOffering( String cloudStackOffering ) { + + SearchBuilder searchByAmazon = createSearchBuilder(); + searchByAmazon.and("CloudStackOffering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ); + searchByAmazon.done(); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = searchByAmazon.create(); + sc.setParameters("CloudStackOffering", cloudStackOffering); + return findOneBy(sc).getAmazonOffering(); + + } finally { + txn.close(); + } + } + + @Override + public void setOfferMapping( String amazonEC2Offering, String cloudStackOffering ) { + + SearchBuilder searchByAmazon = createSearchBuilder(); + searchByAmazon.and("CloudStackOffering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ); + searchByAmazon.and("AmazonEC2Offering", searchByAmazon.entity().getCloudstackOffering() , SearchCriteria.Op.EQ); + searchByAmazon.done(); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + OfferingBundleVO offering = null; + try { + txn.start(); + SearchCriteria sc = searchByAmazon.create(); + sc.setParameters("CloudStackOffering", cloudStackOffering); + sc.setParameters("AmazonEC2Offering", amazonEC2Offering); + offering = findOneBy(sc); + if (null == offering) { + offering = new OfferingBundleVO(); + } + offering.setAmazonOffering(amazonEC2Offering); + offering.setCloudstackOffering(cloudStackOffering); + if (null == offering) + offering = persist(offering); + else + update(offering.getID(), offering); + + txn.commit(); + } finally { + txn.close(); + } + + } + + @Override + public void deleteOfferMapping( String amazonEC2Offering ) { + SearchBuilder searchByAmazon = createSearchBuilder(); + searchByAmazon.and("AmazonEC2Offering", searchByAmazon.entity().getAmazonOffering() , SearchCriteria.Op.EQ); + searchByAmazon.done(); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = searchByAmazon.create(); + sc.setParameters("AmazonEC2Offering", amazonEC2Offering); + remove(sc); + txn.commit(); + } finally { + txn.close(); + } + } + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java index d62ae5b9304..5a5be6e856a 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SAclDao.java @@ -1,76 +1,21 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import java.util.Date; import java.util.List; import com.cloud.bridge.model.SAcl; -import com.cloud.bridge.persist.EntityDao; -import com.cloud.bridge.persist.PersistContext; +import com.cloud.bridge.model.SAclVO; import com.cloud.bridge.service.core.s3.S3AccessControlList; import com.cloud.bridge.service.core.s3.S3Grant; +import com.cloud.utils.db.GenericDao; -public class SAclDao extends EntityDao { - - public SAclDao() { - super(SAcl.class); - } - - public List listGrants(String target, long targetId) { - return queryEntities("from SAcl where target=? and targetId=? order by grantOrder asc", - new Object[] { target, new Long(targetId)}); - } +public interface SAclDao extends GenericDao { - public List listGrants(String target, long targetId, String userCanonicalId) { - return queryEntities("from SAcl where target=? and targetId=? and granteeCanonicalId=? order by grantOrder asc", - new Object[] { target, new Long(targetId), userCanonicalId }); - } + List listGrants(String target, long targetId, String userCanonicalId); + + void save(String target, long targetId, S3AccessControlList acl); + + SAcl save(String target, long targetId, S3Grant grant, int grantOrder); + + List listGrants(String target, long targetId); - public void save(String target, long targetId, S3AccessControlList acl) { - // -> the target's ACLs are being redefined - executeUpdate("delete from SAcl where target=? and targetId=?", new Object[] { target, new Long(targetId)}); - - if(acl != null) { - S3Grant[] grants = acl.getGrants(); - if(grants != null && grants.length > 0) { - int grantOrder = 1; - for(S3Grant grant : grants) { - save(target, targetId, grant, grantOrder++); - } - } - } - } - - public SAcl save(String target, long targetId, S3Grant grant, int grantOrder) { - SAcl aclEntry = new SAcl(); - aclEntry.setTarget(target); - aclEntry.setTargetId(targetId); - aclEntry.setGrantOrder(grantOrder); - - int grantee = grant.getGrantee(); - aclEntry.setGranteeType(grantee); - aclEntry.setPermission(grant.getPermission()); - aclEntry.setGranteeCanonicalId(grant.getCanonicalUserID()); - - Date ts = new Date(); - aclEntry.setCreateTime(ts); - aclEntry.setLastModifiedTime(ts); - PersistContext.getSession().save(aclEntry); - return aclEntry; - } } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SAclDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/SAclDaoImpl.java new file mode 100644 index 00000000000..c73c1db02b1 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/SAclDaoImpl.java @@ -0,0 +1,127 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; + +import java.util.Date; +import java.util.List; + +import javax.ejb.Local; + +import com.cloud.bridge.model.SAcl; +import com.cloud.bridge.model.SAclVO; +import com.cloud.bridge.service.core.s3.S3AccessControlList; +import com.cloud.bridge.service.core.s3.S3Grant; +import com.cloud.utils.db.Filter; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={SAclDao.class}) +public class SAclDaoImpl extends GenericDaoBase implements SAclDao { + + public SAclDaoImpl() {} + + @Override + public List listGrants(String target, long targetId) { + SearchBuilder SearchByTarget = createSearchBuilder(); + SearchByTarget.and("Target", SearchByTarget.entity().getTarget(), SearchCriteria.Op.EQ); + SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ); + SearchByTarget.done(); + Filter filter = new Filter(SAclVO.class, "grantOrder", Boolean.TRUE, null, null); + Transaction txn = Transaction.open( Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = SearchByTarget.create(); + sc.setParameters("Target", target); + sc.setParameters("TargetID", targetId); + return listBy(sc, filter); + + } finally { + txn.close(); + } + } + + @Override + public List listGrants(String target, long targetId, String userCanonicalId) { + SearchBuilder SearchByAcl = createSearchBuilder(); + SearchByAcl.and("Target", SearchByAcl.entity().getTarget(), SearchCriteria.Op.EQ); + SearchByAcl.and("TargetID", SearchByAcl.entity().getTargetId(), SearchCriteria.Op.EQ); + SearchByAcl.and("GranteeCanonicalID", SearchByAcl.entity().getGranteeCanonicalId(), SearchCriteria.Op.EQ); + Filter filter = new Filter(SAclVO.class, "grantOrder", Boolean.TRUE, null, null); + Transaction txn = Transaction.open( Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = SearchByAcl.create(); + sc.setParameters("Target", target); + sc.setParameters("TargetID", targetId); + sc.setParameters("GranteeCanonicalID", userCanonicalId); + return listBy(sc, filter); + } finally { + txn.close(); + } + } + + @Override + public void save(String target, long targetId, S3AccessControlList acl) { + SearchBuilder SearchByTarget = createSearchBuilder(); + SearchByTarget.and("Target", SearchByTarget.entity().getTarget(), SearchCriteria.Op.EQ); + SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ); + + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = SearchByTarget.create(); + sc.setParameters("Target", target); + sc.setParameters("TargetID", targetId); + this.remove(sc); + if(acl != null) { + S3Grant[] grants = acl.getGrants(); + if(grants != null && grants.length > 0) { + int grantOrder = 1; + for(S3Grant grant : grants) { + save(target, targetId, grant, grantOrder++); + } + } + } + txn.commit(); + } finally { + txn.close(); + } + + + } + + @Override + public SAcl save(String target, long targetId, S3Grant grant, int grantOrder) { + SAclVO aclEntry = new SAclVO(); + aclEntry.setTarget(target); + aclEntry.setTargetId(targetId); + aclEntry.setGrantOrder(grantOrder); + + int grantee = grant.getGrantee(); + aclEntry.setGranteeType(grantee); + aclEntry.setPermission(grant.getPermission()); + aclEntry.setGranteeCanonicalId(grant.getCanonicalUserID()); + + Date ts = new Date(); + aclEntry.setCreateTime(ts); + aclEntry.setLastModifiedTime(ts); + aclEntry = this.persist(aclEntry); + return aclEntry; + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SBucketDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SBucketDao.java index 833bf6a7271..0f4220019d1 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SBucketDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SBucketDao.java @@ -1,37 +1,14 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; import java.util.List; -import com.cloud.bridge.model.SBucket; -import com.cloud.bridge.persist.EntityDao; +import com.cloud.bridge.model.SBucketVO; +import com.cloud.utils.db.GenericDao; -public class SBucketDao extends EntityDao { - public SBucketDao() { - super(SBucket.class); - } +public interface SBucketDao extends GenericDao { + + SBucketVO getByName(String bucketName); + + List listBuckets(String canonicalId); - public SBucket getByName(String bucketName) { - return queryEntity("from SBucket where name=?", new Object[] {bucketName}); - } - - public List listBuckets(String canonicalId) { - return queryEntities("from SBucket where ownerCanonicalId=? order by createTime asc", - new Object[] {canonicalId}); - } } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SBucketDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/SBucketDaoImpl.java new file mode 100644 index 00000000000..53e9e07fb1d --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/SBucketDaoImpl.java @@ -0,0 +1,72 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; + +import java.util.List; + +import javax.ejb.Local; + +import com.cloud.bridge.model.SBucket; +import com.cloud.bridge.model.SBucketVO; +import com.cloud.utils.db.Filter; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={SBucketDao.class}) +public class SBucketDaoImpl extends GenericDaoBase implements SBucketDao { + + public SBucketDaoImpl() { + } + + @Override + public SBucketVO getByName(String bucketName) { + SearchBuilder SearchByName = createSearchBuilder(); + SearchByName.and("Name", SearchByName.entity().getName(), SearchCriteria.Op.EQ); + //Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + Transaction txn = Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); + try { + txn.start(); + SearchCriteria sc = SearchByName.create(); + sc.setParameters("Name", bucketName); + return findOneBy(sc); + + }finally { + txn.close(); + } + } + + @Override + public List listBuckets(String canonicalId) { + SearchBuilder ByCanonicalID = createSearchBuilder(); + ByCanonicalID.and("OwnerCanonicalID", ByCanonicalID.entity().getOwnerCanonicalId(), SearchCriteria.Op.EQ); + Filter filter = new Filter(SBucketVO.class, "createTime", Boolean.TRUE, null, null); + Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); + try { + txn.start(); + SearchCriteria sc = ByCanonicalID.create(); + sc.setParameters("OwnerCanonicalID", canonicalId); + return listBy(sc, filter); + }finally { + txn.close(); + } + + } + + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SHostDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SHostDao.java index 1108bcbb037..fc8865c90f5 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SHostDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SHostDao.java @@ -1,35 +1,12 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import com.cloud.bridge.model.SHost; -import com.cloud.bridge.persist.EntityDao; +import com.cloud.bridge.model.SHostVO; +import com.cloud.utils.db.GenericDao; + +public interface SHostDao extends GenericDao { + + SHostVO getByHost(String host); + + SHostVO getLocalStorageHost(long mhostId, String storageRoot); -public class SHostDao extends EntityDao { - public SHostDao() { - super(SHost.class); - } - - public SHost getByHost(String host) { - return queryEntity("from SHost where host=?", new Object[] { host }); - } - - public SHost getLocalStorageHost(long mhostId, String storageRoot) { - return queryEntity("from SHost where mhost=? and exportRoot=?", - new Object[] { new Long(mhostId), storageRoot}); - } } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SHostDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/SHostDaoImpl.java new file mode 100644 index 00000000000..efe9500d9b9 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/SHostDaoImpl.java @@ -0,0 +1,67 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; + +import javax.ejb.Local; + +import com.cloud.bridge.model.SHostVO; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={SHostDao.class}) +public class SHostDaoImpl extends GenericDaoBase implements SHostDao { + public SHostDaoImpl() {} + + @Override + public SHostVO getByHost(String host) { + SearchBuilder HostSearch = createSearchBuilder(); + HostSearch.and("Host", HostSearch.entity().getHost(), SearchCriteria.Op.EQ); + HostSearch.done(); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = HostSearch.create(); + sc.setParameters("Host", host); + return findOneBy(sc); + + }finally { + txn.close(); + } + + } + + @Override + public SHostVO getLocalStorageHost(long mhostId, String storageRoot) { + SearchBuilder LocalStorageHostSearch = createSearchBuilder(); + LocalStorageHostSearch.and("MHostID", LocalStorageHostSearch.entity().getMhostid(), SearchCriteria.Op.EQ); + LocalStorageHostSearch.and("ExportRoot", LocalStorageHostSearch.entity().getExportRoot(), SearchCriteria.Op.EQ); + LocalStorageHostSearch.done(); + Transaction txn = Transaction.currentTxn(); + try { + txn.start(); + SearchCriteria sc = LocalStorageHostSearch.create(); + sc.setParameters("MHostID", mhostId); + sc.setParameters("ExportRoot", storageRoot); + return findOneBy(sc); + + }finally { + txn.close(); + } + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SMetaDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SMetaDao.java index b781bbb6d4f..225138e6351 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SMetaDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SMetaDao.java @@ -1,55 +1,17 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; import java.util.List; -import com.cloud.bridge.model.SMeta; -import com.cloud.bridge.persist.EntityDao; -import com.cloud.bridge.persist.PersistContext; +import com.cloud.bridge.model.SMetaVO; import com.cloud.bridge.service.core.s3.S3MetaDataEntry; +import com.cloud.utils.db.GenericDao; -public class SMetaDao extends EntityDao { - public SMetaDao() { - super(SMeta.class); - } - - public List getByTarget(String target, long targetId) { - return queryEntities("from SMeta where target=? and targetId=?", new Object[] {target, targetId}); - } +public interface SMetaDao extends GenericDao { - public SMeta save(String target, long targetId, S3MetaDataEntry entry) { - SMeta meta = new SMeta(); - meta.setTarget(target); - meta.setTargetId(targetId); - meta.setName(entry.getName()); - meta.setValue(entry.getValue()); - - PersistContext.getSession().save(meta); - return meta; - } - - public void save(String target, long targetId, S3MetaDataEntry[] entries) { - // To redefine the target's metadaa - executeUpdate("delete from SMeta where target=? and targetId=?", new Object[] { target, new Long(targetId)}); + List getByTarget(String target, long targetId); + + SMetaVO save(String target, long targetId, S3MetaDataEntry entry); + + void save(String target, long targetId, S3MetaDataEntry[] entries); - if(entries != null) { - for(S3MetaDataEntry entry : entries) - save(target, targetId, entry); - } - } } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SMetaDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/SMetaDaoImpl.java new file mode 100644 index 00000000000..e0555ecd42f --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/SMetaDaoImpl.java @@ -0,0 +1,88 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; + +import java.util.List; + +import javax.ejb.Local; + +import com.cloud.bridge.model.SMetaVO; +import com.cloud.bridge.service.core.s3.S3MetaDataEntry; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={SMetaDao.class}) +public class SMetaDaoImpl extends GenericDaoBase implements SMetaDao { + + public SMetaDaoImpl() {} + + @Override + public List getByTarget(String target, long targetId) { + SearchBuilder SearchByTarget = createSearchBuilder(); + SearchByTarget.and("Target", SearchByTarget.entity().getTarget(), SearchCriteria.Op.EQ); + SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ); + SearchByTarget.done(); + Transaction txn = Transaction.open( Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = SearchByTarget.create(); + sc.setParameters("Target", target); + sc.setParameters("TargetID", targetId); + return listBy(sc); + } finally { + txn.close(); + } + + } + + @Override + public SMetaVO save(String target, long targetId, S3MetaDataEntry entry) { + SMetaVO meta = new SMetaVO(); + meta.setTarget(target); + meta.setTargetId(targetId); + meta.setName(entry.getName()); + meta.setValue(entry.getValue()); + meta = this.persist(meta); + return meta; + } + + @Override + public void save(String target, long targetId, S3MetaDataEntry[] entries) { + // To redefine the target's metadaa + SearchBuilder SearchByTarget = createSearchBuilder(); + SearchByTarget.and("Target", SearchByTarget.entity().getTarget(), SearchCriteria.Op.EQ); + SearchByTarget.and("TargetID", SearchByTarget.entity().getTargetId(), SearchCriteria.Op.EQ); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = SearchByTarget.create(); + sc.setParameters("Target", target); + sc.setParameters("TargetID", targetId); + this.remove(sc); + + if(entries != null) { + for(S3MetaDataEntry entry : entries) + save(target, targetId, entry); + } + txn.commit(); + }finally { + txn.close(); + } + } +} \ No newline at end of file diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SObjectDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SObjectDao.java index 3d87cbe5036..42fcd02260d 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SObjectDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SObjectDao.java @@ -1,76 +1,19 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import java.util.ArrayList; import java.util.List; -import com.cloud.bridge.model.SBucket; -import com.cloud.bridge.model.SObject; -import com.cloud.bridge.persist.EntityDao; -import com.cloud.bridge.util.EntityParam; +import com.cloud.bridge.model.SBucketVO; +import com.cloud.bridge.model.SObjectVO; +import com.cloud.utils.db.GenericDao; -public class SObjectDao extends EntityDao { - public SObjectDao() { - super(SObject.class); - } +public interface SObjectDao extends GenericDao { - public SObject getByNameKey(SBucket bucket, String nameKey) { - return queryEntity("from SObject where bucket=? and nameKey=?", - new Object[] { new EntityParam(bucket), nameKey }); - } - - public List listBucketObjects(SBucket bucket, String prefix, String marker, int maxKeys) { - StringBuffer sb = new StringBuffer(); - List params = new ArrayList(); + List listBucketObjects(SBucketVO bucket, String prefix, + String marker, int maxKeys); - sb.append("from SObject o left join fetch o.items where deletionMark is null and o.bucket=?"); - params.add(new EntityParam(bucket)); - - if(prefix != null && !prefix.isEmpty()) { - sb.append(" and o.nameKey like ?"); - params.add(new String(prefix + "%")); - } - - if(marker != null && !marker.isEmpty()) { - sb.append(" and o.nameKey > ?"); - params.add(marker); - } - - return queryEntities(sb.toString(), 0, maxKeys, params.toArray()); - } - - public List listAllBucketObjects(SBucket bucket, String prefix, String marker, int maxKeys) { - StringBuffer sb = new StringBuffer(); - List params = new ArrayList(); + List listAllBucketObjects(SBucketVO bucket, String prefix, + String marker, int maxKeys); + + SObjectVO getByNameKey(SBucketVO bucket, String nameKey); - sb.append("from SObject o left join fetch o.items where o.bucket=?"); - params.add(new EntityParam(bucket)); - - if(prefix != null && !prefix.isEmpty()) { - sb.append(" and o.nameKey like ?"); - params.add(new String(prefix + "%")); - } - - if(marker != null && !marker.isEmpty()) { - sb.append(" and o.nameKey > ?"); - params.add(marker); - } - - return queryEntities(sb.toString(), 0, maxKeys, params.toArray()); - } } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SObjectDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/SObjectDaoImpl.java new file mode 100644 index 00000000000..b588877f06c --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/SObjectDaoImpl.java @@ -0,0 +1,119 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import javax.ejb.Local; + +import com.cloud.bridge.model.SBucket; +import com.cloud.bridge.model.SBucketVO; +import com.cloud.bridge.model.SObjectItemVO; +import com.cloud.bridge.model.SObjectVO; +import com.cloud.bridge.util.EntityParam; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.db.Filter; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={SObjectDao.class}) +public class SObjectDaoImpl extends GenericDaoBase implements SObjectDao { + protected final SObjectItemDao itemDao = ComponentLocator.inject(SObjectItemDaoImpl.class); + + public SObjectDaoImpl() {} + + @Override + public SObjectVO getByNameKey(SBucketVO bucket, String nameKey) { + SObjectVO object = null; + SearchBuilder SearchByName = createSearchBuilder(); + SearchByName.and("SBucketID", SearchByName.entity().getBucketID() , SearchCriteria.Op.EQ); + SearchByName.and("NameKey", SearchByName.entity().getNameKey() , SearchCriteria.Op.EQ); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = SearchByName.create(); + sc.setParameters("SBucketID", bucket.getId()); + sc.setParameters("NameKey", nameKey); + object = findOneBy(sc); + if (null != object) { + Set items = new HashSet( + itemDao.getItems(object.getId())); + object.setItems(items); + } + return object; + + }finally { + txn.close(); + } + + } + + @Override + public List listBucketObjects(SBucketVO bucket, String prefix, String marker, int maxKeys) { + StringBuffer sb = new StringBuffer(); + List params = new ArrayList(); + SearchBuilder SearchByBucket = createSearchBuilder(); + List objects = new ArrayList(); + + SearchByBucket.and("SBucketID", SearchByBucket.entity().getBucketID(), SearchCriteria.Op.EQ); + SearchByBucket.and("DeletionMark", SearchByBucket.entity().getDeletionMark(), SearchCriteria.Op.NULL); + Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); + try { + txn.start(); + SearchCriteria sc = SearchByBucket.create(); + sc.setParameters("SBucketID", bucket.getId()); + objects = listBy(sc); + for (SObjectVO sObjectVO : objects) { + Set items = new HashSet(itemDao.getItems(sObjectVO.getId())); + sObjectVO.setItems(items); + } + return objects; + }finally { + txn.close(); + } + } + + @Override + public List listAllBucketObjects(SBucketVO bucket, String prefix, String marker, int maxKeys) { + StringBuffer sb = new StringBuffer(); + List params = new ArrayList(); + SearchBuilder getAllBuckets = createSearchBuilder(); + List objects = new ArrayList(); + getAllBuckets.and("SBucketID", getAllBuckets.entity().getBucketID(), SearchCriteria.Op.EQ); + + Transaction txn = Transaction.currentTxn(); // Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); + try { + txn.start(); + SearchCriteria sc = getAllBuckets.create(); + sc.setParameters("SBucketID", bucket.getId()); + objects = listBy(sc); + for (SObjectVO sObjectVO : objects) { + Set items = new HashSet(itemDao.getItems(sObjectVO.getId())); + sObjectVO.setItems(items); + } + return objects; + }finally { + txn.close(); + } + + } +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDao.java b/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDao.java index f91d180d0ac..2258309744d 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDao.java @@ -1,30 +1,14 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import com.cloud.bridge.model.SObjectItem; -import com.cloud.bridge.persist.EntityDao; +import java.util.List; + +import com.cloud.bridge.model.SObjectItemVO; +import com.cloud.utils.db.GenericDao; + +public interface SObjectItemDao extends GenericDao { + + SObjectItemVO getByObjectIdNullVersion(long id); + + List getItems(long sobjectID); -public class SObjectItemDao extends EntityDao { - public SObjectItemDao() { - super(SObjectItem.class); - } - - public SObjectItem getByObjectIdNullVersion(long id) { - return queryEntity("from SObjectItem where theObject=? and version is null", new Object[] { id }); - } } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDaoImpl.java new file mode 100644 index 00000000000..ec632bbd244 --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/SObjectItemDaoImpl.java @@ -0,0 +1,71 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; + +import java.util.List; + +import javax.ejb.Local; + +import com.cloud.bridge.model.SObjectItemVO; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={SObjectItemDao.class}) +public class SObjectItemDaoImpl extends GenericDaoBase implements SObjectItemDao { + + + public SObjectItemDaoImpl() { + } + + @Override + public SObjectItemVO getByObjectIdNullVersion(long id) { + + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + SearchBuilder SearchByID = createSearchBuilder(); + SearchByID.and("ID", SearchByID.entity().getId(), SearchCriteria.Op.EQ); + + try { + txn.start(); + SearchCriteria sc = SearchByID.create(); + sc.setParameters("ID", id); + return findOneBy(sc); + }finally { + txn.close(); + } + } + + @Override + public List getItems(long sobjectID) { + + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + SearchBuilder SearchBySobjectID = createSearchBuilder(); + SearchBySobjectID.and("SObjectID", SearchBySobjectID.entity().getId(), SearchCriteria.Op.EQ); + + try { + txn.start(); + SearchCriteria sc = SearchBySobjectID.create(); + sc.setParameters("SObjectID", sobjectID); + return listBy(sc); + //findOneIncludingRemovedBy(sc); + } finally { + txn.close(); + } + } + +} diff --git a/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDao.java b/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDao.java index 4beb7a3604f..c178bf8ef45 100644 --- a/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDao.java +++ b/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDao.java @@ -1,169 +1,12 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.persist.dao; -import java.sql.*; +import com.cloud.bridge.model.UserCredentialsVO; +import com.cloud.utils.db.GenericDao; -import org.apache.log4j.Logger; +public interface UserCredentialsDao extends GenericDao { -import com.cloud.bridge.model.UserCredentials; -import com.cloud.bridge.service.exception.NoSuchObjectException; + UserCredentialsVO getByAccessKey(String cloudAccessKey); + UserCredentialsVO getByCertUniqueId(String certId); -public class UserCredentialsDao extends BaseDao{ - public static final Logger logger = Logger.getLogger(UserCredentialsDao.class); - - private Connection conn = null; - - public UserCredentialsDao() { - } - - public void setUserKeys( String cloudAccessKey, String cloudSecretKey ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - UserCredentials user = getByAccessKey( cloudAccessKey ); - PreparedStatement statement = null; - - openConnection(); - try { - if ( null == user ) { - // -> do an insert since the user does not exist yet - statement = conn.prepareStatement ( "INSERT INTO usercredentials (AccessKey, SecretKey) VALUES(?,?)" ); - statement.setString( 1, cloudAccessKey ); - statement.setString( 2, cloudSecretKey ); - } - else { - // -> do an update since the user exists - statement = conn.prepareStatement ( "UPDATE usercredentials SET SecretKey=? WHERE AccessKey=?" ); - statement.setString( 1, cloudSecretKey ); - statement.setString( 2, cloudAccessKey ); - } - int count = statement.executeUpdate(); - statement.close(); - - } finally { - closeConnection(); - } - } - - public void setCertificateId( String cloudAccessKey, String certId ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - UserCredentials user = getByAccessKey( cloudAccessKey ); - PreparedStatement statement = null; - - if (null == user) throw new NoSuchObjectException( "Cloud API Access Key [" + cloudAccessKey + "] is unknown" ); - - openConnection(); - try { - statement = conn.prepareStatement ( "UPDATE usercredentials SET CertUniqueId=? WHERE AccessKey=?" ); - statement.setString( 1, certId ); - statement.setString( 2, cloudAccessKey ); - int count = statement.executeUpdate(); - statement.close(); - - } finally { - closeConnection(); - } - } - - public UserCredentials getByAccessKey( String cloudAccessKey ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - openConnection(); - - UserCredentials user = null; - - try { - PreparedStatement statement = conn.prepareStatement ( "SELECT SecretKey, CertUniqueId FROM usercredentials WHERE AccessKey=?" ); - statement.setString( 1, cloudAccessKey ); - statement.executeQuery(); - ResultSet rs = statement.getResultSet (); - if (rs.next()) { - user = new UserCredentials(); - user.setAccessKey( cloudAccessKey ); - user.setSecretKey( rs.getString( "SecretKey" )); - user.setCertUniqueId( rs.getString( "CertUniqueId" )); - } - - } finally { - closeConnection(); - } - return user; - } - - public UserCredentials getByCertUniqueId( String certId ) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - openConnection(); - - UserCredentials user = null; - - try { - PreparedStatement statement = conn.prepareStatement ( "SELECT AccessKey, SecretKey FROM usercredentials WHERE CertUniqueId=?" ); - statement.setString( 1, certId ); - statement.executeQuery(); - ResultSet rs = statement.getResultSet (); - if (rs.next()) { - user = new UserCredentials(); - user.setAccessKey( rs.getString( "AccessKey" )); - user.setSecretKey( rs.getString( "SecretKey" )); - user.setCertUniqueId( certId ); - } - - } finally { - closeConnection(); - } - return user; - } - - private void openConnection() - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - if (null == conn) { - Class.forName( "com.mysql.jdbc.Driver" ).newInstance(); - conn = DriverManager.getConnection( "jdbc:mysql://" + dbHost + "/" + awsapi_dbName, dbUser, dbPassword ); - } - } - - private void closeConnection() throws SQLException { - if (null != conn) conn.close(); - conn = null; - } - - public static void preCheckTableExistence() throws Exception{ - UserCredentialsDao dao = new UserCredentialsDao(); - dao.checkTableExistence(); - } - - private void checkTableExistence() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { - openConnection(); - - try { - PreparedStatement statement = conn.prepareStatement ( "SELECT * FROM usercredentials " ); - statement.executeQuery(); - ResultSet rs = statement.getResultSet (); - if (rs.next()) { - return; - } - return; - - } catch(Exception e) { - Statement statement = conn.createStatement(); - statement.execute( "create table usercredentials(id integer auto_increment primary key, AccessKey varchar(1000), SecretKey varchar(1000), CertUniqueId varchar(1000))" ); - statement.close(); - } - finally{ - closeConnection(); - } - } } diff --git a/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDaoImpl.java b/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDaoImpl.java new file mode 100644 index 00000000000..c19c757355b --- /dev/null +++ b/awsapi/src/com/cloud/bridge/persist/dao/UserCredentialsDaoImpl.java @@ -0,0 +1,73 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.bridge.persist.dao; + +import java.sql.*; + +import javax.ejb.Local; + +import org.apache.log4j.Logger; + +import com.cloud.bridge.model.UserCredentialsVO; +import com.cloud.utils.db.DB; +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.Transaction; + +@Local(value={UserCredentialsDao.class}) +public class UserCredentialsDaoImpl extends GenericDaoBase implements UserCredentialsDao { + public static final Logger logger = Logger.getLogger(UserCredentialsDaoImpl.class); + + public UserCredentialsDaoImpl() {} + + @DB + @Override + public UserCredentialsVO getByAccessKey( String cloudAccessKey ) { + SearchBuilder SearchByAccessKey = createSearchBuilder(); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchByAccessKey.and("AccessKey", SearchByAccessKey.entity() + .getAccessKey(), SearchCriteria.Op.EQ); + SearchByAccessKey.done(); + SearchCriteria sc = SearchByAccessKey.create(); + sc.setParameters("AccessKey", cloudAccessKey); + return findOneBy(sc); + }finally { + txn.commit(); + txn.close(); + } + } + + @Override + public UserCredentialsVO getByCertUniqueId( String certId ) { + SearchBuilder SearchByCertID = createSearchBuilder(); + SearchByCertID.and("CertUniqueId", SearchByCertID.entity().getCertUniqueId(), SearchCriteria.Op.EQ); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + SearchCriteria sc = SearchByCertID.create(); + sc.setParameters("CertUniqueId", certId); + return findOneBy(sc); + }finally { + txn.close(); + } + + } + +} diff --git a/awsapi/src/com/cloud/bridge/service/EC2MainServlet.java b/awsapi/src/com/cloud/bridge/service/EC2MainServlet.java index 0c904a134ac..dceb665d1f2 100644 --- a/awsapi/src/com/cloud/bridge/service/EC2MainServlet.java +++ b/awsapi/src/com/cloud/bridge/service/EC2MainServlet.java @@ -27,12 +27,18 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.log4j.Logger; -import com.cloud.bridge.persist.PersistContext; import com.cloud.bridge.persist.dao.CloudStackConfigurationDao; -import com.cloud.bridge.persist.dao.UserCredentialsDao; +import com.cloud.bridge.persist.dao.CloudStackConfigurationDaoImpl; import com.cloud.bridge.util.ConfigurationHelper; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.component.Inject; +import com.cloud.utils.db.DB; +import com.cloud.utils.db.Transaction; +import net.sf.ehcache.Cache; +@DB public class EC2MainServlet extends HttpServlet{ private static final long serialVersionUID = 2201599478145974479L; @@ -41,23 +47,23 @@ public class EC2MainServlet extends HttpServlet{ public static final String EC2_SOAP_SERVLET_PATH="/services/AmazonEC2/"; public static final String ENABLE_EC2_API="enable.ec2.api"; private static boolean isEC2APIEnabled = false; + public static final Logger logger = Logger.getLogger(EC2MainServlet.class); + CloudStackConfigurationDao csDao = ComponentLocator.inject(CloudStackConfigurationDaoImpl.class); /** * We build the path to where the keystore holding the WS-Security X509 certificates * are stored. */ + @DB public void init( ServletConfig config ) throws ServletException { try{ - ConfigurationHelper.preConfigureConfigPathFromServletContext(config.getServletContext()); - UserCredentialsDao.preCheckTableExistence(); + ConfigurationHelper.preConfigureConfigPathFromServletContext(config.getServletContext()); // check if API is enabled - CloudStackConfigurationDao csDao = new CloudStackConfigurationDao(); String value = csDao.getConfigValue(ENABLE_EC2_API); if(value != null){ isEC2APIEnabled = Boolean.valueOf(value); } - PersistContext.commitTransaction(true); - PersistContext.closeSession(true); + logger.info("Value of EC2 API Flag ::" + value); }catch(Exception e){ throw new ServletException("Error initializing awsapi: " + e.getMessage()); } diff --git a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java b/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java index ceaf59d4abd..4f748731504 100644 --- a/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java +++ b/awsapi/src/com/cloud/bridge/service/EC2RestServlet.java @@ -94,10 +94,9 @@ import com.amazon.ec2.RunInstancesResponse; import com.amazon.ec2.StartInstancesResponse; import com.amazon.ec2.StopInstancesResponse; import com.amazon.ec2.TerminateInstancesResponse; -import com.cloud.bridge.model.UserCredentials; -import com.cloud.bridge.persist.PersistContext; -import com.cloud.bridge.persist.dao.OfferingDao; -import com.cloud.bridge.persist.dao.UserCredentialsDao; +import com.cloud.bridge.model.UserCredentialsVO; +import com.cloud.bridge.persist.dao.OfferingDaoImpl; +import com.cloud.bridge.persist.dao.UserCredentialsDaoImpl; import com.cloud.bridge.service.controller.s3.ServiceProvider; import com.cloud.bridge.service.core.ec2.EC2AssociateAddress; import com.cloud.bridge.service.core.ec2.EC2AuthorizeRevokeSecurityGroup; @@ -140,11 +139,15 @@ import com.cloud.bridge.util.AuthenticationUtils; import com.cloud.bridge.util.ConfigurationHelper; import com.cloud.bridge.util.EC2RestAuth; import com.cloud.stack.models.CloudStackAccount; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.db.Transaction; public class EC2RestServlet extends HttpServlet { private static final long serialVersionUID = -6168996266762804888L; + protected final UserCredentialsDaoImpl ucDao = ComponentLocator.inject(UserCredentialsDaoImpl.class); + protected final OfferingDaoImpl ofDao = ComponentLocator.inject(OfferingDaoImpl.class); public static final Logger logger = Logger.getLogger(EC2RestServlet.class); @@ -278,8 +281,6 @@ public class EC2RestServlet extends HttpServlet { logger.error("Unsupported action " + action); throw new EC2ServiceException(ClientError.Unsupported, "This operation is not available"); } - PersistContext.commitTransaction(); - PersistContext.commitTransaction(true); } catch( EC2ServiceException e ) { response.setStatus(e.getErrorCode()); @@ -306,8 +307,6 @@ public class EC2RestServlet extends HttpServlet { } catch (IOException e) { logger.error("Unexpected exception " + e.getMessage(), e); } - PersistContext.closeSession(); - PersistContext.closeSession(true); } } @@ -343,7 +342,7 @@ public class EC2RestServlet extends HttpServlet { private void setUserKeys( HttpServletRequest request, HttpServletResponse response ) { String[] accessKey = null; String[] secretKey = null; - + Transaction txn = null; try { // -> all these parameters are required accessKey = request.getParameterValues( "accesskey" ); @@ -369,15 +368,20 @@ public class EC2RestServlet extends HttpServlet { UserContext context = UserContext.current(); try { + txn = Transaction.open(Transaction.AWSAPI_DB); // -> use the keys to see if the account actually exists ServiceProvider.getInstance().getEC2Engine().validateAccount( accessKey[0], secretKey[0] ); - UserCredentialsDao credentialDao = new UserCredentialsDao(); - credentialDao.setUserKeys( accessKey[0], secretKey[0] ); - +/* UserCredentialsDao credentialDao = new UserCredentialsDao(); + credentialDao.setUserKeys( ); +*/ UserCredentialsVO user = new UserCredentialsVO(accessKey[0], secretKey[0]); + ucDao.persist(user); + txn.commit(); + } catch( Exception e ) { logger.error("SetUserKeys " + e.getMessage(), e); response.setStatus(401); endResponse(response, e.toString()); + txn.close(); return; } response.setStatus(200); @@ -402,6 +406,7 @@ public class EC2RestServlet extends HttpServlet { */ private void setCertificate( HttpServletRequest request, HttpServletResponse response ) throws Exception { + Transaction txn = null; try { // [A] Pull the cert and cloud AccessKey from the request String[] certificate = request.getParameterValues( "cert" ); @@ -437,10 +442,16 @@ public class EC2RestServlet extends HttpServlet { // [C] Associate the cert's uniqueId with the Cloud API keys String uniqueId = AuthenticationUtils.X509CertUniqueId( userCert ); logger.debug( "SetCertificate, uniqueId: " + uniqueId ); - UserCredentialsDao credentialDao = new UserCredentialsDao(); - credentialDao.setCertificateId( accessKey[0], uniqueId ); - response.setStatus(200); +/* UserCredentialsDao credentialDao = new UserCredentialsDao(); + credentialDao.setCertificateId( accessKey[0], uniqueId ); +*/ + txn = Transaction.open(Transaction.AWSAPI_DB); + UserCredentialsVO user = ucDao.getByAccessKey(accessKey[0]); + user.setCertUniqueId(uniqueId); + ucDao.update(user.getId(), user); + response.setStatus(200); endResponse(response, "User certificate set successfully"); + txn.commit(); } catch( NoSuchObjectException e ) { logger.error("SetCertificate exception " + e.getMessage(), e); @@ -449,7 +460,10 @@ public class EC2RestServlet extends HttpServlet { } catch( Exception e ) { logger.error("SetCertificate exception " + e.getMessage(), e); response.sendError(500, "SetCertificate exception " + e.getMessage()); + } finally { + txn.close(); } + } /** @@ -464,7 +478,8 @@ public class EC2RestServlet extends HttpServlet { * algorithm. */ private void deleteCertificate( HttpServletRequest request, HttpServletResponse response ) - throws Exception { + throws Exception { + Transaction txn = null; try { String [] accessKey = request.getParameterValues( "AWSAccessKeyId" ); if ( null == accessKey || 0 == accessKey.length ) { @@ -483,10 +498,16 @@ public class EC2RestServlet extends HttpServlet { certStore.store( fsOut, keystorePassword.toCharArray()); // -> dis-associate the cert's uniqueId with the Cloud API keys - UserCredentialsDao credentialDao = new UserCredentialsDao(); - credentialDao.setCertificateId( accessKey[0], null ); +/* UserCredentialsDao credentialDao = new UserCredentialsDao(); + credentialDao.setCertificateId( accessKey[0], null ); + +*/ txn = Transaction.open(Transaction.AWSAPI_DB); + UserCredentialsVO user = ucDao.getByAccessKey(accessKey[0]); + user.setCertUniqueId(null); + ucDao.update(user.getId(), user); response.setStatus(200); - endResponse(response, "User certificate deleted successfully"); + endResponse(response, "User certificate deleted successfully"); + txn.commit(); } else response.setStatus(404); @@ -497,6 +518,8 @@ public class EC2RestServlet extends HttpServlet { } catch( Exception e ) { logger.error("DeleteCertificate exception " + e.getMessage(), e); response.sendError(500, "DeleteCertificate exception " + e.getMessage()); + } finally { + txn.close(); } } @@ -547,7 +570,7 @@ public class EC2RestServlet extends HttpServlet { } try { - OfferingDao ofDao = new OfferingDao(); + ofDao.setOfferMapping( amazonOffer, cloudOffer ); } catch( Exception e ) { @@ -596,9 +619,7 @@ public class EC2RestServlet extends HttpServlet { } try { - OfferingDao ofDao = new OfferingDao(); ofDao.deleteOfferMapping( amazonOffer ); - } catch( Exception e ) { logger.error("DeleteOfferMapping " + e.getMessage(), e); response.setStatus(401); @@ -1695,8 +1716,8 @@ public class EC2RestServlet extends HttpServlet { } // [B] Use the cloudAccessKey to get the users secret key in the db - UserCredentialsDao credentialDao = new UserCredentialsDao(); - UserCredentials cloudKeys = credentialDao.getByAccessKey( cloudAccessKey ); + UserCredentialsVO cloudKeys = ucDao.getByAccessKey( cloudAccessKey ); + if ( null == cloudKeys ) { logger.debug( cloudAccessKey + " is not defined in the EC2 service - call SetUserKeys" ); diff --git a/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java b/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java index 38f80c815fc..6ac8c97e666 100644 --- a/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java +++ b/awsapi/src/com/cloud/bridge/service/EC2SoapServiceImpl.java @@ -259,6 +259,10 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface { List resourceTypeList = new ArrayList(); if (items != null) { for( int i=0; i < items.length; i++ ) { + if (!items[i].getResourceId().contains(":") || items[i].getResourceId().split(":").length != 2) { + throw new EC2ServiceException( ClientError.InvalidResourceId_Format, + "Invalid Format. ResourceId format is resource-type:resource-uuid"); + } String resourceType = items[i].getResourceId().split(":")[0]; if (resourceTypeList.isEmpty()) resourceTypeList.add(resourceType); @@ -1374,7 +1378,7 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface { param7.setPrivateDnsName( "" ); param7.setDnsName( "" ); param7.setReason( "" ); - param7.setKeyName( "" ); + param7.setKeyName( inst.getKeyPairName()); param7.setAmiLaunchIndex( "" ); param7.setInstanceType( inst.getServiceOffering()); @@ -1696,7 +1700,7 @@ public class EC2SoapServiceImpl implements AmazonEC2SkeletonInterface { param7.setPrivateDnsName( "" ); param7.setDnsName( "" ); param7.setReason( "" ); - param7.setKeyName( "" ); + param7.setKeyName( inst.getKeyPairName()); param7.setAmiLaunchIndex( "" ); ProductCodesSetType param9 = new ProductCodesSetType(); diff --git a/awsapi/src/com/cloud/bridge/service/S3RestServlet.java b/awsapi/src/com/cloud/bridge/service/S3RestServlet.java index 282385b063e..c1458a7b4af 100644 --- a/awsapi/src/com/cloud/bridge/service/S3RestServlet.java +++ b/awsapi/src/com/cloud/bridge/service/S3RestServlet.java @@ -43,9 +43,12 @@ import org.w3c.dom.NodeList; import com.cloud.bridge.io.MultiPartDimeInputStream; import com.cloud.bridge.model.SAcl; -import com.cloud.bridge.persist.PersistContext; +import com.cloud.bridge.model.UserCredentialsVO; import com.cloud.bridge.persist.dao.CloudStackConfigurationDao; +import com.cloud.bridge.persist.dao.CloudStackConfigurationDaoImpl; import com.cloud.bridge.persist.dao.UserCredentialsDao; + +import com.cloud.bridge.persist.dao.UserCredentialsDaoImpl; import com.cloud.bridge.service.controller.s3.S3BucketAction; import com.cloud.bridge.service.controller.s3.S3ObjectAction; import com.cloud.bridge.service.controller.s3.ServiceProvider; @@ -57,26 +60,29 @@ import com.cloud.bridge.service.core.s3.S3Grant; import com.cloud.bridge.service.core.s3.S3MetaDataEntry; import com.cloud.bridge.service.core.s3.S3PutObjectRequest; import com.cloud.bridge.service.core.s3.S3PutObjectResponse; -import com.cloud.bridge.service.exception.InternalErrorException; import com.cloud.bridge.service.exception.InvalidBucketName; -import com.cloud.bridge.service.exception.NoSuchObjectException; import com.cloud.bridge.service.exception.PermissionDeniedException; -import com.cloud.bridge.util.AuthenticationUtils; import com.cloud.bridge.util.ConfigurationHelper; import com.cloud.bridge.util.HeaderParam; import com.cloud.bridge.util.RestAuth; import com.cloud.bridge.util.S3SoapAuth; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.db.DB; +import com.cloud.utils.db.Transaction; +import net.sf.ehcache.Cache; public class S3RestServlet extends HttpServlet { private static final long serialVersionUID = -6168996266762804877L; public static final String ENABLE_S3_API="enable.s3.api"; private static boolean isS3APIEnabled = false; public static final Logger logger = Logger.getLogger(S3RestServlet.class); + protected final CloudStackConfigurationDao csDao = ComponentLocator.inject(CloudStackConfigurationDaoImpl.class); + protected final UserCredentialsDao ucDao = ComponentLocator.inject(UserCredentialsDaoImpl.class); protected void doGet(HttpServletRequest req, HttpServletResponse resp) { processRequest( req, resp, "GET" ); - } + } protected void doPost(HttpServletRequest req, HttpServletResponse resp) { @@ -106,15 +112,13 @@ public class S3RestServlet extends HttpServlet { public void init( ServletConfig config ) throws ServletException { try{ ConfigurationHelper.preConfigureConfigPathFromServletContext(config.getServletContext()); - UserCredentialsDao.preCheckTableExistence(); // check if API is enabled - CloudStackConfigurationDao csDao = new CloudStackConfigurationDao(); String value = csDao.getConfigValue(ENABLE_S3_API); if(value != null) { isS3APIEnabled = Boolean.valueOf(value); } - PersistContext.commitTransaction(true); - PersistContext.closeSession(true); + logger.info("S3Engine :: Configuration value is : " + value); + }catch(Exception e){ throw new ServletException("Error initializing awsapi: " + e.getMessage()); } @@ -130,6 +134,7 @@ public class S3RestServlet extends HttpServlet { */ private void processRequest( HttpServletRequest request, HttpServletResponse response, String method ) { + Transaction txn = Transaction.open("cloudbridge", Transaction.AWSAPI_DB, true); try { logRequest(request); @@ -164,12 +169,13 @@ public class S3RestServlet extends HttpServlet { } + txn.start(); // -> authenticated calls if ( !((method.equalsIgnoreCase( "POST" ) && !(request.getQueryString().equalsIgnoreCase("delete"))) ) ){ S3AuthParams params = extractRequestHeaders( request ); authenticateRequest( request, params ); } - + ServletAction action = routeRequest(request); if ( action != null ) { action.execute(request, response); @@ -178,35 +184,30 @@ public class S3RestServlet extends HttpServlet { response.setStatus(404); endResponse(response, "File not found"); } - - PersistContext.commitTransaction(); - + txn.close(); } catch( InvalidBucketName e) { - PersistContext.rollbackTransaction(); logger.error("Unexpected exception " + e.getMessage(), e); response.setStatus(400); endResponse(response, "Invalid Bucket Name - " + e.toString()); } catch(PermissionDeniedException e) { - PersistContext.rollbackTransaction(); logger.error("Unexpected exception " + e.getMessage(), e); response.setStatus(403); endResponse(response, "Access denied - " + e.toString()); } catch(Throwable e) { - PersistContext.rollbackTransaction(); logger.error("Unexpected exception " + e.getMessage(), e); response.setStatus(404); endResponse(response, "Bad request"); } finally { + try { response.flushBuffer(); } catch (IOException e) { logger.error("Unexpected exception " + e.getMessage(), e); } - PersistContext.closeSession(); } } @@ -239,6 +240,7 @@ public class S3RestServlet extends HttpServlet { * * As with all REST calls HTTPS should be used to ensure their security. */ + @DB private void setUserKeys( HttpServletRequest request, HttpServletResponse response ) { String[] accessKey = null; String[] secretKey = null; @@ -266,8 +268,14 @@ public class S3RestServlet extends HttpServlet { try { // -> use the keys to see if the account actually exists //ServiceProvider.getInstance().getEC2Engine().validateAccount( accessKey[0], secretKey[0] ); - UserCredentialsDao credentialDao = new UserCredentialsDao(); - credentialDao.setUserKeys( accessKey[0], secretKey[0] ); + //UserCredentialsDaoImpl credentialDao = new UserCredentialsDao(); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + txn.start(); + UserCredentialsVO user = new UserCredentialsVO(accessKey[0], secretKey[0]); + user = ucDao.persist(user); + txn.commit(); + txn.close(); + //credentialDao.setUserKeys( accessKey[0], secretKey[0] ); } catch( Exception e ) { logger.error("SetUserKeys " + e.getMessage(), e); @@ -586,7 +594,6 @@ private S3ObjectAction routePlainPostRequest (HttpServletRequest request) xml.append( "" ); endResponse(response, xml.toString()); - PersistContext.commitTransaction(); return; } @@ -605,7 +612,6 @@ private S3ObjectAction routePlainPostRequest (HttpServletRequest request) xml.append( "" ); endResponse(response, xml.toString()); - PersistContext.commitTransaction(); } catch(PermissionDeniedException e) { logger.error("Unexpected exception " + e.getMessage(), e); @@ -618,7 +624,6 @@ private S3ObjectAction routePlainPostRequest (HttpServletRequest request) } finally { - PersistContext.closeSession(); } } diff --git a/awsapi/src/com/cloud/bridge/service/controller/s3/S3BucketAction.java b/awsapi/src/com/cloud/bridge/service/controller/s3/S3BucketAction.java index 0ea862d10b2..8f77916f750 100644 --- a/awsapi/src/com/cloud/bridge/service/controller/s3/S3BucketAction.java +++ b/awsapi/src/com/cloud/bridge/service/controller/s3/S3BucketAction.java @@ -49,14 +49,18 @@ import com.amazon.s3.GetBucketAccessControlPolicyResponse; import com.amazon.s3.ListAllMyBucketsResponse; import com.amazon.s3.ListBucketResponse; import com.cloud.bridge.io.MTOMAwareResultStreamWriter; +import com.cloud.bridge.model.BucketPolicyVO; import com.cloud.bridge.model.SAcl; +import com.cloud.bridge.model.SAclVO; import com.cloud.bridge.model.SBucket; +import com.cloud.bridge.model.SBucketVO; import com.cloud.bridge.model.SHost; -import com.cloud.bridge.persist.PersistContext; import com.cloud.bridge.persist.dao.BucketPolicyDao; +import com.cloud.bridge.persist.dao.BucketPolicyDaoImpl; import com.cloud.bridge.persist.dao.MultipartLoadDao; -import com.cloud.bridge.persist.dao.SAclDao; +import com.cloud.bridge.persist.dao.SAclDaoImpl; import com.cloud.bridge.persist.dao.SBucketDao; +import com.cloud.bridge.persist.dao.SBucketDaoImpl; import com.cloud.bridge.service.S3Constants; import com.cloud.bridge.service.S3RestServlet; import com.cloud.bridge.service.controller.s3.ServiceProvider; @@ -81,16 +85,13 @@ import com.cloud.bridge.service.core.s3.S3ListAllMyBucketsResponse; import com.cloud.bridge.service.core.s3.S3ListBucketObjectEntry; import com.cloud.bridge.service.core.s3.S3ListBucketRequest; import com.cloud.bridge.service.core.s3.S3ListBucketResponse; -import com.cloud.bridge.service.core.s3.S3MetaDataEntry; import com.cloud.bridge.service.core.s3.S3MultipartUpload; import com.cloud.bridge.service.core.s3.S3PolicyContext; -import com.cloud.bridge.service.core.s3.S3PutObjectRequest; import com.cloud.bridge.service.core.s3.S3Response; import com.cloud.bridge.service.core.s3.S3SetBucketAccessControlPolicyRequest; import com.cloud.bridge.service.core.s3.S3BucketPolicy.PolicyAccess; import com.cloud.bridge.service.core.s3.S3PolicyAction.PolicyActions; import com.cloud.bridge.service.core.s3.S3PolicyCondition.ConditionKeys; -import com.cloud.bridge.service.exception.InternalErrorException; import com.cloud.bridge.service.exception.InvalidBucketName; import com.cloud.bridge.service.exception.InvalidRequestContentException; import com.cloud.bridge.service.exception.NetworkIOException; @@ -108,10 +109,14 @@ import com.cloud.bridge.util.Triple; import com.cloud.bridge.util.XSerializer; import com.cloud.bridge.util.XSerializerXmlAdapter; import com.cloud.bridge.util.XmlHelper; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.db.Transaction; public class S3BucketAction implements ServletAction { protected final static Logger logger = Logger.getLogger(S3BucketAction.class); + protected final BucketPolicyDao bPolicyDao = ComponentLocator.inject(BucketPolicyDaoImpl.class); + protected final SBucketDao bucketDao = ComponentLocator.inject(SBucketDaoImpl.class); private DocumentBuilderFactory dbf = null; public S3BucketAction() { @@ -347,18 +352,16 @@ private void executeMultiObjectDelete(HttpServletRequest request, HttpServletRes String policy = streamToString( request.getInputStream()); // [A] Is there an owner of an existing policy or bucket? - BucketPolicyDao policyDao = new BucketPolicyDao(); - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName( bucketName ); + SBucketVO bucket = bucketDao.getByName( bucketName ); String owner = null; if ( null != bucket ) { - owner = bucket.getOwnerCanonicalId(); + owner = bucket.getOwnerCanonicalId(); } else { try { - owner = policyDao.getPolicyOwner( bucketName ); + owner = bPolicyDao.getByName(bucketName).getOwnerCanonicalID(); } catch( Exception e ) {} } @@ -366,36 +369,42 @@ private void executeMultiObjectDelete(HttpServletRequest request, HttpServletRes // [B] "The bucket owner by default has permissions to attach bucket policies to their buckets using PUT Bucket policy." // -> the bucket owner may want to restrict the IP address from where this can be executed - String client = UserContext.current().getCanonicalUserId(); - S3PolicyContext context = new S3PolicyContext( PolicyActions.PutBucketPolicy, bucketName ); - switch( S3Engine.verifyPolicy( context )) { - case ALLOW: - break; - - case DEFAULT_DENY: - if (null != owner && !client.equals( owner )) { - response.setStatus(405); - return; - } - break; - - case DENY: - response.setStatus(403); - return; - } - - + String client = UserContext.current().getCanonicalUserId(); + S3PolicyContext context = new S3PolicyContext( + PolicyActions.PutBucketPolicy, bucketName); + + switch (S3Engine.verifyPolicy(context)) { + case ALLOW: + break; + + case DEFAULT_DENY: + if (null != owner && !client.equals(owner)) { + response.setStatus(405); + return; + } + break; + case DENY: + response.setStatus(403); + return; + } + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); // [B] Place the policy into the database over writting an existing policy try { // -> first make sure that the policy is valid by parsing it PolicyParser parser = new PolicyParser(); S3BucketPolicy sbp = parser.parse( policy, bucketName ); - - policyDao.deletePolicy( bucketName ); - if (null != policy && !policy.isEmpty()) policyDao.addPolicy( bucketName, client, policy ); + bPolicyDao.deletePolicy(bucketName); + + if (null != policy && !policy.isEmpty()) { + BucketPolicyVO bpolicy = new BucketPolicyVO(bucketName, client, policy); + bpolicy = bPolicyDao.persist(bpolicy); + //policyDao.addPolicy( bucketName, client, policy ); + } if (null != sbp) ServiceProvider.getInstance().setBucketPolicy( bucketName, sbp ); - response.setStatus(200); + response.setStatus(200); + txn.commit(); + txn.close(); } catch( PermissionDeniedException e ) { logger.error("Put Bucket Policy failed due to " + e.getMessage(), e); @@ -416,185 +425,193 @@ private void executeMultiObjectDelete(HttpServletRequest request, HttpServletRes String bucketName = (String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY); // [A] Is there an owner of an existing policy or bucket? - BucketPolicyDao policyDao = new BucketPolicyDao(); - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName( bucketName ); - String owner = null; - - if ( null != bucket ) - { - owner = bucket.getOwnerCanonicalId(); - } - else - { try { - owner = policyDao.getPolicyOwner( bucketName ); - } - catch( Exception e ) {} - } + SBucketVO bucket = bucketDao.getByName(bucketName); + String owner = null; - - // [B] "The bucket owner by default has permissions to retrieve bucket policies using GET Bucket policy." - // -> the bucket owner may want to restrict the IP address from where this can be executed - String client = UserContext.current().getCanonicalUserId(); - S3PolicyContext context = new S3PolicyContext( PolicyActions.GetBucketPolicy, bucketName ); - switch( S3Engine.verifyPolicy( context )) { - case ALLOW: - break; - - case DEFAULT_DENY: - if (null != owner && !client.equals( owner )) { - response.setStatus(405); - return; - } - break; - - case DENY: - response.setStatus(403); - return; - } - - - // [B] Pull the policy from the database if one exists - try { - String policy = policyDao.getPolicy( bucketName ); - if ( null == policy ) { - response.setStatus(404); - } - else { - response.setStatus(200); - response.setContentType("application/json"); - S3RestServlet.endResponse(response, policy); - } - } - catch( Exception e ) { - logger.error("Get Bucket Policy failed due to " + e.getMessage(), e); - response.setStatus(500); - } + if (null != bucket) { + owner = bucket.getOwnerCanonicalId(); + } else { + try { + owner = bPolicyDao.getByName(bucketName).getOwnerCanonicalID(); + } catch (Exception e) { + } } - private void executeDeleteBucketPolicy(HttpServletRequest request, HttpServletResponse response) - { - String bucketName = (String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY); - - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName( bucketName ); - if (bucket != null) - { - String client = UserContext.current().getCanonicalUserId(); - if (!client.equals( bucket.getOwnerCanonicalId())) { - response.setStatus(405); - return; - } - } + // [B] + // "The bucket owner by default has permissions to retrieve bucket policies using GET Bucket policy." + // -> the bucket owner may want to restrict the IP address from where + // this can be executed + String client = UserContext.current().getCanonicalUserId(); + S3PolicyContext context = new S3PolicyContext( + PolicyActions.GetBucketPolicy, bucketName); + switch (S3Engine.verifyPolicy(context)) { + case ALLOW: + break; - try { - BucketPolicyDao policyDao = new BucketPolicyDao(); - String policy = policyDao.getPolicy( bucketName ); - if ( null == policy ) { - response.setStatus(204); - } - else { - ServiceProvider.getInstance().deleteBucketPolicy( bucketName ); - policyDao.deletePolicy( bucketName ); - response.setStatus(200); - } - } - catch( Exception e ) { - logger.error("Delete Bucket Policy failed due to " + e.getMessage(), e); - response.setStatus(500); - } + case DEFAULT_DENY: + if (null != owner && !client.equals(owner)) { + response.setStatus(405); + return; + } + break; + + case DENY: + response.setStatus(403); + return; } - public void executeGetAllBuckets(HttpServletRequest request, HttpServletResponse response) - throws IOException, XMLStreamException - { - Calendar cal = Calendar.getInstance(); - cal.set( 1970, 1, 1 ); - S3ListAllMyBucketsRequest engineRequest = new S3ListAllMyBucketsRequest(); - engineRequest.setAccessKey(UserContext.current().getAccessKey()); - engineRequest.setRequestTimestamp( cal ); - engineRequest.setSignature( "" ); - - + // [B] Pull the policy from the database if one exists + try { + String policy = bPolicyDao.getByName(bucketName).getPolicy(); + if (null == policy) { + response.setStatus(404); + } else { + response.setStatus(200); + response.setContentType("application/json"); + S3RestServlet.endResponse(response, policy); + } + } catch (Exception e) { + logger.error("Get Bucket Policy failed due to " + e.getMessage(), e); + response.setStatus(500); + } + } + private void executeDeleteBucketPolicy(HttpServletRequest request, + HttpServletResponse response) { + String bucketName = (String) request + .getAttribute(S3Constants.BUCKET_ATTR_KEY); - S3ListAllMyBucketsResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest); - - // To allow the all buckets list to be serialized via Axiom classes - ListAllMyBucketsResponse allBuckets = S3SerializableServiceImplementation.toListAllMyBucketsResponse( engineResponse ); - - OutputStream outputStream = response.getOutputStream(); - response.setStatus(200); - response.setContentType("application/xml"); - // The content-type literally should be "application/xml; charset=UTF-8" - // but any compliant JVM supplies utf-8 by default - -// MTOMAwareResultStreamWriter resultWriter = new MTOMAwareResultStreamWriter ("ListAllMyBucketsResult", outputStream ); -// resultWriter.startWrite(); -// resultWriter.writeout(allBuckets); -// resultWriter.stopWrite(); - StringBuffer xml = new StringBuffer(); - xml.append( "" ); - xml.append(""); - xml.append(""); - xml.append(engineResponse.getOwner().getID()).append(""); - xml.append("").append(engineResponse.getOwner().getDisplayName()).append(""); - xml.append("").append(""); - SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); - for (S3ListAllMyBucketsEntry entry :engineResponse.getBuckets()) { - xml.append("").append("").append(entry.getName()).append(""); - xml.append("").append(sdf.format(entry.getCreationDate().getTime())).append(""); - xml.append(""); - } - xml.append("").append(""); - response.setStatus(200); - response.setContentType("text/xml; charset=UTF-8"); - S3RestServlet.endResponse(response, xml.toString()); + SBucketVO bucket = bucketDao.getByName(bucketName); + if (bucket != null) { + String client = UserContext.current().getCanonicalUserId(); + if (!client.equals(bucket.getOwnerCanonicalId())) { + response.setStatus(405); + return; + } + } + + try { + + String policy = bPolicyDao.getByName(bucketName).getPolicy(); + if (null == policy) { + response.setStatus(204); + } else { + ServiceProvider.getInstance().deleteBucketPolicy(bucketName); + bPolicyDao.deletePolicy(bucketName); + response.setStatus(200); + } + } catch (Exception e) { + logger.error( + "Delete Bucket Policy failed due to " + e.getMessage(), e); + response.setStatus(500); + } + } + + public void executeGetAllBuckets(HttpServletRequest request, + HttpServletResponse response) throws IOException, + XMLStreamException { + Calendar cal = Calendar.getInstance(); + cal.set(1970, 1, 1); + S3ListAllMyBucketsRequest engineRequest = new S3ListAllMyBucketsRequest(); + engineRequest.setAccessKey(UserContext.current().getAccessKey()); + engineRequest.setRequestTimestamp(cal); + engineRequest.setSignature(""); + + S3ListAllMyBucketsResponse engineResponse = ServiceProvider + .getInstance().getS3Engine().handleRequest(engineRequest); + + // To allow the all buckets list to be serialized via Axiom classes + ListAllMyBucketsResponse allBuckets = S3SerializableServiceImplementation + .toListAllMyBucketsResponse(engineResponse); + + OutputStream outputStream = response.getOutputStream(); + response.setStatus(200); + response.setContentType("application/xml"); + // The content-type literally should be "application/xml; charset=UTF-8" + // but any compliant JVM supplies utf-8 by default + + // MTOMAwareResultStreamWriter resultWriter = new + // MTOMAwareResultStreamWriter ("ListAllMyBucketsResult", outputStream + // ); + // resultWriter.startWrite(); + // resultWriter.writeout(allBuckets); + // resultWriter.stopWrite(); + StringBuffer xml = new StringBuffer(); + xml.append(""); + xml.append(""); + xml.append(""); + xml.append(engineResponse.getOwner().getID()).append(""); + xml.append("") + .append(engineResponse.getOwner().getDisplayName()) + .append(""); + xml.append("").append(""); + SimpleDateFormat sdf = new SimpleDateFormat( + "yyyy-MM-dd'T'HH:mm:ss.SSSZ"); + for (S3ListAllMyBucketsEntry entry : engineResponse.getBuckets()) { + xml.append("").append("").append(entry.getName()) + .append(""); + xml.append("") + .append(sdf.format(entry.getCreationDate().getTime())) + .append(""); + xml.append(""); + } + xml.append("").append(""); + response.setStatus(200); + response.setContentType("text/xml; charset=UTF-8"); + S3RestServlet.endResponse(response, xml.toString()); } public void executeGetBucket(HttpServletRequest request, HttpServletResponse response) throws IOException, XMLStreamException { - S3ListBucketRequest engineRequest = new S3ListBucketRequest(); - engineRequest.setBucketName((String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY)); - engineRequest.setDelimiter(request.getParameter("delimiter")); - engineRequest.setMarker(request.getParameter("marker")); - engineRequest.setPrefix(request.getParameter("prefix")); - - int maxKeys = Converter.toInt(request.getParameter("max-keys"), 1000); - engineRequest.setMaxKeys(maxKeys); - try { - S3ListBucketResponse engineResponse = ServiceProvider.getInstance().getS3Engine().listBucketContents( engineRequest, false ); - - // To allow the all list buckets result to be serialized via Axiom classes - ListBucketResponse oneBucket = S3SerializableServiceImplementation.toListBucketResponse( engineResponse ); - - OutputStream outputStream = response.getOutputStream(); - response.setStatus(200); - response.setContentType("application/xml"); - // The content-type literally should be "application/xml; charset=UTF-8" - // but any compliant JVM supplies utf-8 by default; - - MTOMAwareResultStreamWriter resultWriter = new MTOMAwareResultStreamWriter ("ListBucketResult", outputStream ); - resultWriter.startWrite(); - resultWriter.writeout(oneBucket); - resultWriter.stopWrite(); - } catch (NoSuchObjectException nsoe) { - response.setStatus(404); - response.setContentType("application/xml"); + S3ListBucketRequest engineRequest = new S3ListBucketRequest(); + engineRequest.setBucketName((String) request + .getAttribute(S3Constants.BUCKET_ATTR_KEY)); + engineRequest.setDelimiter(request.getParameter("delimiter")); + engineRequest.setMarker(request.getParameter("marker")); + engineRequest.setPrefix(request.getParameter("prefix")); - StringBuffer xmlError = new StringBuffer(); - xmlError.append("") + int maxKeys = Converter.toInt(request.getParameter("max-keys"), 1000); + engineRequest.setMaxKeys(maxKeys); + try { + S3ListBucketResponse engineResponse = ServiceProvider.getInstance() + .getS3Engine().listBucketContents(engineRequest, false); + + // To allow the all list buckets result to be serialized via Axiom + // classes + ListBucketResponse oneBucket = S3SerializableServiceImplementation + .toListBucketResponse(engineResponse); + + OutputStream outputStream = response.getOutputStream(); + response.setStatus(200); + response.setContentType("application/xml"); + // The content-type literally should be + // "application/xml; charset=UTF-8" + // but any compliant JVM supplies utf-8 by default; + + MTOMAwareResultStreamWriter resultWriter = new MTOMAwareResultStreamWriter( + "ListBucketResult", outputStream); + resultWriter.startWrite(); + resultWriter.writeout(oneBucket); + resultWriter.stopWrite(); + } catch (NoSuchObjectException nsoe) { + response.setStatus(404); + response.setContentType("application/xml"); + + StringBuffer xmlError = new StringBuffer(); + xmlError.append("") .append("NoSuchBucketThe specified bucket does not exist") - .append("").append((String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY)) + .append("") + .append((String) request + .getAttribute(S3Constants.BUCKET_ATTR_KEY)) .append("") - .append("1DEADBEEF9") //TODO - .append("abCdeFgHiJ1k2LmN3op4q56r7st89") //TODO + .append("1DEADBEEF9") // TODO + .append("abCdeFgHiJ1k2LmN3op4q56r7st89") // TODO .append(""); - S3RestServlet.endResponse(response, xmlError.toString()); + S3RestServlet.endResponse(response, xmlError.toString()); - } + } } @@ -640,8 +657,7 @@ private void executeMultiObjectDelete(HttpServletRequest request, HttpServletRes return; } - SBucketDao bucketDao = new SBucketDao(); - SBucket sbucket = bucketDao.getByName( bucketName ); + SBucketVO sbucket = bucketDao.getByName( bucketName ); if (sbucket == null) { response.setStatus( 404 ); return; @@ -834,111 +850,124 @@ private void executeMultiObjectDelete(HttpServletRequest request, HttpServletRes public void executePutBucketAcl(HttpServletRequest request, HttpServletResponse response) throws IOException { // [A] Determine that there is an applicable bucket which might have an ACL set - - String bucketName = (String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY); - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName( bucketName ); - String owner = null; - if ( null != bucket ) - owner = bucket.getOwnerCanonicalId(); - if (null == owner) - { - logger.error( "ACL update failed since " + bucketName + " does not exist" ); - throw new IOException("ACL update failed"); - } - - // [B] Obtain the grant request which applies to the acl request string. This latter is supplied as the value of the x-amz-acl header. - - S3SetBucketAccessControlPolicyRequest engineRequest = new S3SetBucketAccessControlPolicyRequest(); - S3Grant grantRequest = new S3Grant(); - S3AccessControlList aclRequest = new S3AccessControlList(); - - String aclRequestString = request.getHeader("x-amz-acl"); - OrderedPair accessControlsForBucketOwner = SAcl.getCannedAccessControls(aclRequestString,"SBucket"); - grantRequest.setPermission(accessControlsForBucketOwner.getFirst()); - grantRequest.setGrantee(accessControlsForBucketOwner.getSecond()); - grantRequest.setCanonicalUserID(owner); - aclRequest.addGrant(grantRequest); - engineRequest.setAcl(aclRequest); - engineRequest.setBucketName(bucketName); - - - // [C] Allow an S3Engine to handle the S3SetBucketAccessControlPolicyRequest - S3Response engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest); - response.setStatus( engineResponse.getResultCode()); + + String bucketName = (String) request + .getAttribute(S3Constants.BUCKET_ATTR_KEY); + SBucketVO bucket = bucketDao.getByName(bucketName); + String owner = null; + if (null != bucket) + owner = bucket.getOwnerCanonicalId(); + if (null == owner) { + logger.error("ACL update failed since " + bucketName + + " does not exist"); + throw new IOException("ACL update failed"); + } + + // [B] Obtain the grant request which applies to the acl request string. + // This latter is supplied as the value of the x-amz-acl header. + + S3SetBucketAccessControlPolicyRequest engineRequest = new S3SetBucketAccessControlPolicyRequest(); + S3Grant grantRequest = new S3Grant(); + S3AccessControlList aclRequest = new S3AccessControlList(); + + String aclRequestString = request.getHeader("x-amz-acl"); + OrderedPair accessControlsForBucketOwner = SAclVO.getCannedAccessControls(aclRequestString, "SBucket"); + grantRequest.setPermission(accessControlsForBucketOwner.getFirst()); + grantRequest.setGrantee(accessControlsForBucketOwner.getSecond()); + grantRequest.setCanonicalUserID(owner); + aclRequest.addGrant(grantRequest); + engineRequest.setAcl(aclRequest); + engineRequest.setBucketName(bucketName); + + // [C] Allow an S3Engine to handle the + // S3SetBucketAccessControlPolicyRequest + S3Response engineResponse = ServiceProvider.getInstance().getS3Engine() + .handleRequest(engineRequest); + response.setStatus(engineResponse.getResultCode()); } public void executePutBucketVersioning(HttpServletRequest request, HttpServletResponse response) throws IOException { - String bucketName = (String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY); - String versioningStatus = null; - Node item = null; + String bucketName = (String) request.getAttribute(S3Constants.BUCKET_ATTR_KEY); + String versioningStatus = null; + Node item = null; - if (null == bucketName) { - logger.error( "executePutBucketVersioning - no bucket name given" ); - response.setStatus( 400 ); - return; - } - - // -> is the XML as defined? - try { - DocumentBuilder db = dbf.newDocumentBuilder(); - Document restXML = db.parse( request.getInputStream()); - NodeList match = S3RestServlet.getElement( restXML, "http://s3.amazonaws.com/doc/2006-03-01/", "Status" ); - if ( 0 < match.getLength()) - { - item = match.item(0); - versioningStatus = new String( item.getFirstChild().getNodeValue()); - } - else - { logger.error( "executePutBucketVersioning - cannot find Status tag in XML body" ); - response.setStatus( 400 ); - return; - } - } - catch( Exception e ) { - logger.error( "executePutBucketVersioning - failed to parse XML due to " + e.getMessage(), e); - response.setStatus(400); - return; - } - - try { - // Irrespective of what the ACLs say only the owner can turn on versioning on a bucket. - // The bucket owner may want to restrict the IP address from which this can occur. - SBucketDao bucketDao = new SBucketDao(); - SBucket sbucket = bucketDao.getByName( bucketName ); - - String client = UserContext.current().getCanonicalUserId(); - if (!client.equals( sbucket.getOwnerCanonicalId())) - throw new PermissionDeniedException( "Access Denied - only the owner can turn on versioing on a bucket" ); - - S3PolicyContext context = new S3PolicyContext( PolicyActions.PutBucketVersioning, bucketName ); - if (PolicyAccess.DENY == S3Engine.verifyPolicy( context )) { - response.setStatus(403); - return; - } + if (null == bucketName) { + logger.error("executePutBucketVersioning - no bucket name given"); + response.setStatus(400); + return; + } - - if (versioningStatus.equalsIgnoreCase( "Enabled" )) sbucket.setVersioningStatus( 1 ); - else if (versioningStatus.equalsIgnoreCase( "Suspended")) sbucket.setVersioningStatus( 2 ); - else { - logger.error( "executePutBucketVersioning - unknown state: [" + versioningStatus + "]" ); - response.setStatus( 400 ); - return; - } - bucketDao.update( sbucket ); - - } catch( PermissionDeniedException e ) { - logger.error( "executePutBucketVersioning - failed due to " + e.getMessage(), e); - throw e; - - } catch( Exception e ) { - logger.error( "executePutBucketVersioning - failed due to " + e.getMessage(), e); - response.setStatus(500); - return; - } - response.setStatus(200); + // -> is the XML as defined? + try { + DocumentBuilder db = dbf.newDocumentBuilder(); + Document restXML = db.parse(request.getInputStream()); + NodeList match = S3RestServlet.getElement(restXML, + "http://s3.amazonaws.com/doc/2006-03-01/", "Status"); + if (0 < match.getLength()) { + item = match.item(0); + versioningStatus = new String(item.getFirstChild() + .getNodeValue()); + } else { + logger.error("executePutBucketVersioning - cannot find Status tag in XML body"); + response.setStatus(400); + return; + } + } catch (Exception e) { + logger.error( + "executePutBucketVersioning - failed to parse XML due to " + + e.getMessage(), e); + response.setStatus(400); + return; + } + + try { + // Irrespective of what the ACLs say only the owner can turn on + // versioning on a bucket. + // The bucket owner may want to restrict the IP address from which + // this can occur. + + SBucketVO sbucket = bucketDao.getByName(bucketName); + + String client = UserContext.current().getCanonicalUserId(); + if (!client.equals(sbucket.getOwnerCanonicalId())) + throw new PermissionDeniedException( + "Access Denied - only the owner can turn on versioing on a bucket"); + + S3PolicyContext context = new S3PolicyContext( + PolicyActions.PutBucketVersioning, bucketName); + if (PolicyAccess.DENY == S3Engine.verifyPolicy(context)) { + response.setStatus(403); + return; + } + + if (versioningStatus.equalsIgnoreCase("Enabled")) + sbucket.setVersioningStatus(1); + else if (versioningStatus.equalsIgnoreCase("Suspended")) + sbucket.setVersioningStatus(2); + else { + logger.error("executePutBucketVersioning - unknown state: [" + + versioningStatus + "]"); + response.setStatus(400); + return; + } + bucketDao.update(sbucket.getId(), sbucket); + + } catch (PermissionDeniedException e) { + logger.error( + "executePutBucketVersioning - failed due to " + + e.getMessage(), e); + throw e; + + } catch (Exception e) { + logger.error( + "executePutBucketVersioning - failed due to " + + e.getMessage(), e); + response.setStatus(500); + return; + } + response.setStatus(200); } public void executePutBucketLogging(HttpServletRequest request, HttpServletResponse response) throws IOException { @@ -949,7 +978,7 @@ private void executeMultiObjectDelete(HttpServletRequest request, HttpServletRes public void executePutBucketWebsite(HttpServletRequest request, HttpServletResponse response) throws IOException { // TODO -- LoPri - Undertake checks on Put Bucket Website // Tested using configuration \nAllowOverride FileInfo AuthConfig Limit... in httpd.conf - // Need some way of using AllowOverride to allow use of .htaccess and then pushing .httaccess file to bucket subdirectory of mount point + // Need some way of using AllowOverride to allow use of .htaccess and then pushing .httaccess file to bucket subdirectory of mount point // Currently has noop effect in the sense that a running apachectl process sees the directory contents without further action response.setStatus(200); } @@ -976,128 +1005,145 @@ private void executeMultiObjectDelete(HttpServletRequest request, HttpServletRes public void executeListMultipartUploads(HttpServletRequest request, HttpServletResponse response) throws IOException { // [A] Obtain parameters and do basic bucket verification - String bucketName = (String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY); - String delimiter = request.getParameter("delimiter"); - String keyMarker = request.getParameter("key-marker"); - String prefix = request.getParameter("prefix"); - int maxUploads = 1000; - int nextUploadId = 0; - String nextKey = null; - boolean isTruncated = false; - S3MultipartUpload[] uploads = null; - S3MultipartUpload onePart = null; - - String temp = request.getParameter("max-uploads"); - if (null != temp) { - maxUploads = Integer.parseInt( temp ); - if (maxUploads > 1000 || maxUploads < 0) maxUploads = 1000; - } - - // -> upload-id-marker is ignored unless key-marker is also specified - String uploadIdMarker = request.getParameter("upload-id-marker"); - if (null == keyMarker) uploadIdMarker = null; - - // -> does the bucket exist, we may need it to verify access permissions - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); - if (bucket == null) { - logger.error( "listMultipartUpload failed since " + bucketName + " does not exist" ); - response.setStatus(404); - return; + String bucketName = (String) request + .getAttribute(S3Constants.BUCKET_ATTR_KEY); + String delimiter = request.getParameter("delimiter"); + String keyMarker = request.getParameter("key-marker"); + String prefix = request.getParameter("prefix"); + int maxUploads = 1000; + int nextUploadId = 0; + String nextKey = null; + boolean isTruncated = false; + S3MultipartUpload[] uploads = null; + S3MultipartUpload onePart = null; + String temp = request.getParameter("max-uploads"); + if (null != temp) { + maxUploads = Integer.parseInt(temp); + if (maxUploads > 1000 || maxUploads < 0) + maxUploads = 1000; + } + + // -> upload-id-marker is ignored unless key-marker is also specified + String uploadIdMarker = request.getParameter("upload-id-marker"); + if (null == keyMarker) + uploadIdMarker = null; + + // -> does the bucket exist, we may need it to verify access permissions + SBucketVO bucket = bucketDao.getByName(bucketName); + if (bucket == null) { + logger.error("listMultipartUpload failed since " + bucketName + + " does not exist"); + response.setStatus(404); + return; + } + + S3PolicyContext context = new S3PolicyContext( + PolicyActions.ListBucketMultipartUploads, bucketName); + context.setEvalParam(ConditionKeys.Prefix, prefix); + context.setEvalParam(ConditionKeys.Delimiter, delimiter); + S3Engine.verifyAccess(context, "SBucket", bucket.getId(), + SAcl.PERMISSION_READ); + + // [B] Query the multipart table to get the list of current uploads + try { + MultipartLoadDao uploadDao = new MultipartLoadDao(); + OrderedPair result = uploadDao + .getInitiatedUploads(bucketName, maxUploads, prefix, + keyMarker, uploadIdMarker); + uploads = result.getFirst(); + isTruncated = result.getSecond().booleanValue(); + } catch (Exception e) { + logger.error( + "List Multipart Uploads failed due to " + e.getMessage(), e); + response.setStatus(500); + } + + StringBuffer xml = new StringBuffer(); + xml.append(""); + xml.append(""); + xml.append("").append(bucketName).append(""); + xml.append("").append((null == keyMarker ? "" : keyMarker)) + .append(""); + xml.append("") + .append((null == uploadIdMarker ? "" : uploadIdMarker)) + .append(""); + + // [C] Construct the contents of the element + StringBuffer partsList = new StringBuffer(); + for (int i = 0; i < uploads.length; i++) { + onePart = uploads[i]; + if (null == onePart) + break; + + if (delimiter != null && !delimiter.isEmpty()) { + // -> is this available only in the CommonPrefixes element? + if (StringHelper.substringInBetween(onePart.getKey(), prefix, + delimiter) != null) + continue; + } + + nextKey = onePart.getKey(); + nextUploadId = onePart.getId(); + partsList.append(""); + partsList.append("").append(nextKey).append(""); + partsList.append("").append(nextUploadId) + .append(""); + partsList.append(""); + partsList.append("").append(onePart.getAccessKey()) + .append(""); + partsList.append(""); + partsList.append(""); + partsList.append(""); + partsList.append("").append(onePart.getAccessKey()) + .append(""); + partsList.append(""); + partsList.append(""); + partsList.append("STANDARD"); + partsList + .append("") + .append(DatatypeConverter.printDateTime(onePart + .getLastModified())).append(""); + partsList.append(""); + } + + // [D] Construct the contents of the elements (if any) + for (int i = 0; i < uploads.length; i++) { + onePart = uploads[i]; + if (null == onePart) + break; + + if (delimiter != null && !delimiter.isEmpty()) { + String subName = StringHelper.substringInBetween( + onePart.getKey(), prefix, delimiter); + if (subName != null) { + partsList.append(""); + partsList.append(""); + if (prefix != null && prefix.length() > 0) + partsList.append(prefix + delimiter + subName); + else + partsList.append(subName); + partsList.append(""); + partsList.append(""); } - - S3PolicyContext context = new S3PolicyContext( PolicyActions.ListBucketMultipartUploads, bucketName ); - context.setEvalParam( ConditionKeys.Prefix, prefix ); - context.setEvalParam( ConditionKeys.Delimiter, delimiter ); - S3Engine.verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_READ ); + } + } - - // [B] Query the multipart table to get the list of current uploads - try { - MultipartLoadDao uploadDao = new MultipartLoadDao(); - OrderedPair result = uploadDao.getInitiatedUploads( bucketName, maxUploads, prefix, keyMarker, uploadIdMarker ); - uploads = result.getFirst(); - isTruncated = result.getSecond().booleanValue(); - } - catch( Exception e ) { - logger.error("List Multipart Uploads failed due to " + e.getMessage(), e); - response.setStatus(500); - } + // [D] Finish off the response + xml.append("").append((null == nextKey ? "" : nextKey)) + .append(""); + xml.append("") + .append((0 == nextUploadId ? "" : nextUploadId)) + .append(""); + xml.append("").append(maxUploads).append(""); + xml.append("").append(isTruncated) + .append(""); - StringBuffer xml = new StringBuffer(); - xml.append( "" ); - xml.append( "" ); - xml.append( "" ).append( bucketName ).append( "" ); - xml.append( "").append((null == keyMarker ? "" : keyMarker)).append( "" ); - xml.append( "").append((null == uploadIdMarker ? "" : uploadIdMarker)).append( "" ); - - - // [C] Construct the contents of the element - StringBuffer partsList = new StringBuffer(); - for( int i=0; i < uploads.length; i++ ) - { - onePart = uploads[i]; - if (null == onePart) break; - - if (delimiter != null && !delimiter.isEmpty()) - { - // -> is this available only in the CommonPrefixes element? - if (StringHelper.substringInBetween(onePart.getKey(), prefix, delimiter) != null) - continue; - } - - nextKey = onePart.getKey(); - nextUploadId = onePart.getId(); - partsList.append( "" ); - partsList.append( "" ).append( nextKey ).append( "" ); - partsList.append( "" ).append( nextUploadId ).append( "" ); - partsList.append( "" ); - partsList.append( "" ).append( onePart.getAccessKey()).append( "" ); - partsList.append( "" ); - partsList.append( "" ); - partsList.append( "" ); - partsList.append( "" ).append( onePart.getAccessKey()).append( "" ); - partsList.append( "" ); - partsList.append( "" ); - partsList.append( "STANDARD" ); - partsList.append( "" ).append( DatatypeConverter.printDateTime( onePart.getLastModified())).append( "" ); - partsList.append( "" ); - } - - // [D] Construct the contents of the elements (if any) - for( int i=0; i < uploads.length; i++ ) - { - onePart = uploads[i]; - if (null == onePart) break; + xml.append(partsList.toString()); + xml.append(""); - if (delimiter != null && !delimiter.isEmpty()) - { - String subName = StringHelper.substringInBetween(onePart.getKey(), prefix, delimiter); - if (subName != null) - { - partsList.append( "" ); - partsList.append( "" ); - if ( prefix != null && prefix.length() > 0 ) - partsList.append( prefix + delimiter + subName ); - else partsList.append( subName ); - partsList.append( "" ); - partsList.append( "" ); - } - } - } - - // [D] Finish off the response - xml.append( "" ).append((null == nextKey ? "" : nextKey)).append( "" ); - xml.append( "" ).append((0 == nextUploadId ? "" : nextUploadId)).append( "" ); - xml.append( "" ).append( maxUploads ).append( "" ); - xml.append( "" ).append( isTruncated ).append( "" ); - - xml.append( partsList.toString()); - xml.append( "" ); - - response.setStatus(200); - response.setContentType("text/xml; charset=UTF-8"); - S3RestServlet.endResponse(response, xml.toString()); + response.setStatus(200); + response.setContentType("text/xml; charset=UTF-8"); + S3RestServlet.endResponse(response, xml.toString()); } private String streamToString( InputStream is ) throws IOException diff --git a/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java b/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java index 8fb89f9de4e..ee4cec65e41 100644 --- a/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java +++ b/awsapi/src/com/cloud/bridge/service/controller/s3/S3ObjectAction.java @@ -45,9 +45,12 @@ import com.amazon.s3.CopyObjectResponse; import com.amazon.s3.GetObjectAccessControlPolicyResponse; import com.cloud.bridge.io.MTOMAwareResultStreamWriter; import com.cloud.bridge.model.SAcl; +import com.cloud.bridge.model.SAclVO; import com.cloud.bridge.model.SBucket; +import com.cloud.bridge.model.SBucketVO; import com.cloud.bridge.persist.dao.MultipartLoadDao; import com.cloud.bridge.persist.dao.SBucketDao; +import com.cloud.bridge.persist.dao.SBucketDaoImpl; import com.cloud.bridge.service.S3Constants; import com.cloud.bridge.service.S3RestServlet; import com.cloud.bridge.service.UserContext; @@ -79,9 +82,11 @@ import com.cloud.bridge.util.DateHelper; import com.cloud.bridge.util.HeaderParam; import com.cloud.bridge.util.ServletRequestDataSource; import com.cloud.bridge.util.OrderedPair; +import com.cloud.utils.component.ComponentLocator; public class S3ObjectAction implements ServletAction { protected final static Logger logger = Logger.getLogger(S3ObjectAction.class); + protected final SBucketDao bucketDao = ComponentLocator.inject(SBucketDaoImpl.class); private DocumentBuilderFactory dbf = null; @@ -273,8 +278,7 @@ public class S3ObjectAction implements ServletAction { String bucketName = (String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY); String key = (String)request.getAttribute(S3Constants.OBJECT_ATTR_KEY); - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName( bucketName ); + SBucketVO bucket = bucketDao.getByName( bucketName ); String owner = null; if ( null != bucket ) owner = bucket.getOwnerCanonicalId(); @@ -296,7 +300,7 @@ public class S3ObjectAction implements ServletAction { S3AccessControlList aclRequest = new S3AccessControlList(); String aclRequestString = request.getHeader("x-amz-acl"); - OrderedPair accessControlsForObjectOwner = SAcl.getCannedAccessControls(aclRequestString,"SObject"); + OrderedPair accessControlsForObjectOwner = SAclVO.getCannedAccessControls(aclRequestString,"SObject"); grantRequest.setPermission(accessControlsForObjectOwner.getFirst()); grantRequest.setGrantee(accessControlsForObjectOwner.getSecond()); grantRequest.setCanonicalUserID(owner); @@ -484,6 +488,11 @@ public class S3ObjectAction implements ServletAction { S3GetObjectResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest( engineRequest ); response.setStatus( engineResponse.getResultCode()); + + //bucket lookup for non-existance key + + if ( engineResponse.getResultCode() == 404 ) + return; String deleteMarker = engineResponse.getDeleteMarker(); if ( null != deleteMarker ) { @@ -891,8 +900,7 @@ public class S3ObjectAction implements ServletAction { // -> does the bucket exist, we may need it to verify access permissions - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); + SBucketVO bucket = bucketDao.getByName(bucketName); if (bucket == null) { logger.error( "listUploadParts failed since " + bucketName + " does not exist" ); response.setStatus(404); diff --git a/awsapi/src/com/cloud/bridge/service/controller/s3/ServiceProvider.java b/awsapi/src/com/cloud/bridge/service/controller/s3/ServiceProvider.java index c8ca2bd5351..2f1791e19a7 100644 --- a/awsapi/src/com/cloud/bridge/service/controller/s3/ServiceProvider.java +++ b/awsapi/src/com/cloud/bridge/service/controller/s3/ServiceProvider.java @@ -35,18 +35,19 @@ import java.util.TimerTask; import org.apache.axis2.AxisFault; import org.apache.log4j.Logger; import org.apache.log4j.xml.DOMConfigurator; -import org.hibernate.SessionException; import com.amazon.s3.AmazonS3SkeletonInterface; import com.amazon.ec2.AmazonEC2SkeletonInterface; -import com.cloud.bridge.model.MHost; +import com.cloud.bridge.model.MHostVO; import com.cloud.bridge.model.SHost; -import com.cloud.bridge.model.UserCredentials; -import com.cloud.bridge.persist.PersistContext; -import com.cloud.bridge.persist.PersistException; +import com.cloud.bridge.model.SHostVO; +import com.cloud.bridge.model.UserCredentialsVO; import com.cloud.bridge.persist.dao.MHostDao; +import com.cloud.bridge.persist.dao.MHostDaoImpl; import com.cloud.bridge.persist.dao.SHostDao; +import com.cloud.bridge.persist.dao.SHostDaoImpl; import com.cloud.bridge.persist.dao.UserCredentialsDao; +import com.cloud.bridge.persist.dao.UserCredentialsDaoImpl; import com.cloud.bridge.service.EC2SoapServiceImpl; import com.cloud.bridge.service.UserInfo; import com.cloud.bridge.service.core.ec2.EC2Engine; @@ -57,17 +58,23 @@ import com.cloud.bridge.util.ConfigurationHelper; import com.cloud.bridge.util.DateHelper; import com.cloud.bridge.util.NetHelper; import com.cloud.bridge.util.OrderedPair; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.db.DB; +import com.cloud.utils.db.Transaction; public class ServiceProvider { protected final static Logger logger = Logger.getLogger(ServiceProvider.class); - + protected final MHostDao mhostDao = ComponentLocator.inject(MHostDaoImpl.class); + protected final SHostDao shostDao = ComponentLocator.inject(SHostDaoImpl.class); + protected final UserCredentialsDao ucDao = ComponentLocator.inject(UserCredentialsDaoImpl.class); + public final static long HEARTBEAT_INTERVAL = 10000; private static ServiceProvider instance; private Map, Object> serviceMap = new HashMap, Object>(); private Timer timer = new Timer(); - private MHost mhost; + private MHostVO mhost; private Properties properties; private boolean useSubDomain = false; // use DNS sub domain for bucket name private String serviceEndpoint = null; @@ -81,6 +88,8 @@ public class ServiceProvider { protected ServiceProvider() throws IOException { // register service implementation object + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + txn.close(); engine = new S3Engine(); EC2_engine = new EC2Engine(); serviceMap.put(AmazonS3SkeletonInterface.class, new S3SerializableServiceImplementation(engine)); @@ -93,11 +102,9 @@ public class ServiceProvider { try { instance = new ServiceProvider(); instance.initialize(); - PersistContext.commitTransaction(); } catch(Throwable e) { logger.error("Unexpected exception " + e.getMessage(), e); } finally { - PersistContext.closeSession(); } } return instance; @@ -172,27 +179,34 @@ public class ServiceProvider { return properties; } - public UserInfo getUserInfo(String accessKey) - throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException { + public UserInfo getUserInfo(String accessKey) { UserInfo info = new UserInfo(); - - UserCredentialsDao credentialDao = new UserCredentialsDao(); - UserCredentials cloudKeys = credentialDao.getByAccessKey( accessKey ); - if ( null == cloudKeys ) { - logger.debug( accessKey + " is not defined in the S3 service - call SetUserKeys" ); - return null; - } else { - info.setAccessKey( accessKey ); - info.setSecretKey( cloudKeys.getSecretKey()); - info.setCanonicalUserId(accessKey); - info.setDescription( "S3 REST request" ); - return info; + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + try { + txn.start(); + UserCredentialsVO cloudKeys = ucDao.getByAccessKey( accessKey ); + if ( null == cloudKeys ) { + logger.debug( accessKey + " is not defined in the S3 service - call SetUserKeys" ); + return null; + } else { + info.setAccessKey( accessKey ); + info.setSecretKey( cloudKeys.getSecretKey()); + info.setCanonicalUserId(accessKey); + info.setDescription( "S3 REST request" ); + return info; + } + }finally { + txn.commit(); } } - + + @DB protected void initialize() { if(logger.isInfoEnabled()) logger.info("Initializing ServiceProvider..."); + + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + //txn.close(); File file = ConfigurationHelper.findConfigurationFile("log4j-cloud.xml"); if(file != null) { @@ -226,14 +240,16 @@ public class ServiceProvider { setupHost(hostKey, host); // we will commit and start a new transaction to allow host info be flushed to DB - PersistContext.flush(); + //PersistContext.flush(); String localStorageRoot = properties.getProperty("storage.root"); if (localStorageRoot != null) setupLocalStorage(localStorageRoot); multipartDir = properties.getProperty("storage.multipartDir"); - + + Transaction txn1 = Transaction.open(Transaction.AWSAPI_DB); timer.schedule(getHeartbeatTask(), HEARTBEAT_INTERVAL, HEARTBEAT_INTERVAL); + txn1.close(); if(logger.isInfoEnabled()) logger.info("ServiceProvider initialized"); @@ -264,45 +280,41 @@ public class ServiceProvider { @Override public void run() { try { - MHostDao mhostDao = new MHostDao(); mhost.setLastHeartbeatTime(DateHelper.currentGMTTime()); - mhostDao.update(mhost); - PersistContext.commitTransaction(); + mhostDao.updateHeartBeat(mhost); } catch(Throwable e){ logger.error("Unexpected exception " + e.getMessage(), e); } finally { - PersistContext.closeSession(); } } }; } private void setupHost(String hostKey, String host) { - MHostDao mhostDao = new MHostDao(); - mhost = mhostDao.getByHostKey(hostKey); + + mhost = mhostDao.getByHostKey(hostKey); if(mhost == null) { - mhost = new MHost(); + mhost = new MHostVO(); mhost.setHostKey(hostKey); mhost.setHost(host); mhost.setLastHeartbeatTime(DateHelper.currentGMTTime()); - mhostDao.save(mhost); + mhost = mhostDao.persist(mhost); } else { mhost.setHost(host); - mhostDao.update(mhost); + mhostDao.update(mhost.getId(), mhost); } } private void setupLocalStorage(String storageRoot) { - SHostDao shostDao = new SHostDao(); - SHost shost = shostDao.getLocalStorageHost(mhost.getId(), storageRoot); + SHostVO shost = shostDao.getLocalStorageHost(mhost.getId(), storageRoot); if(shost == null) { - shost = new SHost(); + shost = new SHostVO(); shost.setMhost(mhost); - mhost.getLocalSHosts().add(shost); + shost.setMhostid(mhost.getId()); shost.setHostType(SHost.STORAGE_HOST_TYPE_LOCAL); shost.setHost(NetHelper.getHostName()); shost.setExportRoot(storageRoot); - PersistContext.getSession().save(shost); + shostDao.persist(shost); } } @@ -318,35 +330,36 @@ public class ServiceProvider { return (T) Proxy.newProxyInstance(serviceObject.getClass().getClassLoader(), new Class[] { serviceInterface }, new InvocationHandler() { - public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - Object result = null; - try { - result = method.invoke(serviceObject, args); - PersistContext.commitTransaction(); - PersistContext.commitTransaction(true); - } catch (PersistException e) { - } catch (SessionException e) { - } catch(Throwable e) { - // Rethrow the exception to Axis: - // Check if the exception is an AxisFault or a RuntimeException - // enveloped AxisFault and if so, pass it on as such. Otherwise - // log to help debugging and throw as is. - if (e.getCause() != null && e.getCause() instanceof AxisFault) - throw e.getCause(); - else if (e.getCause() != null && e.getCause().getCause() != null - && e.getCause().getCause() instanceof AxisFault) - throw e.getCause().getCause(); - else { - logger.warn("Unhandled exception " + e.getMessage(), e); - throw e; - } - } finally { - PersistContext.closeSession(); - PersistContext.closeSession(true); - } - return result; - } - }); + public Object invoke(Object proxy, Method method, + Object[] args) throws Throwable { + Object result = null; + try { + result = method.invoke(serviceObject, args); + } catch (Throwable e) { + // Rethrow the exception to Axis: + // Check if the exception is an AxisFault or a + // RuntimeException + // enveloped AxisFault and if so, pass it on as + // such. Otherwise + // log to help debugging and throw as is. + if (e.getCause() != null + && e.getCause() instanceof AxisFault) + throw e.getCause(); + else if (e.getCause() != null + && e.getCause().getCause() != null + && e.getCause().getCause() instanceof AxisFault) + throw e.getCause().getCause(); + else { + logger.warn( + "Unhandled exception " + e.getMessage(), + e); + throw e; + } + } finally { + } + return result; + } + }); } @SuppressWarnings("unchecked") diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java index 1363d0d7a0f..eb25249bd92 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Engine.java @@ -22,6 +22,9 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.security.SignatureException; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; import java.sql.SQLException; import java.text.ParseException; import java.util.ArrayList; @@ -32,12 +35,15 @@ import java.util.UUID; import javax.xml.parsers.ParserConfigurationException; import org.apache.log4j.Logger; -import org.hibernate.ejb.criteria.expression.UnaryArithmeticOperation.Operation; import org.xml.sax.SAXException; -import com.cloud.bridge.persist.dao.CloudStackSvcOfferingDao; +import com.cloud.bridge.model.CloudStackServiceOfferingVO; import com.cloud.bridge.persist.dao.CloudStackAccountDao; -import com.cloud.bridge.persist.dao.OfferingDao; +import com.cloud.bridge.persist.dao.CloudStackAccountDaoImpl; +import com.cloud.bridge.persist.dao.CloudStackSvcOfferingDao; +import com.cloud.bridge.persist.dao.CloudStackSvcOfferingDaoImpl; +import com.cloud.bridge.persist.dao.OfferingDaoImpl; +import com.cloud.bridge.persist.dao.SObjectItemDaoImpl; import com.cloud.bridge.service.UserContext; import com.cloud.bridge.service.core.ec2.EC2ImageAttributes.ImageAttribute; @@ -70,6 +76,8 @@ import com.cloud.stack.models.CloudStackUser; import com.cloud.stack.models.CloudStackUserVm; import com.cloud.stack.models.CloudStackVolume; import com.cloud.stack.models.CloudStackZone; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.db.Transaction; /** * EC2Engine processes the ec2 commands and calls their cloudstack analogs @@ -80,6 +88,9 @@ public class EC2Engine { String managementServer = null; String cloudAPIPort = null; + protected final CloudStackSvcOfferingDao scvoDao = ComponentLocator.inject(CloudStackSvcOfferingDaoImpl.class); + protected final OfferingDaoImpl ofDao = ComponentLocator.inject(OfferingDaoImpl.class); + CloudStackAccountDao accDao = ComponentLocator.inject(CloudStackAccountDaoImpl.class); private CloudStackApi _eng = null; private CloudStackAccount currentAccount = null; @@ -110,7 +121,6 @@ public class EC2Engine { managementServer = EC2Prop.getProperty( "managementServer" ); cloudAPIPort = EC2Prop.getProperty( "cloudAPIPort", null ); - OfferingDao ofDao = new OfferingDao(); try { if(ofDao.getOfferingCount() == 0) { String strValue = EC2Prop.getProperty("m1.small.serviceId"); @@ -1469,7 +1479,7 @@ public class EC2Engine { if(request.getInstanceType() != null){ instanceType = request.getInstanceType(); } - CloudStackServiceOffering svcOffering = getCSServiceOfferingId(instanceType); + CloudStackServiceOfferingVO svcOffering = getCSServiceOfferingId(instanceType); if(svcOffering == null){ logger.info("No ServiceOffering found to be defined by name, please contact the administrator "+instanceType ); throw new EC2ServiceException(ClientError.Unsupported, "instanceType: [" + instanceType + "] not found!"); @@ -1521,6 +1531,7 @@ public class EC2Engine { vm.setDomainId(resp.getDomainId()); vm.setHypervisor(resp.getHypervisor()); vm.setServiceOffering( svcOffering.getName()); + vm.setKeyPairName(resp.getKeyPairName()); instances.addInstance(vm); countCreated++; } @@ -1778,12 +1789,11 @@ public class EC2Engine { * */ - private CloudStackServiceOffering getCSServiceOfferingId(String instanceType){ + private CloudStackServiceOfferingVO getCSServiceOfferingId(String instanceType){ try { - if (null == instanceType) instanceType = "m1.small"; + if (null == instanceType) instanceType = "m1.small"; - CloudStackSvcOfferingDao dao = new CloudStackSvcOfferingDao(); - return dao.getSvcOfferingByName(instanceType); + return scvoDao.getSvcOfferingByName(instanceType); } catch(Exception e) { logger.error( "Error while retrieving ServiceOffering information by name - ", e); @@ -1801,8 +1811,8 @@ public class EC2Engine { */ private String serviceOfferingIdToInstanceType( String serviceOfferingId ){ try{ - CloudStackSvcOfferingDao dao = new CloudStackSvcOfferingDao(); - CloudStackServiceOffering offering = dao.getSvcOfferingById(serviceOfferingId); + + CloudStackServiceOfferingVO offering = scvoDao.getSvcOfferingById(serviceOfferingId); //dao.getSvcOfferingById(serviceOfferingId); if(offering == null){ logger.warn( "No instanceType match for serviceOfferingId: [" + serviceOfferingId + "]" ); return "m1.small"; @@ -1905,7 +1915,8 @@ public class EC2Engine { ec2Vm.setRootDeviceType(cloudVm.getRootDeviceType()); ec2Vm.setRootDeviceId(cloudVm.getRootDeviceId()); ec2Vm.setServiceOffering(serviceOfferingIdToInstanceType(cloudVm.getServiceOfferingId().toString())); - + ec2Vm.setKeyPairName(cloudVm.getKeyPairName()); + List nics = cloudVm.getNics(); for(CloudStackNic nic : nics) { if(nic.getIsDefault()) { @@ -2258,9 +2269,7 @@ public class EC2Engine { */ private String getDefaultZoneId(String accountId) { try { - CloudStackAccountDao dao = new CloudStackAccountDao(); - CloudStackAccount account = dao.getdefaultZoneId(accountId); - return account.getDefaultZoneId(); + return accDao.getDefaultZoneId(accountId); } catch(Exception e) { logger.error( "Error while retrieving Account information by id - ", e); throw new EC2ServiceException(ServerError.InternalError, e.getMessage()); diff --git a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Instance.java b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Instance.java index 6e2d696aeac..9b43cb74299 100644 --- a/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Instance.java +++ b/awsapi/src/com/cloud/bridge/service/core/ec2/EC2Instance.java @@ -40,6 +40,7 @@ public class EC2Instance { private String hypervisor; private String rootDeviceType; private String rootDeviceId; + private String keyPairName; private List groupSet; private List tagsSet; @@ -60,6 +61,7 @@ public class EC2Instance { hypervisor = null; rootDeviceType = null; rootDeviceId = null; + keyPairName = null; groupSet = new ArrayList(); tagsSet = new ArrayList(); } @@ -192,6 +194,14 @@ public class EC2Instance { rootDeviceId = param; } + public String getKeyPairName() { + return keyPairName; + } + + public void setKeyPairName(String param) { + keyPairName = param; + } + public void addGroupName( String param ) { groupSet.add( param ); } diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java index e8b73a42439..a117d133569 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3Engine.java @@ -36,31 +36,40 @@ import java.util.UUID; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; -import org.hibernate.LockMode; -import org.hibernate.Session; import org.json.simple.parser.ParseException; import com.cloud.bridge.io.S3FileSystemBucketAdapter; -import com.cloud.bridge.model.MHost; -import com.cloud.bridge.model.MHostMount; +import com.cloud.bridge.model.BucketPolicyVO; +import com.cloud.bridge.model.MHostMountVO; +import com.cloud.bridge.model.MHostVO; import com.cloud.bridge.model.SAcl; +import com.cloud.bridge.model.SAclVO; import com.cloud.bridge.model.SBucket; +import com.cloud.bridge.model.SBucketVO; import com.cloud.bridge.model.SHost; -import com.cloud.bridge.model.SMeta; -import com.cloud.bridge.model.SObject; -import com.cloud.bridge.model.SObjectItem; -import com.cloud.bridge.persist.PersistContext; +import com.cloud.bridge.model.SHostVO; +import com.cloud.bridge.model.SMetaVO; +import com.cloud.bridge.model.SObjectVO; +import com.cloud.bridge.model.SObjectItemVO; import com.cloud.bridge.persist.dao.BucketPolicyDao; +import com.cloud.bridge.persist.dao.BucketPolicyDaoImpl; import com.cloud.bridge.persist.dao.MHostDao; +import com.cloud.bridge.persist.dao.MHostDaoImpl; import com.cloud.bridge.persist.dao.MHostMountDao; +import com.cloud.bridge.persist.dao.MHostMountDaoImpl; import com.cloud.bridge.persist.dao.MultipartLoadDao; import com.cloud.bridge.persist.dao.SAclDao; +import com.cloud.bridge.persist.dao.SAclDaoImpl; import com.cloud.bridge.persist.dao.SBucketDao; +import com.cloud.bridge.persist.dao.SBucketDaoImpl; import com.cloud.bridge.persist.dao.SHostDao; +import com.cloud.bridge.persist.dao.SHostDaoImpl; import com.cloud.bridge.persist.dao.SMetaDao; +import com.cloud.bridge.persist.dao.SMetaDaoImpl; import com.cloud.bridge.persist.dao.SObjectDao; +import com.cloud.bridge.persist.dao.SObjectDaoImpl; import com.cloud.bridge.persist.dao.SObjectItemDao; -import com.cloud.bridge.service.S3Constants; +import com.cloud.bridge.persist.dao.SObjectItemDaoImpl; import com.cloud.bridge.service.UserContext; import com.cloud.bridge.service.controller.s3.ServiceProvider; import com.cloud.bridge.service.core.s3.S3BucketPolicy.PolicyAccess; @@ -75,19 +84,31 @@ import com.cloud.bridge.service.exception.ObjectAlreadyExistsException; import com.cloud.bridge.service.exception.OutOfServiceException; import com.cloud.bridge.service.exception.OutOfStorageException; import com.cloud.bridge.service.exception.PermissionDeniedException; -import com.cloud.bridge.service.exception.UnsupportedException; import com.cloud.bridge.util.DateHelper; import com.cloud.bridge.util.PolicyParser; import com.cloud.bridge.util.StringHelper; import com.cloud.bridge.util.OrderedPair; import com.cloud.bridge.util.Triple; +import com.cloud.utils.component.ComponentLocator; +import com.cloud.utils.db.DB; +import com.cloud.utils.db.Transaction; /** * The CRUD control actions to be invoked from S3BucketAction or S3ObjectAction. */ public class S3Engine { protected final static Logger logger = Logger.getLogger(S3Engine.class); - + protected final SHostDao shostDao = ComponentLocator.inject(SHostDaoImpl.class); + protected final MHostDao mhostDao = ComponentLocator.inject(MHostDaoImpl.class); + protected final static BucketPolicyDao bPolicy = ComponentLocator.inject(BucketPolicyDaoImpl.class); + protected final BucketPolicyDao bPolicyDao = ComponentLocator.inject(BucketPolicyDaoImpl.class); + protected final SBucketDao bucketDao = ComponentLocator.inject(SBucketDaoImpl.class); + protected final SAclDao aclDao = ComponentLocator.inject(SAclDaoImpl.class); + protected final static SAclDao saclDao = ComponentLocator.inject(SAclDaoImpl.class); + protected final SObjectDao objectDao = ComponentLocator.inject(SObjectDaoImpl.class); + protected final SObjectItemDao itemDao = ComponentLocator.inject(SObjectItemDaoImpl.class); + protected final SMetaDao metaDao = ComponentLocator.inject(SMetaDaoImpl.class); + protected final MHostMountDao mountDao = ComponentLocator.inject(MHostMountDaoImpl.class); private final int LOCK_ACQUIRING_TIMEOUT_SECONDS = 10; // ten seconds private final Map bucketAdapters = new HashMap(); @@ -169,61 +190,53 @@ public class S3Engine { String cannedAccessPolicy = request.getCannedAccess(); String bucketName = request.getBucketName(); response.setBucketName( bucketName ); - + Transaction txn= null; verifyBucketName( bucketName, false ); S3PolicyContext context = new S3PolicyContext( PolicyActions.CreateBucket, bucketName ); context.setEvalParam( ConditionKeys.Acl, cannedAccessPolicy ); if (PolicyAccess.DENY == verifyPolicy( context )) throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" ); - - if (PersistContext.acquireNamedLock("bucket.creation", LOCK_ACQUIRING_TIMEOUT_SECONDS)) - { - OrderedPair shost_storagelocation_pair = null; - boolean success = false; - try { - SBucketDao bucketDao = new SBucketDao(); - SAclDao aclDao = new SAclDao(); - - if (bucketDao.getByName(request.getBucketName()) != null) - throw new ObjectAlreadyExistsException("Bucket already exists"); - - shost_storagelocation_pair = allocBucketStorageHost(request.getBucketName(), null); - - SBucket sbucket = new SBucket(); - sbucket.setName(request.getBucketName()); - sbucket.setCreateTime(DateHelper.currentGMTTime()); - sbucket.setOwnerCanonicalId( UserContext.current().getCanonicalUserId()); - sbucket.setShost(shost_storagelocation_pair.getFirst()); - shost_storagelocation_pair.getFirst().getBuckets().add(sbucket); - bucketDao.save(sbucket); + OrderedPair shost_storagelocation_pair = null; + boolean success = false; + try { + txn = Transaction.open(Transaction.AWSAPI_DB); - S3AccessControlList acl = request.getAcl(); - - if ( null != cannedAccessPolicy ) - setCannedAccessControls( cannedAccessPolicy, "SBucket", sbucket.getId(), sbucket ); - else if (null != acl) - aclDao.save( "SBucket", sbucket.getId(), acl ); - else setSingleAcl( "SBucket", sbucket.getId(), SAcl.PERMISSION_FULL ); - - // explicitly commit the transaction - PersistContext.commitTransaction(); - success = true; - } - finally - { - if(!success && shost_storagelocation_pair != null) { - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(shost_storagelocation_pair.getFirst()); - bucketAdapter.deleteContainer(shost_storagelocation_pair.getSecond(), request.getBucketName()); - } - PersistContext.rollbackTransaction(false); - PersistContext.releaseNamedLock("bucket.creation"); - } - - } else { - throw new OutOfServiceException("Unable to acquire synchronization lock"); - } - + if (bucketDao.getByName(request.getBucketName()) != null) + throw new ObjectAlreadyExistsException("Bucket already exists"); + + shost_storagelocation_pair = allocBucketStorageHost( + request.getBucketName(), null); + SBucketVO sbucket = new SBucketVO(request.getBucketName(), + DateHelper.currentGMTTime(), UserContext.current() + .getCanonicalUserId(), + shost_storagelocation_pair.getFirst()); + + shost_storagelocation_pair.getFirst().getBuckets().add(sbucket); + // bucketDao.save(sbucket); + sbucket = bucketDao.persist(sbucket); + S3AccessControlList acl = request.getAcl(); + + if (null != cannedAccessPolicy) + setCannedAccessControls(cannedAccessPolicy, "SBucket", + sbucket.getId(), sbucket); + else if (null != acl) + aclDao.save("SBucket", sbucket.getId(), acl); + else + setSingleAcl("SBucket", sbucket.getId(), SAcl.PERMISSION_FULL); + + success = true; + } finally { + if (!success && shost_storagelocation_pair != null) { + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(shost_storagelocation_pair + .getFirst()); + bucketAdapter.deleteContainer( + shost_storagelocation_pair.getSecond(), + request.getBucketName()); + } + txn.rollback(); + txn.close(); + } return response; } @@ -234,37 +247,43 @@ public class S3Engine { public S3Response handleRequest( S3DeleteBucketRequest request ) { - S3Response response = new S3Response(); - SBucketDao bucketDao = new SBucketDao(); + S3Response response = new S3Response(); + // String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName( bucketName ); + SBucketVO sbucket = bucketDao.getByName(bucketName); + Transaction txn = null; if ( sbucket != null ) - { - S3PolicyContext context = new S3PolicyContext( PolicyActions.DeleteBucket, bucketName ); - switch( verifyPolicy( context )) - { - case ALLOW: - // The bucket policy can give users permission to delete a bucket whereas ACLs cannot - break; - - case DENY: - throw new PermissionDeniedException( "Access Denied - bucket policy DENY result" ); - - case DEFAULT_DENY: - default: - // Irrespective of what the ACLs say, only the owner can delete a bucket - String client = UserContext.current().getCanonicalUserId(); - if (!client.equals( sbucket.getOwnerCanonicalId())) { - throw new PermissionDeniedException( "Access Denied - only the owner can delete a bucket" ); - } - break; - } + { + txn = Transaction.open(Transaction.AWSAPI_DB); + txn.start(); + S3PolicyContext context = new S3PolicyContext( PolicyActions.DeleteBucket, bucketName ); + switch( verifyPolicy( context )) + { + case ALLOW: + // The bucket policy can give users permission to delete a + // bucket whereas ACLs cannot + break; - + case DENY: + throw new PermissionDeniedException( + "Access Denied - bucket policy DENY result"); + + case DEFAULT_DENY: + default: + // Irrespective of what the ACLs say, only the owner can delete + // a bucket + String client = UserContext.current().getCanonicalUserId(); + if (!client.equals(sbucket.getOwnerCanonicalId())) { + throw new PermissionDeniedException( + "Access Denied - only the owner can delete a bucket"); + } + break; + } + // Delete the file from its storage location - OrderedPair host_storagelocation_pair = getBucketStorageHost(sbucket); - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); + OrderedPair host_storagelocation_pair = getBucketStorageHost(sbucket); + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); bucketAdapter.deleteContainer(host_storagelocation_pair.getSecond(), request.getBucketName()); // Cascade-deleting can delete related SObject/SObjectItem objects, but not SAcl, SMeta and policy objects. @@ -272,35 +291,37 @@ public class S3Engine { // (1)Get all the objects in the bucket, // (2)then all the items in each object, // (3) then all meta & acl data for each item - Set objectsInBucket = sbucket.getObjectsInBucket(); - Iterator it = objectsInBucket.iterator(); + Set objectsInBucket = sbucket.getObjectsInBucket(); + Iterator it = objectsInBucket.iterator(); while( it.hasNext()) { - SObject oneObject = (SObject)it.next(); - Set itemsInObject = oneObject.getItems(); - Iterator is = itemsInObject.iterator(); + SObjectVO oneObject = (SObjectVO)it.next(); + Set itemsInObject = oneObject.getItems(); + Iterator is = itemsInObject.iterator(); while( is.hasNext()) { - SObjectItem oneItem = (SObjectItem)is.next(); - deleteMetaData( oneItem.getId()); - deleteObjectAcls( "SObjectItem", oneItem.getId()); + SObjectItemVO oneItem = (SObjectItemVO) is.next(); + deleteMetaData(oneItem.getId()); + deleteObjectAcls("SObjectItem", oneItem.getId()); } } // Delete all the policy state associated with the bucket try { - ServiceProvider.getInstance().deleteBucketPolicy( bucketName ); - BucketPolicyDao policyDao = new BucketPolicyDao(); - policyDao.deletePolicy( bucketName ); - } - catch( Exception e ) { - logger.error("When deleting a bucket we must try to delete its policy: ", e); + ServiceProvider.getInstance().deleteBucketPolicy(bucketName); + bPolicyDao.deletePolicy(bucketName); + } catch( Exception e ) { + logger.error("When deleting a bucket we must try to delete its policy: ", e); } deleteBucketAcls( sbucket.getId()); - bucketDao.delete( sbucket ); + bucketDao.remove(sbucket.getId()); + + response.setResultCode(204); response.setResultDescription("OK"); + + txn.close(); } else { response.setResultCode(404); @@ -327,10 +348,10 @@ public class S3Engine { int maxKeys = request.getMaxKeys(); if(maxKeys <= 0) maxKeys = 1000; - SBucketDao bucketDao = new SBucketDao(); - SBucket sbucket = bucketDao.getByName(bucketName); + // + SBucketVO sbucket = bucketDao.getByName(bucketName); if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); - + PolicyActions action = (includeVersions ? PolicyActions.ListBucketVersions : PolicyActions.ListBucket); S3PolicyContext context = new S3PolicyContext( action, bucketName ); context.setEvalParam( ConditionKeys.MaxKeys, new String( "" + maxKeys )); @@ -340,23 +361,23 @@ public class S3Engine { // Wen execting the query, request one more item so that we know how to set isTruncated flag - SObjectDao sobjectDao = new SObjectDao(); - List l = null; + List l = null; if ( includeVersions ) - l = sobjectDao.listAllBucketObjects( sbucket, prefix, marker, maxKeys+1 ); - else l = sobjectDao.listBucketObjects( sbucket, prefix, marker, maxKeys+1 ); + l = objectDao.listAllBucketObjects( sbucket, prefix, marker, maxKeys+1 ); + else l = objectDao.listBucketObjects( sbucket, prefix, marker, maxKeys+1 ); response.setBucketName(bucketName); response.setMarker(marker); response.setMaxKeys(maxKeys); response.setPrefix(prefix); response.setDelimiter(delimiter); - response.setTruncated(l.size() > maxKeys); - if(l.size() > maxKeys) { - response.setNextMarker(l.get(l.size() - 1).getNameKey()); + if (null != l ) { + response.setTruncated(l.size() > maxKeys); + if(l.size() > maxKeys) { + response.setNextMarker(l.get(l.size() - 1).getNameKey()); + } } - // If needed - SOAP response does not support versioning response.setContents( composeListBucketContentEntries(l, prefix, delimiter, maxKeys, includeVersions, request.getVersionIdMarker())); response.setCommonPrefixes( composeListBucketPrefixEntries(l, prefix, delimiter, maxKeys)); @@ -372,10 +393,10 @@ public class S3Engine { public S3ListAllMyBucketsResponse handleRequest(S3ListAllMyBucketsRequest request) { S3ListAllMyBucketsResponse response = new S3ListAllMyBucketsResponse(); - SBucketDao bucketDao = new SBucketDao(); + // "...you can only list buckets for which you are the owner." - List buckets = bucketDao.listBuckets(UserContext.current().getCanonicalUserId()); + List buckets = bucketDao.listBuckets(UserContext.current().getCanonicalUserId()); S3CanonicalUser owner = new S3CanonicalUser(); owner.setID(UserContext.current().getCanonicalUserId()); owner.setDisplayName(""); @@ -385,7 +406,7 @@ public class S3Engine { { S3ListAllMyBucketsEntry[] entries = new S3ListAllMyBucketsEntry[buckets.size()]; int i = 0; - for(SBucket bucket : buckets) + for(SBucketVO bucket : buckets) { String bucketName = bucket.getName(); S3PolicyContext context = new S3PolicyContext( PolicyActions.ListAllMyBuckets, bucketName ); @@ -409,9 +430,8 @@ public class S3Engine { public S3Response handleRequest(S3SetBucketAccessControlPolicyRequest request) { S3Response response = new S3Response(); - SBucketDao bucketDao = new SBucketDao(); String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName(bucketName); + SBucketVO sbucket = bucketDao.getByName(bucketName); if(sbucket == null) { response.setResultCode(404); response.setResultDescription("Bucket does not exist"); @@ -421,7 +441,6 @@ public class S3Engine { S3PolicyContext context = new S3PolicyContext( PolicyActions.PutBucketAcl, bucketName ); verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_WRITE_ACL ); - SAclDao aclDao = new SAclDao(); aclDao.save("SBucket", sbucket.getId(), request.getAcl()); response.setResultCode(200); @@ -438,9 +457,8 @@ public class S3Engine { public S3AccessControlPolicy handleRequest(S3GetBucketAccessControlPolicyRequest request) { S3AccessControlPolicy policy = new S3AccessControlPolicy(); - SBucketDao bucketDao = new SBucketDao(); String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName( bucketName ); + SBucketVO sbucket = bucketDao.getByName( bucketName ); if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); @@ -452,8 +470,8 @@ public class S3Engine { S3PolicyContext context = new S3PolicyContext( PolicyActions.GetBucketAcl, bucketName ); verifyAccess( context, "SBucket", sbucket.getId(), SAcl.PERMISSION_READ_ACL ); - SAclDao aclDao = new SAclDao(); - List grants = aclDao.listGrants("SBucket", sbucket.getId()); + + List grants = aclDao.listGrants("SBucket", sbucket.getId()); policy.setGrants(S3Grant.toGrants(grants)); return policy; } @@ -464,61 +482,69 @@ public class S3Engine { * Called from S3ObjectAction when executing at completion or when aborting multipart upload. * @param bucketName * @param uploadId - * @param verifyPermission - If false then do not check the user's permission to clean up the state + * @param verifyPermissiod - If false then do not check the user's permission to clean up the state */ - public int freeUploadParts(String bucketName, int uploadId, boolean verifyPermission) - { - // -> we need to look up the final bucket to figure out which mount point to use to save the part in - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); - if (bucket == null) { - logger.error( "initiateMultipartUpload failed since " + bucketName + " does not exist" ); - return 404; - } + public int freeUploadParts(String bucketName, int uploadId, boolean verifyPermission) { - OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); + // -> we need to look up the final bucket to figure out which mount + // point to use to save the part in + // SBucketDao bucketDao = new SBucketDao(); + SBucketVO bucket = bucketDao.getByName(bucketName); + if (bucket == null) { + logger.error("initiateMultipartUpload failed since " + bucketName + + " does not exist"); + return 404; + } - try { - MultipartLoadDao uploadDao = new MultipartLoadDao(); - OrderedPair exists = uploadDao.multipartExits( uploadId ); - if (null == exists) { - logger.error( "initiateMultipartUpload failed since multipart upload" + uploadId + " does not exist" ); - return 404; - } - - // -> the multipart initiator or bucket owner can do this action by default - if (verifyPermission) - { - String initiator = uploadDao.getInitiator( uploadId ); - if (null == initiator || !initiator.equals( UserContext.current().getAccessKey())) - { - // -> write permission on a bucket allows a PutObject / DeleteObject action on any object in the bucket - S3PolicyContext context = new S3PolicyContext( PolicyActions.AbortMultipartUpload, bucketName ); - context.setKeyName( exists.getSecond()); - verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); - } - } + OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); - // -> first get a list of all the uploaded files and delete one by one - S3MultipartPart[] parts = uploadDao.getParts( uploadId, 10000, 0 ); - for( int i=0; i < parts.length; i++ ) - { - bucketAdapter.deleteObject( host_storagelocation_pair.getSecond(), ServiceProvider.getInstance().getMultipartDir(), parts[i].getPath()); - } - - uploadDao.deleteUpload( uploadId ); - return 204; + try { + MultipartLoadDao uploadDao = new MultipartLoadDao(); + OrderedPair exists = uploadDao.multipartExits(uploadId); + + if (null == exists) { + logger.error("initiateMultipartUpload failed since multipart upload" + + uploadId + " does not exist"); + return 404; + } + // -> the multipart initiator or bucket owner can do this action by + // default + if (verifyPermission) { + String initiator = uploadDao.getInitiator(uploadId); + if (null == initiator + || !initiator.equals(UserContext.current() + .getAccessKey())) { + // -> write permission on a bucket allows a PutObject / + // DeleteObject action on any object in the bucket + S3PolicyContext context = new S3PolicyContext( + PolicyActions.AbortMultipartUpload, bucketName); + context.setKeyName(exists.getSecond()); + verifyAccess(context, "SBucket", bucket.getId(), + SAcl.PERMISSION_WRITE); } - catch( PermissionDeniedException e ) { - logger.error("freeUploadParts failed due to [" + e.getMessage() + "]", e); - throw e; - } - catch (Exception e) { - logger.error("freeUploadParts failed due to [" + e.getMessage() + "]", e); - return 500; - } + } + + // -> first get a list of all the uploaded files and delete one by + // one + S3MultipartPart[] parts = uploadDao.getParts(uploadId, 10000, 0); + for (int i = 0; i < parts.length; i++) { + bucketAdapter.deleteObject(host_storagelocation_pair.getSecond(), ServiceProvider.getInstance() + .getMultipartDir(), parts[i].getPath()); + } + uploadDao.deleteUpload(uploadId); + return 204; + + } catch (PermissionDeniedException e) { + logger.error("freeUploadParts failed due to [" + e.getMessage() + + "]", e); + throw e; + } catch (Exception e) { + logger.error("freeUploadParts failed due to [" + e.getMessage() + + "]", e); + return 500; + } } /** @@ -534,8 +560,7 @@ public class S3Engine { String nameKey = request.getKey(); // -> does the bucket exist and can we write to it? - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); + SBucketVO bucket = bucketDao.getByName(bucketName); if (bucket == null) { logger.error( "initiateMultipartUpload failed since " + bucketName + " does not exist" ); response.setResultCode(404); @@ -577,8 +602,8 @@ public class S3Engine { String bucketName = request.getBucketName(); // -> we need to look up the final bucket to figure out which mount point to use to save the part in - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); + //SBucketDao bucketDao = new SBucketDao(); + SBucketVO bucket = bucketDao.getByName(bucketName); if (bucket == null) { logger.error( "saveUploadedPart failed since " + bucketName + " does not exist" ); response.setResultCode(404); @@ -587,20 +612,19 @@ public class S3Engine { context.setKeyName( request.getKey()); verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); - OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); + OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); String itemFileName = new String( uploadId + "-" + partNumber ); InputStream is = null; try { - is = request.getDataInputStream(); - String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), ServiceProvider.getInstance().getMultipartDir(), itemFileName); - response.setETag(md5Checksum); - - MultipartLoadDao uploadDao = new MultipartLoadDao(); - uploadDao.savePart( uploadId, partNumber, md5Checksum, itemFileName, (int)request.getContentLength()); - response.setResultCode(200); - + is = request.getDataInputStream(); + String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), ServiceProvider.getInstance().getMultipartDir(), itemFileName); + response.setETag(md5Checksum); + MultipartLoadDao uploadDao = new MultipartLoadDao(); + uploadDao.savePart(uploadId, partNumber, md5Checksum, itemFileName,(int) request.getContentLength()); + response.setResultCode(200); + } catch (IOException e) { logger.error("UploadPart failed due to " + e.getMessage(), e); response.setResultCode(500); @@ -637,70 +661,71 @@ public class S3Engine { public S3PutObjectInlineResponse concatentateMultipartUploads(HttpServletResponse httpResp, S3PutObjectInlineRequest request, S3MultipartPart[] parts, OutputStream outputStream) throws IOException { // [A] Set up and initial error checking - S3PutObjectInlineResponse response = new S3PutObjectInlineResponse(); - String bucketName = request.getBucketName(); - String key = request.getKey(); - S3MetaDataEntry[] meta = request.getMetaEntries(); - - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); - if (bucket == null) { - logger.error( "completeMultipartUpload( failed since " + bucketName + " does not exist" ); - response.setResultCode(404); - } + S3PutObjectInlineResponse response = new S3PutObjectInlineResponse(); + String bucketName = request.getBucketName(); + String key = request.getKey(); + S3MetaDataEntry[] meta = request.getMetaEntries(); - // [B] Now we need to create the final re-assembled object - // -> the allocObjectItem checks for the bucket policy PutObject permissions - OrderedPair object_objectitem_pair = allocObjectItem(bucket, key, meta, null, request.getCannedAccess()); - OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); - - S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); - String itemFileName = object_objectitem_pair.getSecond().getStoredPath(); - - // -> Amazon defines that we must return a 200 response immediately to the client, but - // -> we don't know the version header until we hit here - httpResp.setStatus(200); - httpResp.setContentType("text/xml; charset=UTF-8"); - String version = object_objectitem_pair.getSecond().getVersion(); - if (null != version) httpResp.addHeader( "x-amz-version-id", version ); - httpResp.flushBuffer(); - + SBucketVO bucket = bucketDao.getByName(bucketName); + if (bucket == null) { + logger.error("completeMultipartUpload( failed since " + bucketName + + " does not exist"); + response.setResultCode(404); + } - // [C] Re-assemble the object from its uploaded file parts - try { - // explicit transaction control to avoid holding transaction during long file concatenation process - PersistContext.commitTransaction(); - - OrderedPair result = bucketAdapter. - concatentateObjects - ( host_storagelocation_pair.getSecond(), - bucket.getName(), - itemFileName, - ServiceProvider.getInstance().getMultipartDir(), - parts, - outputStream ); - response.setETag(result.getFirst()); - response.setLastModified(DateHelper.toCalendar( object_objectitem_pair.getSecond().getLastModifiedTime())); - - SObjectItemDao itemDao = new SObjectItemDao(); - SObjectItem item = itemDao.get( object_objectitem_pair.getSecond().getId()); - item.setMd5(result.getFirst()); - item.setStoredSize(result.getSecond().longValue()); - response.setResultCode(200); + // [B] Now we need to create the final re-assembled object + // -> the allocObjectItem checks for the bucket policy PutObject + // permissions + OrderedPair object_objectitem_pair = allocObjectItem( + bucket, key, meta, null, request.getCannedAccess()); + OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); - PersistContext.getSession().save(item); - } - catch (Exception e) { - logger.error("completeMultipartUpload failed due to " + e.getMessage(), e); - } - return response; + S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair + .getFirst()); + String itemFileName = object_objectitem_pair.getSecond() + .getStoredPath(); + + // -> Amazon defines that we must return a 200 response immediately to + // the client, but + // -> we don't know the version header until we hit here + httpResp.setStatus(200); + httpResp.setContentType("text/xml; charset=UTF-8"); + String version = object_objectitem_pair.getSecond().getVersion(); + if (null != version) + httpResp.addHeader("x-amz-version-id", version); + httpResp.flushBuffer(); + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + // [C] Re-assemble the object from its uploaded file parts + try { + // explicit transaction control to avoid holding transaction during + // long file concatenation process + txn.start(); + OrderedPair result = bucketAdapter + .concatentateObjects(host_storagelocation_pair.getSecond(), + bucket.getName(), itemFileName, ServiceProvider + .getInstance().getMultipartDir(), parts, + outputStream); + + response.setETag(result.getFirst()); + response.setLastModified(DateHelper.toCalendar(object_objectitem_pair.getSecond().getLastModifiedTime())); + SObjectItemVO item = itemDao.findById(object_objectitem_pair + .getSecond().getId()); + item.setMd5(result.getFirst()); + item.setStoredSize(result.getSecond().longValue()); + itemDao.update(item.getId(), item); + response.setResultCode(200); + } catch (Exception e) { + logger.error("completeMultipartUpload failed due to " + e.getMessage(),e); + txn.close(); + } + return response; } /** * Return a S3PutObjectInlineResponse which represents an object being created into a bucket * Called from S3ObjectAction when PUTting or POTing an object. */ - + @DB public S3PutObjectInlineResponse handleRequest(S3PutObjectInlineRequest request) { S3PutObjectInlineResponse response = new S3PutObjectInlineResponse(); @@ -710,36 +735,36 @@ public class S3Engine { S3MetaDataEntry[] meta = request.getMetaEntries(); S3AccessControlList acl = request.getAcl(); - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); + SBucketVO bucket = bucketDao.getByName(bucketName); if (bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); // Is the caller allowed to write the object? // The allocObjectItem checks for the bucket policy PutObject permissions - OrderedPair object_objectitem_pair = allocObjectItem(bucket, key, meta, acl, request.getCannedAccess()); - OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); + OrderedPair object_objectitem_pair = allocObjectItem(bucket, key, meta, acl, request.getCannedAccess()); + OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); String itemFileName = object_objectitem_pair.getSecond().getStoredPath(); InputStream is = null; - + Transaction txn = null; try { // explicit transaction control to avoid holding transaction during file-copy process - PersistContext.commitTransaction(); + txn = Transaction.open(Transaction.AWSAPI_DB); + txn.start(); is = request.getDataInputStream(); String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), bucket.getName(), itemFileName); response.setETag(md5Checksum); response.setLastModified(DateHelper.toCalendar( object_objectitem_pair.getSecond().getLastModifiedTime())); response.setVersion( object_objectitem_pair.getSecond().getVersion()); - SObjectItemDao itemDao = new SObjectItemDao(); - SObjectItem item = itemDao.get( object_objectitem_pair.getSecond().getId()); + //SObjectItemDaoImpl itemDao = new SObjectItemDaoImpl(); + SObjectItemVO item = itemDao.findById(object_objectitem_pair.getSecond().getId()); item.setMd5(md5Checksum); item.setStoredSize(contentLength); - PersistContext.getSession().save(item); - + itemDao.update(item.getId(), item); + txn.commit(); } catch (IOException e) { logger.error("PutObjectInline failed due to " + e.getMessage(), e); } catch (OutOfStorageException e) { @@ -752,6 +777,7 @@ public class S3Engine { logger.error("PutObjectInline unable to close stream from data handler.", e); } } + txn.close(); } return response; @@ -771,32 +797,34 @@ public class S3Engine { S3MetaDataEntry[] meta = request.getMetaEntries(); S3AccessControlList acl = request.getAcl(); - SBucketDao bucketDao = new SBucketDao(); - SBucket bucket = bucketDao.getByName(bucketName); + SBucketVO bucket = bucketDao.getByName(bucketName); if(bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); // Is the caller allowed to write the object? // The allocObjectItem checks for the bucket policy PutObject permissions - OrderedPair object_objectitem_pair = allocObjectItem(bucket, key, meta, acl, null); - OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); + OrderedPair object_objectitem_pair = allocObjectItem(bucket, key, meta, acl, null); + OrderedPair host_storagelocation_pair = getBucketStorageHost(bucket); S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(host_storagelocation_pair.getFirst()); String itemFileName = object_objectitem_pair.getSecond().getStoredPath(); InputStream is = null; + Transaction txn = null; try { // explicit transaction control to avoid holding transaction during file-copy process - PersistContext.commitTransaction(); + + txn = Transaction.open(Transaction.AWSAPI_DB); + txn.start(); is = request.getInputStream(); String md5Checksum = bucketAdapter.saveObject(is, host_storagelocation_pair.getSecond(), bucket.getName(), itemFileName); response.setETag(md5Checksum); response.setLastModified(DateHelper.toCalendar( object_objectitem_pair.getSecond().getLastModifiedTime())); - SObjectItemDao itemDao = new SObjectItemDao(); - SObjectItem item = itemDao.get( object_objectitem_pair.getSecond().getId()); + SObjectItemVO item = itemDao.findById(object_objectitem_pair.getSecond().getId()); item.setMd5(md5Checksum); item.setStoredSize(contentLength); - PersistContext.getSession().save(item); + itemDao.update(item.getId(), item); + txn.commit(); } catch (OutOfStorageException e) { logger.error("PutObject failed due to " + e.getMessage(), e); @@ -808,6 +836,7 @@ public class S3Engine { logger.error("Unable to close stream from data handler.", e); } } + txn.close(); } return response; @@ -825,18 +854,16 @@ public class S3Engine { // [A] First find the object in the bucket S3Response response = new S3Response(); - SBucketDao bucketDao = new SBucketDao(); String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName( bucketName ); + SBucketVO sbucket = bucketDao.getByName( bucketName ); if(sbucket == null) { response.setResultCode(404); response.setResultDescription("Bucket " + bucketName + "does not exist"); return response; } - SObjectDao sobjectDao = new SObjectDao(); String nameKey = request.getKey(); - SObject sobject = sobjectDao.getByNameKey( sbucket, nameKey ); + SObjectVO sobject = objectDao.getByNameKey( sbucket, nameKey ); if(sobject == null) { response.setResultCode(404); response.setResultDescription("Object " + request.getKey() + " in bucket " + bucketName + " does not exist"); @@ -852,7 +879,7 @@ public class S3Engine { // [B] Versioning allow the client to ask for a specific version not just the latest - SObjectItem item = null; + SObjectItemVO item = null; int versioningStatus = sbucket.getVersioningStatus(); String wantVersion = request.getVersion(); if ( SBucket.VERSIONING_ENABLED == versioningStatus && null != wantVersion) @@ -875,7 +902,6 @@ public class S3Engine { verifyAccess( context, "SObjectItem", item.getId(), SAcl.PERMISSION_WRITE_ACL ); // -> the acl always goes on the instance of the object - SAclDao aclDao = new SAclDao(); aclDao.save("SObjectItem", item.getId(), request.getAcl()); response.setResultCode(200); @@ -895,15 +921,15 @@ public class S3Engine { // [A] Does the object exist that holds the ACL we are looking for? S3AccessControlPolicy policy = new S3AccessControlPolicy(); - SBucketDao bucketDao = new SBucketDao(); + String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName( bucketName ); + SBucketVO sbucket = bucketDao.getByName( bucketName ); if (sbucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist"); - SObjectDao sobjectDao = new SObjectDao(); + //SObjectDaoImpl sobjectDao = new SObjectDaoImpl(); String nameKey = request.getKey(); - SObject sobject = sobjectDao.getByNameKey( sbucket, nameKey ); + SObjectVO sobject = objectDao.getByNameKey( sbucket, nameKey ); if (sobject == null) throw new NoSuchObjectException("Object " + request.getKey() + " does not exist"); @@ -916,7 +942,7 @@ public class S3Engine { // [B] Versioning allow the client to ask for a specific version not just the latest - SObjectItem item = null; + SObjectItemVO item = null; int versioningStatus = sbucket.getVersioningStatus(); String wantVersion = request.getVersion(); if ( SBucket.VERSIONING_ENABLED == versioningStatus && null != wantVersion) @@ -946,8 +972,8 @@ public class S3Engine { policy.setOwner(owner); policy.setResultCode(200); - SAclDao aclDao = new SAclDao(); - List grants = aclDao.listGrants( "SObjectItem", item.getId()); + + List grants = aclDao.listGrants( "SObjectItem", item.getId()); policy.setGrants(S3Grant.toGrants(grants)); return policy; } @@ -967,18 +993,17 @@ public class S3Engine { int resultCode = 200; // [A] Verify that the bucket and the object exist - SBucketDao bucketDao = new SBucketDao(); + String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName(bucketName); + SBucketVO sbucket = bucketDao.getByName(bucketName); if (sbucket == null) { response.setResultCode(404); response.setResultDescription("Bucket " + request.getBucketName() + " does not exist"); return response; } - SObjectDao objectDao = new SObjectDao(); String nameKey = request.getKey(); - SObject sobject = objectDao.getByNameKey( sbucket, nameKey ); + SObjectVO sobject = objectDao.getByNameKey( sbucket, nameKey ); if (sobject == null) { response.setResultCode(404); response.setResultDescription("Object " + request.getKey() + " does not exist in bucket " + request.getBucketName()); @@ -995,7 +1020,7 @@ public class S3Engine { // [B] Versioning allow the client to ask for a specific version not just the latest - SObjectItem item = null; + SObjectItemVO item = null; int versioningStatus = sbucket.getVersioningStatus(); String wantVersion = request.getVersion(); if ( SBucket.VERSIONING_ENABLED == versioningStatus && null != wantVersion) @@ -1037,15 +1062,15 @@ public class S3Engine { // [D] Return the contents of the object inline // -> extract the meta data that corresponds the specific versioned item - SMetaDao metaDao = new SMetaDao(); - List itemMetaData = metaDao.getByTarget( "SObjectItem", item.getId()); + + List itemMetaData = metaDao.getByTarget( "SObjectItem", item.getId()); if (null != itemMetaData) { int i = 0; S3MetaDataEntry[] metaEntries = new S3MetaDataEntry[ itemMetaData.size() ]; - ListIterator it = itemMetaData.listIterator(); + ListIterator it = itemMetaData.listIterator(); while( it.hasNext()) { - SMeta oneTag = (SMeta)it.next(); + SMetaVO oneTag = (SMetaVO)it.next(); S3MetaDataEntry oneEntry = new S3MetaDataEntry(); oneEntry.setName( oneTag.getName()); oneEntry.setValue( oneTag.getValue()); @@ -1068,7 +1093,7 @@ public class S3Engine { response.setVersion( item.getVersion()); if (request.isInlineData()) { - OrderedPair tupleSHostInfo = getBucketStorageHost(sbucket); + OrderedPair tupleSHostInfo = getBucketStorageHost(sbucket); S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(tupleSHostInfo.getFirst()); if ( 0 <= bytesStart && 0 <= bytesEnd ) @@ -1091,18 +1116,18 @@ public class S3Engine { { // Verify that the bucket and object exist S3Response response = new S3Response(); - SBucketDao bucketDao = new SBucketDao(); + String bucketName = request.getBucketName(); - SBucket sbucket = bucketDao.getByName( bucketName ); + SBucketVO sbucket = bucketDao.getByName( bucketName ); if (sbucket == null) { response.setResultCode(404); response.setResultDescription("Bucket dosen't existsBucket " + bucketName + " does not exist"); return response; } - SObjectDao objectDao = new SObjectDao(); + String nameKey = request.getKey(); - SObject sobject = objectDao.getByNameKey( sbucket, nameKey ); + SObjectVO sobject = objectDao.getByNameKey( sbucket, nameKey ); if (sobject == null) { response.setResultCode(404); response.setResultDescription("Not FoundNo object with key " + nameKey + " exists in bucket " + bucketName+""); @@ -1112,7 +1137,7 @@ public class S3Engine { // Discover whether versioning is enabled. If so versioning requires the setting of a deletion marker. String storedPath = null; - SObjectItem item = null; + SObjectItemVO item = null; int versioningStatus = sbucket.getVersioningStatus(); if ( SBucket.VERSIONING_ENABLED == versioningStatus ) { @@ -1125,7 +1150,7 @@ public class S3Engine { if (null == wantVersion) { // If versioning is on and no versionId is given then we just write a deletion marker sobject.setDeletionMark( UUID.randomUUID().toString()); - objectDao.update( sobject ); + objectDao.update(sobject.getId(), sobject ); response.setResultDescription("true"+ sobject.getDeletionMark() +""); } else { @@ -1133,7 +1158,7 @@ public class S3Engine { String deletionMarker = sobject.getDeletionMark(); if (null != deletionMarker && wantVersion.equalsIgnoreCase( deletionMarker )) { sobject.setDeletionMark( null ); - objectDao.update( sobject ); + objectDao.update(sobject.getId(), sobject ); response.setResultDescription("" + wantVersion +""); response.setResultDescription("true"+ sobject.getDeletionMark() +""); response.setResultCode(204); @@ -1149,7 +1174,7 @@ public class S3Engine { // Providing versionId is non-null, then just delete the one item that matches the versionId from the database storedPath = item.getStoredPath(); sobject.deleteItem( item.getId()); - objectDao.update( sobject ); + objectDao.update(sobject.getId(), sobject ); response.setResultDescription("" + wantVersion +""); } } @@ -1171,9 +1196,9 @@ public class S3Engine { // Otherwiswe remove the entire object // Cascade-deleting can delete related SObject/SObjectItem objects, but not SAcl and SMeta objects. storedPath = item.getStoredPath(); - deleteMetaData( item.getId()); - deleteObjectAcls( "SObjectItem", item.getId()); - objectDao.delete( sobject ); + deleteMetaData( item.getId()); + deleteObjectAcls( "SObjectItem", item.getId()); + objectDao.remove(sobject.getId()); } } } @@ -1181,7 +1206,7 @@ public class S3Engine { // Delete the file holding the object if (null != storedPath) { - OrderedPair host_storagelocation_pair = getBucketStorageHost( sbucket ); + OrderedPair host_storagelocation_pair = getBucketStorageHost( sbucket ); S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter( host_storagelocation_pair.getFirst()); bucketAdapter.deleteObject( host_storagelocation_pair.getSecond(), bucketName, storedPath ); } @@ -1192,50 +1217,48 @@ public class S3Engine { private void deleteMetaData( long itemId ) { - SMetaDao metaDao = new SMetaDao(); - List itemMetaData = metaDao.getByTarget( "SObjectItem", itemId ); + List itemMetaData = metaDao.getByTarget( "SObjectItem", itemId ); if (null != itemMetaData) { - ListIterator it = itemMetaData.listIterator(); + ListIterator it = itemMetaData.listIterator(); while( it.hasNext()) { - SMeta oneTag = (SMeta)it.next(); - metaDao.delete( oneTag ); + SMetaVO oneTag = (SMetaVO)it.next(); + metaDao.remove(oneTag.getId()); } } } private void deleteObjectAcls( String target, long itemId ) { - SAclDao aclDao = new SAclDao(); - List itemAclData = aclDao.listGrants( target, itemId ); + List itemAclData = aclDao.listGrants( target, itemId ); if (null != itemAclData) { - ListIterator it = itemAclData.listIterator(); + ListIterator it = itemAclData.listIterator(); while( it.hasNext()) { - SAcl oneTag = (SAcl)it.next(); - aclDao.delete( oneTag ); + SAclVO oneTag = (SAclVO)it.next(); + aclDao.remove(oneTag.getId()); } } } private void deleteBucketAcls( long bucketId ) { - SAclDao aclDao = new SAclDao(); - List bucketAclData = aclDao.listGrants( "SBucket", bucketId ); + + List bucketAclData = aclDao.listGrants( "SBucket", bucketId ); if (null != bucketAclData) { - ListIterator it = bucketAclData.listIterator(); + ListIterator it = bucketAclData.listIterator(); while( it.hasNext()) { - SAcl oneTag = (SAcl)it.next(); - aclDao.delete( oneTag ); + SAclVO oneTag = (SAclVO)it.next(); + aclDao.remove(oneTag.getId()); } } } - private S3ListBucketPrefixEntry[] composeListBucketPrefixEntries(List l, String prefix, String delimiter, int maxKeys) + private S3ListBucketPrefixEntry[] composeListBucketPrefixEntries(List l, String prefix, String delimiter, int maxKeys) { List entries = new ArrayList(); int count = 0; - for(SObject sobject : l) + for(SObjectVO sobject : l) { if(delimiter != null && !delimiter.isEmpty()) { @@ -1264,14 +1287,14 @@ public class S3Engine { * * TODO - how does the versionIdMarker work when there is a deletion marker in the object? */ - private S3ListBucketObjectEntry[] composeListBucketContentEntries(List l, String prefix, String delimiter, int maxKeys, boolean enableVersion, String versionIdMarker) + private S3ListBucketObjectEntry[] composeListBucketContentEntries(List l, String prefix, String delimiter, int maxKeys, boolean enableVersion, String versionIdMarker) { List entries = new ArrayList(); - SObjectItem latest = null; + SObjectItemVO latest = null; boolean hitIdMarker = false; int count = 0; - for( SObject sobject : l ) + for( SObjectVO sobject : l ) { if (delimiter != null && !delimiter.isEmpty()) { @@ -1301,10 +1324,10 @@ public class S3Engine { } else latest = sobject.getLatestVersion( false ); - Iterator it = sobject.getItems().iterator(); + Iterator it = sobject.getItems().iterator(); while( it.hasNext()) { - SObjectItem item = (SObjectItem)it.next(); + SObjectItemVO item = (SObjectItemVO)it.next(); if ( !hitIdMarker ) { @@ -1318,13 +1341,13 @@ public class S3Engine { } else { // -> if there are multiple versions of an object then just return its last version - Iterator it = sobject.getItems().iterator(); - SObjectItem lastestItem = null; + Iterator it = sobject.getItems().iterator(); + SObjectItemVO lastestItem = null; int maxVersion = 0; int version = 0; while(it.hasNext()) { - SObjectItem item = (SObjectItem)it.next(); + SObjectItemVO item = (SObjectItemVO)it.next(); String versionStr = item.getVersion(); if ( null != versionStr ) @@ -1351,7 +1374,7 @@ public class S3Engine { else return null; } - private static S3ListBucketObjectEntry toListEntry( SObject sobject, SObjectItem item, SObjectItem latest ) + private static S3ListBucketObjectEntry toListEntry( SObjectVO sobject, SObjectItemVO item, SObjectItemVO latest ) { S3ListBucketObjectEntry entry = new S3ListBucketObjectEntry(); entry.setKey(sobject.getNameKey()); @@ -1367,22 +1390,21 @@ public class S3Engine { return entry; } - private OrderedPair getBucketStorageHost(SBucket bucket) + private OrderedPair getBucketStorageHost(SBucketVO bucket) { - MHostMountDao mountDao = new MHostMountDao(); - SHost shost = bucket.getShost(); + SHostVO shost = shostDao.findById(bucket.getShostID()); if(shost.getHostType() == SHost.STORAGE_HOST_TYPE_LOCAL) { - return new OrderedPair(shost, shost.getExportRoot()); + return new OrderedPair(shost, shost.getExportRoot()); } - MHostMount mount = mountDao.getHostMount(ServiceProvider.getInstance().getManagementHostId(), shost.getId()); + MHostMountVO mount = mountDao.getHostMount(ServiceProvider.getInstance().getManagementHostId(), shost.getId()); if(mount != null) { - return new OrderedPair(shost, mount.getMountPath()); + return new OrderedPair(shost, mount.getMountPath()); } - + //return null; // need to redirect request to other node - throw new HostNotMountedException("Storage host " + shost.getHost() + " is not locally mounted"); + throw new HostNotMountedException("Storage host "); // + shost.getHost() + " is not locally mounted"); } /** @@ -1393,15 +1415,12 @@ public class S3Engine { */ private void createUploadFolder(String bucketName) { - if (PersistContext.acquireNamedLock("bucket.creation", LOCK_ACQUIRING_TIMEOUT_SECONDS)) - { try { allocBucketStorageHost(bucketName, ServiceProvider.getInstance().getMultipartDir()); - } + } finally { - PersistContext.releaseNamedLock("bucket.creation"); + } - } } /** @@ -1413,40 +1432,39 @@ public class S3Engine { * @param overrideName * @return */ - private OrderedPair allocBucketStorageHost(String bucketName, String overrideName) + private OrderedPair allocBucketStorageHost(String bucketName, String overrideName) { - MHostDao mhostDao = new MHostDao(); - SHostDao shostDao = new SHostDao(); + //SHostDao shostDao = new SHostDao(); - MHost mhost = mhostDao.get(ServiceProvider.getInstance().getManagementHostId()); + MHostVO mhost = mhostDao.findById(ServiceProvider.getInstance().getManagementHostId()); if(mhost == null) throw new OutOfServiceException("Temporarily out of service"); if(mhost.getMounts().size() > 0) { Random random = new Random(); - MHostMount[] mounts = (MHostMount[])mhost.getMounts().toArray(); - MHostMount mount = mounts[random.nextInt(mounts.length)]; + MHostMountVO[] mounts = (MHostMountVO[])mhost.getMounts().toArray(); + MHostMountVO mount = mounts[random.nextInt(mounts.length)]; S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(mount.getShost()); bucketAdapter.createContainer(mount.getMountPath(), (null != overrideName ? overrideName : bucketName)); - return new OrderedPair(mount.getShost(), mount.getMountPath()); + return new OrderedPair(mount.getShost(), mount.getMountPath()); } // To make things simple, only allow one local mounted storage root TODO - Change in the future String localStorageRoot = ServiceProvider.getInstance().getStartupProperties().getProperty("storage.root"); if(localStorageRoot != null) { - SHost localSHost = shostDao.getLocalStorageHost(mhost.getId(), localStorageRoot); + SHostVO localSHost = shostDao.getLocalStorageHost(mhost.getId(), localStorageRoot); if(localSHost == null) throw new InternalErrorException("storage.root is configured but not initialized"); S3BucketAdapter bucketAdapter = getStorageHostBucketAdapter(localSHost); bucketAdapter.createContainer(localSHost.getExportRoot(),(null != overrideName ? overrideName : bucketName)); - return new OrderedPair(localSHost, localStorageRoot); + return new OrderedPair(localSHost, localStorageRoot); } throw new OutOfStorageException("No storage host is available"); } - public S3BucketAdapter getStorageHostBucketAdapter(SHost shost) + public S3BucketAdapter getStorageHostBucketAdapter(SHostVO shost) { S3BucketAdapter adapter = bucketAdapters.get(shost.getHostType()); if(adapter == null) @@ -1464,17 +1482,13 @@ public class S3Engine { * @throws IOException */ @SuppressWarnings("deprecation") - public OrderedPair allocObjectItem(SBucket bucket, String nameKey, S3MetaDataEntry[] meta, S3AccessControlList acl, String cannedAccessPolicy) + public OrderedPair allocObjectItem(SBucketVO bucket, String nameKey, S3MetaDataEntry[] meta, S3AccessControlList acl, String cannedAccessPolicy) { - SObjectDao objectDao = new SObjectDao(); - SObjectItemDao objectItemDao = new SObjectItemDao(); - SMetaDao metaDao = new SMetaDao(); - SAclDao aclDao = new SAclDao(); - SObjectItem item = null; + SObjectItemVO item = null; int versionSeq = 1; int versioningStatus = bucket.getVersioningStatus(); - Session session = PersistContext.getSession(); + //Session session = PersistContext.getSession(); // [A] To write into a bucket the user must have write permission to that bucket S3PolicyContext context = new S3PolicyContext( PolicyActions.PutObject, bucket.getName()); @@ -1482,65 +1496,79 @@ public class S3Engine { context.setEvalParam( ConditionKeys.Acl, cannedAccessPolicy); verifyAccess( context, "SBucket", bucket.getId(), SAcl.PERMISSION_WRITE ); // TODO - check this validates plain POSTs + Transaction txn = Transaction.open(Transaction.AWSAPI_DB); + txn.start(); // [B] If versioning is off them we over write a null object item - SObject object = objectDao.getByNameKey(bucket, nameKey); + SObjectVO object = objectDao.getByNameKey(bucket, nameKey); if ( object != null ) - { + { // -> if versioning is on create new object items if ( SBucket.VERSIONING_ENABLED == versioningStatus ) { - session.lock(object, LockMode.UPGRADE); + versionSeq = object.getNextSequence(); object.setNextSequence(versionSeq + 1); - session.save(object); + objectDao.update(object.getId(), object); - item = new SObjectItem(); + item = new SObjectItemVO(); item.setTheObject(object); object.getItems().add(item); + item.setsObjectID(object.getId()); item.setVersion(String.valueOf(versionSeq)); Date ts = DateHelper.currentGMTTime(); item.setCreateTime(ts); item.setLastAccessTime(ts); item.setLastModifiedTime(ts); - session.save(item); + item = itemDao.persist(item); + txn.commit(); + //session.save(item); } else { // -> find an object item with a null version, can be null // if bucket started out with versioning enabled and was then suspended - item = objectItemDao.getByObjectIdNullVersion( object.getId()); + item = itemDao.getByObjectIdNullVersion( object.getId()); if (item == null) { - item = new SObjectItem(); + item = new SObjectItemVO(); item.setTheObject(object); + item.setsObjectID(object.getId()); object.getItems().add(item); Date ts = DateHelper.currentGMTTime(); item.setCreateTime(ts); item.setLastAccessTime(ts); item.setLastModifiedTime(ts); - session.save(item); + item = itemDao.persist(item); + txn.commit(); } } } else - { // -> there is no object nor an object item - object = new SObject(); - object.setBucket(bucket); - object.setNameKey(nameKey); - object.setNextSequence(2); - object.setCreateTime(DateHelper.currentGMTTime()); - object.setOwnerCanonicalId(UserContext.current().getCanonicalUserId()); - session.save(object); - - item = new SObjectItem(); - item.setTheObject(object); - object.getItems().add(item); - if (SBucket.VERSIONING_ENABLED == versioningStatus) item.setVersion(String.valueOf(versionSeq)); - Date ts = DateHelper.currentGMTTime(); - item.setCreateTime(ts); - item.setLastAccessTime(ts); - item.setLastModifiedTime(ts); - session.save(item); + { + Transaction txn1 = Transaction.open(Transaction.AWSAPI_DB); + txn1.start(); + // -> there is no object nor an object item + object = new SObjectVO(); + object.setBucket(bucket); + object.setNameKey(nameKey); + object.setNextSequence(2); + object.setBucketID(bucket.getId()); + object.setCreateTime(DateHelper.currentGMTTime()); + object.setOwnerCanonicalId(UserContext.current().getCanonicalUserId()); + object = objectDao.persist(object); + item = new SObjectItemVO(); + item.setTheObject(object); + item.setsObjectID(object.getId()); + object.getItems().add(item); + if (SBucket.VERSIONING_ENABLED == versioningStatus) item.setVersion(String.valueOf(versionSeq)); + Date ts = DateHelper.currentGMTTime(); + item.setCreateTime(ts); + item.setLastAccessTime(ts); + item.setLastModifiedTime(ts); + item = itemDao.persist(item); + txn.commit(); + txn.close(); + } @@ -1570,8 +1598,9 @@ public class S3Engine { aclDao.save( "SObjectItem", item.getId(), acl ); } - session.update(item); - return new OrderedPair(object, item); + itemDao.update(item.getId(), item); + txn.close(); + return new OrderedPair(object, item); } @@ -1579,11 +1608,11 @@ public class S3Engine { * Access controls that are specified via the "x-amz-acl:" headers in REST requests. * Note that canned policies can be set when the object's contents are set */ - public void setCannedAccessControls( String cannedAccessPolicy, String target, long objectId, SBucket bucket ) + public void setCannedAccessControls( String cannedAccessPolicy, String target, long objectId, SBucketVO bucket ) { // Find the permission and symbol for the principal corresponding to the requested cannedAccessPolicy Triple permission_permission_symbol_triple = - SAcl.getCannedAccessControls(cannedAccessPolicy, target, bucket.getOwnerCanonicalId()); + SAclVO.getCannedAccessControls(cannedAccessPolicy, target, bucket.getOwnerCanonicalId()); if ( null == permission_permission_symbol_triple.getThird() ) setSingleAcl(target, objectId, permission_permission_symbol_triple.getFirst()); else @@ -1599,7 +1628,6 @@ public class S3Engine { private void setSingleAcl( String target, long targetId, int permission ) { - SAclDao aclDao = new SAclDao(); S3AccessControlList defaultAcl = new S3AccessControlList(); // -> if an annoymous request, then do not rewrite the ACL @@ -1626,7 +1654,6 @@ public class S3Engine { */ private void setDefaultAcls( String target, long objectId, int permission1, int permission2, String owner ) { - SAclDao aclDao = new SAclDao(); S3AccessControlList defaultAcl = new S3AccessControlList(); // -> object owner @@ -1712,20 +1739,18 @@ public class S3Engine { { if (SAcl.PERMISSION_PASS == requestedPermission) return; - SAclDao aclDao = new SAclDao(); - // If an annoymous request, then canonicalUserId is an empty string String userId = UserContext.current().getCanonicalUserId(); if ( 0 == userId.length()) { // Is an anonymous principal ACL set for this ? - if (hasPermission( aclDao.listGrants( target, targetId, "A" ), requestedPermission )) return; + if (hasPermission( saclDao.listGrants( target, targetId, "A" ), requestedPermission )) return; } else { - if (hasPermission( aclDao.listGrants( target, targetId, userId ), requestedPermission )) return; + if (hasPermission( saclDao.listGrants( target, targetId, userId ), requestedPermission )) return; // Or alternatively is there is any principal authenticated ACL set for this ? - if (hasPermission( aclDao.listGrants( target, targetId, "*" ), requestedPermission )) return; + if (hasPermission( saclDao.listGrants( target, targetId, "*" ), requestedPermission )) return; } // No privileges implies that no access is allowed in the case of an anonymous user throw new PermissionDeniedException( "Access Denied - ACLs do not give user the required permission" ); @@ -1749,8 +1774,11 @@ public class S3Engine { // -> do we have to load it from the database (any other value means there is no policy)? if (-1 == result.getSecond().intValue()) { - BucketPolicyDao policyDao = new BucketPolicyDao(); - String policyInJson = policyDao.getPolicy( context.getBucketName()); + BucketPolicyVO policyvo = bPolicy.getByName(context.getBucketName()); + String policyInJson = null; + if (null != policyvo) + policyInJson = policyvo.getPolicy(); + // -> place in cache that no policy exists in the database if (null == policyInJson) { ServiceProvider.getInstance().setBucketPolicy(context.getBucketName(), null); @@ -1835,13 +1863,13 @@ public class S3Engine { } } - private static boolean hasPermission( List privileges, int requestedPermission ) + private static boolean hasPermission( List privileges, int requestedPermission ) { - ListIterator it = privileges.listIterator(); + ListIterator it = privileges.listIterator(); while( it.hasNext()) { // True providing the requested permission is contained in one or the granted rights for this user. False otherwise. - SAcl rights = (SAcl)it.next(); + SAclVO rights = (SAclVO)it.next(); int permission = rights.getPermission(); if (requestedPermission == (permission & requestedPermission)) return true; } diff --git a/awsapi/src/com/cloud/bridge/service/core/s3/S3Grant.java b/awsapi/src/com/cloud/bridge/service/core/s3/S3Grant.java index b3c07beb16a..28e30e25c05 100644 --- a/awsapi/src/com/cloud/bridge/service/core/s3/S3Grant.java +++ b/awsapi/src/com/cloud/bridge/service/core/s3/S3Grant.java @@ -19,6 +19,7 @@ package com.cloud.bridge.service.core.s3; import java.util.List; import com.cloud.bridge.model.SAcl; +import com.cloud.bridge.model.SAclVO; import com.cloud.bridge.model.SBucket; import com.cloud.bridge.service.exception.UnsupportedException; @@ -64,12 +65,12 @@ public class S3Grant { /* Return an array of S3Grants holding the permissions of grantees by grantee type and their canonicalUserIds. * Used by S3 engine to get ACL policy requests for buckets and objects. */ - public static S3Grant[] toGrants(List grants) { + public static S3Grant[] toGrants(List grants) { if(grants != null) { S3Grant[] entries = new S3Grant[grants.size()]; int i = 0; - for(SAcl acl: grants) { + for(SAclVO acl: grants) { entries[i] = new S3Grant(); entries[i].setGrantee(acl.getGranteeType()); entries[i].setCanonicalUserID(acl.getGranteeCanonicalId()); diff --git a/awsapi/src/com/cloud/bridge/service/exception/EC2ServiceException.java b/awsapi/src/com/cloud/bridge/service/exception/EC2ServiceException.java index f40278d25e2..e1f515ad2c0 100644 --- a/awsapi/src/com/cloud/bridge/service/exception/EC2ServiceException.java +++ b/awsapi/src/com/cloud/bridge/service/exception/EC2ServiceException.java @@ -78,6 +78,7 @@ public class EC2ServiceException extends RuntimeException { InvalidPermission_Malformed("Client.InvalidPermission.Malformed", 400), InvalidReservationID_Malformed("Client.InvalidReservationID.Malformed", 400), InvalidReservationID_NotFound("Client.InvalidReservationID.NotFound", 400), + InvalidResourceId_Format("Client.InvalidResourceId.Format", 400), InvalidSnapshotID_Malformed("Client.InvalidSnapshotID.Malformed", 400), InvalidSnapshot_NotFound("Client.InvalidSnapshot.NotFound", 400), InvalidUserID_Malformed("Client.InvalidUserID.Malformed", 400), diff --git a/awsapi/src/com/cloud/bridge/util/CloudSessionFactory.java b/awsapi/src/com/cloud/bridge/util/CloudSessionFactory.java deleted file mode 100644 index 404f4636a8b..00000000000 --- a/awsapi/src/com/cloud/bridge/util/CloudSessionFactory.java +++ /dev/null @@ -1,106 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.util; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Properties; - -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.cfg.Configuration; -import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; -import org.jasypt.properties.EncryptableProperties; -import org.apache.log4j.Logger; - -public class CloudSessionFactory { - private static CloudSessionFactory instance; - public static final Logger logger = Logger.getLogger(CloudSessionFactory.class); - - private SessionFactory factory; - - private CloudSessionFactory() { - Configuration cfg = new Configuration(); - File file = ConfigurationHelper.findConfigurationFile("hibernate.cfg.xml"); - - File propertiesFile = ConfigurationHelper.findConfigurationFile("db.properties"); - Properties dbProp = null; - String dbName = null; - String dbHost = null; - String dbUser = null; - String dbPassword = null; - String dbPort = null; - - if (null != propertiesFile) { - - if(EncryptionSecretKeyCheckerUtil.useEncryption()){ - StandardPBEStringEncryptor encryptor = EncryptionSecretKeyCheckerUtil.getEncryptor(); - dbProp = new EncryptableProperties(encryptor); - } else { - dbProp = new Properties(); - } - - try { - dbProp.load( new FileInputStream( propertiesFile )); - } catch (FileNotFoundException e) { - logger.warn("Unable to open properties file: " + propertiesFile.getAbsolutePath(), e); - } catch (IOException e) { - logger.warn("Unable to read properties file: " + propertiesFile.getAbsolutePath(), e); - } - } - - - // - // we are packaging hibernate mapping files along with the class files, - // make sure class loader use the same class path when initializing hibernate mapping. - // This is important when we are deploying and testing at different environment (Tomcat/JUnit test runner) - // - if(file != null && dbProp != null){ - Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); - cfg.configure(file); - - dbHost = dbProp.getProperty( "db.cloud.host" ); - dbName = dbProp.getProperty( "db.awsapi.name" ); - dbUser = dbProp.getProperty( "db.cloud.username" ); - dbPassword = dbProp.getProperty( "db.cloud.password" ); - dbPort = dbProp.getProperty( "db.cloud.port" ); - - cfg.setProperty("hibernate.connection.url", "jdbc:mysql://" + dbHost + ":" + dbPort + "/" + dbName); - cfg.setProperty("hibernate.connection.username", dbUser); - cfg.setProperty("hibernate.connection.password", dbPassword); - - - factory = cfg.buildSessionFactory(); - }else{ - logger.warn("Unable to open load db configuration"); - throw new RuntimeException("nable to open load db configuration"); - } - } - - public synchronized static CloudSessionFactory getInstance() { - if(instance == null) { - instance = new CloudSessionFactory(); - } - return instance; - } - - public Session openSession() { - return factory.openSession(); - } -} diff --git a/awsapi/src/com/cloud/bridge/util/CloudStackSessionFactory.java b/awsapi/src/com/cloud/bridge/util/CloudStackSessionFactory.java deleted file mode 100644 index ac5e2d5d71b..00000000000 --- a/awsapi/src/com/cloud/bridge/util/CloudStackSessionFactory.java +++ /dev/null @@ -1,106 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.util; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Properties; - -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.cfg.Configuration; -import org.jasypt.encryption.pbe.StandardPBEStringEncryptor; -import org.jasypt.properties.EncryptableProperties; -import org.apache.log4j.Logger; - -public class CloudStackSessionFactory { - private static CloudStackSessionFactory instance; - public static final Logger logger = Logger.getLogger(CloudStackSessionFactory.class); - - private SessionFactory factory; - - private CloudStackSessionFactory() { - Configuration cfg = new Configuration(); - File file = ConfigurationHelper.findConfigurationFile("CloudStack.cfg.xml"); - - File propertiesFile = ConfigurationHelper.findConfigurationFile("db.properties"); - Properties dbProp = null; - String dbName = null; - String dbHost = null; - String dbUser = null; - String dbPassword = null; - String dbPort = null; - - if (null != propertiesFile) { - - if(EncryptionSecretKeyCheckerUtil.useEncryption()){ - StandardPBEStringEncryptor encryptor = EncryptionSecretKeyCheckerUtil.getEncryptor(); - dbProp = new EncryptableProperties(encryptor); - } else { - dbProp = new Properties(); - } - - try { - dbProp.load( new FileInputStream( propertiesFile )); - } catch (FileNotFoundException e) { - logger.warn("Unable to open properties file: " + propertiesFile.getAbsolutePath(), e); - } catch (IOException e) { - logger.warn("Unable to read properties file: " + propertiesFile.getAbsolutePath(), e); - } - } - - - // - // we are packaging hibernate mapping files along with the class files, - // make sure class loader use the same class path when initializing hibernate mapping. - // This is important when we are deploying and testing at different environment (Tomcat/JUnit test runner) - // - if(file != null && dbProp != null){ - Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); - cfg.configure(file); - - dbHost = dbProp.getProperty( "db.cloud.host" ); - dbName = dbProp.getProperty( "db.cloud.name" ); - dbUser = dbProp.getProperty( "db.cloud.username" ); - dbPassword = dbProp.getProperty( "db.cloud.password" ); - dbPort = dbProp.getProperty( "db.cloud.port" ); - - cfg.setProperty("hibernate.connection.url", "jdbc:mysql://" + dbHost + ":" + dbPort + "/" + dbName); - cfg.setProperty("hibernate.connection.username", dbUser); - cfg.setProperty("hibernate.connection.password", dbPassword); - - - factory = cfg.buildSessionFactory(); - }else{ - logger.warn("Unable to open load db configuration"); - throw new RuntimeException("nable to open load db configuration"); - } - } - - public synchronized static CloudStackSessionFactory getInstance() { - if(instance == null) { - instance = new CloudStackSessionFactory(); - } - return instance; - } - - public Session openSession() { - return factory.openSession(); - } -} diff --git a/awsapi/src/com/cloud/bridge/util/QueryHelper.java b/awsapi/src/com/cloud/bridge/util/QueryHelper.java deleted file mode 100644 index 1a1b58290e1..00000000000 --- a/awsapi/src/com/cloud/bridge/util/QueryHelper.java +++ /dev/null @@ -1,85 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you 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 com.cloud.bridge.util; - -import java.io.Serializable; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.util.Calendar; -import java.util.Date; -import java.util.List; -import java.util.Locale; - -import org.hibernate.Query; - -public class QueryHelper { - public static void bindParameters(Query query, Object[] params) { - int pos = 0; - if(params != null && params.length > 0) { - for(Object param : params) { - if(param instanceof Byte) - query.setByte(pos++, ((Byte)param).byteValue()); - else if(param instanceof Short) - query.setShort(pos++, ((Short)param).shortValue()); - else if(param instanceof Integer) - query.setInteger(pos++, ((Integer)param).intValue()); - else if(param instanceof Long) - query.setLong(pos++, ((Long)param).longValue()); - else if(param instanceof Float) - query.setFloat(pos++, ((Float)param).floatValue()); - else if(param instanceof Double) - query.setDouble(pos++, ((Double)param).doubleValue()); - else if(param instanceof Boolean) - query.setBoolean(pos++, ((Boolean)param).booleanValue()); - else if(param instanceof Character) - query.setCharacter(pos++, ((Character)param).charValue()); - else if(param instanceof Date) - query.setDate(pos++, (Date)param); - else if(param instanceof Calendar) - query.setCalendar(pos++, (Calendar)param); - else if(param instanceof CalendarDateParam) - query.setCalendarDate(pos++, ((CalendarDateParam)param).dateValue()); - else if(param instanceof TimestampParam) - query.setTimestamp(pos++, ((TimestampParam)param).timestampValue()); - else if(param instanceof TimeParam) - query.setTime(pos++, ((TimeParam)param).timeValue()); - else if(param instanceof String) - query.setString(pos++, (String)param); - else if(param instanceof TextParam) - query.setText(pos++, ((TextParam)param).textValue()); - else if(param instanceof byte[]) - query.setBinary(pos++, (byte[])param); - else if(param instanceof BigDecimal) - query.setBigDecimal(pos++, (BigDecimal)param); - else if(param instanceof BigInteger) - query.setBigInteger(pos++, (BigInteger)param); - else if(param instanceof Locale) - query.setLocale(pos++, (Locale)param); - else if(param instanceof EntityParam) - query.setEntity(pos++, ((EntityParam)param).entityValue()); - else if(param instanceof Serializable) - query.setSerializable(pos++, (Serializable)param); - else - query.setEntity(pos++, param); - } - } - } - - public static List executeQuery(Query query) { - return (List)query.list(); - } -} diff --git a/awsapi/src/com/cloud/stack/models/CloudStackAccount.hbm.xml b/awsapi/src/com/cloud/stack/models/CloudStackAccount.hbm.xml deleted file mode 100644 index 799679798d8..00000000000 --- a/awsapi/src/com/cloud/stack/models/CloudStackAccount.hbm.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/stack/models/CloudStackConfiguration.hbm.xml b/awsapi/src/com/cloud/stack/models/CloudStackConfiguration.hbm.xml deleted file mode 100644 index 134e6f10a3e..00000000000 --- a/awsapi/src/com/cloud/stack/models/CloudStackConfiguration.hbm.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.hbm.xml b/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.hbm.xml deleted file mode 100644 index 2bbcfd16dc6..00000000000 --- a/awsapi/src/com/cloud/stack/models/CloudStackServiceOffering.hbm.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java b/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java index e1db2d9ae65..012abc46008 100644 --- a/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java +++ b/awsapi/src/com/cloud/stack/models/CloudStackUserVm.java @@ -67,6 +67,8 @@ public class CloudStackUserVm { private String jobId; @SerializedName(ApiConstants.JOB_STATUS) private Integer jobStatus; + @SerializedName(ApiConstants.SSH_KEYPAIR) + private String keyPairName; @SerializedName(ApiConstants.MEMORY) private Integer memory; @SerializedName(ApiConstants.NAME) @@ -340,6 +342,13 @@ public class CloudStackUserVm { return serviceOfferingName; } + /** + * @return the sshKeyPairName + */ + public String getKeyPairName() { + return keyPairName; + } + /** * @return the state */ diff --git a/build/build-aws-api.xml b/build/build-aws-api.xml index 04db51626f0..3e96069b392 100644 --- a/build/build-aws-api.xml +++ b/build/build-aws-api.xml @@ -26,12 +26,12 @@ - + - + - + @@ -113,7 +113,7 @@ - + @@ -223,6 +223,7 @@ + diff --git a/build/build-cloud-plugins.xml b/build/build-cloud-plugins.xml index a7a1f39aad3..b73289e7d37 100755 --- a/build/build-cloud-plugins.xml +++ b/build/build-cloud-plugins.xml @@ -84,7 +84,6 @@ - @@ -155,9 +154,6 @@ - - - diff --git a/build/build-cloud.properties b/build/build-cloud.properties index 552de7f74db..be67a368fc0 100755 --- a/build/build-cloud.properties +++ b/build/build-cloud.properties @@ -23,3 +23,4 @@ build.type=developer target.compat.version=1.6 source.compat.version=1.6 branding.name=default +ssvm.include.vmware.jar=true diff --git a/build/build-cloud.xml b/build/build-cloud.xml index 2ad3715e5a2..fce3e17586c 100755 --- a/build/build-cloud.xml +++ b/build/build-cloud.xml @@ -78,7 +78,6 @@ - @@ -150,9 +149,6 @@ - - - @@ -576,6 +572,14 @@ + + + + + + + + diff --git a/build/build-usage.xml b/build/build-usage.xml index 264f27f5b1f..9940f46edb3 100644 --- a/build/build-usage.xml +++ b/build/build-usage.xml @@ -41,15 +41,9 @@ - - + - - - - - @@ -57,14 +51,14 @@ - + - + diff --git a/build/deploy/production/db/templates-dev.sql b/build/deploy/production/db/templates-dev.sql index 2a96750e707..c1ec7a3bff0 100644 --- a/build/deploy/production/db/templates-dev.sql +++ b/build/deploy/production/db/templates-dev.sql @@ -1,19 +1,19 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you 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. INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, path, created, type, hvm, bits, created_by, url, checksum, ready, display_text, enable_password) VALUES (1, 'routing', 'DomR Template', 0, 'tank/volumes/demo/template/private/u000000/os/routing', now(), 'ext3', 0, 64, 1, 'http://vmopsserver.lab.vmops.com/images/routing/vmi-root-fc8-x86_64-domR.img.bz2', 'd00927f863a23b98cc6df6e377c9d0c6', 0, 'DomR Template', 0); INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, path, created, type, hvm, bits, created_by, url, checksum, ready, display_text, enable_password) diff --git a/build/developer.xml b/build/developer.xml index f2e5aa6463e..947fa2e41c3 100755 --- a/build/developer.xml +++ b/build/developer.xml @@ -37,6 +37,7 @@ + @@ -149,7 +150,7 @@ - + @@ -216,16 +217,12 @@ - - - - - - - + + - + + @@ -289,6 +286,12 @@ + + + + diff --git a/build/package.xml b/build/package.xml index 83b58376cbf..275d2656567 100755 --- a/build/package.xml +++ b/build/package.xml @@ -123,7 +123,7 @@ - + @@ -156,7 +156,8 @@ - + + @@ -225,8 +226,6 @@ - - @@ -236,6 +235,15 @@ + + + + + + + + + diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index 899e3c0fe60..1ec75baba88 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -17,7 +17,21 @@ #new labels (begin) ********************************************************************************************** + + +#new labels (end) ************************************************************************************************ + + +#modified labels (begin) ***************************************************************************************** message.zoneWizard.enable.local.storage=WARNING: If you enable local storage for this zone, you must do the following, depending on where you would like your system VMs to launch:

1. If system VMs need to be launched in primary storage, primary storage needs to be added to the zone after creation. You must also start the zone in a disabled state.

2. If system VMs need to be launched in local storage, system.vm.use.local.storage needs to be set to true before you enable the zone.


Would you like to continue? +#modified labels (end) ******************************************************************************************* + +label.configure.network.ACLs=Configure Network ACLs +label.network.ACLs=Network ACLs +label.add.network.ACL=Add network ACL +label.private.Gateway=Private Gateway +label.VPC.router.details=VPC router details +label.VMs.in.tier=VMs in tier label.local.storage.enabled=Local storage enabled label.tier.details=Tier details label.edit.tags=Edit tags @@ -63,10 +77,38 @@ message.delete.VPN.connection=Please confirm that you want to delete VPN connect label.add.new.tier=Add new tier label.add.VM.to.tier=Add VM to tier label.remove.tier=Remove tier -#new labels (end) ************************************************************************************************ +label.local.storage.enabled=Local Storage Enabled +label.associated.network=Associated Network +label.add.port.forwarding.rule=Add port forwarding rule +label.dns=DNS + +label.vpc=VPC +label.vpc.id=VPC ID +label.tier=Tier +label.add.vpc=Add VPC +label.super.cidr.for.guest.networks=Super CIDR for Guest Networks +label.DNS.domain.for.guest.networks=DNS domain for Guest Networks +label.configure.vpc=Configure VPC +label.edit.vpc=Edit VPC +label.restart.vpc=restart VPC +message.restart.vpc=Please confirm that you want to restart the VPC +label.remove.vpc=remove VPC +message.remove.vpc=Please confirm that you want to remove the VPC +label.vpn.customer.gateway=VPN Customer Gateway +label.add.vpn.customer.gateway=Add VPN Customer Gateway +label.IKE.encryption=IKE Encryption +label.IKE.hash=IKE Hash +label.IKE.DH=IKE DH +label.ESP.encryption=ESP Encryption +label.ESP.hash=ESP Hash +label.perfect.forward.secrecy=Perfect Forward Secrecy +label.IKE.lifetime=IKE lifetime (second) +label.ESP.lifetime=ESP Lifetime (second) +label.dead.peer.detection=Dead Peer Detection +label.delete.VPN.customer.gateway=delete VPN Customer Gateway +message.delete.VPN.customer.gateway=Please confirm that you want to delete this VPN Customer Gateway -#modified labels (begin) ***************************************************************************************** label.network.domain.text=Network domain label.memory.mb=Memory (in MB) label.cpu.mhz=CPU (in MHz) @@ -76,7 +118,6 @@ message.action.remove.host=Please confirm that you want to remove this host. message.action.reboot.router=All services provided by this virtual router will be interrupted. Please confirm that you want to reboot this router. message.action.stop.router=All services provided by this virtual router will be interrupted. Please confirm that you want to stop this router. message.restart.network=All services provided by this network will be interrupted. Please confirm that you want to restart this network. -#modified labels (end) ******************************************************************************************* label.ipaddress=IP Address diff --git a/client/WEB-INF/classes/resources/messages_es.properties b/client/WEB-INF/classes/resources/messages_es.properties deleted file mode 100644 index a76fce6c5ed..00000000000 --- a/client/WEB-INF/classes/resources/messages_es.properties +++ /dev/null @@ -1,883 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you 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. - -#cloudstack 3.0 (begin) ******************************************************************************************** -create.template.confirm = Por favor, confirme que desea crear una plantilla -create.template.success = Nueva plantilla se está creando -create.template.notification = Crear nueva plantilla -create.template.complete plantilla = se ha creado correctamente -#cloudstack 3.0 (end) ********************************************************************************************** - - - -#cloudstack 2.2.Y (begin) ****************************************************************************************** -label.action.migrate.router=migrar Router -label.action.migrate.router.processing=Migración router .... -message.migrate.router.confirm=Por favor, confirme el huésped que desea migrar el router: -label.migrate.router.to=Router para migrar - -label.action.migrate.systemvm=Migrar del sistema VM -label.action.migrate.systemvm.processing=La migración de VM del sistema .... -message.migrate.systemvm.confirm=Por favor, confirme el huésped que desea migrar la máquina virtual de sistema: -label.migrate.systemvm.to=Migrar máquina virtual del sistema para - - -mode=modo -side.by.side=Juntos -inline=en línea - -extractable=extraíble - -label.ocfs2=OCFS2 - -label.action.edit.host=edición Anfitrión - -network.rate=Tasa de red - -ICMP.type=Tipo ICMP -ICMP.code=ICMP Código - -image.directory=Directorio de la imagen - -label.action.create.template.from.vm=Crear plantilla de VM -label.action.create.template.from.volume=Crear plantilla de volumen - -message.vm.create.template.confirm=Crear plantilla de la máquina virtual se reiniciará automáticamente. - -label.action.manage.cluster=gestionar racimo -message.action.manage.cluster=Por favor, confirme que desea para administrar el clúster. -label.action.manage.cluster.processing=La gestión de clústeres .... - -label.action.unmanage.cluster=Unmanage racimo -message.action.unmanage.cluster=Por favor, confirme que desea unmanage del clúster. -label.action.unmanage.cluster.processing=Unmanaging Grupo .... - -allocation.state=asignación del Estado -managed.state=Estado logró - -label.default.use=Usar por defecto -label.host.tags=etiquetas de la máquina - -label.cidr=CIDR -label.cidr.list=fuente CIDR - -label.storage.tags=Etiquetas de almacenamiento - -label.redundant.router=enrutador redundante -label.is.redundant.router=redundante - -force.delete=Fuerza Borrar -force.delete.domain.warning=Advertencia: Si elige esta opción, la supresión de todos los dominios secundarios y todas las cuentas asociadas y sus recursos. - -force.remove=Fuerza Retire -force.remove.host.warning=Advertencia: Si elige esta opción, CloudStack para detener la fuerza todas las máquinas virtuales en ejecución antes de retirar este host del clúster. - -force.stop=Grupo de Alto -force.stop.instance.warning=Advertencia: Obligar a una parada en este caso debería ser su última opción. Puede conducir a la pérdida de datos, así como un comportamiento incoherente del Estado de la máquina virtual. - -label.PreSetup=PreSetup -label.SR.name = SR Nombre de etiqueta -label.SharedMountPoint = SharedMountPoint -label.clvm=CLVM -label.volgroup=Volume Group -label.VMFS.datastore=VMFS de datos tienda - -label.network.device=De dispositivos de red -label.add.network.device=Añadir dispositivo de red -label.network.device.type=Tipo de red de dispositivos -label.DHCP.server.type=Tipo de servidor DHCP -label.Pxe.server.type=Tipo de servidor Pxe -label.PING.storage.IP=PING almacenamiento IP -label.PING.dir=PING Directorio -label.TFTP.dir=Directorio de TFTP -label.PING.CIFS.username=PING CIFS nombre de usuario -label.PING.CIFS.password=PING CIFS contraseña -label.CPU.cap=CPU Cap - -label.network.domain=red de dominio - -label.action.enable.zone=Habilitar la zona -label.action.enable.zone.processing = Habilitación de zona .... -message.action.enable.zone = Por favor, confirme que desea habilitar esta zona. -label.action.disable.zone = Deshabilitar la zona -label.action.disable.zone.processing = Desactivación de la zona .... -message.action.disable.zone = Por favor, confirme que desea desactivar esta zona. - -label.action.enable.pod = Habilitar Pod -label.action.enable.pod.processing = Habilitación Pod .... -message.action.enable.pod = Por favor, confirme que desea habilitar esta vaina. -label.action.disable.pod = Deshabilitar Pod -label.action.disable.pod.processing = Deshabilitar Pod .... -message.action.disable.pod = Por favor, confirme que desea desactivar esta vaina. - -label.action.enable.cluster = Habilitar clúster -label.action.enable.cluster.processing = Habilitar clúster .... -message.action.enable.cluster = Por favor, confirme que desea habilitar este grupo. -label.action.disable.cluster = Deshabilitar clúster -label.action.disable.cluster.processing = Desactivación de Cluster Server .... -message.action.disable.cluster = Por favor, confirme que desea desactivar este grupo. - -label.account = Cuenta -label.account.id = ID de la cuenta -label.account.name = Nombre de la cuenta -label.account.specific = específicas de la cuenta -label.accounts = Cuentas -label.acquire.new.ip = adquirir nuevas IP -label.show.ingress.rule=Mostrar la regla del ingreso -label.hide.ingress.rule=Ocultar el artículo ingreso -label.action.attach.disk = Conecte el disco -label.action.attach.disk.processing = disco Fijación .... -label.action.attach.iso = Adjuntar ISO -label.action.attach.iso.processing = Colocación de la norma ISO .... -label.action.cancel.maintenance.mode = Cancelar modo de mantenimiento -label.action.cancel.maintenance.mode.processing = Cancelación del modo de mantenimiento .... -label.action.change.password = Cambiar contraseña -label.action.change.service = Cambio de Servicio -label.action.change.service.processing = Cambio de servicio .... -label.action.copy.ISO = Copia de la ISO -label.action.copy.ISO.processing = hacer frente ISO .... -label.action.copy.template = Copia de plantilla -label.action.copy.template.processing = hacer frente plantilla .... -label.action.create.template = Crear plantilla -label.action.create.template.processing = Creación de plantillas .... -label.action.create.vm = Crear VM -label.action.create.vm.processing = Creación de máquina virtual .... -label.action.create.volume = Crear volumen -label.action.create.volume.processing = Crear volumen .... -label.action.delete.IP.range = Eliminar Rango de IP -label.action.delete.IP.range.processing = Eliminar Rango de IP .... -label.action.delete.ISO = Eliminar ISO -label.action.delete.ISO.processing = Eliminación de la norma ISO .... -label.action.delete.account = Eliminar cuenta -label.action.delete.account.processing = Eliminar cuentas .... -label.action.delete.cluster = Borrar Grupo -label.action.delete.cluster.processing = Borrar Grupo .... -label.action.delete.disk.offering = Borrar disco Ofrenda -label.action.delete.disk.offering.processing = Borrar disco ofrece .... - -label.action.update.resource.count=Actualización de recursos Conde -label.action.update.resource.count.processing=Actualización de Conde de recursos .... - -label.action.delete.domain = Eliminar de dominio -label.action.delete.domain.processing = Eliminación de dominio .... -label.action.delete.firewall = Eliminar servidor de seguridad -label.action.delete.firewall.processing = Eliminación de firewall .... -label.action.delete.ingress.rule = Borrar ingreso Regla -label.action.delete.ingress.rule.processing = Eliminación de ingreso regla .... -label.action.delete.load.balancer = Eliminar equilibrador de carga -label.action.delete.load.balancer.processing = Eliminación del equilibrador de carga .... -label.action.edit.network=Edición de redes -label.action.delete.network = Eliminar Red -label.action.delete.network.processing = Eliminación de red .... -label.action.delete.pod = Eliminar Pod -label.action.delete.pod.processing = Eliminar Pod .... -label.action.delete.primary.storage = Almacenamiento primario Eliminar -label.action.delete.primary.storage.processing = Eliminación de almacenamiento primaria .... -label.action.delete.secondary.storage = secundaria almacenamiento Eliminar -label.action.delete.secondary.storage.processing = Eliminación de almacenamiento secundario .... -label.action.delete.security.group = Borrar Grupo de Seguridad -label.action.delete.security.group.processing = Eliminar grupo de seguridad .... -label.action.delete.service.offering = Eliminar Oferta de Servicio -label.action.delete.service.offering.processing = Eliminación de Oferta de Servicio .... -label.action.delete.snapshot = Eliminar instantánea -label.action.delete.snapshot.processing = Eliminar instantánea .... -label.action.delete.template = Eliminar plantilla -label.action.delete.template.processing = Eliminar plantilla .... -label.action.delete.user = Eliminar usuario -label.action.delete.user.processing = Eliminar usuario .... -label.action.delete.volume = Eliminar volumen -label.action.delete.volume.processing = Eliminar volumen .... -label.action.delete.zone = Eliminar Zona -label.action.delete.zone.processing = Eliminación de la Zona .... -label.action.destroy.instance = Destruye Instancia -label.action.destroy.instance.processing = Destrucción Instancia .... -label.action.destroy.systemvm = destruir el sistema VM -label.action.destroy.systemvm.processing = Destrucción del sistema VM .... -label.action.detach.disk = Separar disco -label.action.detach.disk.processing = Extracción disco .... -label.action.detach.iso = Separar ISO -label.action.detach.iso.processing = Extracción ISO .... -label.action.disable.account = Desactivar cuenta -label.action.disable.account.processing = Deshabilitar cuenta .... -label.action.disable.static.NAT = Deshabilitar NAT estática -label.action.disable.static.NAT.processing = Deshabilitar NAT estática .... -label.action.disable.user = Deshabilitar usuario -label.action.disable.user.processing = Desactivación de usuario .... -label.action.download.ISO = ISO Descargar -label.action.download.template = Descargar plantilla -label.action.download.volume = Descargar Volumen -label.action.download.volume.processing = Volumen Descargar .... -label.action.edit.ISO = Editar ISO -label.action.edit.account = Editar cuenta -label.action.edit.disk.offering = Editar disco Ofrenda -label.action.edit.domain = Editar Dominio -label.action.edit.global.setting = Editar Mundial Marco -label.action.edit.instance = Editar Instancia -label.action.edit.network.offering = Editar Red ofrece -label.action.edit.pod = Editar Pod -label.action.edit.primary.storage = Editar Almacenamiento primario -label.action.edit.resource.limits = Editar límites de recursos -label.action.edit.service.offering = Editar Oferta de Servicio -label.action.edit.template = Editar plantilla -label.action.edit.user = Editar usuario -label.action.edit.zone = Edición Zona -label.action.enable.account = Habilitar cuenta -label.action.enable.account.processing = cuenta de Habilitación .... -label.action.enable.maintenance.mode = Activar el modo de mantenimiento -label.action.enable.maintenance.mode.processing = Habilitación del modo de mantenimiento .... -label.action.enable.static.NAT = Habilitar NAT estática -label.action.enable.static.NAT.processing = Habilitar NAT estática .... -label.action.enable.user = usuario Activar -label.action.enable.user.processing = Habilitación del usuario .... -label.action.force.reconnect = Fuerza Vuelva a conectar -label.action.force.reconnect.processing = Reconectando .... -label.action.generate.keys = Generar Claves -label.action.generate.keys.processing = Generar claves .... -label.action.lock.account = Bloqueo de cuenta -label.action.lock.account.processing = Bloqueo de cuenta .... -label.action.migrate.instance = Migrar Instancia -label.action.migrate.instance.processing = Migrar Instancia .... -label.action.reboot.instance = Reiniciar Instancia -label.action.reboot.instance.processing = Reiniciar Instancia .... -label.action.reboot.router = Reiniciar router -label.action.reboot.router.processing = Reiniciar router .... -label.action.reboot.systemvm = Reiniciar sistema VM -label.action.reboot.systemvm.processing = reinicio del sistema VM .... -label.action.recurring.snapshot = recurrente instantáneas -label.action.release.ip = estreno IP -label.action.release.ip.processing = Liberar IP .... -label.action.remove.host = Quitar host -label.action.remove.host.processing = Extracción de host .... -label.action.reset.password = Restablecer contraseña -label.action.reset.password.processing = Restablecimiento de la contraseña .... -label.action.resource.limits = Recursos límites -label.action.restore.instance = Restaurar Instancia -label.action.restore.instance.processing = Restaurar Instancia .... -label.action.start.instance = Iniciar Instancia -label.action.start.instance.processing = A partir Instancia .... -label.action.start.router = inicio del router -label.action.start.router.processing = A partir del router .... -label.action.start.systemvm = Inicio del sistema VM -label.action.start.systemvm.processing = A partir del sistema VM .... -label.action.stop.instance = Detener Instancia -label.action.stop.instance.processing = Detener Instancia .... -label.action.stop.router = Detener router -label.action.stop.router.processing = Detener router .... -label.action.stop.systemvm = parada del sistema VM -label.action.stop.systemvm.processing = Detener sistema VM .... -label.action.take.snapshot = Tomar instantánea -label.action.take.snapshot.processing = Tomar instantáneas .... -label.action.update.OS.preference = Actualizar OS Preferencia -label.action.update.OS.preference.processing = Actualización de sistema operativo preferencia .... -label.actions = Acciones -label.active.sessions = Sesiones activas -label.add = Agregar -label.add.account = Añadir cuenta -label.add.by.cidr = Añadir Por CIDR -label.add.by.group = Añadir Por el Grupo de -label.add.cluster = Añadir Grupo -label.add.direct.iprange = Añadir Direct IP Gama -label.add.disk.offering = Añadir disco Ofrenda -label.add.domain = Agregar dominio -label.add.firewall = Agregar Servidor de seguridad -label.add.host = Agregar host -label.add.ingress.rule = Añadir regla del ingreso -label.add.ip.range = Añadir Rango de IP -label.add.iso = Añadir ISO -label.add.load.balancer = Añadir equilibrador de carga -label.add.more = Añadir más -label.add.network = Agregar sitios de red -label.add.pod = Añadir Pod -label.add.primary.storage = Añadir Almacenamiento primario -label.add.secondary.storage = Añadir secundaria almacenamiento -label.add.security.group = Agregar grupo de seguridad -label.add.service.offering = Añadir Servicio de Oferta -label.add.template = Añadir plantilla -label.add.user = Agregar usuario -label.add.vlan = Añadir VLAN -label.add.volume = Añadir volumen -label.add.zone = Añadir Zona -label.adding = Agregar -label.adding.cluster = Adición de clúster -label.adding.failed = No se pudo agregar -label.adding.pod = Agregar Pod -label.adding.processing = Añadir .... -label.adding.succeeded = Agregar Sucesor -label.adding.user = Agregar usuario -label.adding.zone = Agregar la zona -label.additional.networks = Redes adicional -label.admin = Admin -label.admin.accounts = Administrador de Cuentas -label.advanced = Avanzado -label.advanced.mode = Modo avanzado -label.advanced.search = Búsqueda Avanzada -label.alert=Alerta -label.algorithm = Algoritmo -label.allocated = Asignados -label.api.key = clave de API -label.assign = Asignar -label.assign.to.load.balancer = instancia de Asignación de equilibrador de carga -label.associated.network.id = ID de red asociados -label.attached.iso = adjunta ISO -label.availability = Disponibilidad -label.availability.zone = Disponibilidad de la zona -label.available = Disponible -label.available.public.ips = Disponible direcciones IP públicas -label.back = Volver -label.basic.mode = Modo básico -label.bootable = arranque -label.broadcast.domain.type = Tipo de dominio de difusión -label.by.account = Por Cuenta -label.by.availability = Por Disponibilidad -label.by.domain = Por dominio -label.by.end.date = Por Fecha de finalización -label.by.level = por Nivel -label.by.pod = Por Pod -label.by.role = por función -label.by.start.date = Por Fecha de inicio -label.by.state = Por Estado -label.by.traffic.type = Por tipo de tráfico -label.by.type = Por tipo -label.by.type.id = Por tipo de identificación -label.by.zone = Por Zona -label.bytes.received = Bytes recibidos -label.bytes.sent = Bytes enviados -label.cancel = Cancelar -label.certificate = Certificado -label.privatekey=PKCS#8 la clave privada -label.domain.suffix=DNS sufijo de dominio (es decir, xyz.com) -label.character = Personaje -label.cidr.account = CIDR o de cuenta / Grupo de Seguridad -label.close = Cerrar -label.cloud.console = Cloud Management Console -label.cloud.managed = Cloud.com Gestionado -label.cluster = Grupo -label.cluster.type = Tipo de Cluster Server -label.code = Código -label.confirmation=Confirmation -label.cpu = CPU -label.cpu.allocated = CPU asignado -label.cpu.allocated.for.VMs=CPU asignado para máquinas virtuales -label.cpu.mhz = CPU (en MHZ) -label.cpu.utilized=CPU Utilizado -label.created = creación -label.cross.zones = Cruz Zonas -label.custom.disk.size = Personal Disk Size -label.daily = diario -label.data.disk.offering=Datos Disco Offering -label.date = Fecha -label.day.of.month = Día del mes -label.day.of.week = día de la semana -label.delete = Eliminar -label.deleting.failed = No se pudo eliminar -label.deleting.processing = Eliminar .... -label.description = Descripción -label.detaching.disk = Extracción del disco -label.details = Detalles -label.device.id = ID de dispositivo -label.disabled = personas de movilidad reducida -label.disabling.vpn.access = Desactivación de VPN de acceso -label.disk.allocated = disco asignado -label.disk.offering = disco Ofrenda -label.disk.size = tamaño de disco -label.disk.size.gb = tamaño de disco (en GB) -label.disk.total = disco Total -label.disk.volume = volumen de disco -label.display.text = visualización de texto -label.dns.1 = DNS 1 -label.dns.2 = DNS 2 -label.domain = dominio -label.domain.admin = Administrador de dominio -label.domain.id = ID de dominio -label.domain.name = Nombre de dominio -label.double.quotes.are.not.allowed = comillas dobles no se permite -label.download.progress=Progreso de la descarga -label.edit = Editar -label.email = correo electrónico -label.enabling.vpn = Habilitación VPN -label.enabling.vpn.access = Habilitación de Acceso VPN -label.end.port = Puerto final -label.endpoint.or.operation = punto final o de Operación -label.error = Error -label.error.code = Código de error -label.esx.host = ESX / ESXi anfitrión -label.example = Ejemplo -label.failed = Error -label.featured = destacados -label.firewall = Servidor de seguridad -label.first.name = Nombre -label.format = Formato -label.friday = Viernes -label.full = completo -label.gateway = puerta de enlace -label.general.alerts = General de Alertas -label.generating.url = Generar URL -label.generating.url = Generar URL -label.go.step.2 = Ir al paso 2 -label.go.step.3 = Ir al paso 3 -label.go.step.4 = Ir al paso 4 -label.go.step.5 = Ir al paso 5 -label.group = Grupo -label.group.optional = Grupo (Opcional) -label.guest.cidr = Habitación CIDR -label.guest.gateway = Habitación Gateway -label.guest.ip = Habitación dirección IP -label.guest.ip.range = Habitación Rango de IP -label.guest.netmask = Habitación máscara de red -label.ha.enabled = HA Activado -label.help = Ayuda -label.host = Ejércitos -label.host.alerts = Host Alertas -label.host.name = nombre de host -label.hosts = Ejércitos -label.hourly = por hora -label.hypervisor = Hypervisor -label.hypervisor.type = Tipo Hypervisor -label.id = ID -label.info = Información -label.ingress.rule = ingreso Regla -label.initiated.by = Iniciado por -label.instance = Instancia -label.instance.limits = Instancia Límites -label.instance.name = Nombre de instancia -label.instances = Instancias -label.internal.dns.1 = DNS interno una -label.internal.dns.2 = DNS interno 2 -label.interval.type = Tipo de intervalo -label.invalid.integer = entero no válido -label.invalid.number = Número no válido -label.ip = IP -label.ip.address = Dirección IP -label.ip.allocations = IP asignaciones -label.ip.limits = IP pública Límites -label.ip.or.fqdn = IP o FQDN -label.ip.range = Rango de IP -label.ips = IP -label.is.default = Es por defecto -label.is.shared = es compartido -label.is.system = es el Sistema -label.iscsi = iSCSI -label.iso = ISO -label.iso.boot = ISO de arranque -label.isolation.mode=modo de aislamiento -label.keep = Mantener -label.lang.chinese = Chino (simplificado) -label.lang.english = Inglés -label.lang.japanese = japonés -label.lang.spanish = Español -label.last.disconnected = Última Desconectado -label.last.name = Apellido -label.level = Nivel -lable.linklocal.ip=Enlace adddress IP local -label.load.balancer = equilibrador de carga -label.loading = Carga -label.local = local -label.login = Login -label.logout = Cerrar sesión -label.lun = LUN -label.manage = Administrar -label.maximum = máximo -label.memory = Memoria -label.memory.allocated = memoria asignada -label.memory.mb = memoria (en MB) -label.memory.total = Total de memoria -label.memory.used = memoria usada -label.menu.accounts = Cuentas -label.menu.alerts = Alertas -label.menu.all.accounts = Todas las cuentas -label.menu.all.instances = todas las instancias -label.menu.community.isos = Comunidad ISOs -label.menu.community.templates = plantillas de la comunidad -label.menu.configuration = Configuración -label.menu.dashboard = Interfaz -label.menu.destroyed.instances = Destruir instancias -label.menu.disk.offerings = disco ofertas -label.menu.domains = dominio -label.menu.events = Eventos -label.menu.featured.isos = destacados ISO -label.menu.featured.templates = destacados plantillas -label.menu.global.settings = Configuración global -label.menu.instances = Instancias -label.menu.ipaddresses = Direcciones IP -label.menu.isos = ISO -label.menu.my.accounts = Mis cuentas -label.menu.my.instances = Mi instancias -label.menu.my.isos = Mi ISOs -label.menu.my.templates = Mis plantillas -label.menu.network = Red -label.menu.network.offerings = Red de ofertas -label.menu.physical.resources = Recursos Físicos -label.menu.running.instances = Ejecución de instancias -label.menu.security.groups = Grupos de seguridad -label.menu.service.offerings = Ofertas de Servicios -label.menu.snapshots = instantáneas -label.menu.stopped.instances = Detenido instancias -label.menu.storage = Almacenamiento -label.menu.system = Sistema -label.menu.system.vms = Sistema de máquinas virtuales -label.menu.templates = plantillas -label.menu.virtual.appliances = Virtual Appliances -label.menu.virtual.resources = Virtual de Recursos -label.menu.volumes = Volúmenes -label.migrate.instance.to = Migración de ejemplo para -label.minimum = Mínimo -label.minute.past.hour = Minuto (s) después de la hora -label.monday = lunes -label.monthly = mensual -label.more.templates plantillas = Más -label.my.account = Mi Cuenta -label.name = Nombre -label.name.optional = Nombre (Opcional) -label.netmask = máscara de red -label.network = Red -label.network.desc = Red de Desc -label.network.domain = Red de dominio -label.network.id = ID de red -label.network.name = Nombre de red -label.network.offering = Red ofrece -label.network.offering.display.text = Red ofrece visualización de texto -label.network.offering.id = Red ofrece ID -label.network.offering.name = Red ofrece Nombre -label.network.rate = Tasa de Red -label.network.read = Leer de la red -label.network.type = Tipo de red -label.network.write = Escribir en la red -label.new.password = Nueva contraseña -label.next = Siguiente -label.nfs = NFS -label.nfs.server = servidor NFS -label.nfs.storage = NFS Almacenamiento -label.nics = NIC -label.no = No -label.no.actions = No Acciones disponibles -label.no.alerts = No alertas recientes -label.no.errors = No recientes errores -label.no.isos = No ISOs disponibles -label.no.items = No artículos disponibles -label.no.security.groups = No hay grupos disponibles de Seguridad -label.no.thanks = No, gracias -label.none=Ninguno -label.not.found=No se ha encontrado -label.num.cpu.cores = número de núcleos de CPU -label.numretries = Número de reintentos -label.offer.ha = Oferta HA -label.optional = Opcional -label.os.preference = OS Preferencia -label.os.type = tipo de Sistema Operativo -label.owned.public.ips = propiedad pública Direcciones IP -label.owner.account = titular de la cuenta -label.owner.domain = Propietario de Dominio -label.parent.domain = Padres de dominio -label.password = Contraseña -label.password.enabled = Contraseña Activado -label.path = Ruta -label.please.wait = Por favor espere -label.pod = Pod -label.port.forwarding = Port Forwarding -label.port.range = rango de puertos -label.prev = Anterior -label.primary.allocated = primaria asignado de almacenamiento -label.primary.network = Red Primaria -label.primary.storage = Almacenamiento Primario -label.primary.used = Primaria Almacenado -label.private.interface = Interfaz privada -label.private.ip = dirección IP privada -label.private.ip.range = IP privada Gama -label.private.ips = direcciones IP privadas -label.private.port = Puerto privado -label.private.zone = Zona Privada -label.protocol = Protocolo -label.protocol = Protocolo -label.public = Pública -label.public.interface = interfaz pública -label.public.ip = dirección IP pública -label.public.ips = direcciones IP públicas -label.public.port = Puerto Público -label.public.zone = Zona Pública -label.recent.errors = recientes errores -label.refresh = Actualizar -label.related = relacionados -label.remove.from.load.balancer = ejemplo Eliminación de equilibrador de carga -label.removing.user = Eliminar usuario -label.required = Requerido -label.reserved.system.ip = Reservados sistema de PI -label.resource = Recursos -label.resource.limits = Límites de Recursos -label.resources = Recursos -label.role = Papel -label.root.disk.offering=Root Disco Offering -label.running.vms = Ejecución de máquinas virtuales -label.saturday = sábado -label.save = Guardar -label.saving.processing = ahorro .... -label.scope = Alcance -label.search = Buscar -label.secondary.storage = Almacenamiento secundario -label.secondary.used = Secundaria Almacenado -label.secret.key = clave secreta -label.security.group = Grupo de Seguridad -label.security.group.name = Nombre de grupo de seguridad -label.security.groups = Grupos de seguridad -label.security.groups.enabled=Los grupos de seguridad habilitado -label.sent = Enviados -label.server = Servidor -label.service.offering = Oferta de Servicio -label.session.expired=Session Caducado -label.shared = compartidas -label.size = Tamaño -label.snapshot = Instantánea -label.snapshot.limits = instantáneas Límites -label.snapshot.name = Nombre de instantáneas -label.snapshot.s = Instantánea (s) -label.snapshot.schedule = Lista de instantáneas -label.snapshots = instantáneas -label.source.nat = NAT Fuente -label.specify.vlan = Especifique VLAN -label.start.port = Iniciar Puerto -label.state = Estado -label.static.nat = NAT estática -label.static.nat.to = estático NAT para -label.statistics = Estadísticas -label.status = Estado -label.step.1 = Paso 1 -label.step.1.title = Paso 1: Seleccione una plantilla -label.step.2 = Paso 2 -label.step.2.title = Paso 2: Oferta de Servicio -label.step.3 = Paso 3 -label.step.3.title = Paso 3: Seleccione un disco Ofrenda -label.step.4 = Paso 4 -label.step.4.title = Paso 4: Red -label.step.5 = Paso 5 -label.step.5.title = Paso 5: Revisión -label.stopped.vms = Detenido máquinas virtuales -label.storage = Almacenamiento -label.storage.type = Tipo de almacenamiento -label.submit = Enviar -label.submitted.by = [Enviado por: ] -label.succeeded = Sucesor -label.sunday = domingo -label.system.capacity = Capacidad de todo el sistema -label.system.vm = Sistema de VM -label.system.vm.type = Tipo de sistema VM -label.system.vm.type = Tipo de sistema VM -label.system.vms = Sistema de máquinas virtuales -label.tagged = etiqueta -label.tags = Etiquetas -label.target.iqn = Objetivo IQN -label.template = plantilla -label.template.limits = Plantilla Límites -label.theme.default =Tema Por Defecto -label.theme.grey =Personal - Gris -label.theme.lightblue=Personal - Azul -label.thursday = Jueves -label.time = Tiempo -label.time.zone = Zona horaria -label.timeout.in.second = Tiempo de espera (segundos) -label.timezone = Zona horaria -label.total.cpu=Total CPU -label.total.vms = Total de máquinas virtuales -label.traffic.type = Tipo de Tráfico -label.tuesday = martes -label.type = Tipo -label.type.id = Tipo de identificación -label.unavailable = no disponible -label.unlimited=Unlimited -label.untagged = sin etiquetar -label.update.ssl = Actualizar certificado SSL -label.update.ssl.cert = Actualizar certificado SSL -label.updating = Actualizar -label.url = URL -label.usage.interface = Interfaz de uso -label.used = Usado -label.user = Usuario -label.username = Nombre de usuario -label.users = usuario -label.value = Valor -label.vcenter.cluster = vCenter clúster -label.vcenter.datacenter = vCenter de centros de datos -label.vcenter.datastore = vCenter almacén de datos -label.vcenter.host = vCenter anfitrión -label.vcenter.password = vCenter Contraseña -label.vcenter.username = vCenter Nombre de usuario -label.version = Versión -label.virtual.appliance = Virtual Appliance -label.virtual.appliances = Virtual Appliances -label.virtual.network = Red Virtual -label.vlan = VLAN -label.vlan.id = ID de VLAN -label.vlan.range = VLAN Gama -label.vm.add = Añadir Instancia -label.vm.destroy = Destroy -label.vm.reboot = Reiniciar -label.vm.start = Inicio -label.vm.stop = Detener -label.vmfs = VMFS -label.vms = VM -label.volume = Volumen -label.volume.limits = límites de volumen -label.volume.name = Nombre de Volumen -label.volumes = Volúmenes -label.vpn = VPN -label.vsphere.managed Gestionado = vSphere -label.waiting = Esperando -label.warn = Advertir -label.wednesday = miércoles -label.weekly = Semanal -label.welcome = Bienvenido -label.welcome.cloud.console = Bienvenido a la consola de administración -label.yes = Sí -label.zone = Zona -label.zone.id = Zona de identificación -label.zone.step.1.title = Paso 1: Seleccione una red -label.zone.step.2.title = Paso 2: Añadir una zona -label.zone.step.3.title = Paso 3: Añadir una vaina -label.zone.step.4.title = Paso 4: Añadir un rango de IP -label.zone.wide = Zona para todo el - -#Messages -message.acquire.public.ip = Por favor seleccione una zona de la que desea adquirir su nueva IP. -message.action.cancel.maintenance = Su acogida ha sido cancelado con éxito para el mantenimiento. Este proceso puede tardar hasta varios minutos. -message.action.cancel.maintenance.mode = Por favor, confirme que desea cancelar el mantenimiento -message.action.delete.ISO = Por favor, confirme que desea eliminar la norma ISO -message.action.delete.ISO.for.all.zones = La ISO es utilizado por todas las zonas. Por favor, confirme que desea eliminar de todas las zonas. -message.action.delete.cluster = Por favor, confirme que desea eliminar del clúster -message.action.delete.disk.offering = Por favor, confirme que desea eliminar ofreciendo disco -message.action.delete.domain = Por favor, confirme que desea eliminar de dominio -message.action.delete.external.firewall = Por favor, confirme que desea quitar este servidor de seguridad externo. Advertencia: Si usted está planeando volver a agregar el servidor de seguridad externo mismo, debe restablecer los datos de uso en el dispositivo. -message.action.delete.external.load.balancer = Por favor, confirme que desea eliminar este equilibrador de carga externa. Advertencia: Si usted está planeando volver a agregar la misma equilibrador de carga externo, debe restablecer los datos de uso en el dispositivo. -message.action.delete.ingress.rule = Por favor, confirme que desea eliminar la regla de ingreso -message.action.delete.network = Por favor, confirme que desea eliminar de la red -message.action.delete.pod = Por favor, confirme que desea eliminar de la vaina -message.action.delete.primary.storage = Por favor, confirme que desea eliminar el almacenamiento primario -message.action.delete.secondary.storage = Por favor, confirme que desea eliminar de almacenamiento secundario -message.action.delete.security.group = Por favor, confirme que desea eliminar el grupo de seguridad -message.action.delete.service.offering = Por favor, confirme que desea eliminar oferta de servicios -message.action.delete.snapshot = Por favor, confirme que desea eliminar instantáneas -message.action.delete.template = Por favor, confirme que desea eliminar la plantilla -message.action.delete.template.for.all.zones = La plantilla es utilizada por todas las zonas. Por favor, confirme que desea eliminar de todas las zonas. -message.action.delete.volume = Por favor, confirme que desea eliminar el volumen -message.action.delete.zone = Por favor, confirme que desea eliminar la zona -message.action.destroy.instance = Por favor, confirme que desea destruir ejemplo -message.action.destroy.systemvm = Por favor, confirme que desea destruir la máquina virtual del sistema. -message.action.disable.static.NAT = Por favor, confirme que desea desactivar NAT estática -message.action.enable.maintenance = Su acogida ha sido preparado con éxito para el mantenimiento. Este proceso puede tardar hasta varios minutos o más dependiendo de cómo las máquinas virtuales se encuentran actualmente en este servidor. -message.action.force.reconnect = Por favor, confirme que desea forzar una reconexión para el anfitrión -message.action.force.reconnect = Su acogida ha sido obligado a volver a conectar con éxito. Este proceso puede tardar hasta varios minutos. -message.action.host.enable.maintenance.mode mode = mantenimiento de Habilitación provocará una migración en vivo de todas las instancias que se ejecutan en el sistema para cualquier máquina disponible. -message.action.instance.reset.password = Por favor, confirme que desea cambiar la contraseña de root para esta máquina virtual. -message.action.primarystorage.enable.maintenance.mode = Advertencia: colocar el almacenamiento principal en modo de mantenimiento hará que todas las máquinas virtuales utilizando volúmenes de que sea detenido. ¿Desea continuar? -message.action.reboot.instance = Por favor, confirme que desea reiniciar el ejemplo -message.action.reboot.router = Por favor, confirme que desea reiniciar el router -message.action.reboot.systemvm = Por favor, confirme que desea reiniciar el sistema VM -message.action.release.ip = Por favor, confirme que desea liberar IP -message.action.remove.host = Extracción último / único huésped en el grupo y volver a instalar el huésped va a destruir el medio ambiente de trabajo / base de datos en el host y hacer que la movilidad virtual inutilizable. -message.action.restore.instance = Por favor, confirme que desea restaurar ejemplo -message.action.start.instance = Por favor, confirme que desea iniciar la instancia -message.action.start.router = Por favor, confirme que desea iniciar router -message.action.start.systemvm = Por favor, confirme que desea iniciar el sistema VM -message.action.stop.instance = Por favor, confirme que desea detener la instancia -message.action.stop.router = Por favor, confirme que desea detener router -message.action.stop.systemvm = Por favor, confirme que desea detener sistema VM -message.action.take.snapshot = Por favor, confirme que desea tomar instantáneas -message.add.cluster = Añadir un hipervisor administradas por clúster de zona , la consola de -message.add.cluster.zone = Añadir un hipervisor administradas por clúster de zona -message.add.disk.offering = Por favor, especifique los parámetros siguientes para agregar un nuevo disco que ofrece -message.add.firewall = Añadir un servidor de seguridad a la zona -message.add.host = Por favor, especifique los parámetros siguientes para agregar un nuevo host -message.add.ip.range = Añadir un rango de IP a la red pública en la zona -message.add.ip.range.direct.network = Añadir un rango de IP para dirigir red en la zona -message.add.ip.range.to.pod =

Añadir un rango de IP de la vaina:

-message.add.load.balancer = Añadir un equilibrador de carga a la zona -message.add.network = Agregar una nueva red para la zona: -message.add.pod = Agregar una vaina nueva zona -message.add.primary = Por favor, especifique los parámetros siguientes para agregar un nuevo almacenamiento primario -message.add.primary.storage = Agregar una nueva almacenamiento primario para zona , la consola de -message.add.secondary.storage = Añadir un nuevo almacenamiento de zona -message.add.service.offering = Por favor, rellene los siguientes datos para agregar una nueva oferta de servicio. -message.add.template = Por favor ingrese los siguientes datos para crear la nueva plantilla -message.add.volume = Por favor, rellene los siguientes datos para agregar un nuevo volumen. -message.additional.networks.desc = Por favor seleccione de red adicionales (s) que la instancia virtual estará conectado. -message.advanced.mode.desc = Seleccione este modelo de red si desea habilitar soporte VLAN. Este modelo de red proporciona la máxima flexibilidad al permitir a los administradores proporcionar ofertas personalizadas de la red como el suministro de firewall, VPN, o el apoyo equilibrador de carga, así como permitir vs directa de redes virtuales. -message.advanced.security.group = Elija esta opción si desea utilizar grupos de seguridad para proporcionar resultados de aislamiento VM. -message.advanced.virtual = Elija esta opción si desea utilizar VLAN toda la zona para proporcionar el aislamiento VM invitado. -message.allow.vpn.access = Por favor, introduzca un nombre de usuario y la contraseña del usuario que desea permitir el acceso de VPN. -message.attach.iso.confirm = Por favor, confirme que desea conectar el ISO a la instancia virtual -message.attach.volume = Por favor, rellene los siguientes datos para fijar un nuevo volumen. Si está colocando un volumen de disco a una máquina virtual de Windows basado, usted tendrá que reiniciar la instancia para ver el disco adjunto. -message.basic.mode.desc = Seleccione este modelo de red si lo haces * no * desea habilitar cualquier soporte VLAN. Todas las instancias virtuales creados en virtud de este modelo de red se le asignará una dirección IP directamente desde la red y grupos de seguridad se utilizan para proporcionar la seguridad y la segregación. -message.change.offering.confirm = Por favor, confirme que desea cambiar la oferta de servicio de la instancia virtual. -message.copy.iso.confirm = Por favor, confirme que desea copiar el ISO a -message.copy.template = Copia plantilla XXX de la zona -message.create.template.vm = Crear VM de la plantilla -message.create.template.volume = Por favor, especifique la siguiente información antes de crear una plantilla de su volumen de disco: . Creación de la plantilla puede oscilar entre varios minutos más, dependiendo del tamaño del volumen. -message.delete.account = Por favor, confirme que desea eliminar esta cuenta. -message.detach.iso.confirm = Por favor, confirme que desea quitar el ISO de la instancia virtual -message.disable.account = Por favor, confirme que desea deshabilitar esta cuenta. Al deshabilitar la cuenta, todos los usuarios de esta cuenta ya no tienen acceso a los recursos de su nube. Todas las máquinas virtuales en ejecución se cierre inmediatamente. -message.disable.vpn.access = Por favor, confirme que desea desactivar VPN de acceso. -message.download.ISO=Por favor, haga clic 00000 para descargar la ISO -message.download.template=Por favor, haga clic 00000 para descargar la plantilla -message.download.volume=Por favor, haga clic 00000 para bajar el volumen -message.edit.confirm = Por favor confirmar los cambios antes de hacer clic en "Guardar" -message.edit.limits = Por favor, especifique los límites de los recursos siguientes. A "-1" indica que no hay límite a la cantidad de los recursos de crear. -message.enable.account = Por favor, confirme que desea habilitar esta cuenta. -message.enable.vpn = VPN de acceso actualmente no está habilitado. Por favor, haga clic aquí para habilitar VPN. -message.enable.vpn.access VPN = está desactivado para esta dirección IP. ¿Te gustaría que permitan el acceso VPN? -message.enabled.vpn = Su acceso a la VPN está habilitado y se puede acceder a través de la IP -message.enabled.vpn.ip.sec = La clave pre-compartida IPSec es -message.launch.vm.on.private.network = ¿Desea iniciar su ejemplo en su propia red privada dedicada? -message.lock.account = Por favor, confirme que desea bloquear esta cuenta. Al bloquear la cuenta, todos los usuarios de esta cuenta ya no será capaz de gestionar sus recursos de la nube. Los recursos existentes todavía se puede acceder. -message.migrate.instance.confirm = Por favor, confirme el anfitrión desea migrar la instancia virtual. -message.new.user = Especifique lo siguiente para agregar un nuevo usuario a la cuenta -message.no.network.support = El hipervisor seleccionado, vSphere, no tiene funciones de red adicionales. Por favor, continúe con el paso 5. -message.no.network.support.configuration.not.true = Usted no tiene ninguna zona que ha permitido a grupo de seguridad. Por lo tanto, no hay funciones de red adicionales. Por favor, continúe con el paso 5. -message.number.clusters =

# de Grupos

-message.number.hosts =

# de Anfitrión

-message.number.pods =

# de Las vainas

-message.number.storage =

# de Almacenamiento primario

-message.number.zones =

# de Zonas

-message.remove.vpn.access = Por favor, confirme que desea eliminar el acceso VPN desde el siguiente usuario -message.restart.mgmt.server = Por favor, reinicie el servidor de administración (s) para la nueva configuración surta efecto. -message.security.group.usage = (Uso pulse Ctrl para seleccionar todos los grupos de seguridad se aplica) -message.snapshot.schedule = Puede horarios de configuración recurrente instantáneas mediante la selección de las opciones disponibles a continuación y la aplicación de su preferencia política -message.step.1.continue = Por favor seleccione una plantilla o ISO para continuar -message.step.1.desc = Por favor seleccione una plantilla para la instancia virtual. También puede optar por seleccionar una plantilla en blanco desde el que puede ser una imagen ISO instalado en. -message.step.2.continue = Por favor seleccione una oferta de servicio para continuar -message.step.2.desc = -message.step.3.continue = Por favor seleccione una oferta en disco para continuar -message.step.3.desc = -message.step.4.continue = Por favor seleccione al menos una red social para continuar -message.step.4.desc = Por favor, seleccione la red primaria que la instancia virtual estará conectado. -message.update.os.preference = Por favor seleccione un sistema operativo de preferencia para este equipo. Todas las instancias virtuales con preferencias similares serán los primeros asignados a este equipo antes de elegir otro. -message.update.ssl = Por favor, envíe una nueva X.509 compatible con certificado SSL que se actualizará a cada instancia virtual de la consola del servidor proxy: -message.virtual.network.desc = Una red dedicada virtualizados para su cuenta. El dominio de difusión está contenida dentro de una VLAN y todos los acceso a la red pública se encamina a cabo por un router virtual. -message.volume.create.template.confirm = Por favor, confirme que desea crear una plantilla para este volumen de disco. Creación de la plantilla puede oscilar entre varios minutos más, dependiendo del tamaño del volumen. -message.zone.step.1.desc = Por favor seleccione un modelo de red para su zona. -message.zone.step.2.desc = Por favor ingrese los siguientes datos para agregar una nueva zona -message.zone.step.3.desc = Por favor ingrese los siguientes datos para agregar una vaina nueva -message.apply.snapshot.policy = Ha actualizado su política instantánea actual. -message.disable.snapshot.policy = Ha desactivado su política instantánea actual. -message.action.change.service.warning = Su ejemplo debe ser detenido antes de intentar cambiar su oferta de servicios actual. -message.action.reset.password.warning = Su ejemplo debe ser detenido antes de intentar cambiar su contraseña actual. -message.action.reset.password.off = Su ejemplo en la actualidad no es compatible con esta función. - - -#Errors -error.login = Su nombre de usuario / contraseña no coincide con nuestros registros. -error.menu.select = No se puede realizar la acción debido a que no los artículos que son seleccionados. -error.mgmt.server.inaccessible = El Servidor de Gestión es inaccesible. Por favor, inténtelo de nuevo más tarde. -error.session.expired = Su sesión ha caducado. -error.unresolved.internet.name = El nombre de Internet no se puede resolver. -#cloudstack 2.2.Y (end) ******************************************************************************************** diff --git a/client/WEB-INF/classes/resources/messages_ja.properties b/client/WEB-INF/classes/resources/messages_ja.properties index c7de4ec4866..ec785f6f83e 100644 --- a/client/WEB-INF/classes/resources/messages_ja.properties +++ b/client/WEB-INF/classes/resources/messages_ja.properties @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. + #new labels (begin) ********************************************************************************************** @@ -23,11 +24,104 @@ #modified labels (begin) ***************************************************************************************** -message.action.reboot.router=All services provided by this virtual router will be interrupted. Please confirm that you want to reboot this router. -message.action.stop.router=All services provided by this virtual router will be interrupted. Please confirm that you want to stop this router. -message.restart.network=All services provided by this network will be interrupted. Please confirm that you want to restart this network. + #modified labels (end) ******************************************************************************************* +label.configure.network.ACLs=ネットワーク ACL の構成 +label.network.ACLs=ネットワーク ACL +label.add.network.ACL=ネットワーク ACL の追加 +label.private.Gateway=プライベート ゲートウェイ +label.VPC.router.details=VPC ルーターの詳細 +label.VMs.in.tier=階層内の VM + +message.zoneWizard.enable.local.storage=警告: このゾーンのローカル ストレージを有効にする場合は、システム VM の起動場所に応じて次の操作が必要です。

1. システム VM をプライマリ ストレージで起動する必要がある場合は、プライマリ ストレージを作成した後でゾーンに追加する必要があります。また、無効状態のゾーンを起動する必要もあります。

2. システム VM をローカル ストレージで起動する必要がある場合は、system.vm.use.local.storage を true に設定してからゾーンを有効にする必要があります。


続行してもよろしいですか? +label.local.storage.enabled=ローカル ストレージは有効です +label.tier.details=階層の詳細 +label.edit.tags=タグの編集 +label.network.rate.megabytes=ネットワーク速度 (MB/秒) +label.action.enable.physical.network=物理ネットワークの有効化 +label.action.disable.physical.network=物理ネットワークの無効化 +message.action.enable.physical.network=この物理ネットワークを有効にしてもよろしいですか? +message.action.disable.physical.network=この物理ネットワークを無効にしてもよろしいですか? + +label.select.tier=階層の選択 +label.add.ACL=ACL の追加 +label.remove.ACL=ACL の削除 +label.tier=階層 +label.network.ACL=ネットワーク ACL +label.network.ACL.total=ネットワーク ACL 合計 +label.add.new.gateway=新しいゲートウェイの追加 +message.add.new.gateway.to.vpc=この VPC に新しいゲートウェイを追加するための情報を指定してください。 +label.delete.gateway=ゲートウェイの削除 +message.delete.gateway=このゲートウェイを削除してもよろしいですか? +label.CIDR.of.destination.network=宛先ネットワークの CIDR +label.add.route=ルートの追加 +label.add.static.route=静的ルートの追加 +label.remove.static.route=静的ルートの削除 +label.site.to.site.VPN=サイト間 VPN +label.add.VPN.gateway=VPN ゲートウェイの追加 +message.add.VPN.gateway=VPN ゲートウェイを追加してもよろしいですか? +label.VPN.gateway=VPN ゲートウェイ +label.delete.VPN.gateway=VPN ゲートウェイの削除 +message.delete.VPN.gateway=この VPN ゲートウェイを削除してもよろしいですか? +label.VPN.connection=VPN 接続 +label.IPsec.preshared.key=IPsec 事前共有キー +label.IKE.policy=IKE ポリシー +label.ESP.policy=ESP ポリシー +label.create.VPN.connection=VPN 接続の作成 +label.VPN.customer.gateway=VPN カスタマー ゲートウェイ +label.CIDR.list=CIDR 一覧 +label.IKE.lifetime=IKE 有効期間 (秒) +label.ESP.lifetime=ESP 有効期間 (秒) +label.dead.peer.detection=停止ピアの検出 +label.reset.VPN.connection=VPN 接続のリセット +message.reset.VPN.connection=VPN 接続をリセットしてもよろしいですか? +label.delete.VPN.connection=VPN 接続の削除 +message.delete.VPN.connection=VPN 接続を削除してもよろしいですか? +label.add.new.tier=新しい階層の追加 +label.add.VM.to.tier=階層への VM の追加 +label.remove.tier=階層の削除 + +label.local.storage.enabled=ローカル ストレージは有効です +label.associated.network=関連づけられたネットワーク +label.add.port.forwarding.rule=ポート転送規則の追加 +label.dns=DNS + +label.vpc=VPC +label.vpc.id=VPC ID +label.tier=階層 +label.add.vpc=VPC の追加 +label.super.cidr.for.guest.networks=ゲスト ネットワークのスーパー CIDR +label.DNS.domain.for.guest.networks=ゲスト ネットワークの DNS ドメイン +label.configure.vpc=VPC の構成 +label.edit.vpc=VPC の編集 +label.restart.vpc=VPC の再起動 +message.restart.vpc=VPC を再起動してもよろしいですか? +label.remove.vpc=VPC の削除 +message.remove.vpc=VPC を削除してもよろしいですか? +label.vpn.customer.gateway=VPN カスタマー ゲートウェイ +label.add.vpn.customer.gateway=VPN カスタマー ゲートウェイの追加 +label.IKE.encryption=IKE 暗号化 +label.IKE.hash=IKE ハッシュ +label.IKE.DH=IKE DH +label.ESP.encryption=ESP 暗号化 +label.ESP.hash=ESP ハッシュ +label.perfect.forward.secrecy=Perfect Forward Secrecy +label.IKE.lifetime=IKE 有効期間 (秒) +label.ESP.lifetime=ESP 有効期間 (秒) +label.dead.peer.detection=停止ピアの検出 +label.delete.VPN.customer.gateway=VPN カスタマー ゲートウェイの削除 +message.delete.VPN.customer.gateway=この VPN カスタマー ゲートウェイを削除してもよろしいですか? + +label.network.domain.text=ネットワーク ドメイン +label.memory.mb=メモリ (MB) +label.cpu.mhz=CPU (MHz) +message.action.remove.host=このホストを削除してもよろしいですか? + +message.action.reboot.router=この仮想ルーターで提供するすべてのサービスが中断されます。このルーターを再起動してもよろしいですか? +message.action.stop.router=この仮想ルーターで提供するすべてのサービスが中断されます。このルーターを停止してもよろしいですか? +message.restart.network=このネットワークで提供するすべてのサービスが中断されます。このネットワークを再起動してもよろしいですか? + label.ipaddress=IP アドレス label.vcdcname=vCenter DC 名 @@ -35,14 +129,14 @@ label.vcipaddress=vCenter IP アドレス label.vsmctrlvlanid=コントロール VLAN ID label.vsmpktvlanid=パケット VLAN ID label.vsmstoragevlanid=ストレージ VLAN ID -label.nexusVswitch=Nexus vSwitch -label.action.delete.nexusVswitch=Nexus vSwitch の削除 -label.action.enable.nexusVswitch=Nexus vSwitch の有効化 -label.action.disable.nexusVswitch=Nexus vSwitch の無効化 -label.action.list.nexusVswitch=Nexus vSwitch の一覧表示 -message.action.delete.nexusVswitch=この Nexus vSwitch を削除してもよろしいですか? -message.action.enable.nexusVswitch=この Nexus vSwitch を有効にしてもよろしいですか? -message.action.disable.nexusVswitch=この Nexus vSwitch を無効にしてもよろしいですか? +label.nexusVswitch=Nexus 1000V +label.action.delete.nexusVswitch=Nexus 1000V の削除 +label.action.enable.nexusVswitch=Nexus 1000V の有効化 +label.action.disable.nexusVswitch=Nexus 1000V の無効化 +label.action.list.nexusVswitch=Nexus 1000V の一覧表示 +message.action.delete.nexusVswitch=この Nexus 1000V を削除してもよろしいですか? +message.action.enable.nexusVswitch=この Nexus 1000V を有効にしてもよろしいですか? +message.action.disable.nexusVswitch=この Nexus 1000V を無効にしてもよろしいですか? message.specify.url=URL を指定してください label.select.instance.to.attach.volume.to=ボリュームをアタッチするインスタンスを選択してください label.upload=アップロード @@ -56,7 +150,7 @@ label.action.register.iso=ISO の登録 label.isolation.method=分離方法 label.action.register.template=テンプレートの登録 label.checksum=MD5 チェックサム -label.cpu=CPU +label.vpn=VPN label.vlan=VLAN @@ -262,6 +356,7 @@ label.viewing=表示項目: label.move.to.top=最上位に移動 label.move.up.row=1 行上に移動 label.move.down.row=1 行下に移動 +label.move.to.bottom=最下位に移動 label.drag.new.position=新しい位置にドラッグ label.order=順序 label.no.data=表示するデータがありません @@ -313,7 +408,6 @@ label.stickiness=持続性 label.source=送信元 label.least.connections=最小接続 label.round.robin=ラウンドロビン -label.network.domain.text=ネットワーク ドメイン テキスト label.restart.required=再起動が必要 label.clean.up=クリーン アップ label.restart.network=ネットワークの再起動 @@ -919,8 +1013,8 @@ label.code=コード label.confirmation=確認 label.cpu.allocated.for.VMs=VM に割り当て済みの CPU label.cpu.allocated=割り当て済みの CPU -label.cpu.mhz=CPU label.cpu.utilized=CPU 使用率 +label.cpu=CPU label.created=作成日時 label.cross.zones=クロス ゾーン label.custom.disk.size=カスタム ディスク サイズ @@ -1038,7 +1132,6 @@ label.lun=LUN label.manage=管理 label.maximum=最大 label.memory.allocated=割り当て済みのメモリ -label.memory.mb=メモリ label.memory.total=メモリ合計 label.memory.used=メモリ使用量 label.memory=メモリ @@ -1275,7 +1368,6 @@ label.volume.limits=ボリューム制限 label.volume.name=ボリューム名 label.volume=ボリューム label.volumes=ボリューム -label.vpn=VPN label.vsphere.managed=vSphere による管理 label.waiting=待機しています label.warn=警告 @@ -1326,7 +1418,6 @@ message.action.primarystorage.enable.maintenance.mode=警告: プライマリ message.action.reboot.instance=このインスタンスを再起動してもよろしいですか? message.action.reboot.systemvm=このシステム VM を再起動してもよろしいですか? message.action.release.ip=この IP アドレスを解放してもよろしいですか? -message.action.remove.host=クラスター内に最後まで残った唯一のホストを削除して再インストールすると、ホスト上の作業環境およびデータベースが破棄され、VM ゲストが使用できなくなります。 message.action.restore.instance=このインスタンスを復元してもよろしいですか? message.action.start.instance=このインスタンスを起動してもよろしいですか? message.action.start.router=このルーターを起動してもよろしいですか? diff --git a/client/WEB-INF/classes/resources/messages_zh_CN.properties b/client/WEB-INF/classes/resources/messages_zh_CN.properties index 54f079c1bb2..f86601773cb 100644 --- a/client/WEB-INF/classes/resources/messages_zh_CN.properties +++ b/client/WEB-INF/classes/resources/messages_zh_CN.properties @@ -15,1416 +15,1501 @@ # specific language governing permissions and limitations # under the License. -#new labels (begin) ********************************************************************************************** - - -#new labels (end) ************************************************************************************************ - - -#modified labels (begin) ***************************************************************************************** - -message.action.reboot.router=All services provided by this virtual router will be interrupted. Please confirm that you want to reboot this router. -message.action.stop.router=All services provided by this virtual router will be interrupted. Please confirm that you want to stop this router. -message.restart.network=All services provided by this network will be interrupted. Please confirm that you want to restart this network. -#modified labels (end) ******************************************************************************************* - - -label.ipaddress=IP 地址 -label.vcdcname=vCenter DC 名称 -label.vcipaddress=vCenter IP 地址 -label.vsmctrlvlanid=控制 VLAN ID -label.vsmpktvlanid=数据包 VLAN ID -label.vsmstoragevlanid=存储 VLAN ID -label.nexusVswitch=NexusVswitch -label.action.delete.nexusVswitch=删除 NexusVswitch -label.action.enable.nexusVswitch=启用 NexusVswitch -label.action.disable.nexusVswitch=禁用 NexusVswitch -label.action.list.nexusVswitch=列出 NexusVswitch -message.action.delete.nexusVswitch=请确认您确实要删除此 NexusVswitch。 -message.action.enable.nexusVswitch=请确认您确实要启用此 NexusVswitch。 -message.action.disable.nexusVswitch=请确认您确实要禁用此 NexusVswitch。 -message.specify.url=请指定 URL -label.select.instance.to.attach.volume.to=选择要将卷附加到的实例 -label.upload=上载 -label.upload.volume=上载卷 -label.virtual.routers=虚拟路由器 -label.primary.storage.count=主存储池 -label.secondary.storage.count=辅助存储池 -label.number.of.system.vms=系统 VM 数 -label.number.of.virtual.routers=虚拟路由器数 -label.action.register.iso=注册 ISO -label.isolation.method=隔离方法 -label.action.register.template=注册模板 -label.checksum=MD5 校验和 -label.cpu=CPU -label.vlan=VLAN - - -label.management.ips=管理类 IP 地址 -label.devices=设备 -label.rules=规则 -label.traffic.label=流量标签 -label.vm.state=VM 状态 -message.setup.physical.network.during.zone.creation.basic=添加基础区域时,可以设置一个物理网络,此网络应与虚拟机管理程序中的 NIC 相对应。此网络可以承载多种流量类型。

此外,还可以将其他流量类型拖放到此物理网络。 -label.domain.router=域路由器 -label.console.proxy=控制台代理 -label.secondary.storage.vm=辅助存储 VM -label.add.netScaler.device=添加 Netscaler 设备 -label.add.F5.device=添加 F5 设备 -label.add.SRX.device=添加 SRX 设备 -label.account.and.security.group=帐户、安全组 -label.fetch.latest=提取最新内容 -label.system.offering=系统方案 -message.validate.instance.name=实例名称不得超过 63 个字符。仅允许使用 ASCII 字母 a - z 或 A - Z、数字 0 - 9 以及连字符。实例名称必须以字母开头并以字母或数字结束。 - - -label.isolated.networks=隔离网络 -label.latest.events=最新事件 -state.Enabled=已启用 -label.system.wide.capacity=全系统容量 -label.network.service.providers=网络服务提供程序 -message.launch.zone=区域已准备就绪,可随时启动;请继续执行下一步骤。 -error.unable.to.reach.management.server=无法访问 Management Server -label.internal.name=内部名称 -message.configure.all.traffic.types=您有多个物理网络,请单击“编辑”按钮为每种流量类型配置标签。 -message.edit.traffic.type=请指定您希望与此流量类型关联的流量标签。 -label.edit.traffic.type=编辑流量类型 -label.label=标签 -label.max.networks=最大网络数 -error.invalid.username.password=用户名或密码无效 -message.enabling.security.group.provider=正在启用安全组提供程序 -message.adding.Netscaler.provider=正在添加 Netscaler 提供程序 -message.creating.guest.network=正在创建来宾网络 -label.action.delete.physical.network=删除物理网络 -message.action.delete.physical.network=请确认您确实要删除此物理网络 -message.installWizard.copy.whatIsAHost=主机是指一台计算机。主机提供运行来宾虚拟机的计算资源。每台主机上都安装有虚拟机管理程序软件,用于管理来宾 VM (裸机主机除外,将在“高级安装指南”中讨论这一特殊案例)。例如,启用了 KVM 的 Linux 服务器、Citrix XenServer 服务器和 ESXi 服务器都可用作主机。在基本安装中,我们将使用一台运行 XenServer 的主机。

主机是 CloudStack™ 部署中最小的组织单位。主机包含在群集中,群集包含在提供点中,提供点包含在区域中。 - - -label.add.compute.offering=添加计算方案 -label.compute.offering=计算方案 -label.compute.offerings=计算方案 -label.select.offering=选择方案 -label.menu.infrastructure=基础架构 -label.sticky.tablesize=表大小 -label.sticky.expire=过期日期 -label.sticky.cookie-name=Cookie 名称 -label.sticky.mode=模式 -label.sticky.length=长度 -label.sticky.holdtime=持续时间 -label.sticky.request-learn=request-learn -label.sticky.prefix=prefix -label.sticky.nocache=nocache -label.sticky.indirect=indirect -label.sticky.postonly=postonly -label.sticky.domain=域 -state.Allocating=正在分配 -state.Migrating=正在迁移 -error.please.specify.physical.network.tags=网络方案在您为此物理网络指定标签之后才可用。 - - -state.Stopping=正在停止 -message.add.load.balancer.under.ip=已在以下 IP 下添加负载平衡器规则: -message.select.instance=请选择一个实例。 -label.select=选择 -label.select.vm.for.static.nat=为静态 NAT 选择 VM -label.select.instance=选择实例 -label.nat.port.range=NAT 端口范围 -label.static.nat.vm.details=静态 NAT VM 详情 -label.edit.lb.rule=编辑负载平衡器规则 -message.migrate.instance.to.host=请确认您确实要将实例迁移到其他主机。 -label.migrate.instance.to.host=将实例迁移到其他主机 -message.migrate.instance.to.ps=请确认您确实要将实例迁移到其他主存储。 -label.migrate.instance.to.ps=将实例迁移到其他主存储 -label.corrections.saved=已保存修正 -message.installWizard.copy.whatIsSecondaryStorage=辅助存储与区域相关联,用于存储以下项目:
  • 模板 - 可用于启动 VM 并可以包含其他配置信息(例如,已安装的应用程序)的操作系统映像
  • ISO 映像 - 可重新启动或不可重新启动的操作系统映像
  • 磁盘卷快照 - 已保存的 VM 数据副本,可用于执行数据恢复或创建新模板
-message.installWizard.copy.whatIsPrimaryStorage=CloudStack™ 云基础架构使用以下两种类型的存储: 主存储和辅助存储。这两种类型的存储可以是 iSCSI 或 NFS 服务器,也可以是本地磁盘。

主存储与群集相关联,用于存储该群集中的主机上正在运行的所有 VM 对应的每个来宾 VM 的磁盘卷。主存储服务器通常位于靠近主机的位置。 -message.installWizard.copy.whatIsACluster=群集提供了一种编组主机的方法。群集中的所有主机都具有相同的硬件,运行相同的虚拟机管理程序,位于同一子网中,并访问相同的共享存储。可以实时将虚拟机实例(VM)从一台主机迁移到同一群集内的其他主机,而无需中断向用户提供服务。群集是 CloudStack™ 部署中的第三大组织单位。群集包含在提供点中,提供点包含在区域中。

CloudStack™ 允许云部署中存在多个群集,但对于基本安装,我们只需要一个群集。 -message.installWizard.copy.whatIsAPod=一个提供点通常代表一个机架。同一提供点中的主机位于同一子网中。

提供点是 CloudStack™ 部署中的第二大组织单位。提供点包含在区域中。每个区域中可以包含一个或多个提供点;在基本安装中,您的区域中将仅包含一个提供点。 -message.installWizard.copy.whatIsAZone=区域是 CloudStack™ 部署中最大的组织单位。虽然允许一个数据中心中存在多个区域,但是一个区域通常与一个数据中心相对应。将基础架构编组到区域中的好处是可以提供物理隔离和冗余。例如,每个区域都可以拥有各自的电源供应和网络上行方案,并且各区域可以在地理位置上相隔很远(虽然并非必须相隔很远)。 -message.installWizard.copy.whatIsCloudStack=CloudStack™ 是一个软件平台,可将计算资源集中在一起以构建公共、私有和混合基础设施即服务(IaaS)云。CloudStack™ 负责管理组成云基础架构的网络、存储和计算节点。使用 CloudStack™ 可以部署、管理和配置云计算环境。

CloudStack™ 通过扩展商用硬件上运行的每个虚拟机映像的范围,提供了一个实时可用的云基础架构软件堆栈用于以服务方式交付虚拟数据中心,即交付构建、部署和管理多层次和多租户云应用程序必需的所有组件。开源版本和 Premium 版本都已可用,且提供的功能几乎完全相同。 -message.installWizard.tooltip.addSecondaryStorage.path=导出路径(位于上述指定服务器上) -message.installWizard.tooltip.addSecondaryStorage.nfsServer=托管辅助存储的 NFS 服务器的 IP 地址 -message.installWizard.tooltip.addPrimaryStorage.path=(适用于 NFS)在 NFS 中,此路径为服务器的导出路径。路径(针对 SharedMountPoint)。对于 KVM,此路径为装载了辅助存储的每个主机上的路径。例如,/mnt/primary。 -message.installWizard.tooltip.addPrimaryStorage.server=(适用于 NFS、iSCSI 或 PreSetup)存储设备的 IP 地址或 DNS 名称。 -message.installWizard.tooltip.addPrimaryStorage.name=存储设备的名称。 -message.installWizard.tooltip.addHost.password=此为上述用户的密码(来自 XenServer 安装)。 -message.installWizard.tooltip.addHost.username=通常为 root。 -message.installWizard.tooltip.addHost.hostname=主机的 DNS 名称或 IP 地址。 -message.installWizard.tooltip.addCluster.name=群集的名称。此名称可以是您选择的文本,且未由 CloudStack 使用。 -message.installWizard.tooltip.addPod.reservedSystemEndIp=此为 CloudStack 用于管理辅助存储 VM 和控制台代理 VM 的专用网络中的 IP 范围。这些 IP 地址来自与计算服务器相同的子网。 -message.installWizard.tooltip.addPod.reservedSystemStartIp=此为 CloudStack 用于管理辅助存储 VM 和控制台代理 VM 的专用网络中的 IP 范围。这些 IP 地址来自与计算服务器相同的子网。 -message.installWizard.tooltip.addPod.reservedSystemNetmask=来宾将要使用的子网上正在使用的网络掩码。 -message.installWizard.tooltip.addPod.reservedSystemGateway=该提供点中的主机网关。 -message.installWizard.tooltip.addPod.name=提供点的名称 -message.installWizard.tooltip.configureGuestTraffic.guestEndIp=能够分配给此区域中的来宾的 IP 地址范围。如果使用一个 NIC,这些 IP 应位于与提供点 CIDR 相同的 CIDR 中。 -message.installWizard.tooltip.configureGuestTraffic.guestStartIp=能够分配给此区域中的来宾的 IP 地址范围。如果使用一个 NIC,这些 IP 应位于与提供点 CIDR 相同的 CIDR 中。 -message.installWizard.tooltip.configureGuestTraffic.guestNetmask=来宾应使用的子网上正在使用的网络掩码 -message.installWizard.tooltip.configureGuestTraffic.guestGateway=来宾应使用的网关 -message.installWizard.tooltip.configureGuestTraffic.description=您的网络说明 -message.installWizard.tooltip.configureGuestTraffic.name=您的网络名称 -message.installWizard.tooltip.addZone.internaldns2=这些服务器是供此区域中的系统 VM 使用的 DNS 服务器,将通过系统 VM 的专用网络接口进行访问。您为提供点提供的专用 IP 地址必须路由到在此处指定的 DNS 服务器。 -message.installWizard.tooltip.addZone.internaldns1=这些服务器是供此区域中的系统 VM 使用的 DNS 服务器,将通过系统 VM 的专用网络接口进行访问。您为提供点提供的专用 IP 地址必须路由到在此处指定的 DNS 服务器。 -message.installWizard.tooltip.addZone.dns2=这些服务器是供此区域中的来宾 VM 使用的 DNS 服务器,将通过您稍后要添加的公用网络进行访问。此区域的公用 IP 地址必须路由到在此处指定的 DNS 服务器。 -message.installWizard.tooltip.addZone.name=区域名称 -message.installWizard.tooltip.addZone.dns1=这些服务器是供此区域中的来宾 VM 使用的 DNS 服务器,将通过您稍后要添加的公用网络进行访问。此区域的公用 IP 地址必须路由到在此处指定的 DNS 服务器。 -message.setup.successful=已成功设置云! -label.may.continue=您现在可以继续进行操作。 -error.installWizard.message=出现问题;请返回并更正任何错误 -message.installWizard.now.building=现在正在构建您的云... -message.installWizard.click.retry=请单击此按钮重新尝试启动。 -label.launch=启动 -label.installWizard.click.launch=请单击“启动”按钮。 -label.congratulations=祝贺您! -label.installWizard.addSecondaryStorageIntro.subtitle=什么是辅助存储? -label.installWizard.addSecondaryStorageIntro.title=添加一个辅助存储 -label.installWizard.addPrimaryStorageIntro.subtitle=什么是主存储? -label.installWizard.addPrimaryStorageIntro.title=添加一个主存储 -label.installWizard.addHostIntro.subtitle=什么是主机? -label.installWizard.addHostIntro.title=添加一个主机 -label.installWizard.addClusterIntro.subtitle=什么是群集? -label.installWizard.addClusterIntro.title=添加一个群集 -label.installWizard.addPodIntro.subtitle=什么是提供点? -label.installWizard.addPodIntro.title=添加一个提供点 -label.installWizard.addZone.title=添加区域 -label.installWizard.addZoneIntro.subtitle=什么是区域? -label.installWizard.addZoneIntro.title=添加一个区域 -error.password.not.match=密码字段不一致 -label.confirm.password=确认密码 -message.change.password=请更改您的密码。 -label.save.and.continue=保存并继续 -label.skip.guide=我以前使用过 CloudStack,跳过此指南 -label.continue.basic.install=继续执行基本安装 -label.introduction.to.cloudstack=CloudStack™ 简介 -label.what.is.cloudstack=什么是 CloudStack™? -label.hints=提示 -label.installWizard.subtitle=此教程将帮助您设置 CloudStack™ 安装 -label.continue=继续 -label.installWizard.title=您好,欢迎使用 CloudStack™ -label.agree=同意 -label.license.agreement=许可协议 -label.license.agreement.subtitle=必须先接受 CloudStack™ EULA 才能进行安装。 -label.manage.resources=管理资源 -label.port.forwarding.policies=端口转发策略 -label.load.balancing.policies=负载平衡策略 -label.networking.and.security=网络连接与安全 -label.bandwidth=带宽 -label.virtual.machines=虚拟机 -label.compute.and.storage=计算与存储 -label.task.completed=已完成任务 -label.update.project.resources=更新项目资源 -label.remove.project.account=删除项目帐户 -label.item.listing=项目列表 -message.select.item=请选择一个项目。 -label.removing=正在删除 -label.invite=邀请 -label.add.by=添加方式 -label.max.vms=最大用户 VM 数 -label.max.public.ips=最大公用 IP 数 -label.max.volumes=最大卷数 -label.max.snapshots=最大快照数 -label.max.templates=最大模板数 -label.project.dashboard=项目控制板 -label.remind.later=以后提醒我 -label.invited.accounts=已邀请的帐户 -label.invite.to=邀请加入 -label.add.accounts.to=添加帐户至 -label.add.accounts=添加帐户 -label.project.name=项目名称 -label.create.project=创建项目 -label.networks=网络 -label.launch.vm=启动 VM -label.new.vm=新建 VM -label.previous=上一步 -label.add.to.group=添加到组 -message.vm.review.launch=请先核对以下信息,确认您的虚拟实例正确无误,然后再启动。 -message.select.security.groups=请为您的新 VM 选择安全组 -label.new=新建 -message.please.select.networks=请为您的虚拟机选择网络。 -message.please.proceed=请继续执行下个步骤。 -message.zone.no.network.selection=所选区域无任何网络选项。 -label.no.thanks=不,谢谢 -label.my.templates=我的模板 -message.select.template=请为您的新虚拟实例选择一个模板。 -message.select.iso=请为您的新虚拟实例选择一个 ISO。 -message.template.desc=可用于启动 VM 的操作系统映像 -message.iso.desc=包含操作系统的数据或可启动介质的磁盘映像 -label.select.iso.or.template=选择 ISO 或模板 -message.select.a.zone=一个区域通常与一个数据中心相对应。多个区域可以提供物理隔离和冗余,有助于使云更加可靠。 -label.select.a.zone=选择一个区域 -label.review=核对 -label.select.a.template=选择一个模板 -label.setup=设置 -state.Allocated=已分配 -changed.item.properties=更改项目属性 -label.apply=应用 -label.default=默认值 -label.viewing=正在查看 -label.move.to.top=移至顶部 -label.move.up.row=向上移动一行 -label.move.down.row=向下移动一行 -label.drag.new.position=拖动到新位置 -label.order=排序 -label.no.data=无可显示的数据 -label.change.value=更改值 -label.clear.list=清除列表 -label.full.path=完整路径 -message.add.domain=请指定要在此域下创建的子域 -message.delete.user=请确认您确实要删除此用户。 -message.enable.user=请确认您确实要启用此用户。 -message.disable.user=请确认您确实要禁用此用户。 -message.generate.keys=请确认您确实要为此用户生成新密钥。 -message.update.resource.count=请确认您确实要更新此帐户的资源数。 -message.edit.account=编辑(“-1”表示对要创建的资源数量没有任何限制) -label.total.of.vm=总 VM 数 -label.total.of.ip=总 IP 地址数 -state.enabled=已启用 -message.action.download.iso=请确认您确实要下载此 ISO。 -message.action.download.template=请确认您确实要下载此模板。 -label.destination.zone=目标区域 -label.keyboard.type=键盘类型 -label.nic.adapter.type=NIC 适配器类型 -label.root.disk.controller=根磁盘控制器 -label.community=社区 -label.remove.egress.rule=删除出口规则 -label.add.egress.rule=添加出口规则 -label.egress.rule=出口规则 -label.remove.ingress.rule=删除入口规则 -label.delete.vpn.user=删除 VPN 用户 -label.add.vpn.user=添加 VPN 用户 -label.remove.pf=删除端口转发规则 -label.remove.vm.from.lb=从负载平衡器规则中删除 VM -label.add.vms.to.lb=向负载平衡器规则中添加 VM -label.add.vm=添加 VM -label.remove.static.nat.rule=删除静态 NAT 规则 -label.remove.rule=删除规则 -label.add.static.nat.rule=添加静态 NAT 规则 -label.add.rule=添加规则 -label.configuration=配置 -message.disable.vpn=是否确实要禁用 VPN? -label.disable.vpn=禁用 VPN -message.enable.vpn=请确认您确实要对此 IP 地址启用 VPN 访问。 -label.enable.vpn=启用 VPN -message.acquire.new.ip=请确认您确实要为此网络获取一个新 IP。 -label.elastic=弹性 -label.my.network=我的网络 -label.add.vms=添加 VM -label.configure=配置 -label.stickiness=粘性 -label.source=源算法 -label.least.connections=最少连接算法 -label.round.robin=轮询算法 -label.network.domain.text=网络域文本 -label.restart.required=需要重新启动 -label.clean.up=清除 -label.restart.network=重新启动网络 -label.edit.network.details=编辑网络详情 -label.add.guest.network=添加来宾网络 -label.guest.networks=来宾网络 -message.ip.address.changed=您的 IP 地址可能已发生变化;是否要刷新此列表? 请注意,刷新此列表时,“详细信息”窗格将关闭。 -state.BackingUp=正在备份 -state.BackedUp=已备份 -label.done=完成 -label.vm.name=VM 名称 -message.migrate.volume=请确认您确实要将卷迁移到其他主存储。 -label.migrate.volume=将卷迁移到其他主存储 -message.create.template=是否确实要创建模板? -label.create.template=创建模板 -message.download.volume.confirm=请确认您确实要下载此卷 -message.detach.disk=是否确实要取消附加此磁盘? -state.ready=已就绪 -state.Ready=已就绪 -label.vm.display.name=VM 显示名称 -label.select-view=选择视图 -label.local.storage=本地存储 -label.direct.ips=直接 IP -label.view.all=查看全部 -label.zone.details=区域详情 -message.alert.state.detected=检测到警报状态 -state.Starting=正在启动 -state.Expunging=正在删除 -state.Creating=正在创建 -message.decline.invitation=是否确实要拒绝此项目邀请? -label.decline.invitation=拒绝邀请 -message.confirm.join.project=请确认您确实要加入此项目。 -message.join.project=您现在已加入了一个项目。请切换到“项目视图”以查看项目。 -label.accept.project.invitation=接受项目邀请 -label.token=令牌 -label.project.id=项目 ID -message.enter.token=请输入您在邀请电子邮件中收到的令牌。 -label.enter.token=输入令牌 -state.Accepted=已接受 -state.Pending=待定 -state.Completed=已完成 -state.Declined=已拒绝 -label.project=项目 -label.invitations=邀请 -label.delete.project=删除项目 -message.delete.project=是否确实要删除此项目? -message.activate.project=是否确实要激活此项目? -label.activate.project=激活项目 -label.suspend.project=暂停项目 -message.suspend.project=是否确实要暂停此项目? -state.Suspended=已暂停 -label.edit.project.details=编辑项目详情 -label.new.project=新建项目 -state.Active=活动 -state.Disabled=已禁用 -label.projects=项目 -label.make.project.owner=设为帐户项目所有者 -label.remove.project.account=从项目中删除帐户 -message.project.invite.sent=发送给用户的邀请;用户接受邀请后,将加入到项目中 -label.add.account.to.project=向项目中添加帐户 -label.revoke.project.invite=撤销邀请 -label.project.invite=邀请加入项目 -label.select.project=选择项目 -message.no.projects=您没有任何项目。
请从“项目”部分中创建一个新项目。 -message.no.projects.adminOnly=您没有任何项目。
请要求管理员创建一个新项目。 -message.pending.projects.1=您有待定项目邀请: -message.pending.projects.2=要查看,请转至“项目”部分,然后从下拉列表中选择“邀请”。 -message.instanceWizard.noTemplates=您没有任何可用模板;请添加一个兼容的模板,然后重新启动实例向导。 -label.view=查看 -instances.actions.reboot.label=重新启动实例 -label.filterBy=过滤依据 -label.ok=确定 -notification.reboot.instance=重新启动实例 -notification.start.instance=启动实例 -notification.stop.instance=停止实例 -label.display.name=显示名称 -label.zone.name=区域名称 -ui.listView.filters.all=全部 -ui.listView.filters.mine=本用户 -state.Running=正在运行 -state.Stopped=已停止 -state.Destroyed=已销毁 -state.Error=错误 -message.reset.password.warning.notPasswordEnabled=创建此实例时使用的模板未启用密码 -message.reset.password.warning.notStopped=必须先停止您的实例,才能尝试更改其当前密码 -label.notifications=通知 -label.default.view=默认视图 -label.project.view=项目视图 - -message.add.system.service.offering=请填写以下数据以添加一个新的系统服务方案。 -message.action.delete.system.service.offering=请确认您确实要删除此系统服务方案。 -label.action.delete.system.service.offering=删除系统服务方案 -label.hypervisor.capabilities=虚拟机管理程序功能 -label.hypervisor.version=虚拟机管理程序版本 -label.max.guest.limit=最大来宾数限制 -label.add.network.offering=添加网络方案 -label.supported.services=支持的服务 -label.service.capabilities=服务功能 -label.guest.type=来宾类型 -label.specify.IP.ranges=指定 IP 范围 -label.conserve.mode=保护模式 -label.created.by.system=由系统创建 -label.menu.system.service.offerings=系统方案 -label.add.system.service.offering=添加系统服务方案 -label.redundant.router.capability=冗余路由器功能 -label.supported.source.NAT.type=支持的源 NAT 类型 -label.elastic.LB=弹性负载平衡器 -label.LB.isolation=负载平衡器隔离 -label.elastic.IP=弹性 IP -label.network.label.display.for.blank.value=使用默认网关 -label.xen.traffic.label=XenServer 流量标签 -label.kvm.traffic.label=KVM 流量标签 -label.vmware.traffic.label=VMware 流量标签 -label.start.IP=起始 IP -label.end.IP=结束 IP -label.remove.ip.range=删除 IP 范围 -label.ip.ranges=IP 范围 -label.start.vlan=起始 VLAN -label.end.vlan=结束 VLAN -label.broadcast.domain.range=广播域范围 -label.compute=计算 -message.add.guest.network=请确认您确实要添加一个来宾网络 -label.subdomain.access=子域访问 -label.guest.start.ip=来宾起始 IP -label.guest.end.ip=来宾结束 IP -label.virtual.router=虚拟路由器 -label.physical.network.ID=物理网络 ID -label.destination.physical.network.id=目标物理网络 ID -label.dhcp=DHCP -label.destroy.router=销毁路由器 -message.confirm.destroy.router=请确认您确实要销毁此路由器 -label.change.service.offering=更改服务方案 -label.view.console=查看控制台 -label.redundant.state=冗余状态 -label.enable.provider=启用提供程序 -message.confirm.enable.provider=请确认您确实要启用此提供程序 -label.disable.provider=禁用提供程序 -message.confirm.disable.provider=请确认您确实要禁用此提供程序 -label.shutdown.provider=关闭提供程序 -message.confirm.shutdown.provider=请确认您确实要关闭此提供程序 -label.netScaler=NetScaler -label.add.new.NetScaler=添加新 NetScaler -label.capacity=容量 -label.dedicated=专用 -label.f5=F5 -label.add.new.F5=添加新 F5 -label.srx=SRX -label.providers=提供程序 -label.add.new.SRX=添加新 SRX -label.timeout=超时 -label.public.network=公用网络 -label.private.network=专用网络 -label.enable.swift=启用 SWIFT -confirm.enable.swift=请填写以下信息以启用对 SWIFT 的支持 -message.after.enable.swift=已配置 SWIFT。注意: 退出此页面后,您将无法再次重新配置 SWIFT。 -label.key=密钥 -label.delete.NetScaler=删除 NetScaler -message.confirm.delete.NetScaler=请确认您确实要删除 NetScaler -label.delete.F5=删除 F5 -message.confirm.delete.F5=请确认您确实要删除 F5 -label.delete.SRX=删除 SRX -message.confirm.delete.SRX=请确认您确实要删除 SRX -label.pods=提供点 -label.pod.name=提供点名称 -label.reserved.system.gateway=预留的系统网关 -label.reserved.system.netmask=预留的系统网络掩码 -label.start.reserved.system.IP=起始预留系统 IP -label.end.reserved.system.IP=结束预留系统 IP -label.clusters=群集 -label.cluster.name=群集名称 -label.host.MAC=主机 MAC -label.agent.username=代理用户名 -label.agent.password=代理密码 -message.confirm.action.force.reconnect=请确认您确实要强制重新连接此主机。 -label.resource.state=资源状态 -label.LUN.number=LUN 号 -message.confirm.remove.IP.range=请确认您确实要删除此 IP 范围。 -message.tooltip.zone.name=区域名称。 -message.tooltip.dns.1=供区域中的 VM 使用的 DNS 服务器名称。区域的公用 IP 地址必须路由到此服务器。 -message.tooltip.dns.2=供区域中的 VM 使用的辅助 DNS 服务器名称。区域的公用 IP 地址必须路由到此服务器。 -message.tooltip.internal.dns.1=供区域中的 CloudStack 内部系统 VM 使用的 DNS 服务器名称。提供点的专用 IP 地址必须路由到此服务器。 -message.tooltip.internal.dns.2=供区域中的 CloudStack 内部系统 VM 使用的 DNS 服务器名称。提供点的专用 IP 地址必须路由到此服务器。 -message.tooltip.network.domain=DNS 后缀,将为由来宾 VM 访问的网络创建一个自定义域名。 -message.tooltip.pod.name=此提供点的名称。 -message.tooltip.reserved.system.gateway=提供点中的主机网关。 -message.tooltip.reserved.system.netmask=用于定义提供点子网的网络前缀。请使用 CIDR 符号。 -message.creating.zone=正在创建区域 -message.creating.physical.networks=正在创建物理网络 -message.configuring.physical.networks=正在配置物理网络 -message.adding.Netscaler.device=正在添加 Netscaler 设备 -message.creating.pod=正在创建提供点 -message.configuring.public.traffic=正在配置公共流量 -message.configuring.storage.traffic=正在配置存储流量 -message.configuring.guest.traffic=正在配置来宾流量 -message.creating.cluster=正在创建群集 -message.adding.host=正在添加主机 -message.creating.primary.storage=正在创建主存储 -message.creating.secondary.storage=正在创建辅助存储 -message.Zone.creation.complete=已完成创建区域 -message.enabling.zone=正在启用区域 -error.something.went.wrong.please.correct.the.following=出现问题;请更正以下各项 -error.could.not.enable.zone=无法启用区域 -message.zone.creation.complete.would.you.like.to.enable.this.zone=已完成创建区域。是否要启用此区域? -message.please.add.at.lease.one.traffic.range=请至少添加一个流量范围。 -message.you.must.have.at.least.one.physical.network=您必须至少拥有一个物理网络 -message.please.select.a.different.public.and.management.network.before.removing=请先选择其他公共管理网络,然后再删除 - -label.zone.type=区域类型 -label.setup.zone=设置区域 -label.setup.network=设置网络 -label.add.resources=添加资源 -label.launch=启动 -label.set.up.zone.type=设置区域类型 -message.please.select.a.configuration.for.your.zone=请为您的区域选择一种配置。 -message.desc.basic.zone=提供一个网络,将直接从此网络中为每个 VM 实例分配一个 IP。可以通过安全组等第 3 层方式提供来宾隔离(IP 地址源过滤)。 -label.basic=基本 -message.desc.advanced.zone=适用于更加复杂的网络拓扑。此网络模式在定义来宾网络并提供防火墙、VPN 或负载平衡器支持等自定义网络方案方面提供了最大的灵活性。 -label.advanced=高级 -message.desc.zone=区域是 CloudStack 中最大的组织单位,一个区域通常与一个数据中心相对应。区域可提供物理隔离和冗余。一个区域由一个或多个提供点以及由区域中的所有提供点共享的一个辅助存储服务器组成,其中每个提供点中包含多个主机和主存储服务器。 -label.physical.network=物理网络 -label.public.traffic=公共流量 -label.guest.traffic=来宾流量 -label.storage.traffic=存储流量 -message.setup.physical.network.during.zone.creation=添加高级区域时,需要设置一个或多个物理网络。每个网络都与虚拟机管理程序中的一个 NIC 相对应。每个物理网络中可以包含一种或多种流量类型,并对这些流量类型可能的组合方式设置了某些限制。

可以将一种或多种流量类型拖放到每个物理网络中。 -label.add.physical.network=添加物理网络 -label.traffic.types=流量类型 -label.management=管理 -label.guest=来宾 -label.please.specify.netscaler.info=请指定 Netscaler 信息 -message.public.traffic.in.advanced.zone=云中的 VM 访问 Internet 时将生成公共流量,但必须分配可公开访问的 IP 才能实现。最终用户可以使用 CloudStack UI 获取这些 IP,以在其来宾网络与公用网络之间执行 NAT。

请至少为 Internet 流量提供一个 IP 地址范围。 -message.public.traffic.in.basic.zone=云中的 VM 访问 Internet 或通过 Internet 向客户端提供服务时将生成公共流量,但必须分配可公开访问的 IP 才能实现。创建实例时,将把这一组公用 IP 中的 IP (来宾 IP 地址除外)分配给此实例。静态 1-1 NAT 将在公用 IP 与来宾 IP 之间自动设置。最终用户还可以使用 CloudStack UI 获取其他 IP,以在其实例与公用 IP 之间执行静态 NAT。 -message.add.pod.during.zone.creation=每个区域中必须包含一个或多个提供点,现在我们将添加第一个提供点。提供点中包含主机和主存储服务器,您将在随后的某个步骤中添加这些主机和服务器。首先,请为 CloudStack 的内部管理流量配置一个预留 IP 地址范围。预留的 IP 范围对云中的每个区域来说必须唯一。 -message.guest.traffic.in.advanced.zone=来宾网络流量是指最终用户虚拟机之间的通信。指定一个 VLAN ID 范围可传送每个物理网络的来宾流量。 -message.guest.traffic.in.basic.zone=来宾网络流量是指最终用户虚拟机之间的通信。应指定一个 CloudStack 可以分配给来宾 VM 的 IP 地址范围。请确保此范围与预留的系统 IP 范围不重叠。 -message.storage.traffic=CloudStack 内部资源(包括与 Management Server 通信的任何组件,例如主机和 CloudStack 系统 VM)之间的流量。请在此处配置存储流量。 -message.desc.cluster=每个提供点中必须包含一个或多个群集,现在我们将添加第一个群集。群集提供了一种编组主机的方法。群集中的所有主机都具有相同的硬件,运行相同的虚拟机管理程序,位于相同的子网中,并访问相同的共享存储。每个群集由一个或多个主机以及一个或多个主存储服务器组成。 -message.desc.host=每个群集中必须至少包含一个主机以供来宾 VM 在上面运行,现在我们将添加第一个主机。要使主机在 CloudStack 中运行,必须在此主机上安装虚拟机管理程序软件,为其分配一个 IP 地址,并确保将其连接到 CloudStack Management Server。

请提供主机的 DNS 或 IP 地址、用户名(通常为 root)和密码,以及用于对主机进行分类的任何标签。 -message.desc.primary.storage=每个群集中必须包含一个或多个主存储服务器,现在我们将添加第一个主存储服务器。主存储中包含在群集中的主机上运行的所有 VM 的磁盘卷。请使用底层虚拟机管理程序支持的符合标准的协议。 -message.desc.secondary.storage=每个区域中必须至少包含一个 NFS 或辅助存储服务器,现在我们将添加第一个 NFS 或辅助存储服务器。辅助存储用于存储 VM 模板、ISO 映像和 VM 磁盘卷快照。此服务器必须对区域中的所有服务器可用。

请提供 IP 地址和导出路径。 -label.launch.zone=启动区域 -message.please.wait.while.zone.is.being.created=正在创建区域,请稍候;此操作可能需要一段时间才能完成... - -label.load.balancing=负载平衡 -label.static.nat.enabled=已启用静态 NAT -label.zones=区域 -label.view.more=查看更多 -label.number.of.zones=区域数量 -label.number.of.pods=提供点数量 -label.number.of.clusters=群集数量 -label.number.of.hosts=主机数量 -label.total.hosts=总主机数 -label.total.CPU=CPU 总量 -label.total.memory=内存总量 -label.total.storage=存储总量 -label.purpose=目的 - - - - -label.action.migrate.router=迁移路由器 -label.action.migrate.router.processing=正在迁移路由器... -message.migrate.router.confirm=请确认您要将路由器迁移到的主机: -label.migrate.router.to=迁移路由器至 - -label.action.migrate.systemvm=迁移系统 VM -label.action.migrate.systemvm.processing=正在迁移系统 VM... -message.migrate.systemvm.confirm=请确认您要将系统 VM 迁移到的主机: -label.migrate.systemvm.to=迁移系统 VM 至 - - -mode=模式 -side.by.side=并行 -inline=内联 - -extractable=可提取 - -label.ocfs2=OCFS2 - -label.action.edit.host=编辑主机 - -network.rate=网络速率 - -ICMP.type=ICMP 类型 -ICMP.code=ICMP 代码 - -image.directory=图片目录 - -label.action.create.template.from.vm=基于 VM 创建模板 -label.action.create.template.from.volume=基于卷创建模板 - -message.vm.create.template.confirm=创建模板将自动重新启动 VM。 - -label.action.manage.cluster=托管群集 -message.action.manage.cluster=请确认您确实要托管此群集。 -label.action.manage.cluster.processing=正在托管群集... - -label.action.unmanage.cluster=取消托管群集 -message.action.unmanage.cluster=请确认您确实要取消托管此群集。 -label.action.unmanage.cluster.processing=正在取消托管群集... - -label.allocation.state=分配状态 -managed.state=托管状态 - -label.default.use=默认使用 -label.host.tags=主机标签 - -label.cidr=CIDR -label.cidr.list=源 CIDR - -label.storage.tags=存储标签 - -label.redundant.router=冗余路由器 -label.is.redundant.router=冗余 - -force.delete=强制删除 -force.delete.domain.warning=警告: 选择此选项将导致删除所有子域以及所有相关联的帐户及其资源。 - -force.remove=强制移除 -force.remove.host.warning=警告: 选择此选项将导致 CloudStack 在从群集中移除此主机之前,强制停止所有正在运行的虚拟机。 - -force.stop=强制停止 -force.stop.instance.warning=警告: 除非万不得已,否则不应强制停止此实例。停止此实例可能会导致数据丢失以及致使虚拟机状态不一致。 - -label.PreSetup=PreSetup -label.SR.name = SR 名称标签 -label.SharedMountPoint=SharedMountPoint -label.clvm=CLVM -label.volgroup=卷组 -label.VMFS.datastore=VMFS 数据存储 - -label.network.device=网络设备 -label.add.network.device=添加网络设备 -label.network.device.type=网络设备类型 -label.DHCP.server.type=DHCP 服务器类型 -label.Pxe.server.type=Pxe 服务器类型 -label.PING.storage.IP=PING 存储 IP -label.PING.dir=PING 目录 -label.TFTP.dir=TFTP 目录 -label.PING.CIFS.username=PING CIFS 用户名 -label.PING.CIFS.password=PING CIFS 密码 -label.CPU.cap=CPU 上限 - - -label.action.enable.zone=启用区域 -label.action.enable.zone.processing=正在启用区域... -message.action.enable.zone=请确认您确实要启用此区域。 -label.action.disable.zone=禁用区域 -label.action.disable.zone.processing=正在禁用区域... -message.action.disable.zone=请确认您确实要禁用此区域。 - -label.action.enable.pod=启用提供点 -label.action.enable.pod.processing=正在启用提供点... -message.action.enable.pod=请确认您确实要启用此提供点。 -label.action.disable.pod=禁用提供点 -label.action.disable.pod.processing=正在禁用提供点... -message.action.disable.pod=请确认您确实要禁用此提供点。 - -label.action.enable.cluster=启用群集 -label.action.enable.cluster.processing=正在启用群集... -message.action.enable.cluster=请确认您确实要启用此群集。 -label.action.disable.cluster=禁用群集 -label.action.disable.cluster.processing=正在禁用群集... -message.action.disable.cluster=请确认您确实要禁用此群集。 - -label.account.id=帐户 ID -label.account.name=帐户名称 -label.account.specific=帐户专用 -label.account=帐户 -label.accounts=帐户 -label.acquire.new.ip=获取新 IP -label.show.ingress.rule=显示入口规则 -label.hide.ingress.rule=隐藏入口规则 -label.action.attach.disk.processing=正在附加磁盘... -label.action.attach.disk=附加磁盘 -label.action.attach.iso.processing=正在附加 ISO... -label.action.attach.iso=附加 ISO -label.action.cancel.maintenance.mode.processing=正在取消维护模式... -label.action.cancel.maintenance.mode=取消维护模式 -label.action.change.password=更改密码 -label.action.change.service.processing=正在更改服务... -label.action.change.service=更改服务 -label.action.copy.ISO.processing=正在复制 ISO... -label.action.copy.ISO=复制 ISO -label.action.copy.template.processing=正在复制模板... -label.action.copy.template=复制模板 -label.action.create.template.processing=正在创建模板... -label.action.create.template=创建模板 -label.action.create.vm.processing=正在创建 VM... -label.action.create.vm=创建 VM -label.action.create.volume.processing=正在创建卷... -label.action.create.volume=创建卷 -label.action.delete.IP.range.processing=正在删除 IP 范围... -label.action.delete.IP.range=删除 IP 范围 -label.action.delete.ISO.processing=正在删除 ISO... -label.action.delete.ISO=删除 ISO -label.action.delete.account.processing=正在删除帐户... -label.action.delete.account=删除帐户 -label.action.delete.cluster.processing=正在删除群集... -label.action.delete.cluster=删除群集 -label.action.delete.disk.offering.processing=正在删除磁盘方案... -label.action.delete.disk.offering=删除磁盘方案 - -label.action.update.resource.count=更新资源数量 -label.action.update.resource.count.processing=正在更新资源数量... - -label.action.delete.domain=删除域 -label.action.delete.domain.processing=正在删除域... - -label.action.delete.firewall.processing=正在删除防火墙... -label.action.delete.firewall=删除防火墙规则 -label.action.delete.ingress.rule.processing=正在删除入口规则... -label.action.delete.ingress.rule=删除入口规则 -label.action.delete.load.balancer.processing=正在删除负载平衡器... -label.action.delete.load.balancer=删除负载平衡器规则 -label.action.edit.network.processing=正在编辑网络... -label.action.edit.network=编辑网络 -label.action.delete.network.processing=正在删除网络... -label.action.delete.network=删除网络 -label.action.delete.pod.processing=正在删除提供点... -label.action.delete.pod=删除提供点 -label.action.delete.primary.storage.processing=正在删除主存储... -label.action.delete.primary.storage=删除主存储 -label.action.delete.secondary.storage.processing=正在删除辅助存储... -label.action.delete.secondary.storage=删除辅助存储 -label.action.delete.security.group.processing=正在删除安全组... -label.action.delete.security.group=删除安全组 -label.action.delete.service.offering.processing=正在删除服务方案... -label.action.delete.service.offering=删除服务方案 -label.action.delete.snapshot.processing=正在删除快照... -label.action.delete.snapshot=删除快照 -label.action.delete.template.processing=正在删除模板... -label.action.delete.template=删除模板 -label.action.delete.user.processing=正在删除用户... -label.action.delete.user=删除用户 -label.action.delete.volume.processing=正在删除卷... -label.action.delete.volume=删除卷 -label.action.delete.zone.processing=正在删除区域... -label.action.delete.zone=删除区域 -label.action.destroy.instance.processing=正在销毁实例... -label.action.destroy.instance=销毁实例 -label.action.destroy.systemvm.processing=正在销毁系统 VM... -label.action.destroy.systemvm=销毁系统 VM -label.action.detach.disk.processing=正在取消附加磁盘... -label.action.detach.disk=取消附加磁盘 -label.action.detach.iso.processing=正在取消附加 ISO... -label.action.detach.iso=取消附加 ISO -label.action.disable.account.processing=正在禁用帐户... -label.action.disable.account=禁用帐户 -label.action.disable.static.NAT.processing=正在禁用静态 NAT... -label.action.disable.static.NAT=禁用静态 NAT -label.action.disable.user.processing=正在禁用用户... -label.action.disable.user=禁用用户 -label.action.download.ISO=下载 ISO -label.action.download.template=下载模板 -label.action.download.volume.processing=正在下载卷... -label.action.download.volume=下载卷 -label.action.edit.ISO=编辑 ISO -label.action.edit.account=编辑帐户 -label.action.edit.disk.offering=编辑磁盘方案 -label.action.edit.domain=编辑域 -label.action.edit.global.setting=编辑全局设置 -label.action.edit.instance=编辑实例 -label.action.edit.network.offering=编辑网络方案 -label.action.edit.pod=编辑提供点 -label.action.edit.primary.storage=编辑主存储 -label.action.edit.resource.limits=编辑资源限制 -label.action.edit.service.offering=编辑服务方案 -label.action.edit.template=编辑模板 -label.action.edit.user=编辑用户 -label.action.edit.zone=编辑区域 -label.action.enable.account.processing=正在启用帐户... -label.action.enable.account=启用帐户 -label.action.enable.maintenance.mode.processing=正在启用维护模式... -label.action.enable.maintenance.mode=启用维护模式 -label.action.enable.static.NAT.processing=正在启用静态 NAT... -label.action.enable.static.NAT=启用静态 NAT -label.action.enable.user.processing=正在启用用户... -label.action.enable.user=启用用户 -label.action.force.reconnect.processing=正在重新连接... -label.action.force.reconnect=强制重新连接 -label.action.generate.keys.processing=正在生成密钥... -label.action.generate.keys=生成密钥 -label.action.lock.account.processing=正在锁定帐户... -label.action.lock.account=锁定帐户 -label.action.migrate.instance=迁移实例 -label.action.migrate.instance.processing=正在迁移实例... -label.action.reboot.instance.processing=正在重新启动实例... -label.action.reboot.instance=重新启动实例 -label.action.reboot.router.processing=正在重新启动路由器... -label.action.reboot.router=重新启动路由器 -label.action.reboot.systemvm.processing=正在重新启动系统 VM... -label.action.reboot.systemvm=重新启动系统 VM -label.action.recurring.snapshot=重现快照 -label.action.release.ip.processing=正在释放 IP... -label.action.release.ip=释放 IP -label.action.remove.host.processing=正在删除主机... -label.action.remove.host=删除主机 -label.action.reset.password.processing=正在重置密码... -label.action.reset.password=重置密码 -label.action.resource.limits=资源限制 -label.action.restore.instance.processing=正在还原实例... -label.action.restore.instance=还原实例 -label.action.start.instance.processing=正在启动实例... -label.action.start.instance=启动实例 -label.action.start.router.processing=正在启动路由器... -label.action.start.router=启动路由器 -label.action.start.systemvm.processing=正在启动系统 VM... -label.action.start.systemvm=启动系统 VM -label.action.stop.instance.processing=正在停止实例... -label.action.stop.instance=停止实例 -label.action.stop.router.processing=正在停止路由器... -label.action.stop.router=停止路由器 -label.action.stop.systemvm.processing=正在停止系统 VM... -label.action.stop.systemvm=停止系统 VM -label.action.take.snapshot.processing=正在创建快照... -label.action.take.snapshot=创建快照 -label.action.update.OS.preference.processing=正在更新操作系统首选项... -label.action.update.OS.preference=更新操作系统首选项 -label.actions=操作 -label.active.sessions=活动会话 -label.add.account=添加帐户 -label.add.by.cidr=按 CIDR 添加 -label.add.by.group=按组添加 -label.add.cluster=添加群集 -label.add.direct.iprange=添加直接 IP 范围 -label.add.disk.offering=添加磁盘方案 -label.add.domain=添加域 -label.add.firewall=添加防火墙规则 -label.add.host=添加主机 -label.add.ingress.rule=添加入口规则 -label.add.ip.range=添加 IP 范围 -label.add.load.balancer=添加负载平衡器 -label.add.more=添加更多 -label.add.network=添加网络 -label.add.pod=添加提供点 -label.add.primary.storage=添加主存储 -label.add.secondary.storage=添加辅助存储 -label.add.security.group=添加安全组 -label.add.service.offering=添加服务方案 -label.add.template=添加模板 -label.add.user=添加用户 -label.add.vlan=添加 VLAN -label.add.volume=添加卷 -label.add.zone=添加区域 -label.add=添加 -label.adding.cluster=正在添加群集 -label.adding.failed=添加失败 -label.adding.pod=正在添加提供点 -label.adding.processing=正在添加... -label.adding.succeeded=已成功添加 -label.adding.user=正在添加用户 -label.adding.zone=正在添加区域 -label.adding=正在添加 -label.additional.networks=其他网络 -label.admin.accounts=管理员帐户 -label.admin=管理员 -label.advanced.mode=高级模式 -label.advanced.search=高级搜索 -label.advanced=高级 -label.alert=警报 -label.algorithm=算法 -label.allocated=已分配 -label.api.key=API 密钥 -label.assign.to.load.balancer=正在将实例分配给负载平衡器 -label.assign=分配 -label.associated.network.id=已关联网络 ID -label.attached.iso=已附加 ISO -label.availability.zone=可用区域 -label.availability=可用性 -label.available.public.ips=可用公用 IP 地址 -label.available=可用 -label.back=返回 -label.basic.mode=基本模式 -label.bootable=可启动 -label.broadcast.domain.type=广播域类型 -label.by.account=按帐户 -label.by.availability=按可用性 -label.by.domain=按域 -label.by.end.date=按结束日期 -label.by.level=按级别 -label.by.pod=按提供点 -label.by.role=按角色 -label.by.start.date=按开始日期 -label.by.state=按状态 -label.by.traffic.type=按流量类型 -label.by.type.id=按类型 ID -label.by.type=按类型 -label.by.zone=按区域 -label.bytes.received=接收的字节数 -label.bytes.sent=发送的字节数 -label.cancel=取消 -label.certificate=证书 -label.privatekey=PKCS#8 私钥 -label.domain.suffix=DNS 域后缀(例如 xyz.com) -label.character=字符 -label.cidr.account=CIDR 或帐户/安全组 -label.close=关闭 -label.cloud.console=云管理控制台 -label.cloud.managed=由 Cloud.com 管理 -label.cluster.type=群集类型 -label.cluster=群集 -label.code=代码 -label.confirmation=确认 -label.cpu.allocated.for.VMs=已分配给 VM 的 CPU -label.cpu.allocated=已分配的 CPU -label.cpu.mhz=CPU (MHz) -label.cpu.utilized=CPU 利用率 -label.created=创建日期 -label.cross.zones=跨区域 -label.custom.disk.size=自定义磁盘大小 -label.daily=每天一次 -label.data.disk.offering=数据磁盘方案 -label.date=日期 -label.day.of.month=日期 -label.day.of.week=星期 -label.delete=删除 -label.deleting.failed=删除失败 -label.deleting.processing=正在删除... -label.description=说明 -label.detaching.disk=正在取消附加磁盘 -label.details=详细信息 -label.device.id=设备 ID -label.disabled=已禁用 -label.disabling.vpn.access=正在禁用 VPN 访问 -label.disk.allocated=已分配的磁盘 -label.disk.offering=磁盘方案 -label.disk.size.gb=磁盘大小(GB) -label.disk.size=磁盘大小 -label.disk.total=磁盘总量 -label.disk.volume=磁盘卷 -label.display.text=显示文本 -label.dns.1=DNS 1 -label.dns.2=DNS 2 -label.domain.admin=域管理员 -label.domain.id=域 ID -label.domain.name=域名 -label.domain=域 -label.double.quotes.are.not.allowed=不允许使用双引号 -label.download.progress=下载进度 -label.edit=编辑 -label.email=电子邮件 -label.enabling.vpn.access=正在启用 VPN 访问 -label.enabling.vpn=正在启用 VPN -label.end.port=结束端口 -label.endpoint.or.operation=端点或操作 -label.error.code=错误代码 -label.error=错误 -label.esx.host=ESX/ESXi 主机 -label.example=示例 -label.failed=失败 -label.featured=精选 -label.firewall=防火墙 -label.first.name=名字 -label.format=格式 -label.friday=星期五 -label.full=满载 -label.gateway=网关 -label.general.alerts=常规警报 -label.generating.url=正在生成 URL -label.go.step.2=转至步骤 2 -label.go.step.3=转至步骤 3 -label.go.step.4=转至步骤 4 -label.go.step.5=转至步骤 5 -label.group.optional=组(可选) -label.group=组 -label.guest.cidr=来宾 CIDR -label.guest.gateway=来宾网关 -label.guest.ip.range=来宾 IP 范围 -label.guest.ip=来宾 IP 地址 -label.guest.netmask=来宾网络掩码 -label.ha.enabled=已启用高可用性 -label.help=帮助 -label.host.alerts=主机警报 -label.host.name=主机名称 -label.host=主机 -label.hosts=主机 -label.hourly=每小时一次 -label.hypervisor.type=虚拟机管理程序类型 -label.hypervisor=虚拟机管理程序 -label.id=ID -label.info=信息 -label.ingress.rule=入口规则 -label.initiated.by=启动者 -label.instance.limits=实例限制 -label.instance.name=实例名称 -label.instance=实例 -label.instances=实例 -label.internal.dns.1=内部 DNS 1 -label.internal.dns.2=内部 DNS 2 -label.interval.type=间隔类型 -label.invalid.integer=无效整数 -label.invalid.number=无效数字 -label.ip.address=IP 地址 -label.ip.allocations=IP 分配 -label.ip.limits=公用 IP 限制 -label.ip.or.fqdn=IP 或 FQDN -label.ip.range=IP 范围 -label.ip=IP -label.ips=IP -label.is.default=是否为默认值 -label.is.shared=是否共享 -label.is.system=是否为系统 -label.iscsi=iSCSI -label.iso.boot=ISO 启动 -label.iso=ISO -label.isolation.mode=隔离模式 -label.keep=保留 -label.lang.chinese=简体中文 -label.lang.english=英语 -label.lang.japanese=日语 -label.lang.spanish=西班牙语 -label.last.disconnected=上次断开连接时间 -label.last.name=姓氏 -label.level=级别 -label.linklocal.ip=链接本地 IP 地址 -label.load.balancer=负载平衡器 -label.loading=正在加载 -label.local=本地 -label.login=登录 -label.logout=注销 -label.lun=LUN -label.manage=托管 -label.maximum=最大值 -label.memory.allocated=已分配的内存 -label.memory.mb=内存(MB) -label.memory.total=内存总量 -label.memory.used=已使用的内存 -label.memory=内存 -label.menu.accounts=帐户 -label.menu.alerts=警报 -label.menu.all.accounts=所有帐户 -label.menu.all.instances=所有实例 -label.menu.community.isos=社区 ISO -label.menu.community.templates=社区模板 -label.menu.configuration=配置 -label.menu.dashboard=控制板 -label.menu.destroyed.instances=已销毁的实例 -label.menu.disk.offerings=磁盘方案 -label.menu.domains=域 -label.menu.events=事件 -label.menu.featured.isos=精选 ISO -label.menu.featured.templates=精选模板 -label.menu.global.settings=全局设置 -label.menu.instances=实例 -label.menu.ipaddresses=IP 地址 -label.menu.isos=ISO -label.menu.my.accounts=我的帐户 -label.menu.my.instances=我的实例 -label.menu.my.isos=我的 ISO -label.menu.my.templates=我的模板 -label.menu.network.offerings=网络方案 -label.menu.network=网络 -label.menu.physical.resources=物理资源 -label.menu.running.instances=正在运行的实例 -label.menu.security.groups=安全组 -label.menu.service.offerings=服务方案 -label.menu.snapshots=快照 -label.menu.stopped.instances=已停止的实例 -label.menu.storage=存储 -label.menu.system.vms=系统 VM -label.menu.system=系统 -label.menu.templates=模板 -label.menu.virtual.appliances=虚拟设备 -label.menu.virtual.resources=虚拟资源 -label.menu.volumes=卷 -label.migrate.instance.to=迁移实例至 -label.minimum=最小值 -label.minute.past.hour=分钟时 -label.monday=星期一 -label.monthly=每月一次 -label.more.templates=更多模板 -label.my.account=我的帐户 -label.name.optional=名称(可选) -label.name=名称 -label.netmask=网络掩码 -label.network.desc=网络描述 -label.network.domain=网络域 -label.network.id=网络 ID -label.network.name=网络名称 -label.network.offering.display.text=网络方案显示文本 -label.network.offering.id=网络方案 ID -label.network.offering.name=网络方案名称 -label.network.offering=网络方案 -label.network.rate=网络速率 -label.network.read=网络读取量 -label.network.type=网络类型 -label.network.write=网络写入量 -label.network=网络 -label.new.password=新密码 -label.next=下一步 -label.nfs.server=NFS 服务器 -label.nfs.storage=NFS 存储 -label.nfs=NFS -label.nics=NIC -label.no.actions=无可用操作 -label.no.alerts=无最近发出的警报 -label.no.errors=无最近出现的错误 -label.no.isos=无可用 ISO -label.no.items=无可用项目 -label.no.security.groups=无可用安全组 -label.no.thanks=不,谢谢 -label.no=否 -label.none=无 -label.not.found=未找到 -label.num.cpu.cores=CPU 内核数 -label.numretries=重试次数 -label.offer.ha=提供高可用性 -label.optional=可选 -label.os.preference=操作系统首选项 -label.os.type=操作系统类型 -label.owned.public.ips=拥有的公用 IP 地址数 -label.owner.account=所有者帐户 -label.owner.domain=所有者域 -label.parent.domain=父域 -label.password.enabled=已启用密码 -label.password=密码 -label.path=路径 -label.please.wait=请稍候 -label.pod=提供点 -label.port.forwarding=端口转发 -label.port.range=端口范围 -label.prev=上一页 -label.primary.allocated=已分配的主存储 -label.primary.network=主网络 -label.primary.storage=主存储 -label.primary.used=已使用的主存储 -label.private.interface=专用接口 -label.private.ip.range=专用 IP 范围 -label.private.ip=专用 IP 地址 -label.private.ips=专用 IP 地址 -label.private.port=专用端口 -label.private.zone=专用区域 -label.protocol=协议 -label.public.interface=公用接口 -label.public.ip=公用 IP 地址 -label.public.ips=公用 IP 地址 -label.public.port=公用端口 -label.public.zone=公用区域 -label.public=公用 -label.recent.errors=最近出现的错误 -label.refresh=刷新 -label.related=相关联 -label.remove.from.load.balancer=正在从负载平衡器中删除实例 -label.removing.user=正在删除用户 -label.required=必填项 -label.reserved.system.ip=预留的系统 IP -label.resource.limits=资源限制 -label.resource=资源 -label.resources=资源 -label.role=角色 -label.root.disk.offering=根磁盘方案 -label.running.vms=正在运行的 VM -label.saturday=星期六 -label.save=保存 -label.saving.processing=正在保存... -label.scope=范围 -label.search=搜索 -label.secondary.storage=辅助存储 -label.secondary.used=已使用的辅助存储 -label.secret.key=密钥 -label.security.group.name=安全组名称 -label.security.group=安全组 -label.security.groups.enabled=已启用安全组 -label.security.groups=安全组 -label.sent=已发送 -label.server=服务器 -label.service.offering=服务方案 -label.system.service.offering=系统服务方案 -label.session.expired=会话已过期 -label.shared=已共享 -label.size=大小 -label.snapshot.limits=快照限制 -label.snapshot.name=快照名称 -label.snapshot.s=快照 -label.snapshot.schedule=设置重现快照 -label.snapshot=快照 -label.snapshots=快照 -label.source.nat=源 NAT -label.specify.vlan=指定 VLAN -label.start.port=起始端口 -label.state=状态 -label.static.nat.to=静态 NAT 目标 -label.static.nat=静态 NAT -label.statistics=统计数据 -label.status=状态 -label.step.1.title=步骤 1: 选择一个模板 -label.step.1=步骤 1 -label.step.2.title=步骤 2: 服务方案 -label.step.2=步骤 2 -label.step.3.title=步骤 3: 选择一种磁盘方案 -label.step.3=步骤 3 -label.step.4.title=步骤 4: 网络 -label.step.4=步骤 4 -label.step.5.title=步骤 5: 核对 -label.step.5=步骤 5 -label.stopped.vms=已停止的 VM -label.storage.type=存储类型 -label.storage=存储 -label.submit=提交 -label.submitted.by=[提交者: ] -label.succeeded=成功 -label.sunday=星期日 -label.system.capacity=系统容量 -label.system.vm.type=系统 VM 类型 -label.system.vm=系统 VM -label.system.vms=系统 VM -label.tagged=已标记 -label.tags=标签 -label.target.iqn=目标 IQN -label.template.limits=模板限制 -label.template=模板 -label.theme.default=默认主题 -label.theme.grey=自定义 - 灰色 -label.theme.lightblue=自定义 - 淡蓝色 -label.thursday=星期四 -label.time.zone=时区 -label.time=时间 -label.timeout.in.second = 超时(秒) -label.timezone=时区 -label.total.cpu=CPU 总量 -label.total.vms=总 VM 数 -label.traffic.type=流量类型 -label.tuesday=星期二 -label.type.id=类型 ID -label.type=类型 -label.unavailable=不可用 -label.unlimited=无限制 -label.untagged=已取消标记 -label.update.ssl.cert=更新 SSL 证书 -label.update.ssl=更新 SSL 证书 -label.updating=正在更新 -label.url=URL -label.usage.interface=使用界面 -label.used=已使用 -label.user=用户 -label.username=用户名 -label.users=用户 -label.value=值 -label.vcenter.cluster=vCenter 群集 -label.vcenter.datacenter=vCenter 数据中心 -label.vcenter.datastore=vCenter 数据存储 -label.vcenter.host=vCenter 主机 -label.vcenter.password=vCenter 密码 -label.vcenter.username=vCenter 用户名 -label.version=版本 -label.virtual.appliance=虚拟设备 -label.virtual.appliances=虚拟设备 -label.virtual.network=虚拟网络 -label.vlan.id=VLAN ID -label.vlan.range=VLAN 范围 -label.vm.add=添加实例 -label.vm.destroy=销毁 -label.vm.reboot=重新启动 -label.vm.start=启动 -label.vm.stop=停止 -label.vmfs=VMFS -label.vms=VM -label.volume.limits=卷限制 -label.volume.name=卷名称 -label.volume=卷 -label.volumes=卷 -label.vpn=VPN -label.vsphere.managed=由 vSphere 管理 -label.waiting=正在等待 -label.warn=警告 -label.wednesday=星期三 -label.weekly=每周一次 -label.welcome.cloud.console=欢迎使用管理控制台 -label.welcome=欢迎 -label.yes=是 -label.zone.id=区域 ID -label.zone.step.1.title=步骤 1: 选择一个网络 -label.zone.step.2.title=步骤 2: 添加一个区域 -label.zone.step.3.title=步骤 3: 添加一个提供点 -label.zone.step.4.title=步骤 4: 添加一个 IP 范围 -label.zone.wide=整个区域 -label.zone=区域 - -#Messages -message.acquire.public.ip=请选择一个要从中获取新 IP 的区域。 -message.action.cancel.maintenance.mode=请确认您确实要取消此维护。 -message.action.cancel.maintenance=已成功取消维护您的主机。此过程可能需要长达几分钟时间。 -message.action.delete.ISO.for.all.zones=此 ISO 由所有区域使用。请确认您确实要将其从所有区域中删除。 -message.action.delete.ISO=请确认您确实要删除此 ISO。 -message.action.delete.cluster=请确认您确实要删除此群集。 -message.action.delete.disk.offering=请确认您确实要删除此磁盘方案。 -message.action.delete.domain=请确认您确实要删除此域。 -message.action.delete.external.firewall=请确认您确实要删除此外部防火墙。警告: 如果您计划重新添加同一个外部防火墙,则必须在设备上重置使用数据。 -message.action.delete.external.load.balancer=请确认您确实要删除此外部负载平衡器。警告: 如果您计划重新添加同一个外部负载平衡器,则必须在设备上重置使用数据。 -message.action.delete.ingress.rule=请确认您确实要删除此入口规则。 -message.action.delete.network=请确认您确实要删除此网络。 -message.action.delete.pod=请确认您确实要删除此提供点。 -message.action.delete.primary.storage=请确认您确实要删除此主存储。 -message.action.delete.secondary.storage=请确认您确实要删除此辅助存储。 -message.action.delete.security.group=请确认您确实要删除此安全组。 -message.action.delete.service.offering=请确认您确实要删除此服务方案。 -message.action.delete.snapshot=请确认您确实要删除此快照。 -message.action.delete.template.for.all.zones=此模板由所有区域使用。请确认您确实要将其从所有区域中删除。 -message.action.delete.template=请确认您确实要删除此模板。 -message.action.delete.volume=请确认您确实要删除此卷。 -message.action.delete.zone=请确认您确实要删除此区域。 -message.action.destroy.instance=请确认您确实要销毁此实例。 -message.action.destroy.systemvm=请确认您确实要销毁此系统 VM。 -message.action.disable.static.NAT=请确认您确实要禁用静态 NAT。 -message.action.enable.maintenance=已成功准备好维护您的主机。此过程可能需要长达几分钟或更长时间,具体取决于当前此主机上的 VM 数量。 -message.action.force.reconnect=已成功强制重新连接您的主机。此过程可能需要长达几分钟时间。 -message.action.host.enable.maintenance.mode=启用维护模式将导致将此主机上正在运行的所有实例实时迁移到任何可用的主机。 -message.action.instance.reset.password=请确认您确实要更改此虚拟机的 ROOT 用户密码。 -message.action.primarystorage.enable.maintenance.mode=警告: 将主存储置于维护模式将导致使用主存储中的卷的所有 VM 停止运行。是否要继续? -message.action.reboot.instance=请确认您确实要重新启动此实例。 -message.action.reboot.systemvm=请确认您确实要重新启动此系统 VM。 -message.action.release.ip=请确认您确实要释放此 IP。 -message.action.remove.host=删除群集中的最后一个/仅有的主机并重新安装此主机将销毁主机上的工作环境/数据库,并呈现无法使用的 VM 来宾。 -message.action.restore.instance=请确认您确实要还原此实例。 -message.action.start.instance=请确认您确实要启动此实例。 -message.action.start.router=请确认您确实要启动此路由器。 -message.action.start.systemvm=请确认您确实要启动此系统 VM。 -message.action.stop.instance=请确认您确实要停止此实例。 -message.action.stop.systemvm=请确认您确实要停止此系统 VM。 -message.action.take.snapshot=请确认您确实要创建此卷的快照。 -message.add.cluster.zone=向区域 中添加一个虚拟机管理程序托管的群集 -message.add.cluster=向区域 、提供点 中添加一个虚拟机管理程序托管的群集 -message.add.disk.offering=请指定以下参数以添加一个新的磁盘方案 -message.add.firewall=向区域中添加一个防火墙 -message.add.host=请指定以下参数以添加一台新主机 -message.add.ip.range.direct.network=向区域 中的直接网络 添加一个 IP 范围 -message.add.ip.range.to.pod=

向提供点添加一个 IP 范围:

-message.add.ip.range=向区域中的公用网络添加一个 IP 范围 -message.add.load.balancer=向区域中添加一个负载平衡器 -message.add.network=为区域添加一个新网络: -message.add.pod=为区域 添加一个新提供点 -message.add.primary.storage=为区域 、提供点 添加一个新的主存储 -message.add.primary=请指定以下参数以添加一个新主存储 -message.add.secondary.storage=为区域 添加一个新存储 -message.add.service.offering=请填写以下数据以添加一个新计算方案。 -message.add.template=请输入以下数据以创建新模板 -message.add.volume=请填写以下数据以添加一个新卷。 -message.additional.networks.desc=请选择虚拟机要连接到的其他网络。 -message.advanced.mode.desc=如果您希望启用 VLAN 支持,请选择此网络模式。此网络模式在允许管理员提供防火墙、VPN 或负载平衡器支持等自定义网络方案以及启用直接网络连接与虚拟网络连接等方面提供了最大的灵活性。 -message.advanced.security.group=如果要使用安全组提供来宾 VM 隔离,请选择此模式。 -message.advanced.virtual=如果要使用整个区域的 VLAN 提供来宾 VM 隔离,请选择此模式。 -message.allow.vpn.access=请输入要允许进行 VPN 访问的用户的用户名和密码。 -message.attach.iso.confirm=请确认您确实要将此 ISO 附加到此虚拟实例。 -message.attach.volume=请填写以下数据以附加一个新卷。如果要将磁盘卷附加到基于 Windows 的虚拟机,需要重新启动此实例才能显示已连接的磁盘。 -message.basic.mode.desc=如果您**希望启用任何 VLAN 支持,请选择此网络模式。将直接从此网络中为在此网络模式下创建的所有虚拟机实例分配一个 IP,并使用安全组提供安全性和隔离。 -message.change.offering.confirm=请确认您确实要更改此虚拟实例的服务方案。 -message.copy.iso.confirm=请确认您确实要将 ISO 复制到 -message.copy.template=将模板 XXX 从区域 复制到 -message.create.template.vm=基于模板 创建 VM -message.create.template.volume=请先指定以下信息,然后再创建磁盘卷的模板: 。创建模板可能需要几分钟到更长的时间,具体取决于磁盘卷的大小。 -message.delete.account=请确认您确实要删除此帐户。 -message.detach.iso.confirm=请确认您确实要从此虚拟机中取消附加此 ISO。 -message.disable.account=请确认您确实要禁用此帐户。通过禁用此帐户,此帐户的所有用户将不再有权访问各自的云资源。所有正在运行的虚拟机将立即关闭。 -message.disable.vpn.access=请确认您确实要禁用 VPN 访问。 -message.download.ISO=请单击 00000 下载 ISO -message.download.template=请单击 00000 下载模板 -message.download.volume=请单击 00000 下载卷 -message.edit.confirm=请先确认您所做的更改,然后单击“保存”。 -message.edit.limits=请指定对以下资源的限制。“-1”表示不限制要创建的资源数。 -message.enable.account=请确认您确实要启用此帐户。 -message.enable.vpn.access=当前已对此 IP 地址禁用了 VPN。是否要启用 VPN 访问? -message.enabled.vpn.ip.sec=您的 IPSec 预共享密钥 -message.enabled.vpn=您的 VPN 访问功能当前已启用,可以通过 IP 进行访问 -message.launch.vm.on.private.network=是否要在您的私人专用网络中启动实例? -message.lock.account=请确认您确实要锁定此帐户。通过锁定此帐户,此帐户的所有用户将不再能够管理各自的云资源,但仍然可以访问现有资源。 -message.migrate.instance.confirm=请确认要将虚拟实例迁移到的主机。 -message.new.user=请指定以下信息以向帐户中添加一个新用户 -message.no.network.support.configuration.not.true=您的所有区域都未启用安全组,因此无其他网络功能。请继续执行步骤 5。 -message.no.network.support=您选择的虚拟机管理程序 vSphere 没有任何其他网络功能。请继续执行步骤 5。 -message.number.clusters=

群集

-message.number.hosts=

主机

-message.number.pods=

提供点

-message.number.storage=

主存储卷

-message.number.zones=

区域

-message.remove.vpn.access=请确认您确实要删除以下用户的 VPN 访问。 -message.restart.mgmt.server=请重新启动 Management Server 以使您的新设置生效。 -message.security.group.usage=(按住 Ctrl 键并单击鼠标可选择所有适用的安全组) -message.snapshot.schedule=可以通过从以下可用选项中进行选择并应用您的策略首选项来设置重现快照计划 -message.step.1.continue=请选择一个模板或 ISO 以继续 -message.step.1.desc=请为您的新虚拟实例选择一个模板。还可以选择一个可将 ISO 映像安装到其中的空模板。 -message.step.2.continue=请选择一种服务方案以继续 -message.step.2.desc= -message.step.3.continue=请选择一种磁盘方案以继续 -message.step.3.desc= -message.step.4.continue=请至少选择一个网络以继续 -message.step.4.desc=请选择虚拟实例要连接到的主网络。 -message.update.os.preference=请为此主机选择一个操作系统首选项。首先将具有相似首选项的所有虚拟实例分配至此主机,然后再选择其他实例。 -message.update.ssl=请提交一个新的 X.509 兼容的 SSL 证书,以将其更新到每个控制台代理虚拟实例: -message.virtual.network.desc=您的帐户的专用虚拟网络。广播域包含在 VLAN 中,并且所有公用网络访问都由虚拟路由器路由出去。 -message.volume.create.template.confirm=请确认您确实要为此磁盘卷创建一个模板。创建模板可能需要几分钟到更长的时间,具体取决于卷的大小。 -message.zone.step.1.desc=请为您的区域选择一种网络模式。 -message.zone.step.2.desc=请输入以下信息以添加一个新区域 -message.zone.step.3.desc=请输入以下信息以添加一个新提供点 -message.apply.snapshot.policy=您已成功更新当前的快照策略。 -message.disable.snapshot.policy=您已成功禁用当前的快照策略。 -message.action.change.service.warning.for.instance=必须先禁用您的实例,然后再尝试更改其当前的服务方案。 -message.action.change.service.warning.for.router=必须先停止您的路由器,然后再尝试更改其当前的服务方案。 -message.action.reset.password.warning=必须先停止您的实例,然后再尝试更改其当前的密码。 -message.action.reset.password.off=您的实例当前不支持此功能。 - -#Errors -error.login=您的用户名/密码与我们的记录不一致。 -error.menu.select=正在选择项目,无法执行操作。 -error.mgmt.server.inaccessible=无法访问 Management Server。请稍后再试。 -error.session.expired=您的会话已过期。 -error.unresolved.internet.name=无法解析您的 Internet 名称。 - - - - - - - - + +#new labels (begin) ********************************************************************************************** + + +#new labels (end) ************************************************************************************************ + + +#modified labels (begin) ***************************************************************************************** + + +#modified labels (end) ******************************************************************************************* + +label.configure.network.ACLs=配置网络 ACL +label.network.ACLs=网络 ACL +label.add.network.ACL=添加网络 ACL +label.private.Gateway=专用网关 +label.VPC.router.details=VPC 路由器详细信息 +label.VMs.in.tier=层中的 VM + +message.zoneWizard.enable.local.storage=警告: 如果为此区域启用了本地存储,则必须执行以下操作,具体取决于希望启动系统 VM 的位置:

1. 如果要在主存储中启动系统 VM,则需要在创建后将主存储添加到此区域中。此外,还必须启动处于禁用状态的区域。

2. 如果要在本地存储中启动系统 VM,则需要先将 system.vm.use.local.storage 设置为 True,然后再启用此区域。


是否要继续? +label.local.storage.enabled=已启用本地存储 +label.tier.details=层详细信息 +label.edit.tags=编辑标签 +label.network.rate.megabytes=网络速率(MB/秒) +label.action.enable.physical.network=启用物理网络 +label.action.disable.physical.network=禁用物理网络 +message.action.enable.physical.network=请确认您确实要启用此物理网络。 +message.action.disable.physical.network=请确认您确实要禁用此物理网络。 + +label.select.tier=选择层 +label.add.ACL=添加 ACL +label.remove.ACL=删除 ACL +label.tier=层 +label.network.ACL=网络 ACL +label.network.ACL.total=网络 ACL 总数 +label.add.new.gateway=添加新网关 +message.add.new.gateway.to.vpc=请指定将新网关添加到此 VPC 所需的信息。 +label.delete.gateway=删除网关 +message.delete.gateway=请确认您确实要删除此网关 +label.CIDR.of.destination.network=目的地网络的 CIDR +label.add.route=添加路由 +label.add.static.route=添加静态路由 +label.remove.static.route=删除静态路由 +label.site.to.site.VPN=站点到站点 VPN +label.add.VPN.gateway=添加 VPN 网关 +message.add.VPN.gateway=请确认您确实要添加 VPN 网关 +label.VPN.gateway=VPN 网关 +label.delete.VPN.gateway=删除 VPN 网关 +message.delete.VPN.gateway=请确认您确实要删除此 VPN 网关 +label.VPN.connection=VPN 连接 +label.IPsec.preshared.key=IPsec 预共享密钥 +label.IKE.policy=IKE 策略 +label.ESP.policy=ESP 策略 +label.create.VPN.connection=创建 VPN 连接 +label.VPN.customer.gateway=VPN 客户网关 +label.CIDR.list=CIDR 列表 +label.IKE.lifetime=IKE 使用期限(第二阶段) +label.ESP.lifetime=ESP 使用期限(第二阶段) +label.dead.peer.detection=失效对等体检测 +label.reset.VPN.connection=重置 VPN 连接 +message.reset.VPN.connection=请确认您确实要重置 VPN 连接 +label.delete.VPN.connection=删除 VPN 连接 +message.delete.VPN.connection=请确认您确实要删除 VPN 连接 +label.add.new.tier=添加新层 +label.add.VM.to.tier=向层中添加 VM +label.remove.tier=删除层 + +label.local.storage.enabled=已启用本地存储 +label.associated.network=关联网络 +label.add.port.forwarding.rule=添加端口转发规则 +label.dns=DNS + +label.vpc=VPC +label.vpc.id=VPC ID +label.tier=层 +label.add.vpc=添加 VPC +label.super.cidr.for.guest.networks=来宾网络的超级 CIDR +label.DNS.domain.for.guest.networks=来宾网络的 DNS 域 +label.configure.vpc=配置 VPC +label.edit.vpc=编辑 VPC +label.restart.vpc=重新启动 VPC +message.restart.vpc=请确认您确实要重新启动 VPC +label.remove.vpc=删除 VPC +message.remove.vpc=请确认您确实要删除 VPC +label.vpn.customer.gateway=VPN 客户网关 +label.add.vpn.customer.gateway=添加 VPN 客户网关 +label.IKE.encryption=IKE 加密算法 +label.IKE.hash=IKE 哈希算法 +label.IKE.DH=IKE DH 算法 +label.ESP.encryption=ESP 加密算法 +label.ESP.hash=ESP 哈希算法 +label.perfect.forward.secrecy=完全正向保密 +label.IKE.lifetime=IKE 使用期限(第二阶段) +label.ESP.lifetime=ESP 使用期限(第二阶段) +label.dead.peer.detection=失效对等体检测 +label.delete.VPN.customer.gateway=删除 VPN 客户网关 +message.delete.VPN.customer.gateway=请确认您确实要删除此 VPN 客户网关 + +label.network.domain.text=网络域 +label.memory.mb=内存(MB) +label.cpu.mhz=CPU (MHz) +message.action.remove.host=请确认您确实要删除此主机。 + +message.action.reboot.router=此虚拟路由器提供的所有服务都将中断。请确认您确实要重新启动此路由器。 +message.action.stop.router=此虚拟路由器提供的所有服务都将中断。请确认您确实要停止此路由器。 +message.restart.network=此网络提供的所有服务都将中断。请确认您确实要重新启动此网络。 + + +label.ipaddress=IP 地址 +label.vcdcname=vCenter DC 名称 +label.vcipaddress=vCenter IP 地址 +label.vsmctrlvlanid=控制 VLAN ID +label.vsmpktvlanid=数据包 VLAN ID +label.vsmstoragevlanid=存储 VLAN ID +label.nexusVswitch=Nexus 1000v +label.action.delete.nexusVswitch=删除 Nexus 1000v +label.action.enable.nexusVswitch=启用 Nexus 1000v +label.action.disable.nexusVswitch=禁用 Nexus 1000v +label.action.list.nexusVswitch=列出 Nexus 1000v +message.action.delete.nexusVswitch=请确认您确实要删除此 Nexus 1000v +message.action.enable.nexusVswitch=请确认您确实要启用此 Nexus 1000v +message.action.disable.nexusVswitch=请确认您确实要禁用此 Nexus 1000v +message.specify.url=请指定 URL +label.select.instance.to.attach.volume.to=选择要将卷附加到的实例 +label.upload=上载 +label.upload.volume=上载卷 +label.virtual.routers=虚拟路由器 +label.primary.storage.count=主存储池 +label.secondary.storage.count=辅助存储池 +label.number.of.system.vms=系统 VM 数 +label.number.of.virtual.routers=虚拟路由器数 +label.action.register.iso=注册 ISO +label.isolation.method=隔离方法 +label.action.register.template=注册模板 +label.checksum=MD5 校验和 +label.vpn=VPN +label.vlan=VLAN + + +label.management.ips=管理类 IP 地址 +label.devices=设备 +label.rules=规则 +label.traffic.label=流量标签 +label.vm.state=VM 状态 +message.setup.physical.network.during.zone.creation.basic=添加基础区域时,可以设置一个物理网络,此网络应与虚拟机管理程序中的 NIC 相对应。此网络可以承载多种流量类型。

此外,还可以将其他流量类型拖放到此物理网络。 +label.domain.router=域路由器 +label.console.proxy=控制台代理 +label.secondary.storage.vm=辅助存储 VM +label.add.netScaler.device=添加 Netscaler 设备 +label.add.F5.device=添加 F5 设备 +label.add.SRX.device=添加 SRX 设备 +label.account.and.security.group=帐户、安全组 +label.fetch.latest=提取最新内容 +label.system.offering=系统方案 +message.validate.instance.name=实例名称不得超过 63 个字符。仅允许使用 ASCII 字母 a - z 或 A - Z、数字 0 - 9 以及连字符。实例名称必须以字母开头并以字母或数字结束。 + + +label.isolated.networks=隔离网络 +label.latest.events=最新事件 +state.Enabled=已启用 +label.system.wide.capacity=全系统容量 +label.network.service.providers=网络服务提供程序 +message.launch.zone=区域已准备就绪,可随时启动;请继续执行下一步骤。 +error.unable.to.reach.management.server=无法访问管理服务器 +label.internal.name=内部名称 +message.configure.all.traffic.types=您有多个物理网络,请单击“编辑”按钮为每种流量类型配置标签。 +message.edit.traffic.type=请指定您希望与此流量类型关联的流量标签。 +label.edit.traffic.type=编辑流量类型 +label.label=标签 +label.max.networks=最大网络数 +error.invalid.username.password=用户名或密码无效 +message.enabling.security.group.provider=正在启用安全组提供程序 +message.adding.Netscaler.provider=正在添加 Netscaler 提供程序 +message.creating.guest.network=正在创建来宾网络 +label.action.delete.physical.network=删除物理网络 +message.action.delete.physical.network=请确认您确实要删除此物理网络 +message.installWizard.copy.whatIsAHost=主机是指一台计算机。主机提供运行来宾虚拟机的计算资源。每台主机上都安装有虚拟机管理程序软件,用于管理来宾 VM (裸机主机除外,将在“高级安装指南”中讨论这一特殊案例)。例如,启用了 KVM 的 Linux 服务器、Citrix XenServer 服务器和 ESXi 服务器都可用作主机。在基本安装中,我们将使用一台运行 XenServer 的主机。

主机是 CloudStack™ 部署中最小的组织单位。主机包含在群集中,群集包含在提供点中,提供点包含在区域中。 + + +label.add.compute.offering=添加计算方案 +label.compute.offering=计算方案 +label.compute.offerings=计算方案 +label.select.offering=选择方案 +label.menu.infrastructure=基础架构 +label.sticky.tablesize=表大小 +label.sticky.expire=过期日期 +label.sticky.cookie-name=Cookie 名称 +label.sticky.mode=模式 +label.sticky.length=长度 +label.sticky.holdtime=持续时间 +label.sticky.request-learn=request-learn +label.sticky.prefix=prefix +label.sticky.nocache=nocache +label.sticky.indirect=indirect +label.sticky.postonly=postonly +label.sticky.domain=域 +state.Allocating=正在分配 +state.Migrating=正在迁移 +error.please.specify.physical.network.tags=网络方案在您为此物理网络指定标签之后才可用。 + + +state.Stopping=正在停止 +message.add.load.balancer.under.ip=已在以下 IP 下添加负载平衡器规则: +message.select.instance=请选择一个实例。 +label.select=选择 +label.select.vm.for.static.nat=为静态 NAT 选择 VM +label.select.instance=选择实例 +label.nat.port.range=NAT 端口范围 +label.static.nat.vm.details=静态 NAT VM 详情 +label.edit.lb.rule=编辑负载平衡器规则 +message.migrate.instance.to.host=请确认您确实要将实例迁移到其他主机。 +label.migrate.instance.to.host=将实例迁移到其他主机 +message.migrate.instance.to.ps=请确认您确实要将实例迁移到其他主存储。 +label.migrate.instance.to.ps=将实例迁移到其他主存储 +label.corrections.saved=已保存修正 +message.installWizard.copy.whatIsSecondaryStorage=辅助存储与区域相关联,用于存储以下项目:
  • 模板 - 可用于启动 VM 并可以包含其他配置信息(例如,已安装的应用程序)的操作系统映像
  • ISO 映像 - 可重新启动或不可重新启动的操作系统映像
  • 磁盘卷快照 - 已保存的 VM 数据副本,可用于执行数据恢复或创建新模板
+message.installWizard.copy.whatIsPrimaryStorage=CloudStack™ 云基础架构使用以下两种类型的存储: 主存储和辅助存储。这两种类型的存储可以是 iSCSI 或 NFS 服务器,也可以是本地磁盘。

主存储与群集相关联,用于存储该群集中的主机上正在运行的所有 VM 对应的每个来宾 VM 的磁盘卷。主存储服务器通常位于靠近主机的位置。 +message.installWizard.copy.whatIsACluster=群集提供了一种编组主机的方法。群集中的所有主机都具有相同的硬件,运行相同的虚拟机管理程序,位于同一子网中,并访问相同的共享存储。可以实时将虚拟机实例(VM)从一台主机迁移到同一群集内的其他主机,而无需中断向用户提供服务。群集是 CloudStack™ 部署中的第三大组织单位。群集包含在提供点中,提供点包含在区域中。

CloudStack™ 允许云部署中存在多个群集,但对于基本安装,我们只需要一个群集。 +message.installWizard.copy.whatIsAPod=一个提供点通常代表一个机架。同一提供点中的主机位于同一子网中。

提供点是 CloudStack™ 部署中的第二大组织单位。提供点包含在区域中。每个区域中可以包含一个或多个提供点;在基本安装中,您的区域中将仅包含一个提供点。 +message.installWizard.copy.whatIsAZone=区域是 CloudStack™ 部署中最大的组织单位。虽然允许一个数据中心中存在多个区域,但是一个区域通常与一个数据中心相对应。将基础架构编组到区域中的好处是可以提供物理隔离和冗余。例如,每个区域都可以拥有各自的电源供应和网络上行方案,并且各区域可以在地理位置上相隔很远(虽然并非必须相隔很远)。 +message.installWizard.copy.whatIsCloudStack=CloudStack™ 是一个软件平台,可将计算资源集中在一起以构建公共、私有和混合基础设施即服务(IaaS)云。CloudStack™ 负责管理组成云基础架构的网络、存储和计算节点。使用 CloudStack™ 可以部署、管理和配置云计算环境。

CloudStack™ 通过扩展商用硬件上运行的每个虚拟机映像的范围,提供了一个实时可用的云基础架构软件堆栈用于以服务方式交付虚拟数据中心,即交付构建、部署和管理多层次和多租户云应用程序必需的所有组件。开源版本和 Premium 版本都已可用,且提供的功能几乎完全相同。 +message.installWizard.tooltip.addSecondaryStorage.path=导出路径(位于上述指定服务器上) +message.installWizard.tooltip.addSecondaryStorage.nfsServer=托管辅助存储的 NFS 服务器的 IP 地址 +message.installWizard.tooltip.addPrimaryStorage.path=(适用于 NFS)在 NFS 中,此路径为服务器的导出路径。路径(针对 SharedMountPoint)。对于 KVM,此路径为装载了辅助存储的每个主机上的路径。例如,/mnt/primary。 +message.installWizard.tooltip.addPrimaryStorage.server=(适用于 NFS、iSCSI 或 PreSetup)存储设备的 IP 地址或 DNS 名称。 +message.installWizard.tooltip.addPrimaryStorage.name=存储设备的名称。 +message.installWizard.tooltip.addHost.password=此为上述用户的密码(来自 XenServer 安装)。 +message.installWizard.tooltip.addHost.username=通常为 root。 +message.installWizard.tooltip.addHost.hostname=主机的 DNS 名称或 IP 地址。 +message.installWizard.tooltip.addCluster.name=群集的名称。此名称可以是您选择的文本,且未由 CloudStack 使用。 +message.installWizard.tooltip.addPod.reservedSystemEndIp=此为 CloudStack 用于管理辅助存储 VM 和控制台代理 VM 的专用网络中的 IP 范围。这些 IP 地址来自与计算服务器相同的子网。 +message.installWizard.tooltip.addPod.reservedSystemStartIp=此为 CloudStack 用于管理辅助存储 VM 和控制台代理 VM 的专用网络中的 IP 范围。这些 IP 地址来自与计算服务器相同的子网。 +message.installWizard.tooltip.addPod.reservedSystemNetmask=来宾将要使用的子网上正在使用的网络掩码。 +message.installWizard.tooltip.addPod.reservedSystemGateway=该提供点中的主机网关。 +message.installWizard.tooltip.addPod.name=提供点的名称 +message.installWizard.tooltip.configureGuestTraffic.guestEndIp=能够分配给此区域中的来宾的 IP 地址范围。如果使用一个 NIC,这些 IP 应位于与提供点 CIDR 相同的 CIDR 中。 +message.installWizard.tooltip.configureGuestTraffic.guestStartIp=能够分配给此区域中的来宾的 IP 地址范围。如果使用一个 NIC,这些 IP 应位于与提供点 CIDR 相同的 CIDR 中。 +message.installWizard.tooltip.configureGuestTraffic.guestNetmask=来宾应使用的子网上正在使用的网络掩码 +message.installWizard.tooltip.configureGuestTraffic.guestGateway=来宾应使用的网关 +message.installWizard.tooltip.configureGuestTraffic.description=您的网络说明 +message.installWizard.tooltip.configureGuestTraffic.name=您的网络名称 +message.installWizard.tooltip.addZone.internaldns2=这些服务器是供此区域中的系统 VM 使用的 DNS 服务器,将通过系统 VM 的专用网络接口进行访问。您为提供点提供的专用 IP 地址必须路由到在此处指定的 DNS 服务器。 +message.installWizard.tooltip.addZone.internaldns1=这些服务器是供此区域中的系统 VM 使用的 DNS 服务器,将通过系统 VM 的专用网络接口进行访问。您为提供点提供的专用 IP 地址必须路由到在此处指定的 DNS 服务器。 +message.installWizard.tooltip.addZone.dns2=这些服务器是供此区域中的来宾 VM 使用的 DNS 服务器,将通过您稍后要添加的公用网络进行访问。此区域的公用 IP 地址必须路由到在此处指定的 DNS 服务器。 +message.installWizard.tooltip.addZone.name=区域名称 +message.installWizard.tooltip.addZone.dns1=这些服务器是供此区域中的来宾 VM 使用的 DNS 服务器,将通过您稍后要添加的公用网络进行访问。此区域的公用 IP 地址必须路由到在此处指定的 DNS 服务器。 +message.setup.successful=已成功设置云! +label.may.continue=您现在可以继续进行操作。 +error.installWizard.message=出现问题;请返回并更正任何错误 +message.installWizard.now.building=现在正在构建您的云... +message.installWizard.click.retry=请单击此按钮重新尝试启动。 +label.launch=启动 +label.installWizard.click.launch=请单击“启动”按钮。 +label.congratulations=祝贺您! +label.installWizard.addSecondaryStorageIntro.subtitle=什么是辅助存储? +label.installWizard.addSecondaryStorageIntro.title=添加一个辅助存储 +label.installWizard.addPrimaryStorageIntro.subtitle=什么是主存储? +label.installWizard.addPrimaryStorageIntro.title=添加一个主存储 +label.installWizard.addHostIntro.subtitle=什么是主机? +label.installWizard.addHostIntro.title=添加一个主机 +label.installWizard.addClusterIntro.subtitle=什么是群集? +label.installWizard.addClusterIntro.title=添加一个群集 +label.installWizard.addPodIntro.subtitle=什么是提供点? +label.installWizard.addPodIntro.title=添加一个提供点 +label.installWizard.addZone.title=添加区域 +label.installWizard.addZoneIntro.subtitle=什么是区域? +label.installWizard.addZoneIntro.title=添加一个区域 +error.password.not.match=密码字段不一致 +label.confirm.password=确认密码 +message.change.password=请更改您的密码。 +label.save.and.continue=保存并继续 +label.skip.guide=我以前使用过 CloudStack,跳过此指南 +label.continue.basic.install=继续执行基本安装 +label.introduction.to.cloudstack=CloudStack™ 简介 +label.what.is.cloudstack=什么是 CloudStack™? +label.hints=提示 +label.installWizard.subtitle=此教程将帮助您设置 CloudStack™ 安装 +label.continue=继续 +label.installWizard.title=您好,欢迎使用 CloudStack™ +label.agree=同意 +label.license.agreement=许可协议 +label.license.agreement.subtitle=必须先接受 CloudStack™ EULA 才能进行安装。 +label.manage.resources=管理资源 +label.port.forwarding.policies=端口转发策略 +label.load.balancing.policies=负载平衡策略 +label.networking.and.security=网络连接与安全 +label.bandwidth=带宽 +label.virtual.machines=虚拟机 +label.compute.and.storage=计算与存储 +label.task.completed=已完成任务 +label.update.project.resources=更新项目资源 +label.remove.project.account=删除项目帐户 +label.item.listing=项目列表 +message.select.item=请选择一个项目。 +label.removing=正在删除 +label.invite=邀请 +label.add.by=添加方式 +label.max.vms=最大用户 VM 数 +label.max.public.ips=最大公用 IP 数 +label.max.volumes=最大卷数 +label.max.snapshots=最大快照数 +label.max.templates=最大模板数 +label.project.dashboard=项目控制板 +label.remind.later=以后提醒我 +label.invited.accounts=已邀请的帐户 +label.invite.to=邀请加入 +label.add.accounts.to=添加帐户至 +label.add.accounts=添加帐户 +label.project.name=项目名称 +label.create.project=创建项目 +label.networks=网络 +label.launch.vm=启动 VM +label.new.vm=新建 VM +label.previous=上一步 +label.add.to.group=添加到组 +message.vm.review.launch=请先核对以下信息,确认您的虚拟实例正确无误,然后再启动。 +message.select.security.groups=请为您的新 VM 选择安全组 +label.new=新建 +message.please.select.networks=请为您的虚拟机选择网络。 +message.please.proceed=请继续执行下个步骤。 +message.zone.no.network.selection=所选区域无任何网络选项。 +label.no.thanks=不,谢谢 +label.my.templates=我的模板 +message.select.template=请为您的新虚拟实例选择一个模板。 +message.select.iso=请为您的新虚拟实例选择一个 ISO。 +message.template.desc=可用于启动 VM 的操作系统映像 +message.iso.desc=包含操作系统的数据或可启动介质的磁盘映像 +label.select.iso.or.template=选择 ISO 或模板 +message.select.a.zone=一个区域通常与一个数据中心相对应。多个区域可以提供物理隔离和冗余,有助于使云更加可靠。 +label.select.a.zone=选择一个区域 +label.review=核对 +label.select.a.template=选择一个模板 +label.setup=设置 +state.Allocated=已分配 +changed.item.properties=更改项目属性 +label.apply=应用 +label.default=默认值 +label.viewing=正在查看 +label.move.to.top=移至顶部 +label.move.up.row=向上移动一行 +label.move.down.row=向下移动一行 +label.move.to.bottom=移至底部 +label.drag.new.position=拖动到新位置 +label.order=排序 +label.no.data=无可显示的数据 +label.change.value=更改值 +label.clear.list=清除列表 +label.full.path=完整路径 +message.add.domain=请指定要在此域下创建的子域 +message.delete.user=请确认您确实要删除此用户。 +message.enable.user=请确认您确实要启用此用户。 +message.disable.user=请确认您确实要禁用此用户。 +message.generate.keys=请确认您确实要为此用户生成新密钥。 +message.update.resource.count=请确认您确实要更新此帐户的资源数。 +message.edit.account=编辑(“-1”表示对要创建的资源数量没有任何限制) +label.total.of.vm=总 VM 数 +label.total.of.ip=总 IP 地址数 +state.enabled=已启用 +message.action.download.iso=请确认您确实要下载此 ISO。 +message.action.download.template=请确认您确实要下载此模板。 +label.destination.zone=目标区域 +label.keyboard.type=键盘类型 +label.nic.adapter.type=NIC 适配器类型 +label.root.disk.controller=根磁盘控制器 +label.community=社区 +label.remove.egress.rule=删除出口规则 +label.add.egress.rule=添加出口规则 +label.egress.rule=出口规则 +label.remove.ingress.rule=删除入口规则 +label.delete.vpn.user=删除 VPN 用户 +label.add.vpn.user=添加 VPN 用户 +label.remove.pf=删除端口转发规则 +label.remove.vm.from.lb=从负载平衡器规则中删除 VM +label.add.vms.to.lb=向负载平衡器规则中添加 VM +label.add.vm=添加 VM +label.remove.static.nat.rule=删除静态 NAT 规则 +label.remove.rule=删除规则 +label.add.static.nat.rule=添加静态 NAT 规则 +label.add.rule=添加规则 +label.configuration=配置 +message.disable.vpn=是否确实要禁用 VPN? +label.disable.vpn=禁用 VPN +message.enable.vpn=请确认您确实要对此 IP 地址启用 VPN 访问。 +label.enable.vpn=启用 VPN +message.acquire.new.ip=请确认您确实要为此网络获取一个新 IP。 +label.elastic=弹性 +label.my.network=我的网络 +label.add.vms=添加 VM +label.configure=配置 +label.stickiness=粘性 +label.source=源算法 +label.least.connections=最少连接算法 +label.round.robin=轮询算法 +label.restart.required=需要重新启动 +label.clean.up=清除 +label.restart.network=重新启动网络 +label.edit.network.details=编辑网络详情 +label.add.guest.network=添加来宾网络 +label.guest.networks=来宾网络 +message.ip.address.changed=您的 IP 地址可能已发生变化;是否要刷新此列表? 请注意,刷新此列表时,“详细信息”窗格将关闭。 +state.BackingUp=正在备份 +state.BackedUp=已备份 +label.done=完成 +label.vm.name=VM 名称 +message.migrate.volume=请确认您确实要将卷迁移到其他主存储。 +label.migrate.volume=将卷迁移到其他主存储 +message.create.template=是否确实要创建模板? +label.create.template=创建模板 +message.download.volume.confirm=请确认您确实要下载此卷 +message.detach.disk=是否确实要取消附加此磁盘? +state.ready=已就绪 +state.Ready=已就绪 +label.vm.display.name=VM 显示名称 +label.select-view=选择视图 +label.local.storage=本地存储 +label.direct.ips=直接 IP +label.view.all=查看全部 +label.zone.details=区域详情 +message.alert.state.detected=检测到警报状态 +state.Starting=正在启动 +state.Expunging=正在删除 +state.Creating=正在创建 +message.decline.invitation=是否确实要拒绝此项目邀请? +label.decline.invitation=拒绝邀请 +message.confirm.join.project=请确认您确实要加入此项目。 +message.join.project=您现在已加入了一个项目。请切换到“项目视图”以查看项目。 +label.accept.project.invitation=接受项目邀请 +label.token=令牌 +label.project.id=项目 ID +message.enter.token=请输入您在邀请电子邮件中收到的令牌。 +label.enter.token=输入令牌 +state.Accepted=已接受 +state.Pending=待定 +state.Completed=已完成 +state.Declined=已拒绝 +label.project=项目 +label.invitations=邀请 +label.delete.project=删除项目 +message.delete.project=是否确实要删除此项目? +message.activate.project=是否确实要激活此项目? +label.activate.project=激活项目 +label.suspend.project=暂停项目 +message.suspend.project=是否确实要暂停此项目? +state.Suspended=已暂停 +label.edit.project.details=编辑项目详情 +label.new.project=新建项目 +state.Active=活动 +state.Disabled=已禁用 +label.projects=项目 +label.make.project.owner=设为帐户项目所有者 +label.remove.project.account=从项目中删除帐户 +message.project.invite.sent=发送给用户的邀请;用户接受邀请后,将加入到项目中 +label.add.account.to.project=向项目中添加帐户 +label.revoke.project.invite=撤销邀请 +label.project.invite=邀请加入项目 +label.select.project=选择项目 +message.no.projects=您没有任何项目。
请从“项目”部分中创建一个新项目。 +message.no.projects.adminOnly=您没有任何项目。
请要求管理员创建一个新项目。 +message.pending.projects.1=您有待定项目邀请: +message.pending.projects.2=要查看,请转至“项目”部分,然后从下拉列表中选择“邀请”。 +message.instanceWizard.noTemplates=您没有任何可用模板;请添加一个兼容的模板,然后重新启动实例向导。 +label.view=查看 +instances.actions.reboot.label=重新启动实例 +label.filterBy=过滤依据 +label.ok=确定 +notification.reboot.instance=重新启动实例 +notification.start.instance=启动实例 +notification.stop.instance=停止实例 +label.display.name=显示名称 +label.zone.name=区域名称 +ui.listView.filters.all=全部 +ui.listView.filters.mine=本用户 +state.Running=正在运行 +state.Stopped=已停止 +state.Destroyed=已销毁 +state.Error=错误 +message.reset.password.warning.notPasswordEnabled=创建此实例的模板时未启用密码 +message.reset.password.warning.notStopped=必须先停止您的实例,才能尝试更改其当前密码 +label.notifications=通知 +label.default.view=默认视图 +label.project.view=项目视图 + +message.add.system.service.offering=请填写以下数据以添加一个新的系统服务方案。 +message.action.delete.system.service.offering=请确认您确实要删除此系统服务方案。 +label.action.delete.system.service.offering=删除系统服务方案 +label.hypervisor.capabilities=虚拟机管理程序功能 +label.hypervisor.version=虚拟机管理程序版本 +label.max.guest.limit=最大来宾数限制 +label.add.network.offering=添加网络方案 +label.supported.services=支持的服务 +label.service.capabilities=服务功能 +label.guest.type=来宾类型 +label.specify.IP.ranges=指定 IP 范围 +label.conserve.mode=保护模式 +label.created.by.system=由系统创建 +label.menu.system.service.offerings=系统方案 +label.add.system.service.offering=添加系统服务方案 +label.redundant.router.capability=冗余路由器功能 +label.supported.source.NAT.type=支持的源 NAT 类型 +label.elastic.LB=弹性负载平衡器 +label.LB.isolation=负载平衡器隔离 +label.elastic.IP=弹性 IP +label.network.label.display.for.blank.value=使用默认网关 +label.xen.traffic.label=XenServer 流量标签 +label.kvm.traffic.label=KVM 流量标签 +label.vmware.traffic.label=VMware 流量标签 +label.start.IP=起始 IP +label.end.IP=结束 IP +label.remove.ip.range=删除 IP 范围 +label.ip.ranges=IP 范围 +label.start.vlan=起始 VLAN +label.end.vlan=结束 VLAN +label.broadcast.domain.range=广播域范围 +label.compute=计算 +message.add.guest.network=请确认您确实要添加一个来宾网络 +label.subdomain.access=子域访问 +label.guest.start.ip=来宾起始 IP +label.guest.end.ip=来宾结束 IP +label.virtual.router=虚拟路由器 +label.physical.network.ID=物理网络 ID +label.destination.physical.network.id=目标物理网络 ID +label.dhcp=DHCP +label.destroy.router=销毁路由器 +message.confirm.destroy.router=请确认您确实要销毁此路由器 +label.change.service.offering=更改服务方案 +label.view.console=查看控制台 +label.redundant.state=冗余状态 +label.enable.provider=启用提供程序 +message.confirm.enable.provider=请确认您确实要启用此提供程序 +label.disable.provider=禁用提供程序 +message.confirm.disable.provider=请确认您确实要禁用此提供程序 +label.shutdown.provider=关闭提供程序 +message.confirm.shutdown.provider=请确认您确实要关闭此提供程序 +label.netScaler=NetScaler +label.add.new.NetScaler=添加新 NetScaler +label.capacity=容量 +label.dedicated=专用 +label.f5=F5 +label.add.new.F5=添加新 F5 +label.srx=SRX +label.providers=提供程序 +label.add.new.SRX=添加新 SRX +label.timeout=超时 +label.public.network=公用网络 +label.private.network=专用网络 +label.enable.swift=启用 SWIFT +confirm.enable.swift=请填写以下信息以启用对 SWIFT 的支持 +message.after.enable.swift=已配置 SWIFT。注意: 退出此页面后,您将无法再次重新配置 SWIFT。 +label.key=密钥 +label.delete.NetScaler=删除 NetScaler +message.confirm.delete.NetScaler=请确认您确实要删除 NetScaler +label.delete.F5=删除 F5 +message.confirm.delete.F5=请确认您确实要删除 F5 +label.delete.SRX=删除 SRX +message.confirm.delete.SRX=请确认您确实要删除 SRX +label.pods=提供点 +label.pod.name=提供点名称 +label.reserved.system.gateway=预留的系统网关 +label.reserved.system.netmask=预留的系统网络掩码 +label.start.reserved.system.IP=起始预留系统 IP +label.end.reserved.system.IP=结束预留系统 IP +label.clusters=群集 +label.cluster.name=群集名称 +label.host.MAC=主机 MAC +label.agent.username=代理用户名 +label.agent.password=代理密码 +message.confirm.action.force.reconnect=请确认您确实要强制重新连接此主机。 +label.resource.state=资源状态 +label.LUN.number=LUN 号 +message.confirm.remove.IP.range=请确认您确实要删除此 IP 范围。 +message.tooltip.zone.name=区域名称。 +message.tooltip.dns.1=供区域中的 VM 使用的 DNS 服务器名称。区域的公用 IP 地址必须路由到此服务器。 +message.tooltip.dns.2=供区域中的 VM 使用的辅助 DNS 服务器名称。区域的公用 IP 地址必须路由到此服务器。 +message.tooltip.internal.dns.1=供区域中的 CloudStack 内部系统 VM 使用的 DNS 服务器名称。提供点的专用 IP 地址必须路由到此服务器。 +message.tooltip.internal.dns.2=供区域中的 CloudStack 内部系统 VM 使用的 DNS 服务器名称。提供点的专用 IP 地址必须路由到此服务器。 +message.tooltip.network.domain=DNS 后缀,将为由来宾 VM 访问的网络创建一个自定义域名。 +message.tooltip.pod.name=此提供点的名称。 +message.tooltip.reserved.system.gateway=提供点中的主机网关。 +message.tooltip.reserved.system.netmask=用于定义提供点子网的网络前缀。请使用 CIDR 符号。 +message.creating.zone=正在创建区域 +message.creating.physical.networks=正在创建物理网络 +message.configuring.physical.networks=正在配置物理网络 +message.adding.Netscaler.device=正在添加 Netscaler 设备 +message.creating.pod=正在创建提供点 +message.configuring.public.traffic=正在配置公共流量 +message.configuring.storage.traffic=正在配置存储流量 +message.configuring.guest.traffic=正在配置来宾流量 +message.creating.cluster=正在创建群集 +message.adding.host=正在添加主机 +message.creating.primary.storage=正在创建主存储 +message.creating.secondary.storage=正在创建辅助存储 +message.Zone.creation.complete=已完成创建区域 +message.enabling.zone=正在启用区域 +error.something.went.wrong.please.correct.the.following=出现问题;请更正以下各项 +error.could.not.enable.zone=无法启用区域 +message.zone.creation.complete.would.you.like.to.enable.this.zone=已完成创建区域。是否要启用此区域? +message.please.add.at.lease.one.traffic.range=请至少添加一个流量范围。 +message.you.must.have.at.least.one.physical.network=您必须至少拥有一个物理网络 +message.please.select.a.different.public.and.management.network.before.removing=请先选择其他公共管理网络,然后再删除 + +label.zone.type=区域类型 +label.setup.zone=设置区域 +label.setup.network=设置网络 +label.add.resources=添加资源 +label.launch=启动 +label.set.up.zone.type=设置区域类型 +message.please.select.a.configuration.for.your.zone=请为您的区域选择一种配置。 +message.desc.basic.zone=提供一个网络,将直接从此网络中为每个 VM 实例分配一个 IP。可以通过安全组等第 3 层方式提供来宾隔离(IP 地址源过滤)。 +label.basic=基本 +message.desc.advanced.zone=适用于更加复杂的网络拓扑。此网络模式在定义来宾网络并提供防火墙、VPN 或负载平衡器支持等自定义网络方案方面提供了最大的灵活性。 +label.advanced=高级 +message.desc.zone=区域是 CloudStack 中最大的组织单位,一个区域通常与一个数据中心相对应。区域可提供物理隔离和冗余。一个区域由一个或多个提供点以及由区域中的所有提供点共享的一个辅助存储服务器组成,其中每个提供点中包含多个主机和主存储服务器。 +label.physical.network=物理网络 +label.public.traffic=公共流量 +label.guest.traffic=来宾流量 +label.storage.traffic=存储流量 +message.setup.physical.network.during.zone.creation=添加高级区域时,需要设置一个或多个物理网络。每个网络都与虚拟机管理程序中的一个 NIC 相对应。每个物理网络中可以包含一种或多种流量类型,并对这些流量类型可能的组合方式设置了某些限制。

可以将一种或多种流量类型拖放到每个物理网络中。 +label.add.physical.network=添加物理网络 +label.traffic.types=流量类型 +label.management=管理 +label.guest=来宾 +label.please.specify.netscaler.info=请指定 Netscaler 信息 +message.public.traffic.in.advanced.zone=云中的 VM 访问 Internet 时将生成公共流量,但必须分配可公开访问的 IP 才能实现。最终用户可以使用 CloudStack UI 获取这些 IP,以在其来宾网络与公用网络之间执行 NAT。

请至少为 Internet 流量提供一个 IP 地址范围。 +message.public.traffic.in.basic.zone=云中的 VM 访问 Internet 或通过 Internet 向客户端提供服务时将生成公共流量,但必须分配可公开访问的 IP 才能实现。创建实例时,将把这一组公用 IP 中的 IP (来宾 IP 地址除外)分配给此实例。静态 1-1 NAT 将在公用 IP 与来宾 IP 之间自动设置。最终用户还可以使用 CloudStack UI 获取其他 IP,以在其实例与公用 IP 之间执行静态 NAT。 +message.add.pod.during.zone.creation=每个区域中必须包含一个或多个提供点,现在我们将添加第一个提供点。提供点中包含主机和主存储服务器,您将在随后的某个步骤中添加这些主机和服务器。首先,请为 CloudStack 的内部管理流量配置一个预留 IP 地址范围。预留的 IP 范围对云中的每个区域来说必须唯一。 +message.guest.traffic.in.advanced.zone=来宾网络流量是指最终用户虚拟机之间的通信。指定一个 VLAN ID 范围可传送每个物理网络的来宾流量。 +message.guest.traffic.in.basic.zone=来宾网络流量是指最终用户虚拟机之间的通信。应指定一个 CloudStack 可以分配给来宾 VM 的 IP 地址范围。请确保此范围与预留的系统 IP 范围不重叠。 +message.storage.traffic=CloudStack 内部资源(包括与管理服务器通信的任何组件,例如主机和 CloudStack 系统 VM)之间的流量。请在此处配置存储流量。 +message.desc.cluster=每个提供点中必须包含一个或多个群集,现在我们将添加第一个群集。群集提供了一种编组主机的方法。群集中的所有主机都具有相同的硬件,运行相同的虚拟机管理程序,位于相同的子网中,并访问相同的共享存储。每个群集由一个或多个主机以及一个或多个主存储服务器组成。 +message.desc.host=每个群集中必须至少包含一个主机以供来宾 VM 在上面运行,现在我们将添加第一个主机。要使主机在 CloudStack 中运行,必须在此主机上安装虚拟机管理程序软件,为其分配一个 IP 地址,并确保将其连接到 CloudStack 管理服务器。

请提供主机的 DNS 或 IP 地址、用户名(通常为 root)和密码,以及用于对主机进行分类的任何标签。 +message.desc.primary.storage=每个群集中必须包含一个或多个主存储服务器,现在我们将添加第一个主存储服务器。主存储中包含在群集中的主机上运行的所有 VM 的磁盘卷。请使用底层虚拟机管理程序支持的符合标准的协议。 +message.desc.secondary.storage=每个区域中必须至少包含一个 NFS 或辅助存储服务器,现在我们将添加第一个 NFS 或辅助存储服务器。辅助存储用于存储 VM 模板、ISO 映像和 VM 磁盘卷快照。此服务器必须对区域中的所有服务器可用。

请提供 IP 地址和导出路径。 +label.launch.zone=启动区域 +message.please.wait.while.zone.is.being.created=正在创建区域,请稍候;此操作可能需要一段时间才能完成... + +label.load.balancing=负载平衡 +label.static.nat.enabled=已启用静态 NAT +label.zones=区域 +label.view.more=查看更多 +label.number.of.zones=区域数量 +label.number.of.pods=提供点数量 +label.number.of.clusters=群集数量 +label.number.of.hosts=主机数量 +label.total.hosts=总主机数 +label.total.CPU=CPU 总量 +label.total.memory=内存总量 +label.total.storage=存储总量 +label.purpose=目的 + + + + +label.action.migrate.router=迁移路由器 +label.action.migrate.router.processing=正在迁移路由器... +message.migrate.router.confirm=请确认您要将路由器迁移到的主机: +label.migrate.router.to=迁移路由器至 + +label.action.migrate.systemvm=迁移系统 VM +label.action.migrate.systemvm.processing=正在迁移系统 VM... +message.migrate.systemvm.confirm=请确认您要将系统 VM 迁移到的主机: +label.migrate.systemvm.to=迁移系统 VM 至 + + +mode=模式 +side.by.side=并行 +inline=内联 + +extractable=可提取 + +label.ocfs2=OCFS2 + +label.action.edit.host=编辑主机 + +network.rate=网络速率 + +ICMP.type=ICMP 类型 +ICMP.code=ICMP 代码 + +image.directory=图片目录 + +label.action.create.template.from.vm=基于 VM 创建模板 +label.action.create.template.from.volume=基于卷创建模板 + +message.vm.create.template.confirm=创建模板将自动重新启动 VM。 + +label.action.manage.cluster=托管群集 +message.action.manage.cluster=请确认您确实要托管此群集。 +label.action.manage.cluster.processing=正在托管群集... + +label.action.unmanage.cluster=取消托管群集 +message.action.unmanage.cluster=请确认您确实要取消托管此群集。 +label.action.unmanage.cluster.processing=正在取消托管群集... + +label.allocation.state=分配状态 +managed.state=托管状态 + +label.default.use=默认使用 +label.host.tags=主机标签 + +label.cidr=CIDR +label.cidr.list=源 CIDR + +label.storage.tags=存储标签 + +label.redundant.router=冗余路由器 +label.is.redundant.router=冗余 + +force.delete=强制删除 +force.delete.domain.warning=警告: 选择此选项将导致删除所有子域以及所有相关联的帐户及其资源。 + +force.remove=强制移除 +force.remove.host.warning=警告: 选择此选项将导致 CloudStack 在从群集中移除此主机之前,强制停止所有正在运行的虚拟机。 + +force.stop=强制停止 +force.stop.instance.warning=警告: 除非万不得已,否则不应强制停止此实例。停止此实例可能会导致数据丢失以及致使虚拟机状态不一致。 + +label.PreSetup=PreSetup +label.SR.name = SR 名称标签 +label.SharedMountPoint=SharedMountPoint +label.clvm=CLVM +label.volgroup=卷组 +label.VMFS.datastore=VMFS 数据存储 + +label.network.device=网络设备 +label.add.network.device=添加网络设备 +label.network.device.type=网络设备类型 +label.DHCP.server.type=DHCP 服务器类型 +label.Pxe.server.type=Pxe 服务器类型 +label.PING.storage.IP=PING 存储 IP +label.PING.dir=PING 目录 +label.TFTP.dir=TFTP 目录 +label.PING.CIFS.username=PING CIFS 用户名 +label.PING.CIFS.password=PING CIFS 密码 +label.CPU.cap=CPU 上限 + + +label.action.enable.zone=启用区域 +label.action.enable.zone.processing=正在启用区域... +message.action.enable.zone=请确认您确实要启用此区域。 +label.action.disable.zone=禁用区域 +label.action.disable.zone.processing=正在禁用区域... +message.action.disable.zone=请确认您确实要禁用此区域。 + +label.action.enable.pod=启用提供点 +label.action.enable.pod.processing=正在启用提供点... +message.action.enable.pod=请确认您确实要启用此提供点。 +label.action.disable.pod=禁用提供点 +label.action.disable.pod.processing=正在禁用提供点... +message.action.disable.pod=请确认您确实要禁用此提供点。 + +label.action.enable.cluster=启用群集 +label.action.enable.cluster.processing=正在启用群集... +message.action.enable.cluster=请确认您确实要启用此群集。 +label.action.disable.cluster=禁用群集 +label.action.disable.cluster.processing=正在禁用群集... +message.action.disable.cluster=请确认您确实要禁用此群集。 + +label.account.id=帐户 ID +label.account.name=帐户名称 +label.account.specific=帐户专用 +label.account=帐户 +label.accounts=帐户 +label.acquire.new.ip=获取新 IP +label.show.ingress.rule=显示入口规则 +label.hide.ingress.rule=隐藏入口规则 +label.action.attach.disk.processing=正在附加磁盘... +label.action.attach.disk=附加磁盘 +label.action.attach.iso.processing=正在附加 ISO... +label.action.attach.iso=附加 ISO +label.action.cancel.maintenance.mode.processing=正在取消维护模式... +label.action.cancel.maintenance.mode=取消维护模式 +label.action.change.password=更改密码 +label.action.change.service.processing=正在更改服务... +label.action.change.service=更改服务 +label.action.copy.ISO.processing=正在复制 ISO... +label.action.copy.ISO=复制 ISO +label.action.copy.template.processing=正在复制模板... +label.action.copy.template=复制模板 +label.action.create.template.processing=正在创建模板... +label.action.create.template=创建模板 +label.action.create.vm.processing=正在创建 VM... +label.action.create.vm=创建 VM +label.action.create.volume.processing=正在创建卷... +label.action.create.volume=创建卷 +label.action.delete.IP.range.processing=正在删除 IP 范围... +label.action.delete.IP.range=删除 IP 范围 +label.action.delete.ISO.processing=正在删除 ISO... +label.action.delete.ISO=删除 ISO +label.action.delete.account.processing=正在删除帐户... +label.action.delete.account=删除帐户 +label.action.delete.cluster.processing=正在删除群集... +label.action.delete.cluster=删除群集 +label.action.delete.disk.offering.processing=正在删除磁盘方案... +label.action.delete.disk.offering=删除磁盘方案 + +label.action.update.resource.count=更新资源数量 +label.action.update.resource.count.processing=正在更新资源数量... + +label.action.delete.domain=删除域 +label.action.delete.domain.processing=正在删除域... + +label.action.delete.firewall.processing=正在删除防火墙... +label.action.delete.firewall=删除防火墙规则 +label.action.delete.ingress.rule.processing=正在删除入口规则... +label.action.delete.ingress.rule=删除入口规则 +label.action.delete.load.balancer.processing=正在删除负载平衡器... +label.action.delete.load.balancer=删除负载平衡器规则 +label.action.edit.network.processing=正在编辑网络... +label.action.edit.network=编辑网络 +label.action.delete.network.processing=正在删除网络... +label.action.delete.network=删除网络 +label.action.delete.pod.processing=正在删除提供点... +label.action.delete.pod=删除提供点 +label.action.delete.primary.storage.processing=正在删除主存储... +label.action.delete.primary.storage=删除主存储 +label.action.delete.secondary.storage.processing=正在删除辅助存储... +label.action.delete.secondary.storage=删除辅助存储 +label.action.delete.security.group.processing=正在删除安全组... +label.action.delete.security.group=删除安全组 +label.action.delete.service.offering.processing=正在删除服务方案... +label.action.delete.service.offering=删除服务方案 +label.action.delete.snapshot.processing=正在删除快照... +label.action.delete.snapshot=删除快照 +label.action.delete.template.processing=正在删除模板... +label.action.delete.template=删除模板 +label.action.delete.user.processing=正在删除用户... +label.action.delete.user=删除用户 +label.action.delete.volume.processing=正在删除卷... +label.action.delete.volume=删除卷 +label.action.delete.zone.processing=正在删除区域... +label.action.delete.zone=删除区域 +label.action.destroy.instance.processing=正在销毁实例... +label.action.destroy.instance=销毁实例 +label.action.destroy.systemvm.processing=正在销毁系统 VM... +label.action.destroy.systemvm=销毁系统 VM +label.action.detach.disk.processing=正在取消附加磁盘... +label.action.detach.disk=取消附加磁盘 +label.action.detach.iso.processing=正在取消附加 ISO... +label.action.detach.iso=取消附加 ISO +label.action.disable.account.processing=正在禁用帐户... +label.action.disable.account=禁用帐户 +label.action.disable.static.NAT.processing=正在禁用静态 NAT... +label.action.disable.static.NAT=禁用静态 NAT +label.action.disable.user.processing=正在禁用用户... +label.action.disable.user=禁用用户 +label.action.download.ISO=下载 ISO +label.action.download.template=下载模板 +label.action.download.volume.processing=正在下载卷... +label.action.download.volume=下载卷 +label.action.edit.ISO=编辑 ISO +label.action.edit.account=编辑帐户 +label.action.edit.disk.offering=编辑磁盘方案 +label.action.edit.domain=编辑域 +label.action.edit.global.setting=编辑全局设置 +label.action.edit.instance=编辑实例 +label.action.edit.network.offering=编辑网络方案 +label.action.edit.pod=编辑提供点 +label.action.edit.primary.storage=编辑主存储 +label.action.edit.resource.limits=编辑资源限制 +label.action.edit.service.offering=编辑服务方案 +label.action.edit.template=编辑模板 +label.action.edit.user=编辑用户 +label.action.edit.zone=编辑区域 +label.action.enable.account.processing=正在启用帐户... +label.action.enable.account=启用帐户 +label.action.enable.maintenance.mode.processing=正在启用维护模式... +label.action.enable.maintenance.mode=启用维护模式 +label.action.enable.static.NAT.processing=正在启用静态 NAT... +label.action.enable.static.NAT=启用静态 NAT +label.action.enable.user.processing=正在启用用户... +label.action.enable.user=启用用户 +label.action.force.reconnect.processing=正在重新连接... +label.action.force.reconnect=强制重新连接 +label.action.generate.keys.processing=正在生成密钥... +label.action.generate.keys=生成密钥 +label.action.lock.account.processing=正在锁定帐户... +label.action.lock.account=锁定帐户 +label.action.migrate.instance=迁移实例 +label.action.migrate.instance.processing=正在迁移实例... +label.action.reboot.instance.processing=正在重新启动实例... +label.action.reboot.instance=重新启动实例 +label.action.reboot.router.processing=正在重新启动路由器... +label.action.reboot.router=重新启动路由器 +label.action.reboot.systemvm.processing=正在重新启动系统 VM... +label.action.reboot.systemvm=重新启动系统 VM +label.action.recurring.snapshot=重现快照 +label.action.release.ip.processing=正在释放 IP... +label.action.release.ip=释放 IP +label.action.remove.host.processing=正在删除主机... +label.action.remove.host=删除主机 +label.action.reset.password.processing=正在重置密码... +label.action.reset.password=重置密码 +label.action.resource.limits=资源限制 +label.action.restore.instance.processing=正在还原实例... +label.action.restore.instance=还原实例 +label.action.start.instance.processing=正在启动实例... +label.action.start.instance=启动实例 +label.action.start.router.processing=正在启动路由器... +label.action.start.router=启动路由器 +label.action.start.systemvm.processing=正在启动系统 VM... +label.action.start.systemvm=启动系统 VM +label.action.stop.instance.processing=正在停止实例... +label.action.stop.instance=停止实例 +label.action.stop.router.processing=正在停止路由器... +label.action.stop.router=停止路由器 +label.action.stop.systemvm.processing=正在停止系统 VM... +label.action.stop.systemvm=停止系统 VM +label.action.take.snapshot.processing=正在创建快照... +label.action.take.snapshot=创建快照 +label.action.update.OS.preference.processing=正在更新操作系统首选项... +label.action.update.OS.preference=更新操作系统首选项 +label.actions=操作 +label.active.sessions=活动会话 +label.add.account=添加帐户 +label.add.by.cidr=按 CIDR 添加 +label.add.by.group=按组添加 +label.add.cluster=添加群集 +label.add.direct.iprange=添加直接 IP 范围 +label.add.disk.offering=添加磁盘方案 +label.add.domain=添加域 +label.add.firewall=添加防火墙规则 +label.add.host=添加主机 +label.add.ingress.rule=添加入口规则 +label.add.ip.range=添加 IP 范围 +label.add.load.balancer=添加负载平衡器 +label.add.more=添加更多 +label.add.network=添加网络 +label.add.pod=添加提供点 +label.add.primary.storage=添加主存储 +label.add.secondary.storage=添加辅助存储 +label.add.security.group=添加安全组 +label.add.service.offering=添加服务方案 +label.add.template=添加模板 +label.add.user=添加用户 +label.add.vlan=添加 VLAN +label.add.volume=添加卷 +label.add.zone=添加区域 +label.add=添加 +label.adding.cluster=正在添加群集 +label.adding.failed=添加失败 +label.adding.pod=正在添加提供点 +label.adding.processing=正在添加... +label.adding.succeeded=已成功添加 +label.adding.user=正在添加用户 +label.adding.zone=正在添加区域 +label.adding=正在添加 +label.additional.networks=其他网络 +label.admin.accounts=管理员帐户 +label.admin=管理员 +label.advanced.mode=高级模式 +label.advanced.search=高级搜索 +label.advanced=高级 +label.alert=警报 +label.algorithm=算法 +label.allocated=已分配 +label.api.key=API 密钥 +label.assign.to.load.balancer=正在将实例分配给负载平衡器 +label.assign=分配 +label.associated.network.id=已关联网络 ID +label.attached.iso=已附加 ISO +label.availability.zone=可用区域 +label.availability=可用性 +label.available.public.ips=可用公用 IP 地址 +label.available=可用 +label.back=返回 +label.basic.mode=基本模式 +label.bootable=可启动 +label.broadcast.domain.type=广播域类型 +label.by.account=按帐户 +label.by.availability=按可用性 +label.by.domain=按域 +label.by.end.date=按结束日期 +label.by.level=按级别 +label.by.pod=按提供点 +label.by.role=按角色 +label.by.start.date=按开始日期 +label.by.state=按状态 +label.by.traffic.type=按流量类型 +label.by.type.id=按类型 ID +label.by.type=按类型 +label.by.zone=按区域 +label.bytes.received=接收的字节数 +label.bytes.sent=发送的字节数 +label.cancel=取消 +label.certificate=证书 +label.privatekey=PKCS#8 私钥 +label.domain.suffix=DNS 域后缀(例如 xyz.com) +label.character=字符 +label.cidr.account=CIDR 或帐户/安全组 +label.close=关闭 +label.cloud.console=云管理控制台 +label.cloud.managed=由 Cloud.com 管理 +label.cluster.type=群集类型 +label.cluster=群集 +label.code=代码 +label.confirmation=确认 +label.cpu.allocated.for.VMs=已分配给 VM 的 CPU +label.cpu.allocated=已分配的 CPU +label.cpu.utilized=CPU 利用率 +label.cpu=CPU +label.created=创建日期 +label.cross.zones=跨区域 +label.custom.disk.size=自定义磁盘大小 +label.daily=每天一次 +label.data.disk.offering=数据磁盘方案 +label.date=日期 +label.day.of.month=日期 +label.day.of.week=星期 +label.delete=删除 +label.deleting.failed=删除失败 +label.deleting.processing=正在删除... +label.description=说明 +label.detaching.disk=正在取消附加磁盘 +label.details=详细信息 +label.device.id=设备 ID +label.disabled=已禁用 +label.disabling.vpn.access=正在禁用 VPN 访问 +label.disk.allocated=已分配的磁盘 +label.disk.offering=磁盘方案 +label.disk.size.gb=磁盘大小(GB) +label.disk.size=磁盘大小 +label.disk.total=磁盘总量 +label.disk.volume=磁盘卷 +label.display.text=显示文本 +label.dns.1=DNS 1 +label.dns.2=DNS 2 +label.domain.admin=域管理员 +label.domain.id=域 ID +label.domain.name=域名 +label.domain=域 +label.double.quotes.are.not.allowed=不允许使用双引号 +label.download.progress=下载进度 +label.edit=编辑 +label.email=电子邮件 +label.enabling.vpn.access=正在启用 VPN 访问 +label.enabling.vpn=正在启用 VPN +label.end.port=结束端口 +label.endpoint.or.operation=端点或操作 +label.error.code=错误代码 +label.error=错误 +label.esx.host=ESX/ESXi 主机 +label.example=示例 +label.failed=失败 +label.featured=精选 +label.firewall=防火墙 +label.first.name=名字 +label.format=格式 +label.friday=星期五 +label.full=满载 +label.gateway=网关 +label.general.alerts=常规警报 +label.generating.url=正在生成 URL +label.go.step.2=转至步骤 2 +label.go.step.3=转至步骤 3 +label.go.step.4=转至步骤 4 +label.go.step.5=转至步骤 5 +label.group.optional=组(可选) +label.group=组 +label.guest.cidr=来宾 CIDR +label.guest.gateway=来宾网关 +label.guest.ip.range=来宾 IP 范围 +label.guest.ip=来宾 IP 地址 +label.guest.netmask=来宾网络掩码 +label.ha.enabled=已启用高可用性 +label.help=帮助 +label.host.alerts=主机警报 +label.host.name=主机名称 +label.host=主机 +label.hosts=主机 +label.hourly=每小时一次 +label.hypervisor.type=虚拟机管理程序类型 +label.hypervisor=虚拟机管理程序 +label.id=ID +label.info=信息 +label.ingress.rule=入口规则 +label.initiated.by=启动者 +label.instance.limits=实例限制 +label.instance.name=实例名称 +label.instance=实例 +label.instances=实例 +label.internal.dns.1=内部 DNS 1 +label.internal.dns.2=内部 DNS 2 +label.interval.type=间隔类型 +label.invalid.integer=无效整数 +label.invalid.number=无效数字 +label.ip.address=IP 地址 +label.ip.allocations=IP 分配 +label.ip.limits=公用 IP 限制 +label.ip.or.fqdn=IP 或 FQDN +label.ip.range=IP 范围 +label.ip=IP +label.ips=IP +label.is.default=是否为默认值 +label.is.shared=是否共享 +label.is.system=是否为系统 +label.iscsi=iSCSI +label.iso.boot=ISO 启动 +label.iso=ISO +label.isolation.mode=隔离模式 +label.keep=保留 +label.lang.chinese=简体中文 +label.lang.english=英语 +label.lang.japanese=日语 +label.lang.spanish=西班牙语 +label.last.disconnected=上次断开连接时间 +label.last.name=姓氏 +label.level=级别 +label.linklocal.ip=链接本地 IP 地址 +label.load.balancer=负载平衡器 +label.loading=正在加载 +label.local=本地 +label.login=登录 +label.logout=注销 +label.lun=LUN +label.manage=托管 +label.maximum=最大值 +label.memory.allocated=已分配的内存 +label.memory.total=内存总量 +label.memory.used=已使用的内存 +label.memory=内存 +label.menu.accounts=帐户 +label.menu.alerts=警报 +label.menu.all.accounts=所有帐户 +label.menu.all.instances=所有实例 +label.menu.community.isos=社区 ISO +label.menu.community.templates=社区模板 +label.menu.configuration=配置 +label.menu.dashboard=控制板 +label.menu.destroyed.instances=已销毁的实例 +label.menu.disk.offerings=磁盘方案 +label.menu.domains=域 +label.menu.events=事件 +label.menu.featured.isos=精选 ISO +label.menu.featured.templates=精选模板 +label.menu.global.settings=全局设置 +label.menu.instances=实例 +label.menu.ipaddresses=IP 地址 +label.menu.isos=ISO +label.menu.my.accounts=我的帐户 +label.menu.my.instances=我的实例 +label.menu.my.isos=我的 ISO +label.menu.my.templates=我的模板 +label.menu.network.offerings=网络方案 +label.menu.network=网络 +label.menu.physical.resources=物理资源 +label.menu.running.instances=正在运行的实例 +label.menu.security.groups=安全组 +label.menu.service.offerings=服务方案 +label.menu.snapshots=快照 +label.menu.stopped.instances=已停止的实例 +label.menu.storage=存储 +label.menu.system.vms=系统 VM +label.menu.system=系统 +label.menu.templates=模板 +label.menu.virtual.appliances=虚拟设备 +label.menu.virtual.resources=虚拟资源 +label.menu.volumes=卷 +label.migrate.instance.to=迁移实例至 +label.minimum=最小值 +label.minute.past.hour=分钟时 +label.monday=星期一 +label.monthly=每月一次 +label.more.templates=更多模板 +label.my.account=我的帐户 +label.name.optional=名称(可选) +label.name=名称 +label.netmask=网络掩码 +label.network.desc=网络描述 +label.network.domain=网络域 +label.network.id=网络 ID +label.network.name=网络名称 +label.network.offering.display.text=网络方案显示文本 +label.network.offering.id=网络方案 ID +label.network.offering.name=网络方案名称 +label.network.offering=网络方案 +label.network.rate=网络速率 +label.network.read=网络读取量 +label.network.type=网络类型 +label.network.write=网络写入量 +label.network=网络 +label.new.password=新密码 +label.next=下一步 +label.nfs.server=NFS 服务器 +label.nfs.storage=NFS 存储 +label.nfs=NFS +label.nics=NIC +label.no.actions=无可用操作 +label.no.alerts=无最近发出的警报 +label.no.errors=无最近出现的错误 +label.no.isos=无可用 ISO +label.no.items=无可用项目 +label.no.security.groups=无可用安全组 +label.no.thanks=不,谢谢 +label.no=否 +label.none=无 +label.not.found=未找到 +label.num.cpu.cores=CPU 内核数 +label.numretries=重试次数 +label.offer.ha=提供高可用性 +label.optional=可选 +label.os.preference=操作系统首选项 +label.os.type=操作系统类型 +label.owned.public.ips=拥有的公用 IP 地址数 +label.owner.account=所有者帐户 +label.owner.domain=所有者域 +label.parent.domain=父域 +label.password.enabled=已启用密码 +label.password=密码 +label.path=路径 +label.please.wait=请稍候 +label.pod=提供点 +label.port.forwarding=端口转发 +label.port.range=端口范围 +label.prev=上一页 +label.primary.allocated=已分配的主存储 +label.primary.network=主网络 +label.primary.storage=主存储 +label.primary.used=已使用的主存储 +label.private.interface=专用接口 +label.private.ip.range=专用 IP 范围 +label.private.ip=专用 IP 地址 +label.private.ips=专用 IP 地址 +label.private.port=专用端口 +label.private.zone=专用区域 +label.protocol=协议 +label.public.interface=公用接口 +label.public.ip=公用 IP 地址 +label.public.ips=公用 IP 地址 +label.public.port=公用端口 +label.public.zone=公用区域 +label.public=公用 +label.recent.errors=最近出现的错误 +label.refresh=刷新 +label.related=相关联 +label.remove.from.load.balancer=正在从负载平衡器中删除实例 +label.removing.user=正在删除用户 +label.required=必填项 +label.reserved.system.ip=预留的系统 IP +label.resource.limits=资源限制 +label.resource=资源 +label.resources=资源 +label.role=角色 +label.root.disk.offering=根磁盘方案 +label.running.vms=正在运行的 VM +label.saturday=星期六 +label.save=保存 +label.saving.processing=正在保存... +label.scope=范围 +label.search=搜索 +label.secondary.storage=辅助存储 +label.secondary.used=已使用的辅助存储 +label.secret.key=密钥 +label.security.group.name=安全组名称 +label.security.group=安全组 +label.security.groups.enabled=已启用安全组 +label.security.groups=安全组 +label.sent=已发送 +label.server=服务器 +label.service.offering=服务方案 +label.system.service.offering=系统服务方案 +label.session.expired=会话已过期 +label.shared=已共享 +label.size=大小 +label.snapshot.limits=快照限制 +label.snapshot.name=快照名称 +label.snapshot.s=快照 +label.snapshot.schedule=设置重现快照 +label.snapshot=快照 +label.snapshots=快照 +label.source.nat=源 NAT +label.specify.vlan=指定 VLAN +label.start.port=起始端口 +label.state=状态 +label.static.nat.to=静态 NAT 目标 +label.static.nat=静态 NAT +label.statistics=统计数据 +label.status=状态 +label.step.1.title=步骤 1: 选择一个模板 +label.step.1=步骤 1 +label.step.2.title=步骤 2: 服务方案 +label.step.2=步骤 2 +label.step.3.title=步骤 3: 选择一种磁盘方案 +label.step.3=步骤 3 +label.step.4.title=步骤 4: 网络 +label.step.4=步骤 4 +label.step.5.title=步骤 5: 核对 +label.step.5=步骤 5 +label.stopped.vms=已停止的 VM +label.storage.type=存储类型 +label.storage=存储 +label.submit=提交 +label.submitted.by=[提交者: ] +label.succeeded=成功 +label.sunday=星期日 +label.system.capacity=系统容量 +label.system.vm.type=系统 VM 类型 +label.system.vm=系统 VM +label.system.vms=系统 VM +label.tagged=已标记 +label.tags=标签 +label.target.iqn=目标 IQN +label.template.limits=模板限制 +label.template=模板 +label.theme.default=默认主题 +label.theme.grey=自定义 - 灰色 +label.theme.lightblue=自定义 - 淡蓝色 +label.thursday=星期四 +label.time.zone=时区 +label.time=时间 +label.timeout.in.second = 超时(秒) +label.timezone=时区 +label.total.cpu=CPU 总量 +label.total.vms=总 VM 数 +label.traffic.type=流量类型 +label.tuesday=星期二 +label.type.id=类型 ID +label.type=类型 +label.unavailable=不可用 +label.unlimited=无限制 +label.untagged=已取消标记 +label.update.ssl.cert=更新 SSL 证书 +label.update.ssl=更新 SSL 证书 +label.updating=正在更新 +label.url=URL +label.usage.interface=使用界面 +label.used=已使用 +label.user=用户 +label.username=用户名 +label.users=用户 +label.value=值 +label.vcenter.cluster=vCenter 群集 +label.vcenter.datacenter=vCenter 数据中心 +label.vcenter.datastore=vCenter 数据存储 +label.vcenter.host=vCenter 主机 +label.vcenter.password=vCenter 密码 +label.vcenter.username=vCenter 用户名 +label.version=版本 +label.virtual.appliance=虚拟设备 +label.virtual.appliances=虚拟设备 +label.virtual.network=虚拟网络 +label.vlan.id=VLAN ID +label.vlan.range=VLAN 范围 +label.vm.add=添加实例 +label.vm.destroy=销毁 +label.vm.reboot=重新启动 +label.vm.start=启动 +label.vm.stop=停止 +label.vmfs=VMFS +label.vms=VM +label.volume.limits=卷限制 +label.volume.name=卷名称 +label.volume=卷 +label.volumes=卷 +label.vsphere.managed=由 vSphere 管理 +label.waiting=正在等待 +label.warn=警告 +label.wednesday=星期三 +label.weekly=每周一次 +label.welcome.cloud.console=欢迎使用管理控制台 +label.welcome=欢迎 +label.yes=是 +label.zone.id=区域 ID +label.zone.step.1.title=步骤 1: 选择一个网络 +label.zone.step.2.title=步骤 2: 添加一个区域 +label.zone.step.3.title=步骤 3: 添加一个提供点 +label.zone.step.4.title=步骤 4: 添加一个 IP 范围 +label.zone.wide=整个区域 +label.zone=区域 + +#Messages +message.acquire.public.ip=请选择一个要从中获取新 IP 的区域。 +message.action.cancel.maintenance.mode=请确认您确实要取消此维护。 +message.action.cancel.maintenance=已成功取消维护您的主机。此过程可能需要长达几分钟时间。 +message.action.delete.ISO.for.all.zones=此 ISO 由所有区域使用。请确认您确实要将其从所有区域中删除。 +message.action.delete.ISO=请确认您确实要删除此 ISO。 +message.action.delete.cluster=请确认您确实要删除此群集。 +message.action.delete.disk.offering=请确认您确实要删除此磁盘方案。 +message.action.delete.domain=请确认您确实要删除此域。 +message.action.delete.external.firewall=请确认您确实要删除此外部防火墙。警告: 如果您计划重新添加同一个外部防火墙,则必须在设备上重置使用数据。 +message.action.delete.external.load.balancer=请确认您确实要删除此外部负载平衡器。警告: 如果您计划重新添加同一个外部负载平衡器,则必须在设备上重置使用数据。 +message.action.delete.ingress.rule=请确认您确实要删除此入口规则。 +message.action.delete.network=请确认您确实要删除此网络。 +message.action.delete.pod=请确认您确实要删除此提供点。 +message.action.delete.primary.storage=请确认您确实要删除此主存储。 +message.action.delete.secondary.storage=请确认您确实要删除此辅助存储。 +message.action.delete.security.group=请确认您确实要删除此安全组。 +message.action.delete.service.offering=请确认您确实要删除此服务方案。 +message.action.delete.snapshot=请确认您确实要删除此快照。 +message.action.delete.template.for.all.zones=此模板由所有区域使用。请确认您确实要将其从所有区域中删除。 +message.action.delete.template=请确认您确实要删除此模板。 +message.action.delete.volume=请确认您确实要删除此卷。 +message.action.delete.zone=请确认您确实要删除此区域。 +message.action.destroy.instance=请确认您确实要销毁此实例。 +message.action.destroy.systemvm=请确认您确实要销毁此系统 VM。 +message.action.disable.static.NAT=请确认您确实要禁用静态 NAT。 +message.action.enable.maintenance=已成功准备好维护您的主机。此过程可能需要长达几分钟或更长时间,具体取决于当前此主机上的 VM 数量。 +message.action.force.reconnect=已成功强制重新连接您的主机。此过程可能需要长达几分钟时间。 +message.action.host.enable.maintenance.mode=启用维护模式将导致将此主机上正在运行的所有实例实时迁移到任何可用的主机。 +message.action.instance.reset.password=请确认您确实要更改此虚拟机的 ROOT 用户密码。 +message.action.primarystorage.enable.maintenance.mode=警告: 将主存储置于维护模式将导致使用主存储中的卷的所有 VM 停止运行。是否要继续? +message.action.reboot.instance=请确认您确实要重新启动此实例。 +message.action.reboot.systemvm=请确认您确实要重新启动此系统 VM。 +message.action.release.ip=请确认您确实要释放此 IP。 +message.action.restore.instance=请确认您确实要还原此实例。 +message.action.start.instance=请确认您确实要启动此实例。 +message.action.start.router=请确认您确实要启动此路由器。 +message.action.start.systemvm=请确认您确实要启动此系统 VM。 +message.action.stop.instance=请确认您确实要停止此实例。 +message.action.stop.systemvm=请确认您确实要停止此系统 VM。 +message.action.take.snapshot=请确认您确实要创建此卷的快照。 +message.add.cluster.zone=向区域 中添加一个虚拟机管理程序托管的群集 +message.add.cluster=向区域 、提供点 中添加一个虚拟机管理程序托管的群集 +message.add.disk.offering=请指定以下参数以添加一个新的磁盘方案 +message.add.firewall=向区域中添加一个防火墙 +message.add.host=请指定以下参数以添加一台新主机 +message.add.ip.range.direct.network=向区域 中的直接网络 添加一个 IP 范围 +message.add.ip.range.to.pod=

向提供点添加一个 IP 范围:

+message.add.ip.range=向区域中的公用网络添加一个 IP 范围 +message.add.load.balancer=向区域中添加一个负载平衡器 +message.add.network=为区域添加一个新网络: +message.add.pod=为区域 添加一个新提供点 +message.add.primary.storage=为区域 、提供点 添加一个新的主存储 +message.add.primary=请指定以下参数以添加一个新主存储 +message.add.secondary.storage=为区域 添加一个新存储 +message.add.service.offering=请填写以下数据以添加一个新计算方案。 +message.add.template=请输入以下数据以创建新模板 +message.add.volume=请填写以下数据以添加一个新卷。 +message.additional.networks.desc=请选择虚拟机要连接到的其他网络。 +message.advanced.mode.desc=如果您希望启用 VLAN 支持,请选择此网络模式。此网络模式在允许管理员提供防火墙、VPN 或负载平衡器支持等自定义网络方案以及启用直接网络连接与虚拟网络连接等方面提供了最大的灵活性。 +message.advanced.security.group=如果要使用安全组提供来宾 VM 隔离,请选择此模式。 +message.advanced.virtual=如果要使用整个区域的 VLAN 提供来宾 VM 隔离,请选择此模式。 +message.allow.vpn.access=请输入要允许进行 VPN 访问的用户的用户名和密码。 +message.attach.iso.confirm=请确认您确实要将此 ISO 附加到此虚拟实例。 +message.attach.volume=请填写以下数据以附加一个新卷。如果要将磁盘卷附加到基于 Windows 的虚拟机,需要重新启动此实例才能显示已连接的磁盘。 +message.basic.mode.desc=如果您**希望启用任何 VLAN 支持,请选择此网络模式。将直接从此网络中为在此网络模式下创建的所有虚拟机实例分配一个 IP,并使用安全组提供安全性和隔离。 +message.change.offering.confirm=请确认您确实要更改此虚拟实例的服务方案。 +message.copy.iso.confirm=请确认您确实要将 ISO 复制到 +message.copy.template=将模板 XXX 从区域 复制到 +message.create.template.vm=基于模板 创建 VM +message.create.template.volume=请先指定以下信息,然后再创建磁盘卷的模板: 。创建模板可能需要几分钟到更长的时间,具体取决于磁盘卷的大小。 +message.delete.account=请确认您确实要删除此帐户。 +message.detach.iso.confirm=请确认您确实要从此虚拟机中取消附加此 ISO。 +message.disable.account=请确认您确实要禁用此帐户。通过禁用此帐户,此帐户的所有用户将不再有权访问各自的云资源。所有正在运行的虚拟机将立即关闭。 +message.disable.vpn.access=请确认您确实要禁用 VPN 访问。 +message.download.ISO=请单击 00000 下载 ISO +message.download.template=请单击 00000 下载模板 +message.download.volume=请单击 00000 下载卷 +message.edit.confirm=请先确认您所做的更改,然后单击“保存”。 +message.edit.limits=请指定对以下资源的限制。“-1”表示不限制要创建的资源数。 +message.enable.account=请确认您确实要启用此帐户。 +message.enable.vpn.access=当前已对此 IP 地址禁用了 VPN。是否要启用 VPN 访问? +message.enabled.vpn.ip.sec=您的 IPSec 预共享密钥 +message.enabled.vpn=您的 VPN 访问功能当前已启用,可以通过 IP 进行访问 +message.launch.vm.on.private.network=是否要在您的私人专用网络中启动实例? +message.lock.account=请确认您确实要锁定此帐户。通过锁定此帐户,此帐户的所有用户将不再能够管理各自的云资源,但仍然可以访问现有资源。 +message.migrate.instance.confirm=请确认要将虚拟实例迁移到的主机。 +message.new.user=请指定以下信息以向帐户中添加一个新用户 +message.no.network.support.configuration.not.true=您的所有区域都未启用安全组,因此无其他网络功能。请继续执行步骤 5。 +message.no.network.support=您选择的虚拟机管理程序 vSphere 没有任何其他网络功能。请继续执行步骤 5。 +message.number.clusters=

群集

+message.number.hosts=

主机

+message.number.pods=

提供点

+message.number.storage=

主存储卷

+message.number.zones=

区域

+message.remove.vpn.access=请确认您确实要删除以下用户的 VPN 访问。 +message.restart.mgmt.server=请重新启动管理服务器以使您的新设置生效。 +message.restart.mgmt.usage.server=请重新启动管理服务器和使用服务器以使您的新设置生效。 +message.security.group.usage=(按住 Ctrl 键并单击鼠标可选择所有适用的安全组) +message.snapshot.schedule=可以通过从以下可用选项中进行选择并应用您的策略首选项来设置重现快照计划 +message.step.1.continue=请选择一个模板或 ISO 以继续 +message.step.1.desc=请为您的新虚拟实例选择一个模板。还可以选择一个可将 ISO 映像安装到其中的空模板。 +message.step.2.continue=请选择一种服务方案以继续 +message.step.2.desc= +message.step.3.continue=请选择一种磁盘方案以继续 +message.step.3.desc= +message.step.4.continue=请至少选择一个网络以继续 +message.step.4.desc=请选择虚拟实例要连接到的主网络。 +message.update.os.preference=请为此主机选择一个操作系统首选项。首先将具有相似首选项的所有虚拟实例分配至此主机,然后再选择其他实例。 +message.update.ssl=请提交一个新的 X.509 兼容的 SSL 证书,以将其更新到每个控制台代理虚拟实例: +message.virtual.network.desc=您的帐户的专用虚拟网络。广播域包含在 VLAN 中,并且所有公用网络访问都由虚拟路由器路由出去。 +message.volume.create.template.confirm=请确认您确实要为此磁盘卷创建一个模板。创建模板可能需要几分钟到更长的时间,具体取决于卷的大小。 +message.zone.step.1.desc=请为您的区域选择一种网络模式。 +message.zone.step.2.desc=请输入以下信息以添加一个新区域 +message.zone.step.3.desc=请输入以下信息以添加一个新提供点 +message.apply.snapshot.policy=您已成功更新当前的快照策略。 +message.disable.snapshot.policy=您已成功禁用当前的快照策略。 +message.action.change.service.warning.for.instance=必须先禁用您的实例,然后再尝试更改其当前的服务方案。 +message.action.change.service.warning.for.router=必须先停止您的路由器,然后再尝试更改其当前的服务方案。 +message.action.reset.password.warning=必须先停止您的实例,然后再尝试更改其当前的密码。 +message.action.reset.password.off=您的实例当前不支持此功能。 + +#Errors +error.login=您的用户名/密码与我们的记录不一致。 +error.menu.select=正在选择项目,无法执行操作。 +error.mgmt.server.inaccessible=无法访问管理服务器。请稍后再试。 +error.session.expired=您的会话已过期。 +error.unresolved.internet.name=无法解析您的 Internet 名称。 + diff --git a/client/WEB-INF/web.xml b/client/WEB-INF/web.xml index 41fad73a6e4..50f2455e848 100644 --- a/client/WEB-INF/web.xml +++ b/client/WEB-INF/web.xml @@ -20,6 +20,7 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> + cloudStartupServlet com.cloud.servlet.CloudStartupServlet diff --git a/client/cloudstack-ui.launch b/client/cloudstack-ui.launch new file mode 100644 index 00000000000..b47097c33cf --- /dev/null +++ b/client/cloudstack-ui.launch @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/client/pom.xml b/client/pom.xml index 27e303493d9..502d0232e04 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -17,158 +17,233 @@ under the License. --> - 4.0.0 - cloud-client-ui - Apache CloudStack Client UI - war - - com.cloud - cloud-parent - 4.0.0-SNAPSHOT - ../parent/pom.xml - - - - com.cloud - cloud-server - ${project.version} - - - com.cloud - cloud-server - ${project.version} - - - com.cloud - cloud-plugin-user-authenticator-ldap - ${project.version} - - - com.cloud - cloud-plugin-user-authenticator-md5 - ${project.version} - - - com.cloud - cloud-plugin-user-authenticator-plaintext - ${project.version} - - - com.cloud - cloud-plugin-network-srx - ${project.version} - - - com.cloud - cloud-plugin-network-nvp - ${project.version} - - - com.cloud - cloud-plugin-network-ovs - ${project.version} - - - com.cloud - cloud-plugin-network-netscaler - ${project.version} - - - com.cloud - cloud-plugin-network-midonet - ${project.version} - - - com.cloud - cloud-plugin-network-elb - ${project.version} - - - com.cloud - cloud-plugin-network-f5 - ${project.version} - - - com.cloud - cloud-plugin-netapp - ${project.version} - - - com.cloud - cloud-plugin-hypervisor-kvm - ${project.version} - - - com.cloud - cloud-plugin-hypervisor-xen - ${project.version} - - - com.cloud - cloud-plugin-hypervisor-ovm - ${project.version} - - - com.cloud - cloud-plugin-hypervisor-vmware - ${project.version} - - - com.cloud - cloud-plugin-storage-allocator-random - ${project.version} - - - com.cloud - cloud-plugin-planner-user-dispersing - ${project.version} - - - com.cloud - cloud-plugin-planner-user-concentrated-pod - ${project.version} - - - com.cloud - cloud-plugin-host-allocator-random - ${project.version} - - - mysql - mysql-connector-java - 5.1.21 - runtime - - - - install - - - org.apache.maven.plugins - maven-war-plugin - 2.2 - - ./WEB-INF/web.xml - ../ui - - - - org.mortbay.jetty - maven-jetty-plugin - 6.1.26 - - - - 8080 - 60000 - - - /client - ./WEB-INF/web.xml - ../ui - - - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-client-ui + Apache CloudStack Client UI + war + + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + + + + org.apache.cloudstack + cloud-server + ${project.version} + + + org.apache.cloudstack + cloud-plugin-user-authenticator-ldap + ${project.version} + + + org.apache.cloudstack + cloud-plugin-user-authenticator-md5 + ${project.version} + + + org.apache.cloudstack + cloud-plugin-user-authenticator-plaintext + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-nvp + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-ovs + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-elb + ${project.version} + + + org.apache.cloudstack + cloud-plugin-hypervisor-xen + ${project.version} + + + org.apache.cloudstack + cloud-plugin-hypervisor-ovm + ${project.version} + + + org.apache.cloudstack + cloud-plugin-storage-allocator-random + ${project.version} + + + org.apache.cloudstack + cloud-plugin-planner-user-dispersing + ${project.version} + + + org.apache.cloudstack + cloud-plugin-planner-user-concentrated-pod + ${project.version} + + + org.apache.cloudstack + cloud-plugin-host-allocator-random + ${project.version} + + + mysql + mysql-connector-java + 5.1.21 + runtime + + + + org.apache.cloudstack + cloud-plugin-hypervisor-vmware + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-srx + ${project.version} + + + org.apache.cloudstack + cloud-plugin-hypervisor-kvm + ${project.version} + + + org.mortbay.jetty + jetty + + + + + org.apache.cloudstack + cloud-plugin-netapp + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-f5 + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-netscaler + ${project.version} + + + + install + + + org.apache.maven.plugins + maven-war-plugin + 2.2 + + ./WEB-INF/web.xml + ./target/generated-webapp + + + + org.mortbay.jetty + maven-jetty-plugin + 6.1.26 + + + + 8080 + 60000 + + + /client + ${basedir}/WEB-INF/web.xml + ${basedir}/target/generated-webapp + + + + org.apache.tomcat.maven + tomcat7-maven-plugin + + ${basedir}/WEB-INF/web.xml + ./target/generated-webapp + + + + maven-antrun-plugin + 1.7 + + + generate-resources + + run + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.maven.plugins + + + maven-antrun-plugin + + [1.7,) + + run + + + + + + + + + + + + + diff --git a/client/tomcatconf/components.xml.in b/client/tomcatconf/components.xml.in index beaac13d922..3c4b9fd5b16 100755 --- a/client/tomcatconf/components.xml.in +++ b/client/tomcatconf/components.xml.in @@ -226,4 +226,31 @@ under the License. - + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cloud.spec b/cloud.spec index 0670ec699ea..be29ae413ac 100644 --- a/cloud.spec +++ b/cloud.spec @@ -164,6 +164,8 @@ Requires: %{name}-utils = %{version} Requires: apache-commons-dbcp Requires: apache-commons-collections Requires: jakarta-commons-httpclient +Requires: jakarta-taglibs-standard +Requires: mysql-connector-java %endif Group: System Environment/Libraries @@ -461,45 +463,41 @@ fi %files deps %defattr(0644,root,root,0755) -%{_javadir}/%{name}-commons-codec-1.5.jar -%{_javadir}/%{name}-commons-dbcp-1.4.jar -%{_javadir}/%{name}-commons-pool-1.5.6.jar -%{_javadir}/%{name}-commons-httpclient-3.1.jar -%{_javadir}/%{name}-google-gson-1.7.1.jar -%{_javadir}/%{name}-netscaler.jar -%{_javadir}/%{name}-netscaler-sdx.jar -%{_javadir}/%{name}-log4j-extras.jar -%{_javadir}/%{name}-backport-util-concurrent-3.0.jar -%{_javadir}/%{name}-plugin-hypervisor-kvm.jar -%{_javadir}/%{name}-ehcache.jar -%{_javadir}/%{name}-email.jar -%{_javadir}/%{name}-httpcore-4.0.jar -%{_javadir}/libvirt-0.4.8.jar -%{_javadir}/%{name}-log4j.jar -%{_javadir}/%{name}-trilead-ssh2-build213.jar -%{_javadir}/%{name}-cglib.jar -%{_javadir}/%{name}-mysql-connector-java-5.1.7-bin.jar -%{_javadir}/%{name}-xenserver-5.6.100-1.jar -%{_javadir}/%{name}-xmlrpc-common-3.*.jar -%{_javadir}/%{name}-xmlrpc-client-3.*.jar -%{_javadir}/%{name}-jstl-1.2.jar -%{_javadir}/jetty-6.1.26.jar -%{_javadir}/jetty-util-6.1.26.jar -%{_javadir}/%{name}-axis.jar -%{_javadir}/%{name}-commons-discovery.jar -%{_javadir}/%{name}-wsdl4j-1.6.2.jar -%{_javadir}/%{name}-bcprov-jdk16-1.45.jar -%{_javadir}/%{name}-jsch-0.1.42.jar -%{_javadir}/%{name}-iControl.jar -%{_javadir}/%{name}-manageontap.jar +%{_javadir}/commons-codec-1.6.jar +%{_javadir}/commons-dbcp-1.4.jar +%{_javadir}/commons-pool-1.6.jar +%{_javadir}/gson-1.7.1.jar +%{_javadir}/netscaler-1.0.jar +%{_javadir}/netscaler-sdx-1.0.jar +%{_javadir}/backport-util-concurrent-3.1.jar +%{_javadir}/ehcache-1.5.0.jar +%{_javadir}/httpcore-4.0.jar +%{_javadir}/mail-1.4.jar +%{_javadir}/activation-1.1.jar +%{_javadir}/mysql-connector-java-5.1.21.jar +%{_javadir}/hibernate-jpa-2.0-api-1.0.0.Final.jar +%{_javadir}/hibernate-entitymanager-3.5.1-Final.jar +%{_javadir}/hibernate-core-3.5.1-Final.jar +%{_javadir}/hibernate-commons-annotations-3.2.0.Final.jar +%{_javadir}/hibernate-annotations-3.5.1-Final.jar +%{_javadir}/asm-3.1.jar +%{_javadir}/xapi-5.6.100-1-20120825.123319-1.jar +%{_javadir}/log4j-*.jar +%{_javadir}/trilead-ssh2-build213-svnkit-1.3-patch.jar +%{_javadir}/cglib-2.2.jar +%{_javadir}/xmlrpc-common-3.*.jar +%{_javadir}/xmlrpc-client-3.*.jar +%{_javadir}/axis-1.4.jar +%{_javadir}/wsdl4j-1.6.2.jar +%{_javadir}/bcprov-jdk16-1.46.jar +%{_javadir}/jsch-0.1.42.jar +%{_javadir}/icontrol-1.0.jar +%{_javadir}/manageontap-1.0.jar %{_javadir}/vmware*.jar -%{_javadir}/%{name}-jnetpcap.jar -%{_javadir}/%{name}-junit.jar -%{_javadir}/%{name}-jasypt-1.8.jar -%{_javadir}/%{name}-commons-configuration-1.8.jar -%{_javadir}/%{name}-commons-lang-2.6.jar -%{_javadir}/%{name}-ejb-api-3.0.jar -%{_javadir}/%{name}-javax.persistence-2.0.0.jar +%{_javadir}/jasypt-1.*.jar +%{_javadir}/commons-configuration-1.8.jar +%{_javadir}/commons-lang-2.6.jar +%{_javadir}/ejb-api-3.0.jar %files core @@ -552,6 +550,7 @@ fi %files agent-libs %defattr(0644,root,root,0755) %{_javadir}/%{name}-agent.jar +%{_javadir}/%{name}-plugin-hypervisor-kvm.jar %files agent %defattr(0644,root,root,0755) @@ -589,7 +588,7 @@ fi %defattr(0644,cloud,cloud,0755) %{_datadir}/cloud/bridge/conf/* %{_datadir}/cloud/bridge/lib/* -%{_datadir}/cloud/bridge/webapps/* +%{_datadir}/cloud/bridge/webapps7080/* %attr(0644,root,root) %{_datadir}/cloud/setup/bridge/db/* %attr(0755,root,root) %{_bindir}/cloudstack-aws-api-register %attr(0755,root,root) %{_bindir}/cloud-setup-bridge diff --git a/console-proxy/pom.xml b/console-proxy/pom.xml index 5dca6e7ec21..070beb8f528 100644 --- a/console-proxy/pom.xml +++ b/console-proxy/pom.xml @@ -17,35 +17,158 @@ under the License. --> - 4.0.0 - cloud-console-proxy - Apache CloudStack Console Proxy - - com.cloud - cloud-parent - 4.0.0-SNAPSHOT - ../parent/pom.xml - - - - log4j - log4j - ${cs.log4j.version} - - - com.google.code.gson - gson - ${cs.gson.version} - - - commons-codec - commons-codec - ${cs.codec.version} - - - - install - src - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-console-proxy + Apache CloudStack Console Proxy + + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + + + + log4j + log4j + ${cs.log4j.version} + + + com.google.code.gson + gson + ${cs.gson.version} + + + commons-codec + commons-codec + ${cs.codec.version} + + + + org.apache.cloudstack + cloud-core + ${project.version} + + + org.apache.cloudstack + cloud-vmware-base + ${project.version} + + + org.apache.cloudstack + cloud-agent + ${project.version} + + + org.apache.cloudstack + cloud-api + ${project.version} + + + org.apache.cloudstack + cloud-utils + ${project.version} + + + org.apache.cloudstack + cloud-patches + ${project.version} + + + + install + src + + + certs + + realhostip.csr + + + + + + maven-assembly-plugin + 2.3 + + systemvm + false + + systemvm-descriptor.xml + + + + + make-systemvm + package + + single + + + + + + maven-resources-plugin + 2.6 + + + copy-resources + + package + + copy-resources + + + dist + + + target + + systemvm.zip + + + + ../patches/target/ + + cloud-scripts.tar.gz + + + + ../patches/systemvm/debian/config/root/.ssh + + authorized_keys + + + + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + package + + exec + + + + + mkisofs + dist + + -quiet + -r + -o + systemvm.iso + systemvm.zip + cloud-scripts.tar.gz + authorized_keys + + + + + diff --git a/console-proxy/src/com/cloud/consoleproxy/AjaxFIFOImageCache.java b/console-proxy/src/com/cloud/consoleproxy/AjaxFIFOImageCache.java index c9b5b60f605..a745d0d9e81 100644 --- a/console-proxy/src/com/cloud/consoleproxy/AjaxFIFOImageCache.java +++ b/console-proxy/src/com/cloud/consoleproxy/AjaxFIFOImageCache.java @@ -29,7 +29,7 @@ public class AjaxFIFOImageCache { private List fifoQueue; private Map cache; private int cacheSize; - private int nextKey = 1; + private int nextKey = 0; public AjaxFIFOImageCache(int cacheSize) { this.cacheSize = cacheSize; @@ -61,20 +61,23 @@ public class AjaxFIFOImageCache { return key; } - public synchronized byte[] getImage(int key) { - if(cache.containsKey(key)) { - if(s_logger.isTraceEnabled()) - s_logger.trace("Retrieve image from cache, key: " + key); - - return cache.get(key); - } - - if(s_logger.isTraceEnabled()) - s_logger.trace("Image is no long in cache, key: " + key); - return null; - } - - public synchronized int getNextKey() { - return nextKey++; - } -} + public synchronized byte[] getImage(int key) { + if (key == 0) { + key = nextKey; + } + if (cache.containsKey(key)) { + if (s_logger.isTraceEnabled()) + s_logger.trace("Retrieve image from cache, key: " + key); + + return cache.get(key); + } + + if (s_logger.isTraceEnabled()) + s_logger.trace("Image is no long in cache, key: " + key); + return null; + } + + public synchronized int getNextKey() { + return ++nextKey; + } +} \ No newline at end of file diff --git a/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyAjaxImageHandler.java b/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyAjaxImageHandler.java index 1fdda2ea65a..9c0094839cf 100644 --- a/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyAjaxImageHandler.java +++ b/console-proxy/src/com/cloud/consoleproxy/ConsoleProxyAjaxImageHandler.java @@ -16,6 +16,10 @@ // under the License. package com.cloud.consoleproxy; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.Map; @@ -65,7 +69,14 @@ public class ConsoleProxyAjaxImageHandler implements HttpHandler { String tag = queryMap.get("tag"); String ticket = queryMap.get("ticket"); String keyStr = queryMap.get("key"); - int key = 0; + String console_url = queryMap.get("consoleurl"); + String console_host_session = queryMap.get("sessionref"); + String w = queryMap.get("w"); + String h = queryMap.get("h"); + + int key = 0; + int width = 144; + int height = 110; if(tag == null) tag = ""; @@ -81,9 +92,16 @@ public class ConsoleProxyAjaxImageHandler implements HttpHandler { throw new IllegalArgumentException(e); } - try { - key = Integer.parseInt(keyStr); - } catch (NumberFormatException e) { + try { + if (keyStr != null) + key = Integer.parseInt(keyStr); + if(null != w) + width = Integer.parseInt(w); + + if(null != h) + height = Integer.parseInt(h); + + } catch (NumberFormatException e) { s_logger.warn("Invalid numeric parameter in query string: " + keyStr); throw new IllegalArgumentException(e); } @@ -94,23 +112,48 @@ public class ConsoleProxyAjaxImageHandler implements HttpHandler { param.setClientHostPassword(sid); param.setClientTag(tag); param.setTicket(ticket); - ConsoleProxyClient viewer = ConsoleProxy.getVncViewer(param); - byte[] img = viewer.getAjaxImageCache().getImage(key); - if(img != null) { - Headers hds = t.getResponseHeaders(); - hds.set("Content-Type", "image/jpeg"); - t.sendResponseHeaders(200, img.length); - - OutputStream os = t.getResponseBody(); - try { - os.write(img, 0, img.length); - } finally { - os.close(); - } - } else { - if(s_logger.isInfoEnabled()) - s_logger.info("Image has already been swept out, key: " + key); - t.sendResponseHeaders(404, -1); + param.setClientTunnelUrl(console_url); + param.setClientTunnelSession(console_host_session); + + ConsoleProxyClient viewer = ConsoleProxy.getVncViewer(param); + + if (key == 0) { + Image scaledImage = viewer.getClientScaledImage(width, height); + BufferedImage bufferedImage = new BufferedImage(width, height, + BufferedImage.TYPE_3BYTE_BGR); + Graphics2D bufImageGraphics = bufferedImage.createGraphics(); + bufImageGraphics.drawImage(scaledImage, 0, 0, null); + ByteArrayOutputStream bos = new ByteArrayOutputStream(8196); + javax.imageio.ImageIO.write(bufferedImage, "jpg", bos); + byte[] bs = bos.toByteArray(); + Headers hds = t.getResponseHeaders(); + hds.set("Content-Type", "image/jpeg"); + hds.set("Cache-Control", "no-cache"); + hds.set("Cache-Control", "no-store"); + t.sendResponseHeaders(200, bs.length); + OutputStream os = t.getResponseBody(); + os.write(bs); + os.close(); + } else { + AjaxFIFOImageCache imageCache = viewer.getAjaxImageCache(); + byte[] img = imageCache.getImage(key); + + if(img != null) { + Headers hds = t.getResponseHeaders(); + hds.set("Content-Type", "image/jpeg"); + t.sendResponseHeaders(200, img.length); + + OutputStream os = t.getResponseBody(); + try { + os.write(img, 0, img.length); + } finally { + os.close(); + } + } else { + if(s_logger.isInfoEnabled()) + s_logger.info("Image has already been swept out, key: " + key); + t.sendResponseHeaders(404, -1); + } } } } diff --git a/console-proxy/systemvm-descriptor.xml b/console-proxy/systemvm-descriptor.xml new file mode 100644 index 00000000000..37a1ae9375e --- /dev/null +++ b/console-proxy/systemvm-descriptor.xml @@ -0,0 +1,94 @@ + + systemvm + + zip + + false + + + + + + + + ../scripts/storage/secondary/ + scripts/storage/secondary + 555 + 555 + + + ../scripts/storage/secondary/ + scripts/storage/secondary + 555 + 555 + + + scripts + + 555 + 555 + + + conf + conf + 555 + 555 + + log4j-cloud.xml + consoleproxy.properties + + + + ../console-proxy/images + images + 555 + 555 + + *.jpg + *.gif + *.png + *.cur + + + + ../console-proxy/js + js + 555 + 555 + + *.js + + + + ../console-proxy/ui + ui + 555 + 555 + + *.ftl + + + + ../console-proxy/css + css + 555 + 555 + + *.css + + + + ../console-proxy/certs + certs + 555 + 555 + + *.keystore + *.crt + *.key + + + + diff --git a/core/pom.xml b/core/pom.xml index 2ea1cc6f888..510cb04105e 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -17,48 +17,47 @@ under the License. --> - 4.0.0 - cloud-core - Apache CloudStack Core - - com.cloud - cloud-parent - 4.0.0-SNAPSHOT - ../parent/pom.xml - - - - com.cloud - cloud-api - ${project.version} - - - com.cloud - xapi - ${cs.xapi.version} - - - junit - junit - - - - - commons-httpclient - commons-httpclient - ${cs.httpclient.version} - - - commons-codec - commons-codec - - - - - - install - src - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-core + Apache CloudStack Core + + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + + + + org.apache.cloudstack + cloud-api + ${project.version} + + + org.apache.cloudstack + xapi + ${cs.xapi.version} + + + junit + junit + + + + + commons-httpclient + commons-httpclient + ${cs.httpclient.version} + + + commons-codec + commons-codec + + + + + + install + src + + diff --git a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java index 965dd63b452..f48e3f20b2a 100755 --- a/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java +++ b/core/src/com/cloud/agent/resource/virtualnetwork/VirtualRoutingResource.java @@ -61,14 +61,18 @@ import com.cloud.agent.api.routing.SetFirewallRulesAnswer; import com.cloud.agent.api.routing.SetFirewallRulesCommand; import com.cloud.agent.api.routing.SetPortForwardingRulesAnswer; import com.cloud.agent.api.routing.SetPortForwardingRulesCommand; +import com.cloud.agent.api.routing.SetPortForwardingRulesVpcCommand; import com.cloud.agent.api.routing.SetStaticNatRulesAnswer; import com.cloud.agent.api.routing.SetStaticNatRulesCommand; +import com.cloud.agent.api.routing.SetStaticRouteAnswer; +import com.cloud.agent.api.routing.SetStaticRouteCommand; import com.cloud.agent.api.routing.Site2SiteVpnCfgCommand; import com.cloud.agent.api.routing.VmDataCommand; import com.cloud.agent.api.routing.VpnUsersCfgCommand; import com.cloud.agent.api.to.IpAddressTO; import com.cloud.agent.api.to.PortForwardingRuleTO; import com.cloud.agent.api.to.StaticNatRuleTO; +import com.cloud.exception.InternalErrorException; import com.cloud.network.HAProxyConfigurator; import com.cloud.network.LoadBalancerConfigurator; import com.cloud.utils.NumbersUtil; @@ -109,11 +113,15 @@ public class VirtualRoutingResource implements Manager { public Answer executeRequest(final Command cmd) { try { - if (cmd instanceof SetPortForwardingRulesCommand ) { + if (cmd instanceof SetPortForwardingRulesVpcCommand ) { + return execute((SetPortForwardingRulesVpcCommand)cmd); + } else if (cmd instanceof SetPortForwardingRulesCommand){ return execute((SetPortForwardingRulesCommand)cmd); + } else if (cmd instanceof SetStaticRouteCommand){ + return execute((SetStaticRouteCommand)cmd); } else if (cmd instanceof SetStaticNatRulesCommand){ return execute((SetStaticNatRulesCommand)cmd); - }else if (cmd instanceof LoadBalancerConfigCommand) { + } else if (cmd instanceof LoadBalancerConfigCommand) { return execute((LoadBalancerConfigCommand)cmd); } else if (cmd instanceof IpAssocCommand) { return execute((IpAssocCommand)cmd); @@ -232,12 +240,11 @@ public class VirtualRoutingResource implements Manager { String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); String[] results = new String[cmd.getRules().length]; int i = 0; - boolean endResult = true; for (PortForwardingRuleTO rule : cmd.getRules()) { String result = null; final Script command = new Script(_firewallPath, _timeout, s_logger); - + command.add(routerIp); command.add(rule.revoked() ? "-D" : "-A"); command.add("-P ", rule.getProtocol().toLowerCase()); @@ -674,6 +681,132 @@ public class VirtualRoutingResource implements Manager { return command.execute(); } + public String assignGuestNetwork(final String dev, final String routerIP, + final String routerGIP, final String gateway, final String cidr, + final String netmask, final String dns, final String domainName){ + + String args = " -C"; + args += " -d " + dev; + args += " -i " + routerGIP; + args += " -g " + gateway; + args += " -m " + cidr; + args += " -n " + netmask; + if ( dns != null && !dns.isEmpty() ) { + args += " -s " + dns; + } + if ( domainName != null && !domainName.isEmpty() ) { + args += " -e " + domainName; + } + return routerProxy("vpc_guestnw.sh", routerIP, args); + } + + public String assignNetworkACL(final String routerIP, final String dev, + final String routerGIP, final String netmask, final String rule){ + String args = " -d " + dev; + args += " -i " + routerGIP; + args += " -m " + netmask; + args += " -a " + rule; + return routerProxy("vpc_acl.sh", routerIP, args); + } + + public String assignSourceNat(final String routerIP, final String pubIP, final String dev) { + String args = " -A "; + args += " -l "; + args += pubIP; + args += " -c "; + args += dev; + return routerProxy("vpc_snat.sh", routerIP, args); + } + + private SetPortForwardingRulesAnswer execute(SetPortForwardingRulesVpcCommand cmd) { + String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); + String[] results = new String[cmd.getRules().length]; + int i = 0; + + boolean endResult = true; + for (PortForwardingRuleTO rule : cmd.getRules()) { + String args = rule.revoked() ? " -D" : " -A"; + args += " -P " + rule.getProtocol().toLowerCase(); + args += " -l " + rule.getSrcIp(); + args += " -p " + rule.getStringSrcPortRange(); + args += " -r " + rule.getDstIp(); + args += " -d " + rule.getStringDstPortRange().replace(":", "-"); + + String result = routerProxy("vpc_portforwarding.sh", routerIp, args); + + if (result != null) { + results[i++] = "Failed"; + endResult = false; + } else { + results[i++] = null; + } + } + return new SetPortForwardingRulesAnswer(cmd, results, endResult); + } + + public void assignVpcIpToRouter(final String routerIP, final boolean add, final String pubIP, + final String nicname, final String gateway, final String netmask, final String subnet) throws Exception { + try { + String args = ""; + + if (add) { + args += " -A "; + } else { + args += " -D "; + } + + args += " -l "; + args += pubIP; + args += " -c "; + args += nicname; + args += " -g "; + args += gateway; + args += " -m "; + args += netmask; + args += " -n "; + args += subnet; + + String result = routerProxy("vpc_ipassoc.sh", routerIP, args); + if (result != null) { + throw new InternalErrorException("KVM plugin \"vpc_ipassoc\" failed:"+result); + } + } catch (Exception e) { + String msg = "Unable to assign public IP address due to " + e.toString(); + s_logger.warn(msg, e); + throw new Exception(msg); + } + } + + private SetStaticRouteAnswer execute(SetStaticRouteCommand cmd) { + String routerIP = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); + try { + String[] results = new String[cmd.getStaticRoutes().length]; + String [][] rules = cmd.generateSRouteRules(); + StringBuilder sb = new StringBuilder(); + String[] srRules = rules[0]; + + for (int i = 0; i < srRules.length; i++) { + sb.append(srRules[i]).append(','); + } + + String args = " -a " + sb.toString(); + String result = routerProxy("vpc_staticroute.sh", routerIP, args); + + if (result != null) { + for (int i=0; i < results.length; i++) { + results[i] = "Failed"; + } + return new SetStaticRouteAnswer(cmd, false, results); + } + + return new SetStaticRouteAnswer(cmd, true, results); + } catch (Exception e) { + String msg = "SetStaticRoute failed due to " + e.toString(); + s_logger.error(msg, e); + return new SetStaticRouteAnswer(cmd, false, null); + } + } + public String assignPublicIpAddress(final String vmName, final String privateIpAddress, final String publicIpAddress, diff --git a/debian/cloud-deps.install b/debian/cloud-deps.install index 53e4f4a2583..e6ddde5bacb 100644 --- a/debian/cloud-deps.install +++ b/debian/cloud-deps.install @@ -27,7 +27,6 @@ /usr/share/java/cloud-log4j.jar /usr/share/java/cloud-trilead-ssh2-build213.jar /usr/share/java/cloud-cglib.jar -/usr/share/java/cloud-mysql-connector-java-5.1.7-bin.jar /usr/share/java/cloud-xenserver-5.6.100-1.jar /usr/share/java/cloud-xmlrpc-common-3.*.jar /usr/share/java/cloud-xmlrpc-client-3.*.jar diff --git a/debian/control b/debian/control index 1bc1848cf01..e730becef4a 100644 --- a/debian/control +++ b/debian/control @@ -86,7 +86,7 @@ Provides: vmops-client Conflicts: vmops-client Replaces: vmops-client Architecture: any -Depends: openjdk-6-jre, cloud-deps (= ${source:Version}), cloud-utils (= ${source:Version}), cloud-server (= ${source:Version}), cloud-client-ui (= ${source:Version}), cloud-setup (= ${source:Version}), cloud-python (= ${source:Version}), tomcat6, libws-commons-util-java, libcommons-dbcp-java, libcommons-collections-java, libcommons-httpclient-java, sysvinit-utils, chkconfig, sudo, jsvc, python-mysqldb, python-paramiko, augeas-tools, genisoimage, cloud-system-iso +Depends: openjdk-6-jre, cloud-deps (= ${source:Version}), cloud-utils (= ${source:Version}), cloud-server (= ${source:Version}), cloud-client-ui (= ${source:Version}), cloud-setup (= ${source:Version}), cloud-python (= ${source:Version}), tomcat6, libws-commons-util-java, libcommons-dbcp-java, libcommons-collections-java, libcommons-httpclient-java, sysvinit-utils, chkconfig, sudo, jsvc, python-mysqldb, python-paramiko, augeas-tools, genisoimage, cloud-system-iso, libmysql-java (>= 5.1) Description: CloudStack client The CloudStack management server is the central point of coordination, management, and intelligence in the CloudStack Cloud Stack. This package diff --git a/deps/XenServerJava/BSD b/deps/XenServerJava/BSD new file mode 100644 index 00000000000..634d6890be7 --- /dev/null +++ b/deps/XenServerJava/BSD @@ -0,0 +1,26 @@ +Copyright (c) Citrix Systems, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + 1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/XenServerJava/GPL-2 b/deps/XenServerJava/GPL-2 deleted file mode 100644 index d511905c164..00000000000 --- a/deps/XenServerJava/GPL-2 +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/deps/XenServerJava/LICENSE.Apache-2.0.txt b/deps/XenServerJava/LICENSE.Apache-2.0.txt index 29f81d812f3..261eeb9e9f8 100644 --- a/deps/XenServerJava/LICENSE.Apache-2.0.txt +++ b/deps/XenServerJava/LICENSE.Apache-2.0.txt @@ -1,201 +1,201 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. diff --git a/deps/XenServerJava/LICENSE.txt b/deps/XenServerJava/LICENSE.txt index 5d5f07c5259..76c4a2240fa 100644 --- a/deps/XenServerJava/LICENSE.txt +++ b/deps/XenServerJava/LICENSE.txt @@ -1,35 +1,26 @@ -Copyright (c) 2006-2010 Citrix Systems, Inc. +Copyright (c) Citrix Systems, Inc. +All rights reserved. -This library is free software; you can redistribute it and/or modify it under -the terms of version 2 of the GNU General Public License as published by the -Free Software Foundation, with the additional linking exception as follows: +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: - Linking this library statically or dynamically with other modules is - making a combined work based on this library. Thus, the terms and - conditions of the GNU General Public License cover the whole combination. + 1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - As a special exception, the copyright holders of this library give you - permission to link this library with independent modules to produce an - executable, regardless of the license terms of these independent modules, - and to copy and distribute the resulting executable under terms of your - choice, provided that you also meet, for each linked independent module, - the terms and conditions of the license of that module. An independent - module is a module which is not derived from or based on this library. If - you modify this library, you may extend this exception to your version of - the library, but you are not obligated to do so. If you do not wish to do - so, delete this exception statement from your version. + 2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., 51 Franklin -Street, Fifth Floor, Boston, MA 02110-1301 USA. - - -This library may be accompanied by pedagogical examples. These do not form -part of this library, and are licensed for redistribution and modification -under less restrictive terms. Such examples are licensed clearly at the top -of each file. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/deps/XenServerJava/README.txt b/deps/XenServerJava/README.txt index feef8c6d667..a7cea3549c8 100644 --- a/deps/XenServerJava/README.txt +++ b/deps/XenServerJava/README.txt @@ -1,48 +1,46 @@ -XenServerJava -============= - -Version 5.6.100-1. - -XenServerJava is a complete SDK for Citrix XenServer, exposing the XenServer -API as Java classes. - -For XenServer documentation, see http://docs.xensource.com. -XenServerJava includes a class for every XenServer class, and a method for -each XenServer API call, so API documentation and examples written for -for other languages will apply equally well to Java. -In particular, the SDK Guide and API Documentation are ideal for developers -wishing to use XenServerJava. - -For community content, blogs, and downloads, visit the XenServer Developer -Network at http://community.citrix.com/cdn/xs. - -XenServerJava is free sofware. You can redistribute and modify it under the -terms of the GNU GPL version 2, with an additional linking exception that -allows its use unmodified within closed-source applications. See LICENSE.txt -for details. - -This library may be accompanied by pedagogical examples. These do not form -part of this library, and are licensed for redistribution and modification -under less restrictive terms. Such examples are licensed clearly at the top -of each file. - -XenServerJava is dependent upon Apache XML-RPC and WS-Commons, both by The -Apache Software Foundation. We would like to thank the ASF and the -Apache XML-RPC development team in particular. -Both are licensed under the Apache Software License 2.0; see -LICENSE.Apache-2.0.txt for details. - -We test with version 3.1 of Apache XML-RPC, and version 1.0.2 of WS-Commons. -We recommend that you use these versions, though others may work. - -Downloads ---------- - -XenServerJava is available in three separate archives, one for the compiled -binaries, one for the source code, and one containing sample code. - -All three archives are available from the XenServer Developer Network at -http://community.citrix.com/cdn/xs. - -Apache XML-RPC is available from http://ws.apache.org/xmlrpc/. -WS-Commons is available from http://ws.apache.org/commons/. +XenServerJava +============= + +Version 5.6.100-1. + +XenServerJava is a complete SDK for Citrix XenServer, exposing the XenServer +API as Java classes. + +For XenServer documentation, see http://docs.xensource.com. +XenServerJava includes a class for every XenServer class, and a method for +each XenServer API call, so API documentation and examples written for +for other languages will apply equally well to Java. +In particular, the SDK Guide and API Documentation are ideal for developers +wishing to use XenServerJava. + +For community content, blogs, and downloads, visit the XenServer Developer +Network at http://community.citrix.com/cdn/xs. + +XenServerJava is free sofware. You can redistribute and modify it under the +terms of the BSD 2-clause license. See LICENSE.txt for details. + +This library may be accompanied by pedagogical examples. These do not form +part of this library, and are licensed for redistribution and modification +under less restrictive terms. Such examples are licensed clearly at the top +of each file. + +XenServerJava is dependent upon Apache XML-RPC and WS-Commons, both by The +Apache Software Foundation. We would like to thank the ASF and the +Apache XML-RPC development team in particular. +Both are licensed under the Apache Software License 2.0; see +LICENSE.Apache-2.0.txt for details. + +We test with version 3.1 of Apache XML-RPC, and version 1.0.2 of WS-Commons. +We recommend that you use these versions, though others may work. + +Downloads +--------- + +XenServerJava is available in three separate archives, one for the compiled +binaries, one for the source code, and one containing sample code. + +All three archives are available from the XenServer Developer Network at +http://community.citrix.com/cdn/xs. + +Apache XML-RPC is available from http://ws.apache.org/xmlrpc/. +WS-Commons is available from http://ws.apache.org/commons/. diff --git a/deps/XenServerJava/pom.xml b/deps/XenServerJava/pom.xml index f60f1c8ef66..13375144534 100644 --- a/deps/XenServerJava/pom.xml +++ b/deps/XenServerJava/pom.xml @@ -17,27 +17,27 @@ under the License. --> - 4.0.0 - - cloud-parent - com.cloud - 4.0.0-SNAPSHOT - ../../parent/pom.xml - - xapi - 5.6.100-1-SNAPSHOT - XenSource XAPI - XenSource XAPI Java Bindings - - - org.apache.xmlrpc - xmlrpc-client - ${cs.xmlrpc.version} - - - - src - install - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + ../../pom.xml + + xapi + 5.6.100-1-SNAPSHOT + Apache XenSource XAPI + XenSource XAPI Java Bindings + + + org.apache.xmlrpc + xmlrpc-client + ${cs.xmlrpc.version} + + + + src + install + diff --git a/deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java b/deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java index c003fbc87f6..763b98f2260 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/APIVersion.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; public enum APIVersion diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Auth.java b/deps/XenServerJava/src/com/xensource/xenapi/Auth.java index 142be36e31c..1bf615e1ea4 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Auth.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Auth.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -92,4 +109,4 @@ public class Auth extends XenAPIObject { return Types.toSetOfString(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Blob.java b/deps/XenServerJava/src/com/xensource/xenapi/Blob.java index 9489d044f59..7d3ad582264 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Blob.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Blob.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -381,4 +398,4 @@ public class Blob extends XenAPIObject { return Types.toMapOfBlobBlobRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Bond.java b/deps/XenServerJava/src/com/xensource/xenapi/Bond.java index 171d8b190fd..ee67e3c49e0 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Bond.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Bond.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -373,4 +390,4 @@ public class Bond extends XenAPIObject { return Types.toMapOfBondBondRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Connection.java b/deps/XenServerJava/src/com/xensource/xenapi/Connection.java index c856a7a7001..6c205a2a605 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Connection.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Connection.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import java.net.URL; @@ -48,7 +65,7 @@ public class Connection public Boolean rioConnection = false; private APIVersion apiVersion; - + protected int _wait = 600; /** @@ -256,7 +273,7 @@ public class Connection { return config; } - protected XmlRpcClient getClientFromURL(URL url) + private XmlRpcClient getClientFromURL(URL url) { config.setTimeZone(TimeZone.getTimeZone("UTC")); config.setServerURL(url); diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Console.java b/deps/XenServerJava/src/com/xensource/xenapi/Console.java index 04909e537aa..e73e685a468 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Console.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Console.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -394,4 +411,4 @@ public class Console extends XenAPIObject { return Types.toMapOfConsoleConsoleRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Crashdump.java b/deps/XenServerJava/src/com/xensource/xenapi/Crashdump.java index 8dab0adf4c5..31cf4180c9f 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Crashdump.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Crashdump.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -333,4 +350,4 @@ public class Crashdump extends XenAPIObject { return Types.toMapOfCrashdumpCrashdumpRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/DataSource.java b/deps/XenServerJava/src/com/xensource/xenapi/DataSource.java index e623c10b725..aebe39b7b1e 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/DataSource.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/DataSource.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -139,4 +156,4 @@ public class DataSource extends XenAPIObject { public Double value; } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Event.java b/deps/XenServerJava/src/com/xensource/xenapi/Event.java index 46e2d6c646f..36ebf457abf 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Event.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Event.java @@ -1,29 +1,48 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; +import com.xensource.xenapi.Types.BadServerResponse; +import com.xensource.xenapi.Types.VersionException; +import com.xensource.xenapi.Types.XenAPIException; + import java.io.PrintWriter; import java.io.StringWriter; import java.util.Date; import java.util.HashMap; +import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import org.apache.xmlrpc.XmlRpcException; -import com.xensource.xenapi.Types.BadServerResponse; -import com.xensource.xenapi.Types.XenAPIException; - /** * Asynchronous event registration and handling * @@ -43,7 +62,6 @@ public class Event extends XenAPIObject { this.ref = ref; } - @Override public String toWireString() { return this.ref; } @@ -74,7 +92,6 @@ public class Event extends XenAPIObject { * Represents all the fields in a Event */ public static class Record implements Types.Record { - @Override public String toString() { StringWriter writer = new StringWriter(); PrintWriter print = new PrintWriter(writer); @@ -91,7 +108,6 @@ public class Event extends XenAPIObject { /** * Convert a event.Record to a Map */ - @Override public Map toMap() { Map map = new HashMap(); map.put("id", this.id == null ? 0 : this.id); @@ -239,4 +255,4 @@ public class Event extends XenAPIObject { return Types.toLong(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Host.java b/deps/XenServerJava/src/com/xensource/xenapi/Host.java index a80af94214b..d17609838cb 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Host.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Host.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -2749,4 +2766,4 @@ public class Host extends XenAPIObject { return Types.toMapOfHostHostRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostCpu.java b/deps/XenServerJava/src/com/xensource/xenapi/HostCpu.java index f73b583b1e7..7c7809e0897 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/HostCpu.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/HostCpu.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -511,4 +528,4 @@ public class HostCpu extends XenAPIObject { return Types.toMapOfHostCpuHostCpuRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostCrashdump.java b/deps/XenServerJava/src/com/xensource/xenapi/HostCrashdump.java index a465e4d2c12..b166073185d 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/HostCrashdump.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/HostCrashdump.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -392,4 +409,4 @@ public class HostCrashdump extends XenAPIObject { return Types.toMapOfHostCrashdumpHostCrashdumpRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/HostMetrics.java index d7e447f0698..2a682c806d5 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/HostMetrics.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/HostMetrics.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -348,4 +365,4 @@ public class HostMetrics extends XenAPIObject { return Types.toMapOfHostMetricsHostMetricsRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/HostPatch.java b/deps/XenServerJava/src/com/xensource/xenapi/HostPatch.java index 889a5c58fd7..b871ed90c85 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/HostPatch.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/HostPatch.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -527,4 +544,4 @@ public class HostPatch extends XenAPIObject { return Types.toMapOfHostPatchHostPatchRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Message.java b/deps/XenServerJava/src/com/xensource/xenapi/Message.java index 927ca5c7205..d7b50360699 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Message.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Message.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -295,4 +312,4 @@ public class Message extends XenAPIObject { return Types.toMapOfMessageMessageRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Network.java b/deps/XenServerJava/src/com/xensource/xenapi/Network.java index a013c89dd92..7b1282d5ffc 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Network.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Network.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -707,4 +724,4 @@ public class Network extends XenAPIObject { return Types.toMapOfNetworkNetworkRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/PBD.java b/deps/XenServerJava/src/com/xensource/xenapi/PBD.java index af9e732b70e..0a1e60d354a 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/PBD.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/PBD.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -517,4 +534,4 @@ public class PBD extends XenAPIObject { return Types.toMapOfPBDPBDRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/PIF.java b/deps/XenServerJava/src/com/xensource/xenapi/PIF.java index e23e9428c02..bb0629446a6 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/PIF.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/PIF.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -1211,4 +1228,4 @@ public class PIF extends XenAPIObject { return Types.toMapOfPIFPIFRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/PIFMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/PIFMetrics.java index e3b9eca7f68..34417d3cea3 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/PIFMetrics.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/PIFMetrics.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -508,4 +525,4 @@ public class PIFMetrics extends XenAPIObject { return Types.toMapOfPIFMetricsPIFMetricsRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Pool.java b/deps/XenServerJava/src/com/xensource/xenapi/Pool.java index 1ace8bfe82b..1b06094afe3 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Pool.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Pool.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -2274,4 +2291,4 @@ public class Pool extends XenAPIObject { return Types.toMapOfPoolPoolRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/PoolPatch.java b/deps/XenServerJava/src/com/xensource/xenapi/PoolPatch.java index 2d2649fbfb3..b2740247838 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/PoolPatch.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/PoolPatch.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -602,4 +619,4 @@ public class PoolPatch extends XenAPIObject { return Types.toMapOfPoolPatchPoolPatchRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Role.java b/deps/XenServerJava/src/com/xensource/xenapi/Role.java index e0ac9de5061..c64d18fae3f 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Role.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Role.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -339,4 +356,4 @@ public class Role extends XenAPIObject { return Types.toMapOfRoleRoleRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/SM.java b/deps/XenServerJava/src/com/xensource/xenapi/SM.java index c138ac551d3..12b6a821abb 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/SM.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/SM.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -503,4 +520,4 @@ public class SM extends XenAPIObject { return Types.toMapOfSMSMRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/SR.java b/deps/XenServerJava/src/com/xensource/xenapi/SR.java index 114a66a555a..0f64aa58ca2 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/SR.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/SR.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -1457,4 +1474,4 @@ public class SR extends XenAPIObject { return Types.toMapOfSRSRRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Secret.java b/deps/XenServerJava/src/com/xensource/xenapi/Secret.java index 9e692d61ccb..3a211a050a7 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Secret.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Secret.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -292,4 +309,4 @@ public class Secret extends XenAPIObject { return Types.toMapOfSecretSecretRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Session.java b/deps/XenServerJava/src/com/xensource/xenapi/Session.java index 042ed1a3b4b..9be3388304b 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Session.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Session.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -650,4 +667,4 @@ public class Session extends XenAPIObject { return; } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Subject.java b/deps/XenServerJava/src/com/xensource/xenapi/Subject.java index cbba9a4fc10..e760a5f751e 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Subject.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Subject.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -371,4 +388,4 @@ public class Subject extends XenAPIObject { return Types.toMapOfSubjectSubjectRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Task.java b/deps/XenServerJava/src/com/xensource/xenapi/Task.java index ee688c7202b..884b283a91f 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Task.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Task.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -663,4 +680,4 @@ public class Task extends XenAPIObject { return Types.toMapOfTaskTaskRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java b/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java index 660eafbf73c..17475238ed4 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Tunnel.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -449,4 +466,4 @@ public class Tunnel extends XenAPIObject { return Types.toMapOfTunnelTunnelRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/Types.java b/deps/XenServerJava/src/com/xensource/xenapi/Types.java index 2e9f699b6b8..31ac11a09eb 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/Types.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/Types.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import java.util.Date; @@ -1685,6 +1702,11 @@ public class Types { throw new Types.ImportErrorCannotHandleChunked(); } + if (ErrorDescription[0].equals("VM_ATTACHED_TO_MORE_THAN_ONE_VDI_WITH_TIMEOFFSET_MARKED_AS_RESET_ON_BOOT")) + { + String p1 = ErrorDescription.length > 1 ? ErrorDescription[1] : ""; + throw new Types.VmAttachedToMoreThanOneVdiWithTimeoffsetMarkedAsResetOnBoot(p1); + } if (ErrorDescription[0].equals("NOT_SUPPORTED_DURING_UPGRADE")) { throw new Types.NotSupportedDuringUpgrade(); @@ -2304,11 +2326,11 @@ public class Types */ UNRECOGNIZED, /** - * The VDI will be reset to the state it was in at the last clone + * When a VM containing this VDI is started, the contents of the VDI are reset to the state they were in when this flag was last set. */ RESET, /** - * The VDIs contents are persistent + * Standard behaviour. */ PERSIST }; @@ -8023,6 +8045,24 @@ public class Types } + /** + * You attempted to start a VM that's attached to more than one VDI with a timeoffset marked as reset-on-boot. + */ + public static class VmAttachedToMoreThanOneVdiWithTimeoffsetMarkedAsResetOnBoot extends XenAPIException { + public final String vm; + + /** + * Create a new VmAttachedToMoreThanOneVdiWithTimeoffsetMarkedAsResetOnBoot + * + * @param vm + */ + public VmAttachedToMoreThanOneVdiWithTimeoffsetMarkedAsResetOnBoot(String vm) { + super("You attempted to start a VM that's attached to more than one VDI with a timeoffset marked as reset-on-boot."); + this.vm = vm; + } + + } + /** * This operation is not supported during an upgrade */ diff --git a/deps/XenServerJava/src/com/xensource/xenapi/User.java b/deps/XenServerJava/src/com/xensource/xenapi/User.java index 0c107b92514..9cf239d60ee 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/User.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/User.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -359,4 +376,4 @@ public class User extends XenAPIObject { return; } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VBD.java b/deps/XenServerJava/src/com/xensource/xenapi/VBD.java index d644688d391..cb793398ee3 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/VBD.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/VBD.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -1136,4 +1153,4 @@ public class VBD extends XenAPIObject { return Types.toMapOfVBDVBDRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VBDMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/VBDMetrics.java index 245e48806ee..59928e9bd59 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/VBDMetrics.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/VBDMetrics.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -324,4 +341,4 @@ public class VBDMetrics extends XenAPIObject { return Types.toMapOfVBDMetricsVBDMetricsRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VDI.java b/deps/XenServerJava/src/com/xensource/xenapi/VDI.java index 99ab210defe..e4d20ebf8ba 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/VDI.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/VDI.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -1693,6 +1710,74 @@ public class VDI extends XenAPIObject { return; } + /** + * Set the value of the on_boot parameter. This value can only be changed when the VDI is not attached to a running VM. + * + * @param value The value to set + * @return Task + */ + public Task setOnBootAsync(Connection c, Types.OnBoot value) throws + BadServerResponse, + XenAPIException, + XmlRpcException { + String method_call = "Async.VDI.set_on_boot"; + String session = c.getSessionReference(); + Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)}; + Map response = c.dispatch(method_call, method_params); + Object result = response.get("Value"); + return Types.toTask(result); + } + + /** + * Set the value of the on_boot parameter. This value can only be changed when the VDI is not attached to a running VM. + * + * @param value The value to set + */ + public void setOnBoot(Connection c, Types.OnBoot value) throws + BadServerResponse, + XenAPIException, + XmlRpcException { + String method_call = "VDI.set_on_boot"; + String session = c.getSessionReference(); + Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)}; + Map response = c.dispatch(method_call, method_params); + return; + } + + /** + * Set the value of the allow_caching parameter. This value can only be changed when the VDI is not attached to a running VM. The caching behaviour is only affected by this flag for VHD-based VDIs that have one parent and no child VHDs. Moreover, caching only takes place when the host running the VM containing this VDI has a nominated SR for local caching. + * + * @param value The value to set + * @return Task + */ + public Task setAllowCachingAsync(Connection c, Boolean value) throws + BadServerResponse, + XenAPIException, + XmlRpcException { + String method_call = "Async.VDI.set_allow_caching"; + String session = c.getSessionReference(); + Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)}; + Map response = c.dispatch(method_call, method_params); + Object result = response.get("Value"); + return Types.toTask(result); + } + + /** + * Set the value of the allow_caching parameter. This value can only be changed when the VDI is not attached to a running VM. The caching behaviour is only affected by this flag for VHD-based VDIs that have one parent and no child VHDs. Moreover, caching only takes place when the host running the VM containing this VDI has a nominated SR for local caching. + * + * @param value The value to set + */ + public void setAllowCaching(Connection c, Boolean value) throws + BadServerResponse, + XenAPIException, + XmlRpcException { + String method_call = "VDI.set_allow_caching"; + String session = c.getSessionReference(); + Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(value)}; + Map response = c.dispatch(method_call, method_params); + return; + } + /** * Return a list of all the VDIs known to the system. * @@ -1727,4 +1812,4 @@ public class VDI extends XenAPIObject { return Types.toMapOfVDIVDIRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VIF.java b/deps/XenServerJava/src/com/xensource/xenapi/VIF.java index 25323de0205..4ba78076b15 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/VIF.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/VIF.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -822,4 +839,4 @@ public class VIF extends XenAPIObject { return Types.toMapOfVIFVIFRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VIFMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/VIFMetrics.java index 565747f7fe1..6c0212fcaa3 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/VIFMetrics.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/VIFMetrics.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -324,4 +341,4 @@ public class VIFMetrics extends XenAPIObject { return Types.toMapOfVIFMetricsVIFMetricsRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VLAN.java b/deps/XenServerJava/src/com/xensource/xenapi/VLAN.java index 5429077bd61..b8c968b1df3 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/VLAN.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/VLAN.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -396,4 +413,4 @@ public class VLAN extends XenAPIObject { return Types.toMapOfVLANVLANRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VM.java b/deps/XenServerJava/src/com/xensource/xenapi/VM.java index 1b26d974524..165dcfab4a3 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/VM.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/VM.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -4250,4 +4267,4 @@ public class VM extends XenAPIObject { return Types.toMapOfVMVMRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VMGuestMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/VMGuestMetrics.java index 12dd26a87ea..8b27955df87 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/VMGuestMetrics.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/VMGuestMetrics.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -462,4 +479,4 @@ public class VMGuestMetrics extends XenAPIObject { return Types.toMapOfVMGuestMetricsVMGuestMetricsRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VMMetrics.java b/deps/XenServerJava/src/com/xensource/xenapi/VMMetrics.java index 47634e9a10e..c2d35b35afa 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/VMMetrics.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/VMMetrics.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -485,4 +502,4 @@ public class VMMetrics extends XenAPIObject { return Types.toMapOfVMMetricsVMMetricsRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VMPP.java b/deps/XenServerJava/src/com/xensource/xenapi/VMPP.java index 5df76ad51ff..aeb0d03fdbe 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/VMPP.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/VMPP.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -1133,4 +1150,4 @@ public class VMPP extends XenAPIObject { return Types.toMapOfVMPPVMPPRecord(result); } -} \ No newline at end of file +} diff --git a/deps/XenServerJava/src/com/xensource/xenapi/VTPM.java b/deps/XenServerJava/src/com/xensource/xenapi/VTPM.java index a443d5194ff..c82fa3f4606 100644 --- a/deps/XenServerJava/src/com/xensource/xenapi/VTPM.java +++ b/deps/XenServerJava/src/com/xensource/xenapi/VTPM.java @@ -1,15 +1,32 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +/* Copyright (c) Citrix Systems, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + */ + package com.xensource.xenapi; import com.xensource.xenapi.Types.BadServerResponse; @@ -265,4 +282,4 @@ public class VTPM extends XenAPIObject { return Types.toVM(result); } -} \ No newline at end of file +} diff --git a/deps/awsapi-lib/XmlSchema-1.4.3.jar b/deps/awsapi-lib/XmlSchema-1.4.3.jar deleted file mode 100644 index 656eceddf24..00000000000 Binary files a/deps/awsapi-lib/XmlSchema-1.4.3.jar and /dev/null differ diff --git a/deps/awsapi-lib/antlr-2.7.6.jar b/deps/awsapi-lib/antlr-2.7.6.jar deleted file mode 100644 index 3702b645fc7..00000000000 Binary files a/deps/awsapi-lib/antlr-2.7.6.jar and /dev/null differ diff --git a/deps/awsapi-lib/apache-log4j-extras-1.0.jar b/deps/awsapi-lib/apache-log4j-extras-1.0.jar deleted file mode 100644 index c2a866db405..00000000000 Binary files a/deps/awsapi-lib/apache-log4j-extras-1.0.jar and /dev/null differ diff --git a/deps/awsapi-lib/axiom-api-1.2.8.jar b/deps/awsapi-lib/axiom-api-1.2.8.jar deleted file mode 100644 index 81c07e309a5..00000000000 Binary files a/deps/awsapi-lib/axiom-api-1.2.8.jar and /dev/null differ diff --git a/deps/awsapi-lib/axiom-impl-1.2.8.jar b/deps/awsapi-lib/axiom-impl-1.2.8.jar deleted file mode 100644 index d6044768e7d..00000000000 Binary files a/deps/awsapi-lib/axiom-impl-1.2.8.jar and /dev/null differ diff --git a/deps/awsapi-lib/axis2-1.5.1.jar b/deps/awsapi-lib/axis2-1.5.1.jar deleted file mode 100644 index d8594538bbd..00000000000 Binary files a/deps/awsapi-lib/axis2-1.5.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/axis2-adb-1.5.1.jar b/deps/awsapi-lib/axis2-adb-1.5.1.jar deleted file mode 100644 index 5f5d1ecdb04..00000000000 Binary files a/deps/awsapi-lib/axis2-adb-1.5.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/axis2-ant-plugin-1.5.1.jar b/deps/awsapi-lib/axis2-ant-plugin-1.5.1.jar deleted file mode 100644 index 067d74befe7..00000000000 Binary files a/deps/awsapi-lib/axis2-ant-plugin-1.5.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/axis2-jaxbri-1.5.1.jar b/deps/awsapi-lib/axis2-jaxbri-1.5.1.jar deleted file mode 100644 index c9076248122..00000000000 Binary files a/deps/awsapi-lib/axis2-jaxbri-1.5.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/axis2-jaxws-1.5.1.jar b/deps/awsapi-lib/axis2-jaxws-1.5.1.jar deleted file mode 100644 index 57bb074168c..00000000000 Binary files a/deps/awsapi-lib/axis2-jaxws-1.5.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/axis2-jibx-1.5.1.jar b/deps/awsapi-lib/axis2-jibx-1.5.1.jar deleted file mode 100644 index a0412abeca7..00000000000 Binary files a/deps/awsapi-lib/axis2-jibx-1.5.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/axis2-json-1.5.1.jar b/deps/awsapi-lib/axis2-json-1.5.1.jar deleted file mode 100644 index a576ed6d20d..00000000000 Binary files a/deps/awsapi-lib/axis2-json-1.5.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/axis2-kernel-1.5.1.jar b/deps/awsapi-lib/axis2-kernel-1.5.1.jar deleted file mode 100644 index 13c4c029b2e..00000000000 Binary files a/deps/awsapi-lib/axis2-kernel-1.5.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/axis2-transport-http-1.5.1.jar b/deps/awsapi-lib/axis2-transport-http-1.5.1.jar deleted file mode 100644 index 72b27b4622c..00000000000 Binary files a/deps/awsapi-lib/axis2-transport-http-1.5.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/axis2-transport-local-1.5.1.jar b/deps/awsapi-lib/axis2-transport-local-1.5.1.jar deleted file mode 100644 index 027c00583be..00000000000 Binary files a/deps/awsapi-lib/axis2-transport-local-1.5.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/c3p0-0.9.1.2.jar b/deps/awsapi-lib/c3p0-0.9.1.2.jar deleted file mode 100644 index 0f42d60e316..00000000000 Binary files a/deps/awsapi-lib/c3p0-0.9.1.2.jar and /dev/null differ diff --git a/deps/awsapi-lib/cloud-cglib.jar b/deps/awsapi-lib/cloud-cglib.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/deps/awsapi-lib/cloud-commons-dbcp-1.4.jar b/deps/awsapi-lib/cloud-commons-dbcp-1.4.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/deps/awsapi-lib/cloud-commons-pool-1.5.6.jar b/deps/awsapi-lib/cloud-commons-pool-1.5.6.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/deps/awsapi-lib/cloud-ehcache.jar b/deps/awsapi-lib/cloud-ehcache.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/deps/awsapi-lib/cloud-gson.jar b/deps/awsapi-lib/cloud-gson.jar deleted file mode 100644 index e59483bbba6..00000000000 Binary files a/deps/awsapi-lib/cloud-gson.jar and /dev/null differ diff --git a/deps/awsapi-lib/cloud-javax.persistence-2.0.0.jar b/deps/awsapi-lib/cloud-javax.persistence-2.0.0.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/deps/awsapi-lib/cloud-utils.jar b/deps/awsapi-lib/cloud-utils.jar new file mode 100644 index 00000000000..e69de29bb2d diff --git a/deps/awsapi-lib/commons-codec-1.4.jar b/deps/awsapi-lib/commons-codec-1.4.jar deleted file mode 100644 index 458d432da88..00000000000 Binary files a/deps/awsapi-lib/commons-codec-1.4.jar and /dev/null differ diff --git a/deps/awsapi-lib/commons-collections-3.1.jar b/deps/awsapi-lib/commons-collections-3.1.jar deleted file mode 100644 index 41e230feeaa..00000000000 Binary files a/deps/awsapi-lib/commons-collections-3.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/commons-fileupload-1.2.jar b/deps/awsapi-lib/commons-fileupload-1.2.jar deleted file mode 100644 index 12539f5edb0..00000000000 Binary files a/deps/awsapi-lib/commons-fileupload-1.2.jar and /dev/null differ diff --git a/deps/awsapi-lib/commons-httpclient-3.1.jar b/deps/awsapi-lib/commons-httpclient-3.1.jar deleted file mode 100644 index 7c59774aed4..00000000000 Binary files a/deps/awsapi-lib/commons-httpclient-3.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/commons-io-1.4.jar b/deps/awsapi-lib/commons-io-1.4.jar deleted file mode 100644 index 133dc6cb35f..00000000000 Binary files a/deps/awsapi-lib/commons-io-1.4.jar and /dev/null differ diff --git a/deps/awsapi-lib/commons-logging-1.1.1.jar b/deps/awsapi-lib/commons-logging-1.1.1.jar deleted file mode 100644 index 1deef144cb1..00000000000 Binary files a/deps/awsapi-lib/commons-logging-1.1.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/dom4j-1.6.1.jar b/deps/awsapi-lib/dom4j-1.6.1.jar deleted file mode 100644 index c8c4dbb92d6..00000000000 Binary files a/deps/awsapi-lib/dom4j-1.6.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/hibernate3.jar b/deps/awsapi-lib/hibernate3.jar deleted file mode 100644 index 33755a45fa8..00000000000 Binary files a/deps/awsapi-lib/hibernate3.jar and /dev/null differ diff --git a/deps/awsapi-lib/httpcore-4.0.jar b/deps/awsapi-lib/httpcore-4.0.jar deleted file mode 100644 index 37eb7d4d2b9..00000000000 Binary files a/deps/awsapi-lib/httpcore-4.0.jar and /dev/null differ diff --git a/deps/awsapi-lib/javassist-3.9.0.GA.jar b/deps/awsapi-lib/javassist-3.9.0.GA.jar deleted file mode 100644 index 0316422e7f2..00000000000 Binary files a/deps/awsapi-lib/javassist-3.9.0.GA.jar and /dev/null differ diff --git a/deps/awsapi-lib/jaxb-api-2.1.jar b/deps/awsapi-lib/jaxb-api-2.1.jar deleted file mode 100644 index be3d6dca2fb..00000000000 Binary files a/deps/awsapi-lib/jaxb-api-2.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/jaxb-impl-2.1.7.jar b/deps/awsapi-lib/jaxb-impl-2.1.7.jar deleted file mode 100644 index 034c158670b..00000000000 Binary files a/deps/awsapi-lib/jaxb-impl-2.1.7.jar and /dev/null differ diff --git a/deps/awsapi-lib/jaxb-xjc-2.1.7.jar b/deps/awsapi-lib/jaxb-xjc-2.1.7.jar deleted file mode 100644 index ba2ec468ed9..00000000000 Binary files a/deps/awsapi-lib/jaxb-xjc-2.1.7.jar and /dev/null differ diff --git a/deps/awsapi-lib/jsch-0.1.42.jar b/deps/awsapi-lib/jsch-0.1.42.jar deleted file mode 100644 index c65eff0954f..00000000000 Binary files a/deps/awsapi-lib/jsch-0.1.42.jar and /dev/null differ diff --git a/deps/awsapi-lib/json_simple-1.1.jar b/deps/awsapi-lib/json_simple-1.1.jar deleted file mode 100644 index f395f41471a..00000000000 Binary files a/deps/awsapi-lib/json_simple-1.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/jta-1.1.jar b/deps/awsapi-lib/jta-1.1.jar deleted file mode 100644 index 6d225b764fa..00000000000 Binary files a/deps/awsapi-lib/jta-1.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/junit-4.8.1.jar b/deps/awsapi-lib/junit-4.8.1.jar deleted file mode 100644 index 524cd65ce5f..00000000000 Binary files a/deps/awsapi-lib/junit-4.8.1.jar and /dev/null differ diff --git a/deps/awsapi-lib/log4j-1.2.15.jar b/deps/awsapi-lib/log4j-1.2.15.jar deleted file mode 100644 index c930a6ab4d4..00000000000 Binary files a/deps/awsapi-lib/log4j-1.2.15.jar and /dev/null differ diff --git a/deps/awsapi-lib/mail-1.4.jar b/deps/awsapi-lib/mail-1.4.jar deleted file mode 100644 index 3b28b6ea9db..00000000000 Binary files a/deps/awsapi-lib/mail-1.4.jar and /dev/null differ diff --git a/deps/awsapi-lib/neethi-2.0.4.jar b/deps/awsapi-lib/neethi-2.0.4.jar deleted file mode 100644 index 87da3f0740f..00000000000 Binary files a/deps/awsapi-lib/neethi-2.0.4.jar and /dev/null differ diff --git a/deps/awsapi-lib/slf4j-api-1.5.11.jar b/deps/awsapi-lib/slf4j-api-1.5.11.jar deleted file mode 100644 index ccb8c724b6a..00000000000 Binary files a/deps/awsapi-lib/slf4j-api-1.5.11.jar and /dev/null differ diff --git a/deps/awsapi-lib/slf4j-jdk14-1.5.11.jar b/deps/awsapi-lib/slf4j-jdk14-1.5.11.jar deleted file mode 100644 index eb87ced9725..00000000000 Binary files a/deps/awsapi-lib/slf4j-jdk14-1.5.11.jar and /dev/null differ diff --git a/deps/awsapi-lib/woden-api-1.0M8.jar b/deps/awsapi-lib/woden-api-1.0M8.jar deleted file mode 100644 index c7d918ac24c..00000000000 Binary files a/deps/awsapi-lib/woden-api-1.0M8.jar and /dev/null differ diff --git a/deps/awsapi-lib/woden-impl-dom-1.0M8.jar b/deps/awsapi-lib/woden-impl-dom-1.0M8.jar deleted file mode 100644 index 286d9bfec84..00000000000 Binary files a/deps/awsapi-lib/woden-impl-dom-1.0M8.jar and /dev/null differ diff --git a/deps/awsapi-lib/xercesImpl.jar b/deps/awsapi-lib/xercesImpl.jar deleted file mode 100644 index 3b351f6e2b5..00000000000 Binary files a/deps/awsapi-lib/xercesImpl.jar and /dev/null differ diff --git a/deps/awsapi-lib/xml-apis.jar b/deps/awsapi-lib/xml-apis.jar deleted file mode 100644 index b338fb66932..00000000000 Binary files a/deps/awsapi-lib/xml-apis.jar and /dev/null differ diff --git a/deps/cloud-axis.jar b/deps/cloud-axis.jar deleted file mode 100644 index 20b09a595b4..00000000000 Binary files a/deps/cloud-axis.jar and /dev/null differ diff --git a/deps/cloud-backport-util-concurrent-3.0.jar b/deps/cloud-backport-util-concurrent-3.0.jar deleted file mode 100644 index 99f9b9c6a3e..00000000000 Binary files a/deps/cloud-backport-util-concurrent-3.0.jar and /dev/null differ diff --git a/deps/cloud-bcprov-jdk16-1.45.jar b/deps/cloud-bcprov-jdk16-1.45.jar deleted file mode 100644 index 38685d51051..00000000000 Binary files a/deps/cloud-bcprov-jdk16-1.45.jar and /dev/null differ diff --git a/deps/cloud-cglib.jar b/deps/cloud-cglib.jar deleted file mode 100644 index 8f234e4f4e0..00000000000 Binary files a/deps/cloud-cglib.jar and /dev/null differ diff --git a/deps/cloud-commons-codec-1.5.jar b/deps/cloud-commons-codec-1.5.jar deleted file mode 100644 index e9013fed78f..00000000000 Binary files a/deps/cloud-commons-codec-1.5.jar and /dev/null differ diff --git a/deps/cloud-commons-collections-3.2.1.jar b/deps/cloud-commons-collections-3.2.1.jar deleted file mode 100644 index c35fa1fee14..00000000000 Binary files a/deps/cloud-commons-collections-3.2.1.jar and /dev/null differ diff --git a/deps/cloud-commons-configuration-1.8.jar b/deps/cloud-commons-configuration-1.8.jar deleted file mode 100644 index ae9ae9969b6..00000000000 Binary files a/deps/cloud-commons-configuration-1.8.jar and /dev/null differ diff --git a/deps/cloud-commons-dbcp-1.4.jar b/deps/cloud-commons-dbcp-1.4.jar deleted file mode 100644 index c4c1c4f286a..00000000000 Binary files a/deps/cloud-commons-dbcp-1.4.jar and /dev/null differ diff --git a/deps/cloud-commons-discovery.jar b/deps/cloud-commons-discovery.jar deleted file mode 100644 index b88554847b7..00000000000 Binary files a/deps/cloud-commons-discovery.jar and /dev/null differ diff --git a/deps/cloud-commons-httpclient-3.1.jar b/deps/cloud-commons-httpclient-3.1.jar deleted file mode 100644 index 7c59774aed4..00000000000 Binary files a/deps/cloud-commons-httpclient-3.1.jar and /dev/null differ diff --git a/deps/cloud-commons-lang-2.6.jar b/deps/cloud-commons-lang-2.6.jar deleted file mode 100644 index 98467d3a653..00000000000 Binary files a/deps/cloud-commons-lang-2.6.jar and /dev/null differ diff --git a/deps/cloud-commons-logging-1.1.1.jar b/deps/cloud-commons-logging-1.1.1.jar deleted file mode 100644 index 8758a96b70c..00000000000 Binary files a/deps/cloud-commons-logging-1.1.1.jar and /dev/null differ diff --git a/deps/cloud-commons-pool-1.5.6.jar b/deps/cloud-commons-pool-1.5.6.jar deleted file mode 100644 index ce5ff607bfb..00000000000 Binary files a/deps/cloud-commons-pool-1.5.6.jar and /dev/null differ diff --git a/deps/cloud-ehcache.jar b/deps/cloud-ehcache.jar deleted file mode 100644 index 3a38fb3d14a..00000000000 Binary files a/deps/cloud-ehcache.jar and /dev/null differ diff --git a/deps/cloud-ejb-api-3.0.jar b/deps/cloud-ejb-api-3.0.jar deleted file mode 100644 index e9a86d1ae57..00000000000 Binary files a/deps/cloud-ejb-api-3.0.jar and /dev/null differ diff --git a/deps/cloud-email.jar b/deps/cloud-email.jar deleted file mode 100644 index 09222952eca..00000000000 Binary files a/deps/cloud-email.jar and /dev/null differ diff --git a/deps/cloud-google-gson-1.7.1.jar b/deps/cloud-google-gson-1.7.1.jar deleted file mode 100644 index acd16c0646b..00000000000 Binary files a/deps/cloud-google-gson-1.7.1.jar and /dev/null differ diff --git a/deps/cloud-httpcore-4.0.jar b/deps/cloud-httpcore-4.0.jar deleted file mode 100644 index 7c619fc9dba..00000000000 Binary files a/deps/cloud-httpcore-4.0.jar and /dev/null differ diff --git a/deps/cloud-iControl.jar b/deps/cloud-iControl.jar deleted file mode 100644 index 2d188168fa3..00000000000 Binary files a/deps/cloud-iControl.jar and /dev/null differ diff --git a/deps/cloud-jasypt-1.8.jar b/deps/cloud-jasypt-1.8.jar deleted file mode 100644 index daaed002a46..00000000000 Binary files a/deps/cloud-jasypt-1.8.jar and /dev/null differ diff --git a/deps/cloud-javax.persistence-2.0.0.jar b/deps/cloud-javax.persistence-2.0.0.jar deleted file mode 100644 index 62ee5c35beb..00000000000 Binary files a/deps/cloud-javax.persistence-2.0.0.jar and /dev/null differ diff --git a/deps/cloud-jnetpcap.jar b/deps/cloud-jnetpcap.jar deleted file mode 100644 index 01b9001f714..00000000000 Binary files a/deps/cloud-jnetpcap.jar and /dev/null differ diff --git a/deps/cloud-jsch-0.1.42.jar b/deps/cloud-jsch-0.1.42.jar deleted file mode 100644 index c65eff0954f..00000000000 Binary files a/deps/cloud-jsch-0.1.42.jar and /dev/null differ diff --git a/deps/cloud-jstl-1.2.jar b/deps/cloud-jstl-1.2.jar deleted file mode 100644 index 0fd275e9466..00000000000 Binary files a/deps/cloud-jstl-1.2.jar and /dev/null differ diff --git a/deps/cloud-junit.jar b/deps/cloud-junit.jar deleted file mode 100644 index 524cd65ce5f..00000000000 Binary files a/deps/cloud-junit.jar and /dev/null differ diff --git a/deps/cloud-log4j-extras.jar b/deps/cloud-log4j-extras.jar deleted file mode 100644 index 61ab1c9c7ac..00000000000 Binary files a/deps/cloud-log4j-extras.jar and /dev/null differ diff --git a/deps/cloud-log4j.jar b/deps/cloud-log4j.jar deleted file mode 100644 index 3f9d847618b..00000000000 Binary files a/deps/cloud-log4j.jar and /dev/null differ diff --git a/deps/cloud-manageontap.jar b/deps/cloud-manageontap.jar deleted file mode 100644 index 3f2a6712186..00000000000 Binary files a/deps/cloud-manageontap.jar and /dev/null differ diff --git a/deps/cloud-netscaler-sdx.jar b/deps/cloud-netscaler-sdx.jar deleted file mode 100755 index 25a7496d2f4..00000000000 Binary files a/deps/cloud-netscaler-sdx.jar and /dev/null differ diff --git a/deps/cloud-netscaler.jar b/deps/cloud-netscaler.jar deleted file mode 100755 index a073b5067c8..00000000000 Binary files a/deps/cloud-netscaler.jar and /dev/null differ diff --git a/deps/cloud-servlet-api.jar b/deps/cloud-servlet-api.jar deleted file mode 100644 index 3363d5a7194..00000000000 Binary files a/deps/cloud-servlet-api.jar and /dev/null differ diff --git a/deps/cloud-trilead-ssh2-build213.jar b/deps/cloud-trilead-ssh2-build213.jar deleted file mode 100644 index d22178a7374..00000000000 Binary files a/deps/cloud-trilead-ssh2-build213.jar and /dev/null differ diff --git a/deps/cloud-ws-commons-util-1.0.2.jar b/deps/cloud-ws-commons-util-1.0.2.jar deleted file mode 100755 index 3fc364e7f60..00000000000 Binary files a/deps/cloud-ws-commons-util-1.0.2.jar and /dev/null differ diff --git a/deps/cloud-wsdl4j-1.6.2.jar b/deps/cloud-wsdl4j-1.6.2.jar deleted file mode 100644 index b9ffc36b9f5..00000000000 Binary files a/deps/cloud-wsdl4j-1.6.2.jar and /dev/null differ diff --git a/deps/cloud-wsdl4j.jar b/deps/cloud-wsdl4j.jar deleted file mode 100644 index c6254ee6966..00000000000 Binary files a/deps/cloud-wsdl4j.jar and /dev/null differ diff --git a/deps/cloud-xenserver-5.6.100-1.jar b/deps/cloud-xenserver-5.6.100-1.jar deleted file mode 100644 index ff3744fa9d8..00000000000 Binary files a/deps/cloud-xenserver-5.6.100-1.jar and /dev/null differ diff --git a/deps/cloud-xmlrpc-client-3.1.3.jar b/deps/cloud-xmlrpc-client-3.1.3.jar deleted file mode 100644 index 38e3359e30c..00000000000 Binary files a/deps/cloud-xmlrpc-client-3.1.3.jar and /dev/null differ diff --git a/deps/cloud-xmlrpc-common-3.1.3.jar b/deps/cloud-xmlrpc-common-3.1.3.jar deleted file mode 100644 index b5eb9dffdad..00000000000 Binary files a/deps/cloud-xmlrpc-common-3.1.3.jar and /dev/null differ diff --git a/deps/cloud-xstream-1.3.1.jar b/deps/cloud-xstream-1.3.1.jar deleted file mode 100644 index 4ef4219c6f6..00000000000 Binary files a/deps/cloud-xstream-1.3.1.jar and /dev/null differ diff --git a/deps/install-non-oss.sh b/deps/install-non-oss.sh new file mode 100755 index 00000000000..8f4a63dc2c2 --- /dev/null +++ b/deps/install-non-oss.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +mvn install:install-file -Dfile=cloud-iControl.jar -DgroupId=com.cloud.com.f5 -DartifactId=icontrol -Dversion=1.0 -Dpackaging=jar +mvn install:install-file -Dfile=cloud-netscaler.jar -DgroupId=com.cloud.com.citrix -DartifactId=netscaler -Dversion=1.0 -Dpackaging=jar +mvn install:install-file -Dfile=cloud-netscaler-sdx.jar -DgroupId=com.cloud.com.citrix -DartifactId=netscaler-sdx -Dversion=1.0 -Dpackaging=jar +mvn install:install-file -Dfile=cloud-manageontap.jar -DgroupId=com.cloud.com.netapp -DartifactId=manageontap -Dversion=1.0 -Dpackaging=jar +mvn install:install-file -Dfile=libvirt-0.4.8.jar -DgroupId=org.libvirt -DartifactId=libvirt -Dversion=0.4.8 -Dpackaging=jar +mvn install:install-file -Dfile=vmware-vim.jar -DgroupId=com.cloud.com.vmware -DartifactId=vmware-vim -Dversion=1.0 -Dpackaging=jar +mvn install:install-file -Dfile=vmware-vim25.jar -DgroupId=com.cloud.com.vmware -DartifactId=vmware-vim25 -Dversion=1.0 -Dpackaging=jar +mvn install:install-file -Dfile=vmware-apputils.jar -DgroupId=com.cloud.com.vmware -DartifactId=vmware-apputils -Dversion=1.0 -Dpackaging=jar diff --git a/deps/jetty-6.1.26.jar b/deps/jetty-6.1.26.jar deleted file mode 100644 index 2cbe07aeefa..00000000000 Binary files a/deps/jetty-6.1.26.jar and /dev/null differ diff --git a/deps/jetty-util-6.1.26.jar b/deps/jetty-util-6.1.26.jar deleted file mode 100644 index cd237528add..00000000000 Binary files a/deps/jetty-util-6.1.26.jar and /dev/null differ diff --git a/deps/libvirt-0.4.8.jar b/deps/libvirt-0.4.8.jar deleted file mode 100644 index 3a30a1ae551..00000000000 Binary files a/deps/libvirt-0.4.8.jar and /dev/null differ diff --git a/deps/pom.xml b/deps/pom.xml new file mode 100644 index 00000000000..cb31eeb94c4 --- /dev/null +++ b/deps/pom.xml @@ -0,0 +1,203 @@ + + + 4.0.0 + cloud-deps + Apache CloudStack Dependencies + jar + + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + + + + org.apache.cloudstack + cloud-server + ${project.version} + + + org.apache.cloudstack + cloud-plugin-user-authenticator-ldap + ${project.version} + + + org.apache.cloudstack + cloud-plugin-user-authenticator-md5 + ${project.version} + + + org.apache.cloudstack + cloud-plugin-user-authenticator-plaintext + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-nvp + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-ovs + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-elb + ${project.version} + + + org.apache.cloudstack + cloud-plugin-hypervisor-xen + ${project.version} + + + org.apache.cloudstack + cloud-plugin-hypervisor-ovm + ${project.version} + + + org.apache.cloudstack + cloud-plugin-storage-allocator-random + ${project.version} + + + org.apache.cloudstack + cloud-plugin-planner-user-dispersing + ${project.version} + + + org.apache.cloudstack + cloud-plugin-planner-user-concentrated-pod + ${project.version} + + + org.apache.cloudstack + cloud-plugin-host-allocator-random + ${project.version} + + + org.apache.cloudstack + cloud-awsapi + ${project.version} + + + mysql + mysql-connector-java + 5.1.21 + runtime + + + + org.apache.cloudstack + cloud-plugin-hypervisor-vmware + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-srx + ${project.version} + + + org.apache.cloudstack + cloud-plugin-hypervisor-kvm + ${project.version} + + + org.apache.cloudstack + cloud-plugin-netapp + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-f5 + ${project.version} + + + org.apache.cloudstack + cloud-plugin-network-netscaler + ${project.version} + + + + org.apache.axis2 + axis2-ant-plugin + 1.4.1 + + + + install + + + org.apache.maven.plugins + maven-dependency-plugin + 2.5.1 + + + copy-dependencies + install + + copy-dependencies + + + . + false + false + true + cloud-core,cloud-server,cloud-api,cloud-utils,cloud-vmware-base,cloud-agent,cloud-plugin-host-allocator-random,cloud-plugin-hypervisor-kvm,cloud-plugin-hypervisor-ovm,cloud-plugin-hypervisor-vmware,cloud-plugin-hypervisor-xen,cloud-plugin-netapp,cloud-plugin-network-elb,cloud-plugin-network-f5,cloud-plugin-network-netscaler,cloud-plugin-network-nvp,cloud-plugin-network-ovs,cloud-plugin-network-srx,cloud-plugin-planner-user-concentrated-pod,cloud-plugin-planner-user-dispersing,cloud-plugin-storage-allocator-random,cloud-plugin-user-authenticator-ldap,cloud-plugin-user-authenticator-md5,cloud-plugin-user-authenticator-plaintext,cloud-utils,cloud-vmware-base,cloud-awsapi + + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.apache.maven.plugins + + + maven-antrun-plugin + + [1.7,) + + run + + + + + + + + + + + + + + diff --git a/deps/vmware-apputils.jar b/deps/vmware-apputils.jar deleted file mode 100644 index f93d46eba06..00000000000 Binary files a/deps/vmware-apputils.jar and /dev/null differ diff --git a/deps/vmware-lib-jaxrpc.jar b/deps/vmware-lib-jaxrpc.jar deleted file mode 100644 index a2c13d9a212..00000000000 Binary files a/deps/vmware-lib-jaxrpc.jar and /dev/null differ diff --git a/deps/vmware-vim.jar b/deps/vmware-vim.jar deleted file mode 100644 index c9831af675f..00000000000 Binary files a/deps/vmware-vim.jar and /dev/null differ diff --git a/deps/vmware-vim25.jar b/deps/vmware-vim25.jar deleted file mode 100644 index 01ba127da12..00000000000 Binary files a/deps/vmware-vim25.jar and /dev/null differ diff --git a/docs/en-US/about-physical-networks.xml b/docs/en-US/about-physical-networks.xml index b35aeeb077a..8edb9e060c2 100644 --- a/docs/en-US/about-physical-networks.xml +++ b/docs/en-US/about-physical-networks.xml @@ -40,4 +40,5 @@ + diff --git a/docs/en-US/advanced-zone-configuration.xml b/docs/en-US/advanced-zone-configuration.xml index d73bcf815a8..85909e3a08b 100644 --- a/docs/en-US/advanced-zone-configuration.xml +++ b/docs/en-US/advanced-zone-configuration.xml @@ -24,5 +24,159 @@
Advanced Zone Configuration - TODO + + After you select Advanced in the Add Zone wizard and click Next, you will be asked to enter the following details. Then click Next. + + Name. A name for the zone. + DNS 1 and 2. These are DNS servers for use by guest VMs in the zone. These DNS servers will be accessed via the public network you will add later. The public IP addresses for the zone must have a route to the DNS server named here. + Internal DNS 1 and Internal DNS 2. These are DNS servers for use by system VMs in the zone(these are VMs used by &PRODUCT; itself, such as virtual routers, console proxies,and Secondary Storage VMs.) These DNS servers will be accessed via the management traffic network interface of the System VMs. The private IP address you provide for the pods must have a route to the internal DNS server named here. + Network Domain. (Optional) If you want to assign a special domain name to the guest VM network, specify the DNS suffix. + Guest CIDR. This is the CIDR that describes the IP addresses in use in the guest virtual networks in this zone. For example, 10.1.1.0/24. As a matter of good practice you should set different CIDRs for different zones. This will make it easier to set up VPNs between networks in different zones. + Hypervisor. (Introduced in version 3.0.1) Choose the hypervisor for the first cluster in the zone. You can add clusters with different hypervisors later, after you finish adding the zone. + Public. A public zone is available to all users. A zone that is not public will be assigned to a particular domain. Only users in that domain will be allowed to create guest VMs in this zone. + + + Choose which traffic types will be carried by the physical network. + The traffic types are management, public, guest, and storage traffic. For more information about the types, roll over the icons to display their tool tips, or see . This screen starts out with one network already configured. If you have multiple physical networks, you need to add more. Drag and drop traffic types onto a greyed-out network and it will become active. You can move the traffic icons from one network to another; for example, if the default traffic types shown for Network 1 do not match your actual setup, you can move them down. You can also change the network names if desired. + + (Introduced in version 3.0.1) Assign a network traffic label to each traffic type on each physical network. These labels must match the labels you have already defined on the hypervisor host. To assign each label, click the Edit button under the traffic type icon within each physical network. A popup dialog appears where you can type the label, then click OK. + These traffic labels will be defined only for the hypervisor selected for the first cluster. For all other hypervisors, the labels can be configured after the zone is created. + (VMware only) If you have enabled Nexus dvSwitch in the environment, you must specify the corresponding Ethernet port profile names as network traffic label for each traffic type on the physical network. For more information on Nexus dvSwitch, see Configuring a vSphere Cluster with Nexus 1000v Virtual Switch. + + Click Next. + + Configure the IP range for public Internet traffic. Enter the following details, then click Add. If desired, you can repeat this step to add more public Internet IP ranges. When done, click Next. + + Gateway. The gateway in use for these IP addresses. + Netmask. The netmask associated with this IP range. + VLAN. The VLAN that will be used for public traffic. + Start IP/End IP. A range of IP addresses that are assumed to be accessible from the Internet and will be allocated for access to guest networks. + + + In a new zone, &PRODUCT; adds the first pod for you. You can always add more pods later. For an overview of what a pod is, see . + To configure the first pod, enter the following, then click Next: + + Pod Name. A name for the pod. + Reserved system gateway. The gateway for the hosts in that pod. + Reserved system netmask. The network prefix that defines the pod's subnet. Use CIDR notation. + Start/End Reserved System IP. The IP range in the management network that &PRODUCT; uses to manage various system VMs, such as Secondary Storage VMs, Console Proxy VMs, and DHCP. For more information, see . + + + Specify a range of VLAN IDs to carry guest traffic for each physical network (see VLAN Allocation Example ), then click Next. + + In a new pod, &PRODUCT; adds the first cluster for you. You can always add more clusters later. For an overview of what a cluster is, see . + To configure the first cluster, enter the following, then click Next: + + Hypervisor. (Version 3.0.0 only; in 3.0.1, this field is read only) Choose the type of hypervisor software that all hosts in this cluster will run. If you choose VMware, additional fields appear so you can give information about a vSphere cluster. For vSphere servers, we recommend creating the cluster of hosts in vCenter and then adding the entire cluster to &PRODUCT;. See Add Cluster: vSphere . + Cluster name. Enter a name for the cluster. This can be text of your choosing and is not used by &PRODUCT;. + + + In a new cluster, &PRODUCT; adds the first host for you. You can always add more hosts later. For an overview of what a host is, see . + When you deploy &PRODUCT;, the hypervisor host must not have any VMs already running. + Before you can configure the host, you need to install the hypervisor software on the host. You will need to know which version of the hypervisor software version is supported by &PRODUCT; and what additional configuration is required to ensure the host will work with &PRODUCT;. To find these installation details, see: + + Citrix XenServer Installation for &PRODUCT; + VMware vSphere Installation and Configuration + KVM Installation and Configuration + Oracle VM (OVM) Installation and Configuration + + To configure the first host, enter the following, then click Next: + + Host Name. The DNS name or IP address of the host. + Username. Usually root. + Password. This is the password for the user named above (from your XenServer or KVM install). + Host Tags. (Optional) Any labels that you use to categorize hosts for ease of maintenance. For example, you can set to the cloud's HA tag (set in the ha.tag global configuration parameter) if you want this host to be used only for VMs with the "high availability" feature enabled. For more information, see HA-Enabled Virtual Machines as well as HA for Hosts, both in the Administration Guide. + + + In a new cluster, &PRODUCT; adds the first primary storage server for you. You can always add more servers later. For an overview of what primary storage is, see . + To configure the first primary storage server, enter the following, then click Next: + + Name. The name of the storage device. + Protocol. For XenServer, choose either NFS, iSCSI, or PreSetup. For KVM, choose NFS or SharedMountPoint. For vSphere choose either VMFS (iSCSI or FiberChannel) or NFS. The remaining fields in the screen vary depending on what you choose here. + + + + + + + NFS + + + Server. The IP address or DNS name of the storage device. + Path. The exported path from the server. + + Tags (optional). The comma-separated list of tags for this storage device. It should be an equivalent set or superset of the tags on your disk offerings. + The tag sets on primary storage across clusters in a Zone must be identical. For example, if cluster A provides primary storage that has tags T1 and T2, all other clusters in the Zone must also provide primary storage that has tags T1 and T2. + + + + + + iSCSI + + + Server. The IP address or DNS name of the storage device. + Target IQN. The IQN of the target. For example, iqn.1986-03.com.sun:02:01ec9bb549-1271378984. + Lun. The LUN number. For example, 3. + + Tags (optional). The comma-separated list of tags for this storage device. It should be an equivalent set or superset of the tags on your disk offerings. + The tag sets on primary storage across clusters in a Zone must be identical. For example, if cluster A provides primary storage that has tags T1 and T2, all other clusters in the Zone must also provide primary storage that has tags T1 and T2. + + + + + + preSetup + + + Server. The IP address or DNS name of the storage device. + SR Name-Label. Enter the name-label of the SR that has been set up outside &PRODUCT;. + + Tags (optional). The comma-separated list of tags for this storage device. It should be an equivalent set or superset of the tags on your disk offerings. + The tag sets on primary storage across clusters in a Zone must be identical. For example, if cluster A provides primary storage that has tags T1 and T2, all other clusters in the Zone must also provide primary storage that has tags T1 and T2. + + + + + + SharedMountPoint + + + Path. The path on each host that is where this primary storage is mounted. For example, "/mnt/primary". + + Tags (optional). The comma-separated list of tags for this storage device. It should be an equivalent set or superset of the tags on your disk offerings. + The tag sets on primary storage across clusters in a Zone must be identical. For example, if cluster A provides primary storage that has tags T1 and T2, all other clusters in the Zone must also provide primary storage that has tags T1 and T2. + + + + + + VMFS + + + Server. The IP address or DNS name of the vCenter server. + Path. A combination of the datacenter name and the datastore name. The format is "/" datacenter name "/" datastore name. For example, "/cloud.dc.VM/cluster1datastore". + + Tags (optional). The comma-separated list of tags for this storage device. It should be an equivalent set or superset of the tags on your disk offerings. + The tag sets on primary storage across clusters in a Zone must be identical. For example, if cluster A provides primary storage that has tags T1 and T2, all other clusters in the Zone must also provide primary storage that has tags T1 and T2. + + + + + + + + + + + In a new zone, &PRODUCT; adds the first secondary storage server for you. For an overview of what secondary storage is, see . + Before you can fill out this screen, you need to prepare the secondary storage by setting up NFS shares and installing the latest &PRODUCT; System VM template. See Adding Secondary Storage : + + NFS Server. The IP address of the server. + Path. The exported path from the server. + + + Click Launch. + +
diff --git a/docs/en-US/cloud-infrastructure-concepts.xml b/docs/en-US/cloud-infrastructure-concepts.xml index 40ceff8aed2..58f8844c826 100644 --- a/docs/en-US/cloud-infrastructure-concepts.xml +++ b/docs/en-US/cloud-infrastructure-concepts.xml @@ -30,4 +30,5 @@ + diff --git a/docs/en-US/management_server_multi_node_install.xml b/docs/en-US/hypervisor-host-install-agent.xml similarity index 52% rename from docs/en-US/management_server_multi_node_install.xml rename to docs/en-US/hypervisor-host-install-agent.xml index 30f6af9f6a7..d1b774a7a30 100644 --- a/docs/en-US/management_server_multi_node_install.xml +++ b/docs/en-US/hypervisor-host-install-agent.xml @@ -1,5 +1,5 @@ - %BOOK_ENTITIES; ]> @@ -11,9 +11,9 @@ to you 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 @@ -22,9 +22,13 @@ under the License. --> - - Management Server Multi-Node Installation - - - - +
+ Install and configure the Agent + To manage KVM instances on the host &PRODUCT; uses a Agent. This Agent communicates with the Management server and controls all the instances on the host. + First we start by installing the agent: + In RHEL or CentOS: + yum install cloud-agent + In Ubuntu: + apt-get install cloud-agent + The host is now ready to be added to a cluster. This is covered in a later section, see . It is recommended that you continue to read the documentation before adding the host! +
\ No newline at end of file diff --git a/docs/en-US/hypervisor-host-install-firewall.xml b/docs/en-US/hypervisor-host-install-firewall.xml index 9efca5ed43b..e99c88e4882 100644 --- a/docs/en-US/hypervisor-host-install-firewall.xml +++ b/docs/en-US/hypervisor-host-install-firewall.xml @@ -36,11 +36,18 @@ It depends on the firewall you are using how to open these ports. Below you'll find examples how to open these ports in RHEL/CentOS and Ubuntu.
Open ports in RHEL/CentOS - TODO: How to open ports + RHEL and CentOS use iptables for firewalling the system, you can open extra ports by executing the following iptable commands: + iptables -I INPUT -p tcp -m tcp --dport 22 -j ACCEPT + iptables -I INPUT -p tcp -m tcp --dport 1798 -j ACCEPT + iptables -I INPUT -p tcp -m tcp --dport 16509 -j ACCEPT + iptables -I INPUT -p tcp -m tcp --dport 5900:6100 -j ACCEPT + iptables -I INPUT -p tcp -m tcp --dport 49152:492160 -j ACCEPT + These iptable settings are not persistent accross reboots, we have to save them first. + iptables-save > /etc/sysconfig/iptables
Open ports in Ubuntu - The default firewall under Ubuntu is UFW (Uncomplicated FireWall), although not enabled. + The default firewall under Ubuntu is UFW (Uncomplicated FireWall), which is a Python wrapper around iptables. To open the required ports, execute the following commands: ufw allow proto tcp from any to any port 22 ufw allow proto tcp from any to any port 1798 diff --git a/docs/en-US/hypervisor-host-install-flow.xml b/docs/en-US/hypervisor-host-install-flow.xml index af1daa744e3..74668c8f423 100644 --- a/docs/en-US/hypervisor-host-install-flow.xml +++ b/docs/en-US/hypervisor-host-install-flow.xml @@ -30,4 +30,5 @@ +
\ No newline at end of file diff --git a/docs/en-US/hypervisor-host-install-libvirt.xml b/docs/en-US/hypervisor-host-install-libvirt.xml index b3b691c3754..15cfde2efa7 100644 --- a/docs/en-US/hypervisor-host-install-libvirt.xml +++ b/docs/en-US/hypervisor-host-install-libvirt.xml @@ -35,15 +35,15 @@ In order to have live migration working libvirt has to listen for unsecured TCP connections. - # vi /etc/libvirt/libvirtd.conf + vi /etc/libvirt/libvirtd.conf Set the following paramaters: listen_tls = 0 listen_tcp = 1 tcp_port = 16059 - auth_tcp none + auth_tcp = "none" - In order to have libvirt listening on TCP we have to change the execution arguments. + Turning on "listen_tcp" in libvirtd.conf is not enough, we have to change the parameters as well: On RHEL or CentOS: vi /etc/sysconfig/libvirtd Uncomment the following line: diff --git a/docs/en-US/hypervisor-host-install-network.xml b/docs/en-US/hypervisor-host-install-network.xml index e4f668e0c4b..8f6a10cdd69 100644 --- a/docs/en-US/hypervisor-host-install-network.xml +++ b/docs/en-US/hypervisor-host-install-network.xml @@ -25,18 +25,20 @@
Configure the network bridges This is a very important section, please make sure you read this thoroughly. - In order to forward traffic to your instances you will need at least two bridges: public and private. - By default these bridges are called cloudbr0 and cloudbr1, but you do have to make sure they are available on each hypervisor. + In order to forward traffic to your instances you will need at least two bridges: public and private. + By default these bridges are called cloudbr0 and cloudbr1, but you do have to make sure they are available on each hypervisor. + The most important factor is that you keep the configuration consistent on all your hypervisors.
Network example There are many ways to configure your network. In the Basic networking mode you should have two (V)LAN's, one for your private network and one for the public network. - The hypervisor has one NIC (eth0) with three VLAN's: + We assume that the hypervisor has one NIC (eth0) with three tagged VLAN's: VLAN 100 for management of the hypervisor VLAN 200 for public network of the instances (cloudbr0) VLAN 300 for private network of the instances (cloudbr1) On VLAN 100 we give the Hypervisor the IP-Address 192.168.42.11/24 with the gateway 192.168.42.1 + The Hypervisor and Management server don't have to be in the same subnet!
Configuring the network bridges @@ -116,18 +118,14 @@ STP=yes]]> Hypervisor Host Installation Overview This section describes installing a Hypervisor host. This is targeted towards hosts running Linux Kernel Virtual Machine (KVM) Before continuing, make sure that you have applied the latest updates to your host. + It is NOT recommended to run services on this host not controlled by &PRODUCT;. The procedure for installing the Hypervisor Host is: Prepare the Operating System diff --git a/docs/en-US/hypervisor-host-install-prepare-os.xml b/docs/en-US/hypervisor-host-install-prepare-os.xml index 8eaedeae3b2..e2e32e709ae 100644 --- a/docs/en-US/hypervisor-host-install-prepare-os.xml +++ b/docs/en-US/hypervisor-host-install-prepare-os.xml @@ -29,16 +29,16 @@ Log in to your OS as root. Check for a fully qualified hostname. - # hostname --fqdn + hostname --fqdn This should return a fully qualified hostname such as "kvm1.lab.example.org". If it does not, edit /etc/hosts so that it does. Make sure that the machine can reach the Internet. - # ping www.cloudstack.org + ping www.cloudstack.org Turn on NTP for time synchronization. - NTP is required to synchronize the clocks of the servers in your cloud. + NTP is required to synchronize the clocks of the servers in your cloud. Unsynchronized clocks can cause unexpected problems. Install NTP On RHEL or CentOS: diff --git a/docs/en-US/hypervisor-host-install-security-policies.xml b/docs/en-US/hypervisor-host-install-security-policies.xml index 699fb9744c9..5fd6925a8c0 100644 --- a/docs/en-US/hypervisor-host-install-security-policies.xml +++ b/docs/en-US/hypervisor-host-install-security-policies.xml @@ -24,6 +24,7 @@
Configure the Security Policies + &PRODUCT; does various things which can be blocked by security mechanisms like AppArmor and SELinux. These have to be disabled to ensure the Agent has all the required permissions. Configure SELinux (RHEL and CentOS) diff --git a/docs/en-US/initialize-and-test.xml b/docs/en-US/initialize-and-test.xml index e5a57d89dc2..cf0c04ecea6 100644 --- a/docs/en-US/initialize-and-test.xml +++ b/docs/en-US/initialize-and-test.xml @@ -24,5 +24,30 @@
Initialize and Test - TODO + After everything is configured, &PRODUCT; will perform its initialization. This can take 30 minutes or more, depending on the speed of your network. When the initialization has completed successfully, the administrator's Dashboard should be displayed in the &PRODUCT; UI. + + Verify that the system is ready. In the left navigation bar, select Templates. Click on the CentOS 5.5 (64bit) no Gui (KVM) template. Check to be sure that the status is "Download Complete." Do not proceed to the next step until this status is displayed. + Go to the Instances tab, and filter by My Instances. + Click Add Instance and follow the steps in the wizard. + + Choose the zone you just added. + In the template selection, choose the template to use in the VM. If this is a fresh installation, likely only the provided CentOS template is available. + Select a service offering. Be sure that the hardware you have allows starting the selected service offering. + In data disk offering, if desired, add another data disk. This is a second volume that will be available to but not mounted in the guest. For example, in Linux on XenServer you will see /dev/xvdb in the guest after rebooting the VM. A reboot is not required if you have a PV-enabled OS kernel in use. + In default network, choose the primary network for the guest. In a trial installation, you would have only one option here. + Optionally give your VM a name and a group. Use any descriptive text you would like. + Click Launch VM. Your VM will be created and started. It might take some time to download the template and complete the VM startup. You can watch the VM’s progress in the Instances screen. + + + + To use the VM, click the View Console button. + + + ConsoleButton.png: button to launch a console + + + + + Congratulations! You have successfully completed a &PRODUCT; Installation. + If you decide to grow your deployment, you can add more hosts, primary storage, zones, pods, and clusters.
diff --git a/docs/en-US/install-management-server.xml b/docs/en-US/install-management-server.xml deleted file mode 100644 index d8eb1e5d4eb..00000000000 --- a/docs/en-US/install-management-server.xml +++ /dev/null @@ -1,58 +0,0 @@ - - -%BOOK_ENTITIES; -]> - - - -
- Install the Management Server on the First Host - The first step in installation, whether you are installing the Management Server on one host or many, is to install the software on a single node. - - If you are planning to install the Management Server on multiple nodes for high availability, do not proceed to the additional nodes yet. That step will come later. - - Download the Management Server onto the host where it will run. Get the software from the following link. - https://www.citrix.com/English/ss/downloads/ - FIXME - You will need a MyCitrix account. - - Install the packages. You should have a file in the form of “&PRODUCT;-VERSION-N-OSVERSION.tar.gz”. Untar the file and then run the install.sh script inside it. Replace the file and directory names below with those you are using: - -# tar xzf &PRODUCT;-VERSION-N-OSVERSION.tar.gz -# cd &PRODUCT;-VERSION-N-OSVERSION -# ./install.sh - - You should see a few messages as the installer prepares, followed by a list of choices. - - Choose M to install the Management Server software. - > M - - Wait for a message like “Complete! Done,” which indicates that the software was installed successfully. - - (RHEL or CentOS) When the installation is finished, run the following commands to start essential services (the commands might be different depending on your OS): - -# service rpcbind start -# service nfs start -# chkconfig nfs on -# chkconfig rpcbind on - - - -
diff --git a/docs/en-US/management-server-install-client.xml b/docs/en-US/management-server-install-client.xml new file mode 100644 index 00000000000..93273ce3f34 --- /dev/null +++ b/docs/en-US/management-server-install-client.xml @@ -0,0 +1,40 @@ + + +%BOOK_ENTITIES; +]> + + + +
+ Install the Management Server on the First Host + The first step in installation, whether you are installing the Management Server on one host or many, is to install the software on a single node. + + If you are planning to install the Management Server on multiple nodes for high availability, do not proceed to the additional nodes yet. That step will come later. + The &PRODUCT; Management server can be installed using either RPM or DEB packages. These packages will depend on everything you need to run the Management server. +
+ Install on CentOS/RHEL + We start by installing the required packages: + yum install cloud-client +
+
+ Install on Ubuntu + apt-get install cloud-client +
+
diff --git a/docs/en-US/installation-complete.xml b/docs/en-US/management-server-install-complete.xml similarity index 100% rename from docs/en-US/installation-complete.xml rename to docs/en-US/management-server-install-complete.xml diff --git a/docs/en-US/install-database-on-separate-node.xml b/docs/en-US/management-server-install-db-external.xml similarity index 100% rename from docs/en-US/install-database-on-separate-node.xml rename to docs/en-US/management-server-install-db-external.xml diff --git a/docs/en-US/install-database-on-management-server-node.xml b/docs/en-US/management-server-install-db-local.xml similarity index 100% rename from docs/en-US/install-database-on-management-server-node.xml rename to docs/en-US/management-server-install-db-local.xml diff --git a/docs/en-US/management-server-install-flow.xml b/docs/en-US/management-server-install-flow.xml index b6c7052d268..112771bb500 100644 --- a/docs/en-US/management-server-install-flow.xml +++ b/docs/en-US/management-server-install-flow.xml @@ -24,13 +24,13 @@
Management Server Installation - - - - - - - - - + + + + + + + + +
diff --git a/docs/en-US/install-management-server-multi-nodes.xml b/docs/en-US/management-server-install-multi-node.xml similarity index 100% rename from docs/en-US/install-management-server-multi-nodes.xml rename to docs/en-US/management-server-install-multi-node.xml diff --git a/docs/en-US/prepare-nfs-shares.xml b/docs/en-US/management-server-install-nfs-shares.xml similarity index 100% rename from docs/en-US/prepare-nfs-shares.xml rename to docs/en-US/management-server-install-nfs-shares.xml diff --git a/docs/en-US/management-server-installation-overview.xml b/docs/en-US/management-server-install-overview.xml similarity index 96% rename from docs/en-US/management-server-installation-overview.xml rename to docs/en-US/management-server-install-overview.xml index 3ccbdccfc9b..5bc6f1ba8f2 100644 --- a/docs/en-US/management-server-installation-overview.xml +++ b/docs/en-US/management-server-install-overview.xml @@ -37,7 +37,7 @@ Prepare the Operating System Install the First Management Server - Install and Configure the Database + Install and Configure the MySQL database Prepare NFS Shares Prepare and Start Additional Management Servers (optional) Prepare the System VM Template diff --git a/docs/en-US/management-server-install-prepare-os.xml b/docs/en-US/management-server-install-prepare-os.xml new file mode 100644 index 00000000000..ee76a5f1566 --- /dev/null +++ b/docs/en-US/management-server-install-prepare-os.xml @@ -0,0 +1,54 @@ + + +%BOOK_ENTITIES; +]> + + + +
+ Prepare the Operating System + The OS must be prepared to host the Management Server using the following steps. These steps must be performed on each Management Server node. + + Log in to your OS as root. + + Check for a fully qualified hostname. + hostname --fqdn + This should return a fully qualified hostname such as "managament1.lab.example.org". If it does not, edit /etc/hosts so that it does. + + + Make sure that the machine can reach the Internet. + ping www.google.com + + + Turn on NTP for time synchronization. + NTP is required to synchronize the clocks of the servers in your cloud. + + + Install NTP. + On RHEL or CentOS: + yum install ntp + On Ubuntu: + apt-get install openntpd + + + + Repeat all of these steps on every host where the Management Server will be installed. + +
diff --git a/docs/en-US/prepare-system-vm-template.xml b/docs/en-US/management-server-install-systemvm.xml similarity index 100% rename from docs/en-US/prepare-system-vm-template.xml rename to docs/en-US/management-server-install-systemvm.xml diff --git a/docs/en-US/management_server_overview.xml b/docs/en-US/management_server_overview.xml deleted file mode 100644 index b5d74f38a8b..00000000000 --- a/docs/en-US/management_server_overview.xml +++ /dev/null @@ -1,53 +0,0 @@ - - -%BOOK_ENTITIES; -]> - - -
- Management Server Overview - The Management Server is the &PRODUCT; software that manages cloud resources. By interacting with the Management Server through its UI or API, you can configure and manage your cloud infrastructure. - The Management Server runs on a dedicated server or VM. It controls allocation of virtual machines to hosts and assigns storage and IP addresses to the virtual machine instances. The &PRODUCT; Management Server runs in a Tomcat container and requires a MySQL database for persistence. - The machine must meet the system requirements described in System Requirements. - The Management Server: - - - Provides the web user interface for the administrator and a reference user interface for end users. - - - Provides the APIs for the &PRODUCT; platform. - - - Manages the assignment of guest VMs to particular hosts. - - - Manages the assignment of public and private IP addresses to particular accounts. - - - Manages the allocation of storage to guests as virtual disks. - - - Manages snapshots, templates, and ISO images, possibly replicating them across data centers. - - - Provides a single point of configuration for the cloud. - - -
diff --git a/docs/en-US/prepare-os.xml b/docs/en-US/prepare-os.xml deleted file mode 100644 index 677ae43d4b8..00000000000 --- a/docs/en-US/prepare-os.xml +++ /dev/null @@ -1,110 +0,0 @@ - - -%BOOK_ENTITIES; -]> - - - -
- Prepare the Operating System - - The OS must be prepared to host the Management Server using the following steps. These steps must be performed on each Management Server node. - - - Log in to your OS as root. - Check for a fully qualified hostname. - # hostname --fqdn - This should return a fully qualified hostname such as "kvm1.lab.example.org". If it does not, edit /etc/hosts so that it does. - - Set SELinux to be permissive by default. - - Check to see whether SELinux is installed on your machine. If not, you can skip to step 4. - In RHEL or CentOS, SELinux is installed and enabled by default. You can verify this with: - # rpm -qa | grep selinux - In Ubuntu, SELinux is not installed by default. You can verify this with: - # dpkg --list 'selinux' - - Set the SELINUX variable in /etc/selinux/config to “permissive”. This ensures that the permissive setting will be maintained after a system reboot. - In RHEL or CentOS: - # vi /etc/selinux/config - In Ubuntu (do this step only if SELinux was found on the machine in the previous step): - # selinux-config-enforcing permissive - - Then set SELinux to permissive starting immediately, without requiring a system reboot. - In CentOS: - # setenforce permissive - In RHEL: - # setenforce 0 - In Ubuntu (do this step only if SELinux was found on the machine): - # setenforce permissive - - - - Make sure that the machine can reach the Internet. - # ping www.google.com - - (RHEL 6.2) If you do not have a Red Hat Network account, you need to prepare a local Yum repository. - - If you are working with a physical host, insert the RHEL 6.2 installation CD. If you are using a VM, attach the RHEL6 ISO. - Mount the CDROM to /media. - Create a repo file at /etc/yum.repos.d/rhel6.repo. In the file, insert the following lines: - -[rhel] -name=rhel6 -baseurl=file:///media -enabled=1 -gpgcheck=0 - - - - - Turn on NTP for time synchronization. - NTP is required to synchronize the clocks of the servers in your cloud. - - Install NTP. - On RHEL or CentOS: - # yum install ntp - On Ubuntu: - # apt-get install ntp - - Edit the NTP configuration file to point to your NTP server. - # vi /etc/ntp.conf - Add one or more server lines in this file with the names of the NTP servers - you want to use. For example: - server 0.xenserver.pool.ntp.org -server 1.xenserver.pool.ntp.org -server 2.xenserver.pool.ntp.org -server 3.xenserver.pool.ntp.org - - - Restart the NTP client. - # service ntpd restart - - Make sure NTP will start again upon reboot. - On RHEL or CentOS: - # chkconfig ntpd on - On Ubuntu: - # chkconfig ntp on - - - - Repeat all of these steps on every host where the Management Server will be installed. - -
diff --git a/patches/cloudpatch-descriptor.xml b/patches/cloudpatch-descriptor.xml new file mode 100644 index 00000000000..263fb341532 --- /dev/null +++ b/patches/cloudpatch-descriptor.xml @@ -0,0 +1,43 @@ + + cloud-scripts + + tar.gz + + false + + + ../patches/systemvm/debian/config/ + + 555 + 555 + + + ../patches/systemvm/debian/vpn/ + + 555 + 555 + + + ../patches/systemvm/debian/xe/ + + 555 + 555 + + **/xe-* + **/xen-* + + + + ../patches/systemvm/debian/xe/ + usr/sbin + 555 + 555 + + **/xe-* + **/xen-* + + + + diff --git a/patches/pom.xml b/patches/pom.xml new file mode 100644 index 00000000000..efe61af0ccd --- /dev/null +++ b/patches/pom.xml @@ -0,0 +1,97 @@ + + + 4.0.0 + cloud-patches + Apache CloudStack SystemVM Patches + + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + + + + log4j + log4j + ${cs.log4j.version} + + + com.google.code.gson + gson + ${cs.gson.version} + + + commons-codec + commons-codec + ${cs.codec.version} + + + + org.apache.cloudstack + cloud-core + ${project.version} + + + org.apache.cloudstack + cloud-vmware-base + ${project.version} + + + org.apache.cloudstack + cloud-agent + ${project.version} + + + org.apache.cloudstack + cloud-api + ${project.version} + + + org.apache.cloudstack + cloud-utils + ${project.version} + + + + install + + + maven-assembly-plugin + 2.3 + + cloud-scripts + false + + cloudpatch-descriptor.xml + + + + + make-cloud-scripts + package + + single + + + + + + + diff --git a/patches/systemvm/debian/config/etc/init.d/cloud-early-config b/patches/systemvm/debian/config/etc/init.d/cloud-early-config index d46a1e733e8..4bf4d6b0920 100755 --- a/patches/systemvm/debian/config/etc/init.d/cloud-early-config +++ b/patches/systemvm/debian/config/etc/init.d/cloud-early-config @@ -433,7 +433,7 @@ setup_redundant_router() { cp /root/redundant_router/arping_gateways.sh.templ $rrouter_bin_path/arping_gateways.sh cp /root/redundant_router/check_bumpup.sh $rrouter_bin_path/ cp /root/redundant_router/disable_pubip.sh $rrouter_bin_path/ - cp /root/redundant_router/checkrouter.sh.templ /root/checkrouter.sh + cp /root/redundant_router/checkrouter.sh.templ /opt/cloud/bin/checkrouter.sh sed -i "s/\[ROUTER_ID\]/$NAME/g" /etc/keepalived/keepalived.conf sed -i "s/\[ROUTER_IP\]/$GUEST_GW\/$GUEST_CIDR_SIZE/g" /etc/keepalived/keepalived.conf sed -i "s/\[BOARDCAST\]/$GUEST_BRD/g" /etc/keepalived/keepalived.conf @@ -460,7 +460,7 @@ setup_redundant_router() { sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/primary-backup.sh sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/check_heartbeat.sh sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" $rrouter_bin_path/arping_gateways.sh - sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" /root/checkrouter.sh + sed -i "s/\[RROUTER_LOG\]/$rrouter_log_str/g" /opt/cloud/bin/checkrouter.sh chmod a+x $rrouter_bin_path/*.sh sed -i "s/--exec\ \$DAEMON;/--exec\ \$DAEMON\ --\ --vrrp;/g" /etc/init.d/keepalived diff --git a/patches/systemvm/debian/config/etc/profile.d/cloud.sh b/patches/systemvm/debian/config/etc/profile.d/cloud.sh index 2634aa44993..844527fb23b 100755 --- a/patches/systemvm/debian/config/etc/profile.d/cloud.sh +++ b/patches/systemvm/debian/config/etc/profile.d/cloud.sh @@ -1,16 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. if [ "`id -u`" -eq 0 ]; then diff --git a/patches/systemvm/debian/config/opt/cloud/bin/get_template_version.sh b/patches/systemvm/debian/config/opt/cloud/bin/get_template_version.sh index 4252ce98fd7..298bc380f82 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/get_template_version.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/get_template_version.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. echo -n `cat /etc/cloudstack-release`'&' cat /var/cache/cloud/cloud-scripts-signature diff --git a/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh b/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh index c38fc7074dd..c9a5e14e56b 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/ipassoc.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. @@ -313,7 +315,7 @@ grep "redundant_router=1" /var/cache/cloud/cmdline > /dev/null if [ $? -eq 0 ] then is_redundant=1 - sudo /root/checkrouter.sh --no-lock|grep "Status: MASTER" > /dev/null 2>&1 + sudo /opt/cloud/bin/checkrouter.sh --no-lock|grep "Status: MASTER" > /dev/null 2>&1 if [ $? -eq 0 ] then is_master=1 diff --git a/patches/systemvm/debian/config/opt/cloud/bin/ipsectunnel.sh b/patches/systemvm/debian/config/opt/cloud/bin/ipsectunnel.sh index d4f4153bd78..e511a3d966a 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/ipsectunnel.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/ipsectunnel.sh @@ -1,15 +1,21 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. - #!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + source /root/func.sh lock="biglock" diff --git a/patches/systemvm/debian/config/opt/cloud/bin/netusage.sh b/patches/systemvm/debian/config/opt/cloud/bin/netusage.sh index d4307b9a00a..10c61902a20 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/netusage.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/netusage.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/patches/systemvm/debian/config/opt/cloud/bin/patchsystemvm.sh b/patches/systemvm/debian/config/opt/cloud/bin/patchsystemvm.sh index 6f0a0f234af..bdec43af1a9 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/patchsystemvm.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/patchsystemvm.sh @@ -1,18 +1,20 @@ #/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/patches/systemvm/debian/config/opt/cloud/bin/serve_password.sh b/patches/systemvm/debian/config/opt/cloud/bin/serve_password.sh index 5c52605f4b6..c1f928ddcc8 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/serve_password.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/serve_password.sh @@ -1,19 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_acl.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_acl.sh index 0d20247273d..fa57c043570 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_acl.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_acl.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # firewall_rule.sh -- allow some ports / protocols to vm instances # @VERSION@ diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_func.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_func.sh index 18cbf4efd1b..17cb078b34f 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_func.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_func.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # @VERSION@ diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh index 0ca371c1d7b..cb98fd419d0 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_guestnw.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # guestnw.sh -- create/destroy guest network # @VERSION@ @@ -54,19 +58,31 @@ create_acl_chain() { setup_apache2() { - logger_it "Setting up apache web server for $dev" + logger -t cloud "Setting up apache web server for $dev" cp /etc/apache2/vhostexample.conf /etc/apache2/conf.d/vhost$dev.conf sed -i -e "s///" /etc/apache2/conf.d/vhost$dev.conf sed -i -e "s///" /etc/apache2/conf.d/vhost$dev.conf sed -i -e "s/\tServerName.*/\tServerName vhost$dev.cloudinternal.com/" /etc/apache2/conf.d/vhost$dev.conf sed -i -e "s/Listen .*:80/Listen $ip:80/g" /etc/apache2/conf.d/vhost$dev.conf sed -i -e "s/Listen .*:443/Listen $ip:443/g" /etc/apache2/conf.d/vhost$dev.conf + if [ -e "/etc/apache2/sites-enabled/000-default" ] + then + sed -i -e "s/^#*/#/g" /etc/apache2/sites-enabled/000-default + fi + if [ -e "/etc/apache2/sites-enabled/default-ssl" ] + then + sed -i -e "s/^#*/#/g" /etc/apache2/sites-enabled/default-ssl + fi + if [ -e "/etc/apache2/ports.conf" ] + then + sed -i -e "s/^#*/#/g" /etc/apache2/ports.conf + fi service apache2 restart sudo iptables -A INPUT -i $dev -d $ip -p tcp -m state --state NEW --dport 80 -j ACCEPT } desetup_apache2() { - logger_it "Desetting up apache web server for $dev" + logger -t cloud "Desetting up apache web server for $dev" rm -f /etc/apache2/conf.d/vhost$dev.conf service apache2 restart sudo iptables -D INPUT -i $dev -d $ip -p tcp -m state --state NEW --dport 80 -j ACCEPT diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_ipassoc.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_ipassoc.sh index 8ef19e41f45..53e739d02d6 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_ipassoc.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_ipassoc.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_loadbalancer.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_loadbalancer.sh index ed854670300..334c6177392 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_loadbalancer.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_loadbalancer.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # @VERSION@ diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_netusage.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_netusage.sh index 393b4bb12eb..4f32a46cbb8 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_netusage.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_netusage.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. source /root/func.sh source /opt/cloud/bin/vpc_func.sh diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_portforwarding.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_portforwarding.sh index f8bee33442a..5aeaa70357b 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_portforwarding.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_portforwarding.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # @VERSION@ source /root/func.sh diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_privateGateway.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_privateGateway.sh index 0fe803ed8ab..a09d8f7e38b 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_privateGateway.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_privateGateway.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # @VERSION@ diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_snat.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_snat.sh index ff88354dc49..aa33e081441 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_snat.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_snat.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # @VERSION@ diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_staticnat.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_staticnat.sh index 1a2127463a1..a98a26225b6 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_staticnat.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_staticnat.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # @VERSION@ source /root/func.sh diff --git a/patches/systemvm/debian/config/opt/cloud/bin/vpc_staticroute.sh b/patches/systemvm/debian/config/opt/cloud/bin/vpc_staticroute.sh index b75c0fb3580..2a9f50a27cd 100755 --- a/patches/systemvm/debian/config/opt/cloud/bin/vpc_staticroute.sh +++ b/patches/systemvm/debian/config/opt/cloud/bin/vpc_staticroute.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # @VERSION@ source /root/func.sh diff --git a/patches/systemvm/debian/config/root/bumpup_priority.sh b/patches/systemvm/debian/config/root/bumpup_priority.sh index 9f1011a2c6b..2b8d8c3cb39 100755 --- a/patches/systemvm/debian/config/root/bumpup_priority.sh +++ b/patches/systemvm/debian/config/root/bumpup_priority.sh @@ -1,15 +1,19 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. touch /tmp/rrouter_bumped diff --git a/patches/systemvm/debian/config/root/clearUsageRules.sh b/patches/systemvm/debian/config/root/clearUsageRules.sh index 16b4b5509e0..061688b7438 100755 --- a/patches/systemvm/debian/config/root/clearUsageRules.sh +++ b/patches/systemvm/debian/config/root/clearUsageRules.sh @@ -1,19 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # clearUsageRules.sh - remove iptable rules for removed public interfaces diff --git a/patches/systemvm/debian/config/root/edithosts.sh b/patches/systemvm/debian/config/root/edithosts.sh index c4e1a68c152..3c6102d61d5 100755 --- a/patches/systemvm/debian/config/root/edithosts.sh +++ b/patches/systemvm/debian/config/root/edithosts.sh @@ -1,17 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/patches/systemvm/debian/config/root/firewall.sh b/patches/systemvm/debian/config/root/firewall.sh index ea4065a8d60..56153603a78 100755 --- a/patches/systemvm/debian/config/root/firewall.sh +++ b/patches/systemvm/debian/config/root/firewall.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # $Id: firewall.sh 9947 2010-06-25 19:34:24Z manuel $ $HeadURL: svn://svn.lab.vmops.com/repos/vmdev/java/patches/xenserver/root/firewall.sh $ # firewall.sh -- allow some ports / protocols to vm instances # @VERSION@ @@ -48,7 +52,7 @@ ip_to_dev() { } doHairpinNat () { - local vrGuestIPNetwork=$(sudo ip addr show dev eth0 | grep inet | grep eth0 | awk '{print $2}' ) + local vrGuestIPNetwork=$(sudo ip addr show dev eth0 | grep inet | grep eth0 | awk '{print $2}' | head -1) local vrGuestIP=$(echo $vrGuestIPNetwork | awk -F'/' '{print $1}') local publicIp=$1 diff --git a/patches/systemvm/debian/config/root/firewall_rule.sh b/patches/systemvm/debian/config/root/firewall_rule.sh index ea17f2ab424..9e459f02ea9 100755 --- a/patches/systemvm/debian/config/root/firewall_rule.sh +++ b/patches/systemvm/debian/config/root/firewall_rule.sh @@ -1,16 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # firewall_rule.sh -- allow some ports / protocols to vm instances # @VERSION@ diff --git a/patches/systemvm/debian/config/root/func.sh b/patches/systemvm/debian/config/root/func.sh index 170d4a91609..4047a4047a6 100644 --- a/patches/systemvm/debian/config/root/func.sh +++ b/patches/systemvm/debian/config/root/func.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # Only one lock is allowed: biglock diff --git a/patches/systemvm/debian/config/root/loadbalancer.sh b/patches/systemvm/debian/config/root/loadbalancer.sh index 26d47e1feee..2c7f77a30cc 100755 --- a/patches/systemvm/debian/config/root/loadbalancer.sh +++ b/patches/systemvm/debian/config/root/loadbalancer.sh @@ -1,18 +1,20 @@ #!/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/patches/systemvm/debian/config/root/reconfigLB.sh b/patches/systemvm/debian/config/root/reconfigLB.sh index 304ab85ee09..ab91a39cc87 100755 --- a/patches/systemvm/debian/config/root/reconfigLB.sh +++ b/patches/systemvm/debian/config/root/reconfigLB.sh @@ -1,18 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. ret=0 diff --git a/patches/systemvm/debian/config/root/redundant_router/check_bumpup.sh b/patches/systemvm/debian/config/root/redundant_router/check_bumpup.sh index 0e6f4daf334..7682bad5f63 100644 --- a/patches/systemvm/debian/config/root/redundant_router/check_bumpup.sh +++ b/patches/systemvm/debian/config/root/redundant_router/check_bumpup.sh @@ -1,15 +1,19 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. cat /tmp/rrouter_bumped diff --git a/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh b/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh index 1f3d9e43caf..84631f67951 100644 --- a/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh +++ b/patches/systemvm/debian/config/root/redundant_router/disable_pubip.sh @@ -1,16 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. ip link|grep BROADCAST|grep -v eth0|grep -v eth1|cut -d ":" -f 2 > /tmp/iflist while read i diff --git a/patches/systemvm/debian/config/root/redundant_router/primary-backup.sh.templ b/patches/systemvm/debian/config/root/redundant_router/primary-backup.sh.templ index f5e13ee6805..4eb9eafe4fd 100644 --- a/patches/systemvm/debian/config/root/redundant_router/primary-backup.sh.templ +++ b/patches/systemvm/debian/config/root/redundant_router/primary-backup.sh.templ @@ -1,13 +1,19 @@ -#Copyright 2012 Citrix Systems, Inc. Licensed under the -#Apache License, Version 2.0 (the "License"); you may not use this -#file except in compliance with the License. Citrix Systems, Inc. -#reserves all rights not expressly granted by 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. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. CONNTRACKD_BIN=/usr/sbin/conntrackd CONNTRACKD_LOCK=/var/lock/conntrack.lock diff --git a/patches/systemvm/debian/config/root/userdata.py b/patches/systemvm/debian/config/root/userdata.py index 85fbda3c750..cc130a55dd7 100644 --- a/patches/systemvm/debian/config/root/userdata.py +++ b/patches/systemvm/debian/config/root/userdata.py @@ -1,19 +1,20 @@ #!/usr/bin/python -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/patches/systemvm/debian/config/root/userdata.sh b/patches/systemvm/debian/config/root/userdata.sh index bbc65186b11..e5d170b5b23 100644 --- a/patches/systemvm/debian/config/root/userdata.sh +++ b/patches/systemvm/debian/config/root/userdata.sh @@ -1,18 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/patches/systemvm/debian/vpn/opt/cloud/bin/vpc_vpn_l2tp.sh b/patches/systemvm/debian/vpn/opt/cloud/bin/vpc_vpn_l2tp.sh index 574fd69e794..9277bc7e943 100755 --- a/patches/systemvm/debian/vpn/opt/cloud/bin/vpc_vpn_l2tp.sh +++ b/patches/systemvm/debian/vpn/opt/cloud/bin/vpc_vpn_l2tp.sh @@ -1,18 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/patches/systemvm/debian/vpn/opt/cloud/bin/vpn_l2tp.sh b/patches/systemvm/debian/vpn/opt/cloud/bin/vpn_l2tp.sh index e29b1abb9e0..7eb8b00d288 100755 --- a/patches/systemvm/debian/vpn/opt/cloud/bin/vpn_l2tp.sh +++ b/patches/systemvm/debian/vpn/opt/cloud/bin/vpn_l2tp.sh @@ -1,18 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/patches/systemvm/debian/xe/xe-daemon b/patches/systemvm/debian/xe/xe-daemon index d949895b2dd..bc514d780b8 100644 --- a/patches/systemvm/debian/xe/xe-daemon +++ b/patches/systemvm/debian/xe/xe-daemon @@ -1,15 +1,21 @@ #!/bin/bash -#Copyright 2012 Citrix Systems, Inc. Licensed under the -#Apache License, Version 2.0 (the "License"); you may not use this -#file except in compliance with the License. Citrix Systems, Inc. -#reserves all rights not expressly granted by 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. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. LANG="C" export LANG diff --git a/patches/systemvm/debian/xe/xe-linux-distribution b/patches/systemvm/debian/xe/xe-linux-distribution index 4a940dde455..774f1c75859 100644 --- a/patches/systemvm/debian/xe/xe-linux-distribution +++ b/patches/systemvm/debian/xe/xe-linux-distribution @@ -1,15 +1,21 @@ #! /bin/sh -#Copyright 2012 Citrix Systems, Inc. Licensed under the -#Apache License, Version 2.0 (the "License"); you may not use this -#file except in compliance with the License. Citrix Systems, Inc. -#reserves all rights not expressly granted by 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. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # Script to write information about the current distribution to stdout or a file. # Information collected: diff --git a/patches/systemvm/debian/xe/xe-update-guest-attrs b/patches/systemvm/debian/xe/xe-update-guest-attrs index e00d9817950..30a44980b92 100644 --- a/patches/systemvm/debian/xe/xe-update-guest-attrs +++ b/patches/systemvm/debian/xe/xe-update-guest-attrs @@ -1,15 +1,21 @@ #!/bin/sh -#Copyright 2012 Citrix Systems, Inc. Licensed under the -#Apache License, Version 2.0 (the "License"); you may not use this -#file except in compliance with the License. Citrix Systems, Inc. -#reserves all rights not expressly granted by 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. +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. # Script to write information about the guest to XenStore. # diff --git a/plugins/deployment-planners/user-concentrated-pod/pom.xml b/plugins/deployment-planners/user-concentrated-pod/pom.xml index 682ac05f167..ca2fae143ab 100644 --- a/plugins/deployment-planners/user-concentrated-pod/pom.xml +++ b/plugins/deployment-planners/user-concentrated-pod/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-planner-user-concentrated-pod - Apache CloudStack Plugin - User Concentrated Pod Deployment Planner - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-planner-user-concentrated-pod + Apache CloudStack Plugin - User Concentrated Pod Deployment Planner + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java b/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java index 2b28d19cbf2..2ab98566e0a 100644 --- a/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java +++ b/plugins/deployment-planners/user-concentrated-pod/src/com/cloud/deploy/UserConcentratedPodPlanner.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.deploy; import java.util.ArrayList; diff --git a/plugins/deployment-planners/user-dispersing/pom.xml b/plugins/deployment-planners/user-dispersing/pom.xml index 247479a206c..6e1ffc6f026 100644 --- a/plugins/deployment-planners/user-dispersing/pom.xml +++ b/plugins/deployment-planners/user-dispersing/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-planner-user-dispersing - Apache CloudStack Plugin - User Dispersing Deployment Planner - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-planner-user-dispersing + Apache CloudStack Plugin - User Dispersing Deployment Planner + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java b/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java index dcad1e70aff..2db2051389d 100755 --- a/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java +++ b/plugins/deployment-planners/user-dispersing/src/com/cloud/deploy/UserDispersingPlanner.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.deploy; import java.util.ArrayList; diff --git a/plugins/file-systems/netapp/pom.xml b/plugins/file-systems/netapp/pom.xml index 9a59d163a4a..f10e5a4a499 100644 --- a/plugins/file-systems/netapp/pom.xml +++ b/plugins/file-systems/netapp/pom.xml @@ -17,21 +17,21 @@ under the License. --> - 4.0.0 - cloud-plugin-netapp - Apache CloudStack Plugin - NetApp File System - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - - - - com.cloud.com.netapp - manageontap - 1.0 - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-netapp + Apache CloudStack Plugin - NetApp File System + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + + + + com.cloud.com.netapp + manageontap + 1.0 + + diff --git a/plugins/host-allocators/random/pom.xml b/plugins/host-allocators/random/pom.xml index 478e2733106..ad66c0e0af0 100644 --- a/plugins/host-allocators/random/pom.xml +++ b/plugins/host-allocators/random/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-host-allocator-random - Apache CloudStack Plugin - Host Allocator Random - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-host-allocator-random + Apache CloudStack Plugin - Host Allocator Random + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java b/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java index 3ca2da16072..0887ee97969 100755 --- a/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java +++ b/plugins/host-allocators/random/src/com/cloud/agent/manager/allocator/impl/RandomAllocator.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.agent.manager.allocator.impl; import java.util.ArrayList; diff --git a/plugins/hypervisors/kvm/pom.xml b/plugins/hypervisors/kvm/pom.xml index 149b57a1b9a..8cdaa868157 100644 --- a/plugins/hypervisors/kvm/pom.xml +++ b/plugins/hypervisors/kvm/pom.xml @@ -17,26 +17,26 @@ under the License. --> - 4.0.0 - cloud-plugin-hypervisor-kvm - Apache CloudStack Plugin - Hypervisor KVM - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - - - - com.cloud - cloud-agent - ${project.version} - - - org.libvirt - libvirt - 0.4.8 - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-hypervisor-kvm + Apache CloudStack Plugin - Hypervisor KVM + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + + + + org.apache.cloudstack + cloud-agent + ${project.version} + + + org.libvirt + libvirt + 0.4.8 + + diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMGuestOsMapper.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMGuestOsMapper.java index e3615ad9dfd..88bb0f5f060 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMGuestOsMapper.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMGuestOsMapper.java @@ -105,6 +105,7 @@ public class KVMGuestOsMapper { s_mapper.put("Ubuntu 8.04 (64-bit)", "Other Linux"); s_mapper.put("Debian GNU/Linux 5(32-bit)", "Debian GNU/Linux 5"); s_mapper.put("Debian GNU/Linux 5(64-bit)", "Debian GNU/Linux 5"); + s_mapper.put("Debian GNU/Linux 5.0(32-bit)", "Debian GNU/Linux 5"); s_mapper.put("Debian GNU/Linux 4(32-bit)", "Debian GNU/Linux 4"); s_mapper.put("Debian GNU/Linux 4(64-bit)", "Debian GNU/Linux 4"); s_mapper.put("Debian GNU/Linux 6(64-bit)", "Debian GNU/Linux 6"); diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 9e2b62bff23..53e6da735e0 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -115,6 +115,8 @@ import com.cloud.agent.api.PingCommand; import com.cloud.agent.api.PingRoutingCommand; import com.cloud.agent.api.PingRoutingWithNwGroupsCommand; import com.cloud.agent.api.PingTestCommand; +import com.cloud.agent.api.PlugNicAnswer; +import com.cloud.agent.api.PlugNicCommand; import com.cloud.agent.api.PrepareForMigrationAnswer; import com.cloud.agent.api.PrepareForMigrationCommand; import com.cloud.agent.api.ReadyAnswer; @@ -124,6 +126,8 @@ import com.cloud.agent.api.RebootCommand; import com.cloud.agent.api.RebootRouterCommand; import com.cloud.agent.api.SecurityGroupRuleAnswer; import com.cloud.agent.api.SecurityGroupRulesCmd; +import com.cloud.agent.api.SetupGuestNetworkAnswer; +import com.cloud.agent.api.SetupGuestNetworkCommand; import com.cloud.agent.api.StartAnswer; import com.cloud.agent.api.StartCommand; import com.cloud.agent.api.StartupCommand; @@ -131,6 +135,8 @@ import com.cloud.agent.api.StartupRoutingCommand; import com.cloud.agent.api.StartupStorageCommand; import com.cloud.agent.api.StopAnswer; import com.cloud.agent.api.StopCommand; +import com.cloud.agent.api.UnPlugNicAnswer; +import com.cloud.agent.api.UnPlugNicCommand; import com.cloud.agent.api.UpgradeSnapshotCommand; import com.cloud.agent.api.VmStatsEntry; import com.cloud.agent.api.check.CheckSshAnswer; @@ -140,7 +146,12 @@ import com.cloud.agent.api.proxy.ConsoleProxyLoadAnswer; import com.cloud.agent.api.proxy.WatchConsoleProxyLoadCommand; import com.cloud.agent.api.routing.IpAssocAnswer; import com.cloud.agent.api.routing.IpAssocCommand; +import com.cloud.agent.api.routing.IpAssocVpcCommand; import com.cloud.agent.api.routing.NetworkElementCommand; +import com.cloud.agent.api.routing.SetNetworkACLAnswer; +import com.cloud.agent.api.routing.SetNetworkACLCommand; +import com.cloud.agent.api.routing.SetSourceNatAnswer; +import com.cloud.agent.api.routing.SetSourceNatCommand; import com.cloud.agent.api.storage.CopyVolumeAnswer; import com.cloud.agent.api.storage.CopyVolumeCommand; import com.cloud.agent.api.storage.CreateAnswer; @@ -1020,6 +1031,18 @@ public class LibvirtComputingResource extends ServerResourceBase implements return execute((FenceCommand) cmd); } else if (cmd instanceof StartCommand) { return execute((StartCommand) cmd); + } else if (cmd instanceof PlugNicCommand) { + return execute((PlugNicCommand) cmd); + } else if (cmd instanceof UnPlugNicCommand) { + return execute((UnPlugNicCommand) cmd); + } else if (cmd instanceof SetupGuestNetworkCommand) { + return execute((SetupGuestNetworkCommand) cmd); + } else if (cmd instanceof SetNetworkACLCommand) { + return execute((SetNetworkACLCommand) cmd); + } else if (cmd instanceof SetSourceNatCommand) { + return execute((SetSourceNatCommand) cmd); + } else if (cmd instanceof IpAssocVpcCommand) { + return execute((IpAssocVpcCommand) cmd); } else if (cmd instanceof IpAssocCommand) { return execute((IpAssocCommand) cmd); } else if (cmd instanceof NetworkElementCommand) { @@ -1231,7 +1254,242 @@ public class LibvirtComputingResource extends ServerResourceBase implements } Domain vm = getDomain(conn, vmName); - vm.attachDevice(_vifDriver.plug(nicTO, "Other PV").toString()); + vm.attachDevice(_vifDriver.plug(nicTO, "Other PV (32-bit)").toString()); + } + + private PlugNicAnswer execute(PlugNicCommand cmd) { + Connect conn; + NicTO nic = cmd.getNic(); + String vmName = cmd.getVmName(); + try { + conn = LibvirtConnection.getConnection(); + Domain vm = getDomain(conn, vmName); + List pluggedNics = getInterfaces(conn, vmName); + Integer nicnum = 0; + for (InterfaceDef pluggedNic : pluggedNics) { + if (pluggedNic.getMacAddress().equalsIgnoreCase(nic.getMac())) { + s_logger.debug("found existing nic for mac "+ pluggedNic.getMacAddress() + " at index "+nicnum); + return new PlugNicAnswer(cmd, true, "success"); + } + nicnum++; + } + vm.attachDevice(_vifDriver.plug(nic, "Other PV (32-bit)").toString()); + return new PlugNicAnswer(cmd, true, "success"); + } catch (Exception e) { + String msg = " Plug Nic failed due to " + e.toString(); + s_logger.warn(msg, e); + return new PlugNicAnswer(cmd, false, msg); + } + } + + private UnPlugNicAnswer execute(UnPlugNicCommand cmd) { + Connect conn; + NicTO nic = cmd.getNic(); + String vmName = cmd.getInstanceName(); + try { + conn = LibvirtConnection.getConnection(); + Domain vm = getDomain(conn, vmName); + List pluggedNics = getInterfaces(conn, vmName); + for (InterfaceDef pluggedNic : pluggedNics) { + if (pluggedNic.getMacAddress().equalsIgnoreCase(nic.getMac())) { + vm.detachDevice(pluggedNic.toString()); + return new UnPlugNicAnswer(cmd, true, "success"); + } + } + return new UnPlugNicAnswer(cmd, true, "success"); + } catch (Exception e) { + String msg = " Unplug Nic failed due to " + e.toString(); + s_logger.warn(msg, e); + return new UnPlugNicAnswer(cmd, false, msg); + } + } + + private SetupGuestNetworkAnswer execute(SetupGuestNetworkCommand cmd) { + Connect conn; + NicTO nic = cmd.getNic(); + String routerIP = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); + String routerGIP = cmd.getAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP); + String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME); + String gateway = cmd.getAccessDetail(NetworkElementCommand.GUEST_NETWORK_GATEWAY); + String cidr = Long.toString(NetUtils.getCidrSize(nic.getNetmask()));; + String domainName = cmd.getNetworkDomain(); + String dns = cmd.getDefaultDns1(); + + if (dns == null || dns.isEmpty()) { + dns = cmd.getDefaultDns2(); + } else { + String dns2= cmd.getDefaultDns2(); + if ( dns2 != null && !dns2.isEmpty()) { + dns += "," + dns2; + } + } + + try { + conn = LibvirtConnection.getConnection(); + Domain vm = getDomain(conn, routerName); + List pluggedNics = getInterfaces(conn, routerName); + InterfaceDef routerNic = null; + + for (InterfaceDef pluggedNic : pluggedNics) { + if (pluggedNic.getMacAddress().equalsIgnoreCase(nic.getMac())) { + routerNic = pluggedNic; + break; + } + } + + if ( routerNic == null ) { + return new SetupGuestNetworkAnswer(cmd, false, "Can not find nic with mac " + nic.getMac() + " for VM " + routerName); + } + + String args = "vpc_guestnw.sh " + routerIP + " -C"; + String dev = "eth" + nic.getDeviceId(); + String netmask = NetUtils.getSubNet(routerGIP, nic.getNetmask()); + String result = _virtRouterResource.assignGuestNetwork(dev, routerIP, + routerGIP, gateway, cidr, netmask, dns, domainName ); + + if (result != null) { + return new SetupGuestNetworkAnswer(cmd, false, "Creating guest network failed due to " + result); + } + return new SetupGuestNetworkAnswer(cmd, true, "success"); + } catch (Exception e) { + String msg = "Creating guest network failed due to " + e.toString(); + s_logger.warn(msg, e); + return new SetupGuestNetworkAnswer(cmd, false, msg); + } + } + + private SetNetworkACLAnswer execute(SetNetworkACLCommand cmd) { + String[] results = new String[cmd.getRules().length]; + String callResult; + Connect conn; + String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME); + String routerIp = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); + + try { + conn = LibvirtConnection.getConnection(); + Domain vm = getDomain(conn, routerName); + String [][] rules = cmd.generateFwRules(); + String[] aclRules = rules[0]; + NicTO nic = cmd.getNic(); + String dev = "eth" + nic.getDeviceId(); + String netmask = Long.toString(NetUtils.getCidrSize(nic.getNetmask())); + StringBuilder sb = new StringBuilder(); + + for (int i = 0; i < aclRules.length; i++) { + sb.append(aclRules[i]).append(','); + } + + String rule = sb.toString(); + String result = _virtRouterResource.assignNetworkACL(routerIp, + dev, nic.getIp(), netmask, rule); + + if (result != null) { + for (int i=0; i < results.length; i++) { + results[i] = "Failed"; + } + return new SetNetworkACLAnswer(cmd, false, results); + } + + return new SetNetworkACLAnswer(cmd, true, results); + } catch (Exception e) { + String msg = "SetNetworkACL failed due to " + e.toString(); + s_logger.error(msg, e); + return new SetNetworkACLAnswer(cmd, false, results); + } + } + + protected SetSourceNatAnswer execute(SetSourceNatCommand cmd) { + Connect conn; + String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME); + String routerIP = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); + IpAddressTO pubIP = cmd.getIpAddress(); + + try { + conn = LibvirtConnection.getConnection(); + Domain vm = getDomain(conn, routerName); + Integer devNum = 0; + String pubVlan = pubIP.getVlanId(); + List pluggedNics = getInterfaces(conn, routerName); + + for (InterfaceDef pluggedNic : pluggedNics) { + String pluggedVlanBr = pluggedNic.getBrName(); + String pluggedVlanId = getVlanIdFromBridge(pluggedVlanBr); + if (pubVlan.equalsIgnoreCase(Vlan.UNTAGGED) + && pluggedVlanBr.equalsIgnoreCase(_publicBridgeName)) { + break; + } else if (pluggedVlanBr.equalsIgnoreCase(_linkLocalBridgeName)){ + /*skip over, no physical bridge device exists*/ + } else if (pluggedVlanId == null) { + /*this should only be true in the case of link local bridge*/ + return new SetSourceNatAnswer(cmd, false, "unable to find the vlan id for bridge "+pluggedVlanBr+ + " when attempting to set up" + pubVlan + " on router " + routerName); + } else if (pluggedVlanId.equals(pubVlan)) { + break; + } + devNum++; + } + + String dev = "eth" + devNum; + String result = _virtRouterResource.assignSourceNat(routerIP, pubIP.getPublicIp(), dev); + + if (result != null) { + return new SetSourceNatAnswer(cmd, false, "KVM plugin \"vpc_snat\" failed:"+result); + } + return new SetSourceNatAnswer(cmd, true, "success"); + } catch (Exception e) { + String msg = "Ip SNAT failure due to " + e.toString(); + s_logger.error(msg, e); + return new SetSourceNatAnswer(cmd, false, msg); + } + } + + protected IpAssocAnswer execute(IpAssocVpcCommand cmd) { + Connect conn; + String[] results = new String[cmd.getIpAddresses().length]; + int i = 0; + String routerName = cmd.getAccessDetail(NetworkElementCommand.ROUTER_NAME); + String routerIP = cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP); + + try { + conn = LibvirtConnection.getConnection(); + IpAddressTO[] ips = cmd.getIpAddresses(); + Domain vm = getDomain(conn, routerName); + Integer devNum = 0; + Map vlanToNicNum = new HashMap(); + List pluggedNics = getInterfaces(conn, routerName); + + for (InterfaceDef pluggedNic : pluggedNics) { + String pluggedVlan = pluggedNic.getBrName(); + if (pluggedVlan.equalsIgnoreCase(_linkLocalBridgeName)) { + vlanToNicNum.put("LinkLocal",devNum); + } + else if (pluggedVlan.equalsIgnoreCase(_publicBridgeName) + || pluggedVlan.equalsIgnoreCase(_privBridgeName) + || pluggedVlan.equalsIgnoreCase(_guestBridgeName)) { + vlanToNicNum.put(Vlan.UNTAGGED,devNum); + } + else { + vlanToNicNum.put(getVlanIdFromBridge(pluggedVlan),devNum); + } + devNum++; + } + + for (IpAddressTO ip : ips) { + String ipVlan = ip.getVlanId(); + String nicName = "eth" + vlanToNicNum.get(ip.getVlanId()); + String netmask = Long.toString(NetUtils.getCidrSize(ip.getVlanNetmask())); + String subnet = NetUtils.getSubNet(ip.getPublicIp(), ip.getVlanNetmask()); + _virtRouterResource.assignVpcIpToRouter(routerIP, ip.isAdd(), ip.getPublicIp(), + nicName, ip.getVlanGateway(), netmask, subnet); + results[i++] = ip.getPublicIp() + " - success"; + } + + } catch (Exception e) { + s_logger.error("Ip Assoc failure on applying one ip due to exception: ", e); + results[i++] = IpAssocAnswer.errorResult; + } + + return new IpAssocAnswer(cmd, results); } public Answer execute(IpAssocCommand cmd) { @@ -1249,12 +1507,14 @@ public class LibvirtComputingResource extends ServerResourceBase implements if (nic.getBrName().equalsIgnoreCase(_linkLocalBridgeName)) { vlanAllocatedToVM.put("LinkLocal", nicPos); } else { - String vlanId = getVlanIdFromBridge(nic.getBrName()); - if (vlanId != null) { - vlanAllocatedToVM.put(vlanId, nicPos); - } else { - vlanAllocatedToVM.put(Vlan.UNTAGGED, nicPos); - } + if (nic.getBrName().equalsIgnoreCase(_publicBridgeName) + || nic.getBrName().equalsIgnoreCase(_privBridgeName) + || nic.getBrName().equalsIgnoreCase(_guestBridgeName)) { + vlanAllocatedToVM.put(Vlan.UNTAGGED, nicPos); + } else { + String vlanId = getVlanIdFromBridge(nic.getBrName()); + vlanAllocatedToVM.put(vlanId, nicPos); + } } nicPos++; } @@ -3769,7 +4029,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements NodeInfo node = conn.nodeInfo(); utilization = utilization / node.cpus; - stats.setCPUUtilization(utilization * 100); + if(utilization > 0){ + stats.setCPUUtilization(utilization * 100); + } } /* get network stats */ diff --git a/plugins/hypervisors/ovm/pom.xml b/plugins/hypervisors/ovm/pom.xml index 28dfcd13885..a8b23d0b943 100644 --- a/plugins/hypervisors/ovm/pom.xml +++ b/plugins/hypervisors/ovm/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-hypervisor-ovm - Apache CloudStack Plugin - Hypervisor OracleVM - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-hypervisor-ovm + Apache CloudStack Plugin - Hypervisor OracleVM + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/plugins/hypervisors/vmware/pom.xml b/plugins/hypervisors/vmware/pom.xml index 5869fba7860..435ae38b847 100644 --- a/plugins/hypervisors/vmware/pom.xml +++ b/plugins/hypervisors/vmware/pom.xml @@ -17,21 +17,21 @@ under the License. --> - 4.0.0 - cloud-plugin-hypervisor-vmware - Apache CloudStack Plugin - Hypervisor VMware - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - - - - com.cloud - cloud-vmware-base - ${project.version} - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-hypervisor-vmware + Apache CloudStack Plugin - Hypervisor VMware + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + + + + org.apache.cloudstack + cloud-vmware-base + ${project.version} + + diff --git a/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareFencer.java b/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareFencer.java index f33f1e16b95..c732b94f707 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareFencer.java +++ b/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareFencer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.ha; import java.util.Map; diff --git a/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareInvestigator.java b/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareInvestigator.java index b85f307eb0f..a7e67e1bbe1 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareInvestigator.java +++ b/plugins/hypervisors/vmware/src/com/cloud/ha/VmwareInvestigator.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.ha; import javax.ejb.Local; diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java index 4f936beba91..546df5f2389 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.guru; import java.util.ArrayList; diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java index ee2f56ffad6..a3e2fca16bd 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareCleanupMaid.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.vmware; import java.util.ArrayList; diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java index af53daded02..a75640bedfe 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/VmwareServerDiscoverer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.vmware; import java.net.URI; diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java index 5822af85dd6..4906b2fdd21 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareHostService.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.vmware.manager; import com.cloud.agent.api.Command; diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java index 7d85a961ab7..be3fe9f465b 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManager.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.vmware.manager; import java.io.File; diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java index 91c52e52571..205fb26f09d 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.vmware.manager; import java.io.File; diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java index b2372915f7e..f27e0269a64 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManager.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.vmware.manager; import com.cloud.agent.api.Answer; diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java index b525e13654a..8650274719e 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.vmware.manager; import java.io.BufferedWriter; diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java index 9f4de50b9fd..8ea22020093 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageMount.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.vmware.manager; public interface VmwareStorageMount { diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java index f82afb8d3f0..053ed6eaf46 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareContextFactory.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.vmware.resource; import org.apache.log4j.Logger; diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index 838a132f579..ba71fafcfef 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.vmware.resource; import java.io.File; @@ -138,6 +142,7 @@ import com.cloud.agent.api.routing.SetSourceNatCommand; import com.cloud.agent.api.routing.SetSourceNatAnswer; import com.cloud.agent.api.routing.SetStaticNatRulesAnswer; import com.cloud.agent.api.routing.SetStaticNatRulesCommand; +import com.cloud.agent.api.routing.Site2SiteVpnCfgCommand; import com.cloud.agent.api.routing.VmDataCommand; import com.cloud.agent.api.routing.VpnUsersCfgCommand; import com.cloud.agent.api.storage.CopyVolumeAnswer; @@ -442,6 +447,10 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa answer = execute((SetNetworkACLCommand) cmd); } else if (clz == SetPortForwardingRulesVpcCommand.class) { answer = execute((SetPortForwardingRulesVpcCommand) cmd); + } else if (clz == Site2SiteVpnCfgCommand.class) { + answer = execute((Site2SiteVpnCfgCommand) cmd); + } else if (clz == CheckS2SVpnConnectionsCommand.class) { + answer = execute((CheckS2SVpnConnectionsCommand) cmd); } else { answer = Answer.createUnsupportedCommandAnswer(cmd); } @@ -1114,6 +1123,75 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa return new SetPortForwardingRulesAnswer(cmd, results, endResult); } + protected Answer execute(Site2SiteVpnCfgCommand cmd) { + if (s_logger.isInfoEnabled()) { + s_logger.info("Executing resource Site2SiteVpnCfgCommand " + _gson.toJson(cmd)); + } + + VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); + + String routerIp = getRouterSshControlIp(cmd); + + String args =""; + if (cmd.isCreate()) { + args += " -A"; + args += " -l "; + args += cmd.getLocalPublicIp(); + args += " -n "; + args += cmd.getLocalGuestCidr(); + args += " -g "; + args += cmd.getLocalPublicGateway(); + args += " -r "; + args += cmd.getPeerGatewayIp(); + args += " -N "; + args += cmd.getPeerGuestCidrList(); + args += " -e "; + args += "\"" + cmd.getEspPolicy() + "\""; + args += " -i "; + args += "\"" + cmd.getIkePolicy() + "\""; + args += " -t "; + args += Long.toString(cmd.getIkeLifetime()); + args += " -T "; + args += Long.toString(cmd.getEspLifetime()); + args += " -s "; + args += "\"" + cmd.getIpsecPsk() + "\""; + args += " -d "; + if (cmd.getDpd()) { + args += "1"; + } else { + args += "0"; + } + } else { + args += " -D"; + args += " -r "; + args += cmd.getPeerGatewayIp(); + args += " -n "; + args += cmd.getLocalGuestCidr(); + args += " -N "; + args += cmd.getPeerGuestCidrList(); + } + + Pair result; + try { + result = SshHelper.sshExecute(routerIp, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null, + "/opt/cloud/bin/ipsectunnel.sh " + args); + + if (!result.first()) { + s_logger.error("Setup site2site VPN " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + " failed, message: " + result.second()); + + return new Answer(cmd, false, "Setup site2site VPN falied due to " + result.second()); + } + + if (s_logger.isDebugEnabled()) { + s_logger.debug("setup site 2 site vpn on router " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + " completed"); + } + } catch (Throwable e) { + String msg = "Setup site2site VPN falied due to " + VmwareHelper.getExceptionMessage(e); + s_logger.error(msg, e); + return new Answer(cmd, false, "Setup site2site VPN failed due to " + VmwareHelper.getExceptionMessage(e)); + } + return new Answer(cmd, true, result.second()); + } private PlugNicAnswer execute(PlugNicCommand cmd) { if (s_logger.isInfoEnabled()) { @@ -1344,11 +1422,11 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa args += vlanGateway; if (s_logger.isDebugEnabled()) { - s_logger.debug("Run command on domain router " + privateIpAddress + ", /root/ipassoc.sh " + args); + s_logger.debug("Run command on domain router " + privateIpAddress + ", /opt/cloud/bin/ipassoc.sh " + args); } VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); - Pair result = SshHelper.sshExecute(privateIpAddress, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null, "/root/ipassoc.sh " + args); + Pair result = SshHelper.sshExecute(privateIpAddress, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null, "/opt/cloud/bin/ipassoc.sh " + args); if (!result.first()) { s_logger.error("ipassoc command on domain router " + privateIpAddress + " failed. message: " + result.second()); @@ -1602,8 +1680,12 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa try { VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); String controlIp = getRouterSshControlIp(cmd); - result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null, - "/opt/cloud/bin/checkbatchs2svpn.sh "); + String cmdline = "/opt/cloud/bin/checkbatchs2svpn.sh "; + for (String ip : cmd.getVpnIps()) { + cmdline += " " + ip; + } + + result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null, cmdline); if (!result.first()) { s_logger.error("check site-to-site vpn connections command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + " failed, message: " + result.second()); @@ -1632,7 +1714,7 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa VmwareManager mgr = getServiceContext().getStockObject(VmwareManager.CONTEXT_STOCK_NAME); String controlIp = getRouterSshControlIp(cmd); result = SshHelper.sshExecute(controlIp, DEFAULT_DOMR_SSHPORT, "root", mgr.getSystemVMKeyFile(), null, - "/root/checkrouter.sh "); + "/opt/cloud/bin/checkrouter.sh "); if (!result.first()) { s_logger.error("check router command on domR " + cmd.getAccessDetail(NetworkElementCommand.ROUTER_IP) + " failed, message: " + result.second()); @@ -3072,7 +3154,8 @@ public class VmwareResource implements StoragePoolResource, ServerResource, Vmwa // TODO, check if iso is already attached, or if there is a previous // attachment - String isoDatastorePath = String.format("[%s] %s%s", getSecondaryDatastoreUUID(storeUrl), isoStorePathFromRoot, isoFileName); + String storeName = getSecondaryDatastoreUUID(storeUrl).replace("-", ""); + String isoDatastorePath = String.format("[%s] %s%s", storeName, isoStorePathFromRoot, isoFileName); if (cmd.isAttach()) { vmMo.attachIso(isoDatastorePath, morSecondaryDs, true, false); diff --git a/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java index 69638587f7a..05214f5c912 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/network/CiscoNexusVSMDeviceManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network; import java.util.HashMap; diff --git a/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java b/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java index 95771a5f26c..26264b35e4e 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java +++ b/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDao.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.dao; import java.util.List; diff --git a/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java b/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java index 02d9e44c18b..7d8c5abfc07 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/network/dao/CiscoNexusVSMDeviceDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.dao; import java.util.List; @@ -105,4 +109,4 @@ public class CiscoNexusVSMDeviceDaoImpl extends GenericDaoBase - 4.0.0 - cloud-plugin-hypervisor-xen - Apache CloudStack Plugin - Hypervisor Xen - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - - - - com.cloud - cloud-plugin-network-ovs - ${project.version} - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-hypervisor-xen + Apache CloudStack Plugin - Hypervisor Xen + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + + + + org.apache.cloudstack + cloud-plugin-network-ovs + ${project.version} + + diff --git a/plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java b/plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java index c9c701a40d8..d810c583b71 100755 --- a/plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java +++ b/plugins/hypervisors/xen/src/com/cloud/ha/XenServerFencer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.ha; import java.util.List; diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java index f9e1c8980e9..585a18ce18f 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor; import javax.ejb.Local; diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java index b13730c34b7..9faceaae3bd 100755 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/discoverer/XcpServerDiscoverer.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.xen.discoverer; import java.net.InetAddress; diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java index 1cc1075dd78..bbb1ecfdb95 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixHelper.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.xen.resource; import java.util.ArrayList; diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index c88ae8047c7..b71b47c416a 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.xen.resource; @@ -4646,7 +4650,8 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe /* return : if setup is needed */ protected boolean setupServer(Connection conn) { - String version = this.getClass().getName() + "-" + CitrixResourceBase.class.getPackage().getImplementationVersion(); + String packageVersion = CitrixResourceBase.class.getPackage().getImplementationVersion(); + String version = this.getClass().getName() + "-" + ( packageVersion == null ? Long.toString(System.currentTimeMillis()) : packageVersion ); try { Host host = Host.getByUuid(conn, _host.uuid); @@ -7373,7 +7378,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe } return new SetupGuestNetworkAnswer(cmd, true, "success"); } catch (Exception e) { - String msg = " UnPlug Nic failed due to " + e.toString(); + String msg = "Creating guest network failed due to " + e.toString(); s_logger.warn(msg, e); return new SetupGuestNetworkAnswer(cmd, false, msg); } diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java index 8325b0649d2..0ce91bc58e2 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XcpServerResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.xen.resource; import java.io.File; diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java index d689393688b..58b8a035171 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56FP1Resource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.xen.resource; diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java index 9f672c5a742..270240b69c8 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.xen.resource; import java.io.File; diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java index 420d4df750c..38e1271207b 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56SP2Resource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.xen.resource; diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java index 03aa9b49694..bd8518ba171 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer600Resource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.xen.resource; diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java index 9c2e914d9f8..212bc47d2e7 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer602Resource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.xen.resource; diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java index 11fbd492803..e4dd675b334 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerConnectionPool.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.xen.resource; import java.io.File; @@ -976,4 +980,4 @@ public class XenServerConnectionPool { } } -} \ No newline at end of file +} diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java index 7650d44ecd9..33f2bf96606 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServerPoolVms.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.hypervisor.xen.resource; import java.util.HashMap; diff --git a/plugins/network-elements/elastic-loadbalancer/pom.xml b/plugins/network-elements/elastic-loadbalancer/pom.xml index c4a81216c76..c1ab2c56664 100644 --- a/plugins/network-elements/elastic-loadbalancer/pom.xml +++ b/plugins/network-elements/elastic-loadbalancer/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-network-elb - Apache CloudStack Plugin - Network Elastic Load Balancer - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-network-elb + Apache CloudStack Plugin - Network Elastic Load Balancer + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/plugins/network-elements/f5/pom.xml b/plugins/network-elements/f5/pom.xml index f135efa8f38..0cba48cdfcf 100644 --- a/plugins/network-elements/f5/pom.xml +++ b/plugins/network-elements/f5/pom.xml @@ -17,26 +17,26 @@ under the License. --> - 4.0.0 - cloud-plugin-network-f5 - Apache CloudStack Plugin - F5 - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - - - - com.cloud.com.f5 - icontrol - 1.0 - - - org.apache.axis - axis - ${cs.axis.version} - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-network-f5 + Apache CloudStack Plugin - F5 + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + + + + com.cloud.com.f5 + icontrol + 1.0 + + + org.apache.axis + axis + ${cs.axis.version} + + diff --git a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java index d685ad973c1..6cfe3333049 100644 --- a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java +++ b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElement.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.element; import java.util.ArrayList; diff --git a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElementService.java b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElementService.java index ee288ef3c1f..24c76753b47 100644 --- a/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElementService.java +++ b/plugins/network-elements/f5/src/com/cloud/network/element/F5ExternalLoadBalancerElementService.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.element; import java.util.List; diff --git a/plugins/network-elements/f5/src/com/cloud/network/resource/F5BigIpResource.java b/plugins/network-elements/f5/src/com/cloud/network/resource/F5BigIpResource.java index bf7719249e2..a45dd92ca98 100644 --- a/plugins/network-elements/f5/src/com/cloud/network/resource/F5BigIpResource.java +++ b/plugins/network-elements/f5/src/com/cloud/network/resource/F5BigIpResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.resource; import iControl.CommonEnabledState; @@ -1076,4 +1080,4 @@ public class F5BigIpResource implements ServerResource { - \ No newline at end of file + diff --git a/plugins/network-elements/juniper-srx/pom.xml b/plugins/network-elements/juniper-srx/pom.xml index 6854e506fe8..38a2b550c7e 100644 --- a/plugins/network-elements/juniper-srx/pom.xml +++ b/plugins/network-elements/juniper-srx/pom.xml @@ -17,26 +17,26 @@ under the License. --> - 4.0.0 - cloud-plugin-network-srx - Apache CloudStack Plugin - Juniper SRX - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - - - - com.cloud.com.f5 - icontrol - 1.0 - - - org.apache.axis - axis - ${cs.axis.version} - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-network-srx + Apache CloudStack Plugin - Juniper SRX + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + + + + com.cloud.com.f5 + icontrol + 1.0 + + + org.apache.axis + axis + ${cs.axis.version} + + diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddExternalFirewallCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddExternalFirewallCmd.java index df6ec163233..9b55af644ac 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddExternalFirewallCmd.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddExternalFirewallCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.api.commands; import org.apache.log4j.Logger; diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddSrxFirewallCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddSrxFirewallCmd.java index 6a6bfaffd9c..6872c8eabfe 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddSrxFirewallCmd.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/AddSrxFirewallCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.api.commands; import org.apache.log4j.Logger; diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java index 62a5746a982..d5d90ff1196 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ConfigureSrxFirewallCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.api.commands; import org.apache.log4j.Logger; diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java index 1eeb27f8b27..8a0af1f05bb 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteExternalFirewallCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.api.commands; import org.apache.log4j.Logger; diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java index 18ec2301d80..d741c0ca3b9 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/DeleteSrxFirewallCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.api.commands; import org.apache.log4j.Logger; diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListExternalFirewallsCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListExternalFirewallsCmd.java index 48931c7c1d2..111df728095 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListExternalFirewallsCmd.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListExternalFirewallsCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.api.commands; import java.util.ArrayList; diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java index b8ab03bc9d4..43a5dff0508 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallNetworksCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.api.commands; import java.util.ArrayList; diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallsCmd.java b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallsCmd.java index 803fcc96de1..a4f68566a25 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallsCmd.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/api/commands/ListSrxFirewallsCmd.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.api.commands; import java.util.ArrayList; diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java index ad2516b3b44..4580685291d 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXExternalFirewallElement.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.element; import java.util.ArrayList; @@ -542,4 +546,4 @@ public class JuniperSRXExternalFirewallElement extends ExternalFirewallDeviceMan // TODO Auto-generated method stub return false; } -} \ No newline at end of file +} diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXFirewallElementService.java b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXFirewallElementService.java index f622ee72263..6d07d303128 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXFirewallElementService.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/network/element/JuniperSRXFirewallElementService.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.element; import java.util.List; diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java b/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java index 8f8278558c2..ebb3de6c850 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.resource; import java.io.BufferedReader; @@ -3201,4 +3205,4 @@ public class JuniperSrxResource implements ServerResource { } } -} \ No newline at end of file +} diff --git a/plugins/network-elements/midokura-midonet/pom.xml b/plugins/network-elements/midokura-midonet/pom.xml index f305e93b47d..7f2e2d3cebe 100644 --- a/plugins/network-elements/midokura-midonet/pom.xml +++ b/plugins/network-elements/midokura-midonet/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-network-midonet - Apache CloudStack Plugin - Midokura Midonet - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-network-midonet + Apache CloudStack Plugin - Midokura Midonet + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/plugins/network-elements/netscaler/pom.xml b/plugins/network-elements/netscaler/pom.xml index 83b377a1300..377e6e0f228 100644 --- a/plugins/network-elements/netscaler/pom.xml +++ b/plugins/network-elements/netscaler/pom.xml @@ -17,26 +17,26 @@ under the License. --> - 4.0.0 - cloud-plugin-network-netscaler - Apache CloudStack Plugin - Network Netscaler - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - - - - com.cloud.com.citrix - netscaler - 1.0 - - - com.cloud.com.citrix - netscaler-sdx - 1.0 - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-network-netscaler + Apache CloudStack Plugin - Network Netscaler + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + + + + com.cloud.com.citrix + netscaler + 1.0 + + + com.cloud.com.citrix + netscaler-sdx + 1.0 + + diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/NetScalerPodVO.java b/plugins/network-elements/netscaler/src/com/cloud/network/NetScalerPodVO.java index 9325c1400a9..f28078749d2 100644 --- a/plugins/network-elements/netscaler/src/com/cloud/network/NetScalerPodVO.java +++ b/plugins/network-elements/netscaler/src/com/cloud/network/NetScalerPodVO.java @@ -1,14 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network; import javax.persistence.Column; diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDao.java b/plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDao.java index 4a458617ef6..4a82cffdac6 100644 --- a/plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDao.java +++ b/plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDao.java @@ -1,14 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.dao; import java.util.List; @@ -21,4 +26,4 @@ public interface NetScalerPodDao extends GenericDao { NetScalerPodVO findByPodId(long podId); List listByNetScalerDeviceId(long netscalerDeviceId); -} \ No newline at end of file +} diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDaoImpl.java b/plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDaoImpl.java index f4df3130d12..44af53a0b64 100644 --- a/plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDaoImpl.java +++ b/plugins/network-elements/netscaler/src/com/cloud/network/dao/NetScalerPodDaoImpl.java @@ -1,14 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. - +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.dao; import java.util.List; diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java index f7be3fab478..e60ee194830 100644 --- a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java +++ b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerElement.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.element; import java.net.URI; @@ -785,4 +789,4 @@ public class NetscalerElement extends ExternalLoadBalancerDeviceManagerImpl impl } return null; } -} \ No newline at end of file +} diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerLoadBalancerElementService.java b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerLoadBalancerElementService.java index d96ced6bba3..158b36e5475 100644 --- a/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerLoadBalancerElementService.java +++ b/plugins/network-elements/netscaler/src/com/cloud/network/element/NetscalerLoadBalancerElementService.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.element; import java.util.List; diff --git a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java index c7b31f31464..a709cd4ec91 100644 --- a/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java +++ b/plugins/network-elements/netscaler/src/com/cloud/network/resource/NetscalerResource.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.network.resource; import java.util.List; @@ -1530,4 +1534,4 @@ public class NetscalerResource implements ServerResource { public void disconnected() { return; } -} \ No newline at end of file +} diff --git a/plugins/network-elements/nicira-nvp/pom.xml b/plugins/network-elements/nicira-nvp/pom.xml index f70557ca462..37c3a3a6ecd 100644 --- a/plugins/network-elements/nicira-nvp/pom.xml +++ b/plugins/network-elements/nicira-nvp/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-network-nvp - Apache CloudStack Plugin - Network Nicira NVP - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-network-nvp + Apache CloudStack Plugin - Network Nicira NVP + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/awsapi/src/com/cloud/bridge/persist/PersistException.java b/plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/FindLogicalSwitchPortAnswer.java similarity index 58% rename from awsapi/src/com/cloud/bridge/persist/PersistException.java rename to plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/FindLogicalSwitchPortAnswer.java index 920cf40740e..f54bd85882d 100644 --- a/awsapi/src/com/cloud/bridge/persist/PersistException.java +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/FindLogicalSwitchPortAnswer.java @@ -14,23 +14,23 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. -package com.cloud.bridge.persist; +package com.cloud.agent.api; -public class PersistException extends RuntimeException { - private static final long serialVersionUID = -7137918292537610367L; +public class FindLogicalSwitchPortAnswer extends Answer { + private String _logicalSwitchPortUuid; - public PersistException() { - } - - public PersistException(String message) { - super(message); - } - - public PersistException(Throwable e) { - super(e); - } - - public PersistException(String message, Throwable e) { - super(message, e); - } + public FindLogicalSwitchPortAnswer(Command command, boolean success, + String details, String localSwitchPortUuid) { + super(command, success, details); + this._logicalSwitchPortUuid = localSwitchPortUuid; + } + + public String getLogicalSwitchPortUuid() { + return _logicalSwitchPortUuid; + } + + public FindLogicalSwitchPortAnswer(Command command, Exception e) { + super(command, e); + } + } diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/FindLogicalSwitchPortCommand.java b/plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/FindLogicalSwitchPortCommand.java new file mode 100644 index 00000000000..cccce67182b --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/FindLogicalSwitchPortCommand.java @@ -0,0 +1,44 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.agent.api; + +public class FindLogicalSwitchPortCommand extends Command { + private String _logicalSwitchUuid; + private String _logicalSwitchPortUuid; + + public FindLogicalSwitchPortCommand(String logicalSwitchUuid, String logicalSwitchPortUuid) { + this._logicalSwitchUuid = logicalSwitchUuid; + this._logicalSwitchPortUuid = logicalSwitchPortUuid; + } + + + public String getLogicalSwitchUuid() { + return _logicalSwitchUuid; + } + + + public String getLogicalSwitchPortUuid() { + return _logicalSwitchPortUuid; + } + + + @Override + public boolean executeInSequence() { + return false; + } + +} diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/UpdateLogicalSwitchPortAnswer.java b/plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/UpdateLogicalSwitchPortAnswer.java new file mode 100644 index 00000000000..3b7fbf7f2ae --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/UpdateLogicalSwitchPortAnswer.java @@ -0,0 +1,36 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.agent.api; + +public class UpdateLogicalSwitchPortAnswer extends Answer { + private String _logicalSwitchPortUuid; + + public UpdateLogicalSwitchPortAnswer(Command command, boolean success, + String details, String localSwitchPortUuid) { + super(command, success, details); + this._logicalSwitchPortUuid = localSwitchPortUuid; + } + + public String getLogicalSwitchPortUuid() { + return _logicalSwitchPortUuid; + } + + public UpdateLogicalSwitchPortAnswer(Command command, Exception e) { + super(command, e); + } + +} diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/UpdateLogicalSwitchPortCommand.java b/plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/UpdateLogicalSwitchPortCommand.java new file mode 100644 index 00000000000..83ae23146b5 --- /dev/null +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/agent/api/UpdateLogicalSwitchPortCommand.java @@ -0,0 +1,65 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.agent.api; + +public class UpdateLogicalSwitchPortCommand extends Command { + private String _logicalSwitchUuid; + private String _logicalSwitchPortUuid; + private String _attachmentUuid; + private String _ownerName; + private String _nicName; + + public UpdateLogicalSwitchPortCommand(String logicalSwitchPortUuid, String logicalSwitchUuid, String attachmentUuid, String ownerName, String nicName) { + this._logicalSwitchUuid = logicalSwitchUuid; + this._logicalSwitchPortUuid = logicalSwitchPortUuid; + this._attachmentUuid = attachmentUuid; + this._ownerName = ownerName; + this._nicName = nicName; + } + + + public String getLogicalSwitchUuid() { + return _logicalSwitchUuid; + } + + + public String getLogicalSwitchPortUuid() { + return _logicalSwitchPortUuid; + } + + + public String getAttachmentUuid() { + return _attachmentUuid; + } + + + public String getOwnerName() { + return _ownerName; + } + + + public String getNicName() { + return _nicName; + } + + + @Override + public boolean executeInSequence() { + return false; + } + +} diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java index bff69aa235b..1fcccdb1ee3 100644 --- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/element/NiciraNvpElement.java @@ -51,8 +51,12 @@ import com.cloud.agent.api.CreateLogicalSwitchPortAnswer; import com.cloud.agent.api.CreateLogicalSwitchPortCommand; import com.cloud.agent.api.DeleteLogicalSwitchPortAnswer; import com.cloud.agent.api.DeleteLogicalSwitchPortCommand; +import com.cloud.agent.api.FindLogicalSwitchPortAnswer; +import com.cloud.agent.api.FindLogicalSwitchPortCommand; import com.cloud.agent.api.StartupCommand; import com.cloud.agent.api.StartupNiciraNvpCommand; +import com.cloud.agent.api.UpdateLogicalSwitchPortAnswer; +import com.cloud.agent.api.UpdateLogicalSwitchPortCommand; import com.cloud.api.commands.AddNiciraNvpDeviceCmd; import com.cloud.api.commands.DeleteNiciraNvpDeviceCmd; import com.cloud.api.commands.ListNiciraNvpDeviceNetworksCmd; @@ -198,6 +202,26 @@ public class NiciraNvpElement extends AdapterBase implements ConnectivityProvide } NiciraNvpDeviceVO niciraNvpDevice = devices.get(0); HostVO niciraNvpHost = _hostDao.findById(niciraNvpDevice.getHostId()); + + NiciraNvpNicMappingVO existingNicMap = _niciraNvpNicMappingDao.findByNicUuid(nicVO.getUuid()); + if (existingNicMap != null) { + FindLogicalSwitchPortCommand findCmd = new FindLogicalSwitchPortCommand(existingNicMap.getLogicalSwitchUuid(), + existingNicMap.getLogicalSwitchPortUuid()); + FindLogicalSwitchPortAnswer answer = (FindLogicalSwitchPortAnswer) _agentMgr.easySend(niciraNvpHost.getId(), findCmd); + + if (answer.getResult()) { + s_logger.warn("Existing Logical Switchport found for nic " + nic.getName() + " with uuid " + existingNicMap.getLogicalSwitchPortUuid()); + UpdateLogicalSwitchPortCommand cmd = new UpdateLogicalSwitchPortCommand(existingNicMap.getLogicalSwitchPortUuid(), + network.getBroadcastUri().getSchemeSpecificPart(), nicVO.getUuid(), + context.getDomain().getName() + "-" + context.getAccount().getAccountName(), nic.getName()); + _agentMgr.easySend(niciraNvpHost.getId(), cmd); + return true; + } + else { + s_logger.error("Stale entry found for nic " + nic.getName() + " with logical switchport uuid " + existingNicMap.getLogicalSwitchPortUuid()); + _niciraNvpNicMappingDao.remove(existingNicMap.getId()); + } + } CreateLogicalSwitchPortCommand cmd = new CreateLogicalSwitchPortCommand(network.getBroadcastUri().getSchemeSpecificPart(), nicVO.getUuid(), context.getDomain().getName() + "-" + context.getAccount().getAccountName(), nic.getName()); @@ -244,7 +268,7 @@ public class NiciraNvpElement extends AdapterBase implements ConnectivityProvide s_logger.error("No mapping for nic " + nic.getName()); return false; } - + DeleteLogicalSwitchPortCommand cmd = new DeleteLogicalSwitchPortCommand(nicMap.getLogicalSwitchUuid(), nicMap.getLogicalSwitchPortUuid()); DeleteLogicalSwitchPortAnswer answer = (DeleteLogicalSwitchPortAnswer) _agentMgr.easySend(niciraNvpHost.getId(), cmd); diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java index 264b24a9e0e..2c002abdbff 100644 --- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/nicira/NiciraNvpApi.java @@ -195,6 +195,22 @@ public class NiciraNvpApi { return ccs; } + public NiciraNvpList findLogicalSwitchPortsByUuid(String logicalSwitchUuid, String logicalSwitchPortUuid) throws NiciraNvpApiException { + String uri = "/ws.v1/lswitch/" + logicalSwitchUuid + "/lport"; + Map params = new HashMap(); + params.put("uuid", logicalSwitchPortUuid); + params.put("fields", "uuid"); + + NiciraNvpList lspl = executeRetrieveObject(new TypeToken>(){}.getType(), uri, params); + + if (lspl == null ) { + throw new NiciraNvpApiException("Unexpected response from API"); + } + + return lspl; + } + + private void executeUpdateObject(T newObject, String uri, Map parameters) throws NiciraNvpApiException { String url; try { diff --git a/plugins/network-elements/nicira-nvp/src/com/cloud/network/resource/NiciraNvpResource.java b/plugins/network-elements/nicira-nvp/src/com/cloud/network/resource/NiciraNvpResource.java index f0f1a0c4786..31cac6f000c 100644 --- a/plugins/network-elements/nicira-nvp/src/com/cloud/network/resource/NiciraNvpResource.java +++ b/plugins/network-elements/nicira-nvp/src/com/cloud/network/resource/NiciraNvpResource.java @@ -35,6 +35,8 @@ import com.cloud.agent.api.DeleteLogicalSwitchAnswer; import com.cloud.agent.api.DeleteLogicalSwitchCommand; import com.cloud.agent.api.DeleteLogicalSwitchPortAnswer; import com.cloud.agent.api.DeleteLogicalSwitchPortCommand; +import com.cloud.agent.api.FindLogicalSwitchPortAnswer; +import com.cloud.agent.api.FindLogicalSwitchPortCommand; import com.cloud.agent.api.MaintainAnswer; import com.cloud.agent.api.MaintainCommand; import com.cloud.agent.api.PingCommand; @@ -42,6 +44,8 @@ import com.cloud.agent.api.ReadyAnswer; import com.cloud.agent.api.ReadyCommand; import com.cloud.agent.api.StartupCommand; import com.cloud.agent.api.StartupNiciraNvpCommand; +import com.cloud.agent.api.UpdateLogicalSwitchPortAnswer; +import com.cloud.agent.api.UpdateLogicalSwitchPortCommand; import com.cloud.host.Host; import com.cloud.host.Host.Type; import com.cloud.network.nicira.ControlClusterStatus; @@ -49,6 +53,7 @@ import com.cloud.network.nicira.LogicalSwitch; import com.cloud.network.nicira.LogicalSwitchPort; import com.cloud.network.nicira.NiciraNvpApi; import com.cloud.network.nicira.NiciraNvpApiException; +import com.cloud.network.nicira.NiciraNvpList; import com.cloud.network.nicira.NiciraNvpTag; import com.cloud.network.nicira.TransportZoneBinding; import com.cloud.network.nicira.VifAttachment; @@ -186,6 +191,12 @@ public class NiciraNvpResource implements ServerResource { else if (cmd instanceof DeleteLogicalSwitchPortCommand) { return executeRequest((DeleteLogicalSwitchPortCommand) cmd, numRetries); } + else if (cmd instanceof UpdateLogicalSwitchPortCommand) { + return executeRequest((UpdateLogicalSwitchPortCommand) cmd, numRetries); + } + else if (cmd instanceof FindLogicalSwitchPortCommand) { + return executeRequest((FindLogicalSwitchPortCommand) cmd, numRetries); + } s_logger.debug("Received unsupported command " + cmd.toString()); return Answer.createUnsupportedCommandAnswer(cmd); } @@ -284,6 +295,51 @@ public class NiciraNvpResource implements ServerResource { } } + private Answer executeRequest(UpdateLogicalSwitchPortCommand cmd, int numRetries) { + String logicalSwitchUuid = cmd.getLogicalSwitchUuid(); + String logicalSwitchPortUuid = cmd.getLogicalSwitchPortUuid(); + String attachmentUuid = cmd.getAttachmentUuid(); + + try { + // Tags set to scope cs_account and account name + List tags = new ArrayList(); + tags.add(new NiciraNvpTag("cs_account",cmd.getOwnerName())); + + _niciraNvpApi.modifyLogicalSwitchPortAttachment(logicalSwitchUuid, logicalSwitchPortUuid, new VifAttachment(attachmentUuid)); + return new UpdateLogicalSwitchPortAnswer(cmd, true, "Attachment for " + logicalSwitchPortUuid + " updated", logicalSwitchPortUuid); + } catch (NiciraNvpApiException e) { + if (numRetries > 0) { + return retry(cmd, --numRetries); + } + else { + return new UpdateLogicalSwitchPortAnswer(cmd, e); + } + } + + } + + private Answer executeRequest(FindLogicalSwitchPortCommand cmd, int numRetries) { + String logicalSwitchUuid = cmd.getLogicalSwitchUuid(); + String logicalSwitchPortUuid = cmd.getLogicalSwitchPortUuid(); + + try { + NiciraNvpList ports = _niciraNvpApi.findLogicalSwitchPortsByUuid(logicalSwitchUuid, logicalSwitchPortUuid); + if (ports.getResult_count() == 0) { + return new FindLogicalSwitchPortAnswer(cmd, false, "Logical switchport " + logicalSwitchPortUuid + " not found", null); + } + else { + return new FindLogicalSwitchPortAnswer(cmd, true, "Logical switchport " + logicalSwitchPortUuid + " found", logicalSwitchPortUuid); + } + } catch (NiciraNvpApiException e) { + if (numRetries > 0) { + return retry(cmd, --numRetries); + } + else { + return new FindLogicalSwitchPortAnswer(cmd, e); + } + } + } + private Answer executeRequest(ReadyCommand cmd) { return new ReadyAnswer(cmd); } diff --git a/plugins/network-elements/ovs/pom.xml b/plugins/network-elements/ovs/pom.xml index bd216d9b798..02d455c2b54 100644 --- a/plugins/network-elements/ovs/pom.xml +++ b/plugins/network-elements/ovs/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-network-ovs - Apache CloudStack Plugin - Open vSwitch - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-network-ovs + Apache CloudStack Plugin - Open vSwitch + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/plugins/pom.xml b/plugins/pom.xml index d6d31e47908..2a6ca3168c7 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -17,41 +17,110 @@ under the License. --> - 4.0.0 - cloud-plugins - Apache CloudStack Plugin POM - pom - - com.cloud - cloud-parent - 4.0.0-SNAPSHOT - ../parent/pom.xml - - - install - src - - - parent - deployment-planners/user-concentrated-pod - deployment-planners/user-dispersing - file-systems/netapp - host-allocators/random - hypervisors/kvm - hypervisors/ovm - hypervisors/vmware - hypervisors/xen - network-elements/elastic-loadbalancer - network-elements/ovs - network-elements/f5 - network-elements/juniper-srx - network-elements/midokura-midonet - network-elements/netscaler - network-elements/nicira-nvp - storage-allocators/random - user-authenticators/ldap - user-authenticators/md5 - user-authenticators/plain-text - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloudstack-plugins + Apache CloudStack Plugin POM + pom + + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + + + install + src + + + deployment-planners/user-concentrated-pod + deployment-planners/user-dispersing + host-allocators/random + hypervisors/ovm + hypervisors/xen + network-elements/elastic-loadbalancer + network-elements/ovs + network-elements/nicira-nvp + storage-allocators/random + user-authenticators/ldap + user-authenticators/md5 + user-authenticators/plain-text + + + + + org.apache.cloudstack + cloud-server + ${project.version} + + + + + + netapp + + + nonoss + + + + file-systems/netapp + + + + kvm + + + nonoss + + + + hypervisors/kvm + + + + f5 + + + nonoss + + + + network-elements/f5 + + + + netscaler + + + nonoss + + + + network-elements/netscaler + + + + srx + + + nonoss + + + + network-elements/juniper-srx + + + + vmware + + + nonoss + + + + hypervisors/vmware + + + + diff --git a/plugins/storage-allocators/random/pom.xml b/plugins/storage-allocators/random/pom.xml index aba14961660..6cb60cdf7ff 100644 --- a/plugins/storage-allocators/random/pom.xml +++ b/plugins/storage-allocators/random/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-storage-allocator-random - Apache CloudStack Plugin - Storage Allocator Random - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-storage-allocator-random + Apache CloudStack Plugin - Storage Allocator Random + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/plugins/user-authenticators/ldap/pom.xml b/plugins/user-authenticators/ldap/pom.xml index 0dfd6bcd935..7facc3f3307 100644 --- a/plugins/user-authenticators/ldap/pom.xml +++ b/plugins/user-authenticators/ldap/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-user-authenticator-ldap - Apache CloudStack Plugin - User Authenticator LDAP - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-user-authenticator-ldap + Apache CloudStack Plugin - User Authenticator LDAP + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/plugins/user-authenticators/md5/pom.xml b/plugins/user-authenticators/md5/pom.xml index 7f4e7809628..1dac92d7e3f 100644 --- a/plugins/user-authenticators/md5/pom.xml +++ b/plugins/user-authenticators/md5/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-user-authenticator-md5 - Apache CloudStack Plugin - User Authenticator MD5 - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-user-authenticator-md5 + Apache CloudStack Plugin - User Authenticator MD5 + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/plugins/user-authenticators/plain-text/pom.xml b/plugins/user-authenticators/plain-text/pom.xml index e9d24d1f721..a4280a37d26 100644 --- a/plugins/user-authenticators/plain-text/pom.xml +++ b/plugins/user-authenticators/plain-text/pom.xml @@ -17,14 +17,14 @@ under the License. --> - 4.0.0 - cloud-plugin-user-authenticator-plaintext - Apache CloudStack Plugin - User Authenticator Plain Text - - com.cloud - cloud-plugin-parent - 4.0.0-SNAPSHOT - ../../parent/pom.xml - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-plugin-user-authenticator-plaintext + Apache CloudStack Plugin - User Authenticator Plain Text + + org.apache.cloudstack + cloudstack-plugins + 4.0.0-SNAPSHOT + ../../pom.xml + diff --git a/pom.xml b/pom.xml index 299610a16b3..99b1177e855 100644 --- a/pom.xml +++ b/pom.xml @@ -17,170 +17,215 @@ under the License. --> - 4.0.0 - com.cloud - cloudstack - 4.0.0-SNAPSHOT - pom - Apache CloudStack - CloudStack is an IaaS (“Infrastracture as a Service”) cloud orchestration platform. - http://www.cloudstack.org - - scm:git:https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git - scm:git:https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git - - - jira - https://issues.apache.org/jira/browse/CLOUDSTACK - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + 4.0.0 - - 1.6 - UTF-8 - + + org.apache + apache + 11 + - - - apache.releases.https - Apache Release Distribution Repository - https://repository.apache.org/service/local/staging/deploy/maven2 - - - apache.snapshots.https - Apache Development Snapshot Repository - https://repository.apache.org/content/repositories/snapshots - - - - apache.cloudstack.site - ${site.deploy.url} - - - - - apache.snapshots - http://repository.apache.org/snapshots/ - Apache Snapshot Repo - - true - - - false - - - - - - apache.snapshots - http://repository.apache.org/snapshots/ - - true - - - false - - - + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + pom + Apache CloudStack + CloudStack is an IaaS (“Infrastracture as a Service”) cloud orchestration platform. + http://www.cloudstack.org + + scm:git:https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git + scm:git:https://git-wip-us.apache.org/repos/asf/incubator-cloudstack.git + + + jira + https://issues.apache.org/jira/browse/CLOUDSTACK + - 2012 + + 1.6 + UTF-8 - - - Apache CloudStack User List - cloudstack-users-subscribe@incubator.apache.org - cloudstack-users-unsubscribe@incubator.apache.org - cloudstack-users@incubator.apache.org - http://mail-archives.apache.org/mod_mbox/incubator-cloudstack-users - - - Apache CloudStack Developer List - cloudstack-dev-subscribe@incubator.apache.org - cloudstack-dev-unsubscribe@incubator.apache.org - cloudstack-dev@incubator.apache.org - http://mail-archives.apache.org/mod_mbox/incubator-cloudstack-dev - - - Apache CloudStack Commits List - cloudstack-commits-subscribe@incubator.apache.org - cloudstack-commits-unsubscribe@incubator.apache.org - cloudstack-commits@incubator.apache.org - http://mail-archives.apache.org/mod_mbox/incubator-cloudstack-commits - - + 1.2.16 + 1.1 + 2.2.2 + 1.4 + 1.6 + 1.6 + 1.8 + 3.2.1 + 1.1.1 + 0.5 + 3.0 + 4.10 + 1.46 + 0.1.42 + 1.0.0.Final + 1.9.0 + build213-svnkit-1.3-patch + 1.5.0 + 1.7.1 + 5.6.100-1-SNAPSHOT + 3.1 + 4.0 + 5.1.12 + 1.3.1 + 3.1.3 + 1.4 + 1.4 + 1.5.1 + 1.2.8 + 3.5.1-Final + 2.0.4 + 2.4 + 1.2 - - - The Apache CloudStack Team - cloudstack-dev@incubator.apache.org - http://incubator.apache.org/projects/cloudstack.html - Apache Software Foundation - http://apache.org/ - - + true - - Jenkin - http://jenkins.cloudstack.org/ - + - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - + + + apache.cloudstack.site + ${site.deploy.url} + + - - The Apache Software Foundation - http://www.apache.org/ - + 2012 - - parent - api - agent - console-proxy - core - server - usage - utils - deps/XenServerJava - vmware-base - plugins - awsapi - + + + Apache CloudStack User List + cloudstack-users-subscribe@incubator.apache.org + cloudstack-users-unsubscribe@incubator.apache.org + cloudstack-users@incubator.apache.org + http://mail-archives.apache.org/mod_mbox/incubator-cloudstack-users + + + Apache CloudStack Developer List + cloudstack-dev-subscribe@incubator.apache.org + cloudstack-dev-unsubscribe@incubator.apache.org + cloudstack-dev@incubator.apache.org + http://mail-archives.apache.org/mod_mbox/incubator-cloudstack-dev + + + Apache CloudStack Commits List + cloudstack-commits-subscribe@incubator.apache.org + cloudstack-commits-unsubscribe@incubator.apache.org + cloudstack-commits@incubator.apache.org + http://mail-archives.apache.org/mod_mbox/incubator-cloudstack-commits + + - - install - - - - org.apache.rat - apache-rat-plugin - 0.8 - - 350 - false - - .git/** - .gitignore - velocity.log - **/target/** - distribution/** - **/jaxb.index - **/META-INF/MANIFEST - **/src/test/**/*.txt - **/.classpath - **/.settings/**/* - **/.project - - - - - - + + + The Apache CloudStack Team + cloudstack-dev@incubator.apache.org + http://incubator.apache.org/projects/cloudstack.html + Apache Software Foundation + http://apache.org/ + + + + Jenkin + http://jenkins.cloudstack.org/ + + + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + The Apache Software Foundation + http://www.apache.org/ + + + + api + agent + console-proxy + core + server + usage + utils + deps/XenServerJava + vmware-base + plugins + awsapi + patches + + + + + junit + junit + ${cs.junit.version} + test + + + + + install + + + + org.apache.tomcat.maven + tomcat7-maven-plugin + 2.0-SNAPSHOT + + + org.apache.rat + apache-rat-plugin + 0.8 + + 350 + false + + .git/** + .gitignore + velocity.log + **/target/** + distribution/** + **/jaxb.index + **/META-INF/MANIFEST + **/src/test/**/*.txt + **/.classpath + **/.settings/**/* + **/.project + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.5.1 + + ${cs.jdk.version} + ${cs.jdk.version} + + + + + + + + + client + + client + + + + deps + + deps + + + diff --git a/scripts/network/domr/s2s_vpn.sh b/scripts/network/domr/s2s_vpn.sh index 0bdccc4f7b7..3ec3e260636 100755 --- a/scripts/network/domr/s2s_vpn.sh +++ b/scripts/network/domr/s2s_vpn.sh @@ -1,17 +1,20 @@ #!/bin/bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/scripts/vm/network/security_group.py b/scripts/vm/network/security_group.py index 31e054434c5..b0798907c8a 100755 --- a/scripts/vm/network/security_group.py +++ b/scripts/vm/network/security_group.py @@ -489,36 +489,54 @@ def cleanup_rules_for_dead_vms(): def cleanup_rules(): - try: - - chainscmd = "iptables-save | grep '^:' | grep -v '.*-def' | grep -v '.*-eg' | awk '{print $1}' | cut -d':' -f2" - chains = execute(chainscmd).split('\n') - cleaned = 0 - cleanup = [] - for chain in chains: - if 1 in [ chain.startswith(c) for c in ['r-', 'i-', 's-', 'v-'] ]: - vm_name = chain + try: + chainscmd = "iptables-save | grep '^:' | grep -v '.*-def' | grep -v '.*-eg' | awk '{print $1}' | cut -d':' -f2" + chains = execute(chainscmd).split('\n') + cleanup = [] + for chain in chains: + if 1 in [ chain.startswith(c) for c in ['r-', 'i-', 's-', 'v-'] ]: + vm_name = chain - cmd = "virsh list |grep " + vm_name - try: - result = execute(cmd) - except: - result = None + cmd = "virsh list |grep " + vm_name + try: + result = execute(cmd) + except: + result = None - if result == None or len(result) == 0: - logging.debug("chain " + chain + " does not correspond to a vm, cleaning up") - cleanup.append(vm_name) - continue - if result.find("running") == -1: - logging.debug("vm " + vm_name + " is not running, cleaning up") - cleanup.append(vm_name) - - for vmname in cleanup: - destroy_network_rules_for_vm(vmname) + if result == None or len(result) == 0: + logging.debug("chain " + chain + " does not correspond to a vm, cleaning up") + cleanup.append(vm_name) + continue + if result.find("running") == -1: + logging.debug("vm " + vm_name + " is not running, cleaning up") + cleanup.append(vm_name) + + chainscmd = "ebtables-save |grep :i |awk '{print $1}' |sed -e 's/\-in//g' |sed -e 's/\-out//g' |sed -e 's/^://g'" + chains = execute(chainscmd).split('\n') + for chain in chains: + if 1 in [ chain.startswith(c) for c in ['r-', 'i-', 's-', 'v-'] ]: + vm_name = chain + + cmd = "virsh list |grep " + vm_name + try: + result = execute(cmd) + except: + result = None + + if result == None or len(result) == 0: + logging.debug("chain " + chain + " does not correspond to a vm, cleaning up") + cleanup.append(vm_name) + continue + if result.find("running") == -1: + logging.debug("vm " + vm_name + " is not running, cleaning up") + cleanup.append(vm_name) + + for vmname in cleanup: + destroy_network_rules_for_vm(vmname) - logging.debug("Cleaned up rules for " + str(len(cleanup)) + " chains") - except: - logging.debug("Failed to cleanup rules !") + logging.debug("Cleaned up rules for " + str(len(cleanup)) + " chains") + except: + logging.debug("Failed to cleanup rules !") def check_rule_log_for_vm(vmName, vmId, vmIP, domID, signature, seqno): vm_name = vmName; diff --git a/server/pom.xml b/server/pom.xml index c82bb6bbfee..f7178d8eb0a 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -17,58 +17,57 @@ under the License. --> - 4.0.0 - cloud-server - Apache CloudStack Server - - com.cloud - cloud-parent - 4.0.0-SNAPSHOT - ../parent/pom.xml - - - - com.cloud - cloud-core - ${project.version} - - - javax.servlet - servlet-api - 2.4 - provided - - - org.apache.httpcomponents - httpcore - ${cs.httpcore.version} - - - mysql - mysql-connector-java - ${cs.mysql.version} - provided - - - com.thoughtworks.xstream - xstream - ${cs.xstream.version} - - - javax.mail - mail - ${cs.mail.version} - - - - - install - src - - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 + cloud-server + Apache CloudStack Server + + org.apache.cloudstack + cloudstack + 4.0.0-SNAPSHOT + + + + org.apache.cloudstack + cloud-core + ${project.version} + + + javax.servlet + servlet-api + ${cs.servlet.version} + provided + + + org.apache.httpcomponents + httpcore + ${cs.httpcore.version} + + + mysql + mysql-connector-java + ${cs.mysql.version} + provided + + + com.thoughtworks.xstream + xstream + ${cs.xstream.version} + + + javax.mail + mail + ${cs.mail.version} + + + jstl + jstl + ${cs.jstl.version} + + + + install + src + + diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java index e1e88652ba3..55c86716790 100755 --- a/server/src/com/cloud/api/ApiDBUtils.java +++ b/server/src/com/cloud/api/ApiDBUtils.java @@ -125,10 +125,12 @@ import com.cloud.user.Account; import com.cloud.user.AccountDetailsDao; import com.cloud.user.AccountVO; import com.cloud.user.ResourceLimitService; +import com.cloud.user.SSHKeyPairVO; import com.cloud.user.User; import com.cloud.user.UserStatisticsVO; import com.cloud.user.UserVO; import com.cloud.user.dao.AccountDao; +import com.cloud.user.dao.SSHKeyPairDao; import com.cloud.user.dao.UserDao; import com.cloud.user.dao.UserStatisticsDao; import com.cloud.uservm.UserVm; @@ -139,6 +141,7 @@ import com.cloud.vm.ConsoleProxyVO; import com.cloud.vm.DomainRouterVO; import com.cloud.vm.InstanceGroupVO; import com.cloud.vm.NicProfile; +import com.cloud.vm.UserVmDetailVO; import com.cloud.vm.UserVmManager; import com.cloud.vm.UserVmVO; import com.cloud.vm.VMInstanceVO; @@ -148,6 +151,7 @@ import com.cloud.vm.dao.ConsoleProxyDao; import com.cloud.vm.dao.DomainRouterDao; import com.cloud.vm.dao.UserVmDao; import com.cloud.vm.dao.UserVmData; +import com.cloud.vm.dao.UserVmDetailsDao; import com.cloud.vm.dao.VMInstanceDao; public class ApiDBUtils { @@ -206,6 +210,8 @@ public class ApiDBUtils { private static HighAvailabilityManager _haMgr; private static VpcManager _vpcMgr; private static TaggedResourceService _taggedResourceService; + private static UserVmDetailsDao _userVmDetailsDao; + private static SSHKeyPairDao _sshKeyPairDao; static { _ms = (ManagementServer) ComponentLocator.getComponent(ManagementServer.Name); @@ -263,6 +269,8 @@ public class ApiDBUtils { _haMgr = locator.getManager(HighAvailabilityManager.class); _vpcMgr = locator.getManager(VpcManager.class); _taggedResourceService = locator.getManager(TaggedResourceService.class); + _sshKeyPairDao = locator.getDao(SSHKeyPairDao.class); + _userVmDetailsDao = locator.getDao(UserVmDetailsDao.class); // Note: stats collector should already have been initialized by this time, otherwise a null instance is returned _statsCollector = StatsCollector.getInstance(); @@ -803,4 +811,13 @@ public class ApiDBUtils { public static List listByResourceTypeAndId(TaggedResourceType type, long resourceId) { return _taggedResourceService.listByResourceTypeAndId(type, resourceId); } + + public static String getKeyPairName(String sshPublicKey) { + SSHKeyPairVO sshKeyPair = _sshKeyPairDao.findByPublicKey(sshPublicKey); + return sshKeyPair.getName(); + } + + public static UserVmDetailVO findPublicKeyByVmId(long vmId) { + return _userVmDetailsDao.findDetail(vmId, "SSH.PublicKey"); + } } diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 73344880bbf..aee6af0db4c 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -211,6 +211,7 @@ import com.cloud.vm.ConsoleProxyVO; import com.cloud.vm.InstanceGroup; import com.cloud.vm.InstanceGroupVO; import com.cloud.vm.NicProfile; +import com.cloud.vm.UserVmDetailVO; import com.cloud.vm.VMInstanceVO; import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachine.State; @@ -3332,6 +3333,12 @@ public class ApiResponseHelper implements ResponseGenerator { } userVmResponse.setTags(tagResponses); + UserVmDetailVO userVmDetail = ApiDBUtils.findPublicKeyByVmId(userVmData.getId()); + if (userVmDetail != null && userVmDetail.getValue() != null) { + String keyPairName = ApiDBUtils.getKeyPairName(userVmDetail.getValue()); + userVmResponse.setKeyPairName(keyPairName); + } + return userVmResponse; } diff --git a/server/src/com/cloud/api/response/ApiResponseSerializer.java b/server/src/com/cloud/api/response/ApiResponseSerializer.java index 83e4e6ef117..124bee1f2e3 100644 --- a/server/src/com/cloud/api/response/ApiResponseSerializer.java +++ b/server/src/com/cloud/api/response/ApiResponseSerializer.java @@ -118,7 +118,7 @@ public class ApiResponseSerializer { private static String toXMLSerializedString(ResponseObject result) { StringBuilder sb = new StringBuilder(); - sb.append(""); + sb.append(""); sb.append("<" + result.getResponseName() + " cloud-stack-version=\"" + ApiDBUtils.getVersion() + "\">"); if (result instanceof ListResponse) { diff --git a/server/src/com/cloud/capacity/StorageCapacityListener.java b/server/src/com/cloud/capacity/StorageCapacityListener.java index 384bdb9f5ed..d5751a34cc9 100755 --- a/server/src/com/cloud/capacity/StorageCapacityListener.java +++ b/server/src/com/cloud/capacity/StorageCapacityListener.java @@ -76,13 +76,6 @@ public class StorageCapacityListener implements Listener { if (!(startup instanceof StartupStorageCommand)) { return; } - SearchCriteria capacitySC = _capacityDao.createSearchCriteria(); - capacitySC.addAnd("hostOrPoolId", SearchCriteria.Op.EQ, server.getId()); - capacitySC.addAnd("dataCenterId", SearchCriteria.Op.EQ, - server.getDataCenterId()); - capacitySC.addAnd("podId", SearchCriteria.Op.EQ, server.getPodId()); - List capacities = _capacityDao.search(capacitySC, null); - StartupStorageCommand ssCmd = (StartupStorageCommand) startup; if (ssCmd.getResourceType() == Storage.StorageResourceType.STORAGE_HOST) { diff --git a/server/src/com/cloud/maint/Version.java b/server/src/com/cloud/maint/Version.java index 083364f3047..73175474edc 100644 --- a/server/src/com/cloud/maint/Version.java +++ b/server/src/com/cloud/maint/Version.java @@ -47,11 +47,15 @@ public class Version { } public static String trimToPatch(String version) { + int index = version.indexOf("-"); + + if ( index > 0 ) + version = version.substring(0, index); + String[] tokens = version.split("[.]"); - + if ( tokens.length < 3 ) return "0"; - return tokens[0] + "." + tokens[1]+ "." + tokens[2]; } diff --git a/server/src/com/cloud/network/NetworkManager.java b/server/src/com/cloud/network/NetworkManager.java index 74e9d885eb6..4124b19d84b 100755 --- a/server/src/com/cloud/network/NetworkManager.java +++ b/server/src/com/cloud/network/NetworkManager.java @@ -187,7 +187,7 @@ public interface NetworkManager extends NetworkService { Nic getDefaultNic(long vmId); - List getPasswordResetElements(); + UserDataServiceProvider getPasswordResetProvider(Network network); boolean networkIsConfiguredForExternalNetworking(long zoneId, long networkId); @@ -225,8 +225,6 @@ public interface NetworkManager extends NetworkService { List listNetworkOfferingsForUpgrade(long networkId); - PhysicalNetwork translateZoneIdToPhysicalNetwork(long zoneId); - boolean isSecurityGroupSupportedInNetwork(Network network); boolean isProviderSupportServiceInNetwork(long networkId, Service service, Provider provider); diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index 873c98208ff..292a25987ba 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -4180,9 +4180,15 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag throw new CloudRuntimeException("Unable to find network offering with availability=" + Availability.Required + " to automatically create the network as part of createVlanIpRange"); } - PhysicalNetwork physicalNetwork = translateZoneIdToPhysicalNetwork(zoneId); - if (requiredOfferings.get(0).getState() == NetworkOffering.State.Enabled) { + + long physicalNetworkId = findPhysicalNetworkId(zoneId, requiredOfferings.get(0).getTags(), requiredOfferings.get(0).getTrafficType()); + // Validate physical network + PhysicalNetwork physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId); + if (physicalNetwork == null) { + throw new InvalidParameterValueException("Unable to find physical network with id: "+physicalNetworkId + " and tag: " +requiredOfferings.get(0).getTags()); + } + s_logger.debug("Creating network for account " + owner + " from the network offering id=" + requiredOfferings.get(0).getId() + " as a part of createVlanIpRange process"); guestNetwork = createGuestNetwork(requiredOfferings.get(0).getId(), owner.getAccountName() + "-network" @@ -4292,15 +4298,15 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag } @Override - public List getPasswordResetElements() { - List elements = new ArrayList(); - for (NetworkElement element : _networkElements) { - if (element instanceof UserDataServiceProvider) { - UserDataServiceProvider e = (UserDataServiceProvider) element; - elements.add(e); - } + public UserDataServiceProvider getPasswordResetProvider(Network network) { + String passwordProvider = _ntwkSrvcDao.getProviderForServiceInNetwork(network.getId(), Service.UserData); + + if (passwordProvider == null) { + s_logger.debug("Network " + network + " doesn't support service " + Service.UserData.getName()); + return null; } - return elements; + + return (UserDataServiceProvider)getElementImplementingProvider(passwordProvider); } @Override @@ -5876,20 +5882,6 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag } } - @Override - public PhysicalNetwork translateZoneIdToPhysicalNetwork(long zoneId) { - List pNtwks = _physicalNetworkDao.listByZone(zoneId); - if (pNtwks.isEmpty()) { - throw new InvalidParameterValueException("Unable to find physical network in zone id=" + zoneId); - } - - if (pNtwks.size() > 1) { - throw new InvalidParameterValueException("More than one physical networks exist in zone id=" + zoneId); - } - - return pNtwks.get(0); - } - @Override public List listNetworkOfferingsForUpgrade(long networkId) { List offeringsToReturn = new ArrayList(); diff --git a/server/src/com/cloud/network/dao/Site2SiteCustomerGatewayDao.java b/server/src/com/cloud/network/dao/Site2SiteCustomerGatewayDao.java index c716961fc39..997322b6846 100644 --- a/server/src/com/cloud/network/dao/Site2SiteCustomerGatewayDao.java +++ b/server/src/com/cloud/network/dao/Site2SiteCustomerGatewayDao.java @@ -23,6 +23,6 @@ import com.cloud.utils.db.GenericDao; public interface Site2SiteCustomerGatewayDao extends GenericDao { Site2SiteCustomerGatewayVO findByGatewayIp(String ip); - Site2SiteCustomerGatewayVO findByName(String name); + Site2SiteCustomerGatewayVO findByNameAndAccountId(String name, long accountId); List listByAccountId(long accountId); } diff --git a/server/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java b/server/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java index 971c7075680..bf6900d87ee 100644 --- a/server/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java +++ b/server/src/com/cloud/network/dao/Site2SiteCustomerGatewayDaoImpl.java @@ -49,9 +49,10 @@ public class Site2SiteCustomerGatewayDaoImpl extends GenericDaoBase sc = AllFieldsSearch.create(); sc.setParameters("name", name); + sc.setParameters("accountId", accountId); return findOneBy(sc); } diff --git a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java index f11206570df..82aa9d25809 100644 --- a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java +++ b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java @@ -439,6 +439,11 @@ public class FirewallManagerImpl implements FirewallService, FirewallManager, Ma success = false; } else { removeRule(rule); + if (rule.getSourceIpAddressId() != null) { + //if the rule is the last one for the ip address assigned to VPC, unassign it from the network + IpAddress ip = _ipAddressDao.findById(rule.getSourceIpAddressId()); + _vpcMgr.unassignIPFromVpcNetwork(ip.getId(), rule.getNetworkId()); + } } } else if (rule.getState() == FirewallRule.State.Add) { FirewallRuleVO ruleVO = _firewallDao.findById(rule.getId()); diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 0d812a27df4..bc92916ea6e 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -444,37 +444,21 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian } @Override - public boolean savePasswordToRouter(Network network, NicProfile nic, VirtualMachineProfile profile, List routers) throws ResourceUnavailableException { - if (routers == null || routers.isEmpty()) { - s_logger.warn("Unable save password, router doesn't exist in network " + network.getId()); - throw new CloudRuntimeException("Unable to save password to router"); - } + public boolean savePasswordToRouter(Network network, final NicProfile nic, VirtualMachineProfile profile, List routers) throws ResourceUnavailableException { + _userVmDao.loadDetails((UserVmVO) profile.getVirtualMachine()); - UserVm userVm = profile.getVirtualMachine(); - String password = (String) profile.getParameter(Param.VmPassword); - String encodedPassword = PasswordGenerator.rot13(password); - DataCenter dc = _dcDao.findById(userVm.getDataCenterIdToDeployIn()); + final VirtualMachineProfile updatedProfile = profile; - boolean result = true; - for (VirtualRouter router : routers) { - boolean sendPassword = true; - if (dc.getNetworkType() == NetworkType.Basic && userVm.getPodIdToDeployIn().longValue() != router.getPodIdToDeployIn().longValue()) { - sendPassword = false; + return applyRules(network, routers, "save password entry", false, null, false, new RuleApplier() { + @Override + public boolean execute(Network network, VirtualRouter router) throws ResourceUnavailableException { + // for basic zone, send vm data/password information only to the router in the same pod + Commands cmds = new Commands(OnError.Stop); + NicVO nicVo = _nicDao.findById(nic.getId()); + createPasswordCommand(router, updatedProfile, nicVo, cmds); + return sendCommandsToRouter(router, cmds); } - - if (sendPassword) { - Commands cmds = new Commands(OnError.Continue); - SavePasswordCommand cmd = new SavePasswordCommand(encodedPassword, nic.getIp4Address(), userVm.getHostName()); - cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, getRouterControlIp(router.getId())); - cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName()); - DataCenterVO dcVo = _dcDao.findById(router.getDataCenterIdToDeployIn()); - cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, dcVo.getNetworkType().toString()); - cmds.addCommand("password", cmd); - - result = result && sendCommandsToRouter(router, cmds); - } - } - return result; + }); } @Override @ActionEvent(eventType = EventTypes.EVENT_ROUTER_STOP, eventDescription = "stopping router Vm", async = true) @@ -2411,28 +2395,36 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian }); } - private String findDefaultDnsIp(long userVmId) { - NicVO defaultNic = _nicDao.findDefaultNicForVM(userVmId); - - //check if DNS provider is the domR - if (!_networkMgr.isProviderSupportServiceInNetwork(defaultNic.getNetworkId(), Service.Dns, Provider.VirtualRouter)) { - return null; - } - - NetworkOfferingVO offering = _networkOfferingDao.findById(_networkDao.findById(defaultNic.getNetworkId()).getNetworkOfferingId()); - if (offering.getRedundantRouter()) { - return findGatewayIp(userVmId); - } - - //find domR's nic in the network - NicVO domrDefaultNic = _nicDao.findByNetworkIdTypeAndGateway(defaultNic.getNetworkId(), VirtualMachine.Type.DomainRouter, defaultNic.getGateway()); - return domrDefaultNic.getIp4Address(); - } - - private String findGatewayIp(long userVmId) { - NicVO defaultNic = _nicDao.findDefaultNicForVM(userVmId); - return defaultNic.getGateway(); - } + private String findDefaultDnsIp(long userVmId) { + NicVO defaultNic = _nicDao.findDefaultNicForVM(userVmId); + + //check if DNS provider is the domR + if (!_networkMgr.isProviderSupportServiceInNetwork(defaultNic.getNetworkId(), Service.Dns, Provider.VirtualRouter)) { + return null; + } + + NetworkOfferingVO offering = _networkOfferingDao.findById(_networkDao.findById(defaultNic.getNetworkId()).getNetworkOfferingId()); + if (offering.getRedundantRouter()) { + return findGatewayIp(userVmId); + } + + DataCenter dc = _dcDao.findById(_networkMgr.getNetwork(defaultNic.getNetworkId()).getDataCenterId()); + boolean isZoneBasic = (dc.getNetworkType() == NetworkType.Basic); + + //find domR's nic in the network + NicVO domrDefaultNic; + if (isZoneBasic){ + domrDefaultNic = _nicDao.findByNetworkIdTypeAndGateway(defaultNic.getNetworkId(), VirtualMachine.Type.DomainRouter, defaultNic.getGateway()); + } else{ + domrDefaultNic = _nicDao.findByNetworkIdAndType(defaultNic.getNetworkId(), VirtualMachine.Type.DomainRouter); + } + return domrDefaultNic.getIp4Address(); + } + + private String findGatewayIp(long userVmId) { + NicVO defaultNic = _nicDao.findDefaultNicForVM(userVmId); + return defaultNic.getGateway(); + } @Override public boolean applyUserData(Network network, final NicProfile nic, VirtualMachineProfile profile, DeployDestination dest, List routers) @@ -2664,7 +2656,7 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian } IpAssocCommand cmd = new IpAssocCommand(ipsToSend); cmd.setAccessDetail(NetworkElementCommand.ROUTER_IP, getRouterControlIp(router.getId())); - cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, getRouterIpInNetwork(ipAddrList.get(0).getNetworkId(), router.getId())); + cmd.setAccessDetail(NetworkElementCommand.ROUTER_GUEST_IP, getRouterIpInNetwork(ipAddrList.get(0).getAssociatedWithNetworkId(), router.getId())); cmd.setAccessDetail(NetworkElementCommand.ROUTER_NAME, router.getInstanceName()); DataCenterVO dcVo = _dcDao.findById(router.getDataCenterIdToDeployIn()); cmd.setAccessDetail(NetworkElementCommand.ZONE_NETWORK_TYPE, dcVo.getNetworkType().toString()); diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java index 2d4d0bfb8b7..61846cbb47e 100644 --- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java @@ -626,7 +626,6 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian Map vlanMacAddress = new HashMap(); List ipsToSend = new ArrayList(); for (PublicIpAddress ipAddr : ipAddress) { - String broadcastURI = BroadcastDomainType.Vlan.toUri(ipAddr.getVlanTag()).toString(); Nic nic = _nicDao.findByNetworkIdInstanceIdAndBroadcastUri(ipAddr.getNetworkId(), router.getId(), broadcastURI); @@ -645,8 +644,12 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian ipsToSend.add(ipAddr); } } - createVpcAssociatePublicIPCommands(router, ipsToSend, cmds, vlanMacAddress); - return sendCommandsToRouter(router, cmds); + if (!ipsToSend.isEmpty()) { + createVpcAssociatePublicIPCommands(router, ipsToSend, cmds, vlanMacAddress); + return sendCommandsToRouter(router, cmds); + }else { + return true; + } } }); if(result && netUsagecmds.size() > 0){ diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java index f4c47ed9c49..d24009ddbe8 100644 --- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java +++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java @@ -528,8 +528,9 @@ public class VpcManagerImpl implements VpcManager, Manager{ // Validate vpc offering VpcOfferingVO vpcOff = _vpcOffDao.findById(vpcOffId); - if (vpcOff == null) { - InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find vpc offering by specified id"); + if (vpcOff == null || vpcOff.getState() != State.Enabled) { + InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find vpc offering in " + State.Enabled + + " state by specified id"); ex.addProxyObject("vpc_offerings", vpcOffId, "vpcOfferingId"); throw ex; } diff --git a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java index ba4d974bcba..db678ae694c 100644 --- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java +++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java @@ -210,7 +210,7 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnManager, Manager { } Long espLifetime = cmd.getEspLifetime(); if (espLifetime == null) { - // Default value of lifetime is 1 day + // Default value of lifetime is 1 hour espLifetime = (long) 3600; } if (espLifetime > 86400) { @@ -222,16 +222,17 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnManager, Manager { dpd = false; } + long accountId = owner.getAccountId(); if (_customerGatewayDao.findByGatewayIp(gatewayIp) != null) { - throw new InvalidParameterValueException("The customer gateway with ip " + gatewayIp + " already existed!"); + throw new InvalidParameterValueException("The customer gateway with ip " + gatewayIp + " already existed in the system!"); } - if (_customerGatewayDao.findByName(name) != null) { + if (_customerGatewayDao.findByNameAndAccountId(name, accountId) != null) { throw new InvalidParameterValueException("The customer gateway with name " + name + " already existed!"); } checkCustomerGatewayCidrList(guestCidrList); - Site2SiteCustomerGatewayVO gw = new Site2SiteCustomerGatewayVO(name, owner.getAccountId(), owner.getDomainId(), gatewayIp, guestCidrList, ipsecPsk, + Site2SiteCustomerGatewayVO gw = new Site2SiteCustomerGatewayVO(name, accountId, owner.getDomainId(), gatewayIp, guestCidrList, ipsecPsk, ikePolicy, espPolicy, ikeLifetime, espLifetime, dpd); _customerGatewayDao.persist(gw); return gw; @@ -454,7 +455,7 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnManager, Manager { } Long espLifetime = cmd.getEspLifetime(); if (espLifetime == null) { - // Default value of lifetime is 1 day + // Default value of lifetime is 1 hour espLifetime = (long) 3600; } if (espLifetime > 86400) { @@ -467,6 +468,14 @@ public class Site2SiteVpnManagerImpl implements Site2SiteVpnManager, Manager { } checkCustomerGatewayCidrList(guestCidrList); + + long accountId = gw.getAccountId(); + if (_customerGatewayDao.findByGatewayIp(gatewayIp) != null) { + throw new InvalidParameterValueException("The customer gateway with ip " + gatewayIp + " already existed in the system!"); + } + if (_customerGatewayDao.findByNameAndAccountId(name, accountId) != null) { + throw new InvalidParameterValueException("The customer gateway with name " + name + " already existed!"); + } gw.setName(name); gw.setGatewayIp(gatewayIp); diff --git a/server/src/com/cloud/resource/ResourceManagerImpl.java b/server/src/com/cloud/resource/ResourceManagerImpl.java index 14b5df57a4b..14143706bb2 100755 --- a/server/src/com/cloud/resource/ResourceManagerImpl.java +++ b/server/src/com/cloud/resource/ResourceManagerImpl.java @@ -1007,12 +1007,12 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma umanageHost(host.getId()); } } - int retry = 10; + int retry = 40; boolean lsuccess = true; for ( int i = 0; i < retry; i++) { lsuccess = true; try { - Thread.sleep(20 * 1000); + Thread.sleep(5 * 1000); } catch (Exception e) { } hosts = listAllUpAndEnabledHosts(Host.Type.Routing, cluster.getId(), cluster.getPodId(), cluster.getDataCenterId()); @@ -1211,7 +1211,7 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma GuestOSCategoryVO guestOSCategory = _guestOSCategoryDao.findById(guestOSCategoryId); Map hostDetails = _hostDetailsDao.findDetails(hostId); - if (guestOSCategory != null) { + if (guestOSCategory != null && !GuestOSCategoryVO.CATEGORY_NONE.equalsIgnoreCase(guestOSCategory.getName())) { // Save a new entry for guest.os.category.id hostDetails.put("guest.os.category.id", String.valueOf(guestOSCategory.getId())); } else { @@ -1601,6 +1601,15 @@ public class ResourceManagerImpl implements ResourceManager, ResourceService, Ma return null; } + /* Generate a random version in a dev setup situation */ + if ( this.getClass().getPackage().getImplementationVersion() == null ) { + for ( StartupCommand cmd : cmds ) { + if ( cmd.getVersion() == null ) { + cmd.setVersion(Long.toString(System.currentTimeMillis())); + } + } + } + if (s_logger.isDebugEnabled()) { new Request(-1l, -1l, cmds, true, false).logD("Startup request from directly connected host: ", true); } diff --git a/server/src/com/cloud/servlet/ConsoleProxyServlet.java b/server/src/com/cloud/servlet/ConsoleProxyServlet.java index a8519fec443..7f073f1a74f 100644 --- a/server/src/com/cloud/servlet/ConsoleProxyServlet.java +++ b/server/src/com/cloud/servlet/ConsoleProxyServlet.java @@ -336,8 +336,9 @@ public class ConsoleProxyServlet extends HttpServlet { param.setClientTunnelSession(parsedHostInfo.third()); } - sb.append("/ajaximg?token=" + encryptor.encryptObject(ConsoleProxyClientParam.class, param)); - sb.append("&w=").append(w).append("&h=").append(h); + sb.append("/ajaximg?token=" + + encryptor.encryptObject(ConsoleProxyClientParam.class, param)); + sb.append("&w=").append(w).append("&h=").append(h).append("&key=0"); if(s_logger.isDebugEnabled()) { s_logger.debug("Compose thumbnail url: " + sb.toString()); diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 9d4ba0cbbbb..50a78db4786 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -2124,14 +2124,11 @@ public class StorageManagerImpl implements StorageManager, Manager, ClusterManag @Override public void createCapacityEntry(StoragePoolVO storagePool, short capacityType, long allocated) { SearchCriteria capacitySC = _capacityDao.createSearchCriteria(); - - List capacities = _capacityDao.search(capacitySC, null); - capacitySC = _capacityDao.createSearchCriteria(); capacitySC.addAnd("hostOrPoolId", SearchCriteria.Op.EQ, storagePool.getId()); capacitySC.addAnd("dataCenterId", SearchCriteria.Op.EQ, storagePool.getDataCenterId()); capacitySC.addAnd("capacityType", SearchCriteria.Op.EQ, capacityType); - capacities = _capacityDao.search(capacitySC, null); + List capacities = _capacityDao.search(capacitySC, null); long totalOverProvCapacity; if (storagePool.getPoolType() == StoragePoolType.NetworkFilesystem) { diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java index 86620008159..7a94001c405 100755 --- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java +++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java @@ -1064,9 +1064,14 @@ public class SecondaryStorageManagerImpl implements SecondaryStorageVmManager, V if (_configDao.isPremium()) { if (profile.getHypervisorType() == HypervisorType.Hyperv) { + s_logger.debug("Hyperv hypervisor configured, telling the ssvm to load the CifsSecondaryStorageResource"); buf.append(" resource=com.cloud.storage.resource.CifsSecondaryStorageResource"); + } else if (profile.getHypervisorType() == HypervisorType.VMware) { + s_logger.debug("VmWare hypervisor configured, telling the ssvm to load the PremiumSecondaryStorageResource"); + buf.append(" resource=com.cloud.storage.resource.PremiumSecondaryStorageResource"); } else { - buf.append(" resource=com.cloud.storage.resource.PremiumSecondaryStorageResource"); + s_logger.debug("Telling the ssvm to load the NfsSecondaryStorageResource"); + buf.append(" resource=com.cloud.storage.resource.NfsSecondaryStorageResource"); } } else { buf.append(" resource=com.cloud.storage.resource.NfsSecondaryStorageResource"); diff --git a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java index 7166504020f..4231be81ff6 100755 --- a/server/src/com/cloud/storage/upload/UploadMonitorImpl.java +++ b/server/src/com/cloud/storage/upload/UploadMonitorImpl.java @@ -234,25 +234,14 @@ public class UploadMonitorImpl implements UploadMonitor { } //Construct actual URL locally now that the symlink exists at SSVM - List ssVms = _secStorageVmDao.getSecStorageVmListInStates(SecondaryStorageVm.Role.templateProcessor, dataCenterId, State.Running); - if (ssVms.size() > 0) { - SecondaryStorageVmVO ssVm = ssVms.get(0); - if (ssVm.getPublicIpAddress() == null) { - errorString = "A running secondary storage vm has a null public ip?"; - s_logger.error(errorString); - throw new CloudRuntimeException(errorString); - } - String extractURL = generateCopyUrl(ssVm.getPublicIpAddress(), uuid); - UploadVO vo = _uploadDao.createForUpdate(); - vo.setLastUpdated(new Date()); - vo.setUploadUrl(extractURL); - vo.setUploadState(Status.DOWNLOAD_URL_CREATED); - _uploadDao.update(uploadTemplateObj.getId(), vo); - success = true; - return _uploadDao.findById(uploadTemplateObj.getId(), true); - } - errorString = "Couldnt find a running SSVM in the zone" + dataCenterId+ ". Couldnt create the extraction URL."; - throw new CloudRuntimeException(errorString); + String extractURL = generateCopyUrl(ssvm.getPublicIpAddress(), uuid); + UploadVO vo = _uploadDao.createForUpdate(); + vo.setLastUpdated(new Date()); + vo.setUploadUrl(extractURL); + vo.setUploadState(Status.DOWNLOAD_URL_CREATED); + _uploadDao.update(uploadTemplateObj.getId(), vo); + success = true; + return _uploadDao.findById(uploadTemplateObj.getId(), true); }finally{ if(!success){ UploadVO uploadJob = _uploadDao.createForUpdate(uploadTemplateObj.getId()); diff --git a/server/src/com/cloud/upgrade/DatabaseIntegrityChecker.java b/server/src/com/cloud/upgrade/DatabaseIntegrityChecker.java index 4688b3e617b..24f6aeb07e3 100755 --- a/server/src/com/cloud/upgrade/DatabaseIntegrityChecker.java +++ b/server/src/com/cloud/upgrade/DatabaseIntegrityChecker.java @@ -167,10 +167,10 @@ public class DatabaseIntegrityChecker implements SystemIntegrityChecker { txn.start(); try { String dbVersion = _dao.getCurrentVersion(); - + if ( dbVersion == null ) return false; - + if (Version.compare(Version.trimToPatch(dbVersion), Version.trimToPatch("2.2.8")) != 0) { return true; } diff --git a/server/src/com/cloud/upgrade/dao/Upgrade302to40.java b/server/src/com/cloud/upgrade/dao/Upgrade302to40.java index 198dafdbf11..0a836e92620 100644 --- a/server/src/com/cloud/upgrade/dao/Upgrade302to40.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade302to40.java @@ -517,7 +517,7 @@ public class Upgrade302to40 extends Upgrade30xBase implements DbUpgrade { s_logger.debug("Unique key already exists on host_details - not adding new one"); }else{ //add the key - PreparedStatement pstmtUpdate = conn.prepareStatement("ALTER TABLE `cloud`.`host_details` ADD CONSTRAINT UNIQUE KEY `uk_host_id_name` (`host_id`, `name`)"); + PreparedStatement pstmtUpdate = conn.prepareStatement("ALTER IGNORE TABLE `cloud`.`host_details` ADD CONSTRAINT UNIQUE KEY `uk_host_id_name` (`host_id`, `name`)"); pstmtUpdate.executeUpdate(); s_logger.debug("Unique key did not exist on host_details - added new one"); pstmtUpdate.close(); diff --git a/server/src/com/cloud/upgrade/dao/Upgrade30xBase.java b/server/src/com/cloud/upgrade/dao/Upgrade30xBase.java index 63047a2bcde..585e08673b8 100644 --- a/server/src/com/cloud/upgrade/dao/Upgrade30xBase.java +++ b/server/src/com/cloud/upgrade/dao/Upgrade30xBase.java @@ -1,13 +1,19 @@ -/*Copyright 2012 Citrix Systems, Inc. Licensed under the -Apache License, Version 2.0 (the "License"); you may not use this -file except in compliance with the License. Citrix Systems, Inc. -reserves all rights not expressly granted by 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.*/ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.upgrade.dao; diff --git a/server/src/com/cloud/user/dao/SSHKeyPairDao.java b/server/src/com/cloud/user/dao/SSHKeyPairDao.java index 84295da5d80..b1833bfc445 100644 --- a/server/src/com/cloud/user/dao/SSHKeyPairDao.java +++ b/server/src/com/cloud/user/dao/SSHKeyPairDao.java @@ -31,6 +31,8 @@ public interface SSHKeyPairDao extends GenericDao { public SSHKeyPairVO findByName(long accountId, long domainId, String name); + public SSHKeyPairVO findByPublicKey(String publicKey); + public boolean deleteByName(long accountId, long domainId, String name); } diff --git a/server/src/com/cloud/user/dao/SSHKeyPairDaoImpl.java b/server/src/com/cloud/user/dao/SSHKeyPairDaoImpl.java index 58999e06ff1..ac16cc9c01e 100644 --- a/server/src/com/cloud/user/dao/SSHKeyPairDaoImpl.java +++ b/server/src/com/cloud/user/dao/SSHKeyPairDaoImpl.java @@ -61,7 +61,14 @@ public class SSHKeyPairDaoImpl extends GenericDaoBase implem sc.addAnd("name", SearchCriteria.Op.EQ, name); return findOneBy(sc); } - + + @Override + public SSHKeyPairVO findByPublicKey(String publicKey) { + SearchCriteria sc = createSearchCriteria(); + sc.addAnd("publicKey", SearchCriteria.Op.EQ, publicKey); + return findOneBy(sc); + } + @Override public boolean deleteByName(long accountId, long domainId, String name) { SSHKeyPairVO pair = findByName(accountId, domainId, name); diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index d7a1bd2387f..183617667cc 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -421,6 +421,8 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager userVm.setDetail("Encrypted.Password", encryptedPasswd); _vmDao.saveDetails(userVm); } + } else { + throw new CloudRuntimeException("Failed to reset password for the virtual machine "); } return userVm; @@ -448,15 +450,14 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager VirtualMachineProfile vmProfile = new VirtualMachineProfileImpl(vmInstance); vmProfile.setParameter(VirtualMachineProfile.Param.VmPassword, password); - List elements = _networkMgr.getPasswordResetElements(); - - boolean result = true; - for (UserDataServiceProvider element : elements) { - if (!element.savePassword(defaultNetwork, defaultNicProfile, vmProfile)) { - result = false; - } + UserDataServiceProvider element = _networkMgr.getPasswordResetProvider(defaultNetwork); + if (element == null) { + throw new CloudRuntimeException("Can't find network element for " + Service.UserData.getName() + + " provider needed for password reset"); } + boolean result = element.savePassword(defaultNetwork, defaultNicProfile, vmProfile); + // Need to reboot the virtual machine so that the password gets redownloaded from the DomR, and reset on the VM if (!result) { s_logger.debug("Failed to reset password for the virutal machine; no need to reboot the vm"); @@ -2205,13 +2206,18 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager throw new InvalidParameterValueException("Unable to find network offering with availability=" + Availability.Required + " to automatically create the network as a part of vm creation"); } - PhysicalNetwork physicalNetwork = _networkMgr.translateZoneIdToPhysicalNetwork(zone.getId()); if (requiredOfferings.get(0).getState() == NetworkOffering.State.Enabled) { // get Virtual networks List virtualNetworks = _networkMgr.listNetworksForAccount(owner.getId(), zone.getId(), Network.GuestType.Isolated); if (virtualNetworks.isEmpty()) { - s_logger.debug("Creating network for account " + owner + " from the network offering id=" + requiredOfferings.get(0).getId() + " as a part of deployVM process"); + long physicalNetworkId = _networkMgr.findPhysicalNetworkId(zone.getId(), requiredOfferings.get(0).getTags(), requiredOfferings.get(0).getTrafficType()); + // Validate physical network + PhysicalNetwork physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId); + if (physicalNetwork == null) { + throw new InvalidParameterValueException("Unable to find physical network with id: "+physicalNetworkId + " and tag: " +requiredOfferings.get(0).getTags()); + } + s_logger.debug("Creating network for account " + owner + " from the network offering id=" +requiredOfferings.get(0).getId() + " as a part of deployVM process"); Network newNetwork = _networkMgr.createGuestNetwork(requiredOfferings.get(0).getId(), owner.getAccountName() + "-network", owner.getAccountName() + "-network", null, null, null, null, owner, null, physicalNetwork, zone.getId(), ACLType.Account, null, null); @@ -3592,13 +3598,18 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager throw new InvalidParameterValueException("Unable to find network offering with availability=" + Availability.Required + " to automatically create the network as a part of vm creation"); } - - PhysicalNetwork physicalNetwork = _networkMgr.translateZoneIdToPhysicalNetwork(zone.getId()); if (requiredOfferings.get(0).getState() == NetworkOffering.State.Enabled) { // get Virtual networks List virtualNetworks = _networkMgr.listNetworksForAccount(newAccount.getId(), zone.getId(), Network.GuestType.Isolated); if (virtualNetworks.isEmpty()) { + long physicalNetworkId = _networkMgr.findPhysicalNetworkId(zone.getId(), requiredOfferings.get(0).getTags(), requiredOfferings.get(0).getTrafficType()); + // Validate physical network + PhysicalNetwork physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId); + if (physicalNetwork == null) { + throw new InvalidParameterValueException("Unable to find physical network with id: "+physicalNetworkId + " and tag: " +requiredOfferings.get(0).getTags()); + } + s_logger.debug("Creating network for account " + newAccount + " from the network offering id=" + requiredOfferings.get(0).getId() + " as a part of deployVM process"); Network newNetwork = _networkMgr.createGuestNetwork(requiredOfferings.get(0).getId(), diff --git a/server/src/com/cloud/vm/dao/UserVmData.java b/server/src/com/cloud/vm/dao/UserVmData.java index 4a0d10d7702..82c737c0e5b 100644 --- a/server/src/com/cloud/vm/dao/UserVmData.java +++ b/server/src/com/cloud/vm/dao/UserVmData.java @@ -70,6 +70,7 @@ public class UserVmData { private Long publicIpId; private String publicIp; private String instanceName; + private String sshPublicKey; private boolean initialized; @@ -710,5 +711,13 @@ public class UserVmData { public void setInstanceName(String instanceName) { this.instanceName = instanceName; } + + public String getSshPublicKey() { + return sshPublicKey; + } + + public void setSshPublicKey(String sshPublicKey) { + this.sshPublicKey = sshPublicKey; + } } diff --git a/server/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java b/server/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java index 6975c8c79d8..b74741b6818 100644 --- a/server/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java +++ b/server/src/com/cloud/vm/dao/UserVmDetailsDaoImpl.java @@ -39,7 +39,7 @@ public class UserVmDetailsDaoImpl extends GenericDaoBase i VmSearch.done(); DetailSearch = createSearchBuilder(); - DetailSearch.and("hostId", DetailSearch.entity().getVmId(), SearchCriteria.Op.EQ); + DetailSearch.and("vmId", DetailSearch.entity().getVmId(), SearchCriteria.Op.EQ); DetailSearch.and("name", DetailSearch.entity().getName(), SearchCriteria.Op.EQ); DetailSearch.done(); } diff --git a/server/test/com/cloud/network/MockNetworkManagerImpl.java b/server/test/com/cloud/network/MockNetworkManagerImpl.java index 06104c503f6..c2ae1bfd29c 100755 --- a/server/test/com/cloud/network/MockNetworkManagerImpl.java +++ b/server/test/com/cloud/network/MockNetworkManagerImpl.java @@ -584,11 +584,6 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS return null; } - @Override - public PhysicalNetwork translateZoneIdToPhysicalNetwork(long zoneId) { - // TODO Auto-generated method stub - return null; - } @Override public boolean isSecurityGroupSupportedInNetwork(Network network) { @@ -615,7 +610,7 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS } @Override - public List getPasswordResetElements() { + public UserDataServiceProvider getPasswordResetProvider(Network network) { // TODO Auto-generated method stub return null; } @@ -1137,4 +1132,13 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager, NetworkS // TODO Auto-generated method stub return null; } + + /* (non-Javadoc) + * @see com.cloud.network.NetworkManager#getNetworkLockTimeout() + */ + @Override + public int getNetworkLockTimeout() { + // TODO Auto-generated method stub + return 0; + } } diff --git a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java index 8841483ddef..37c4678eb7a 100644 --- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java +++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc; import java.util.List; diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java index 7f558912d65..dfd4f7e839f 100644 --- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java +++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc; import java.util.ArrayList; @@ -801,7 +805,7 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager{ * @see com.cloud.network.NetworkManager#getPasswordResetElements() */ @Override - public List getPasswordResetElements() { + public UserDataServiceProvider getPasswordResetProvider(Network network) { // TODO Auto-generated method stub return null; } @@ -1488,13 +1492,14 @@ public class MockNetworkManagerImpl implements NetworkManager, Manager{ return null; } + /* (non-Javadoc) - * @see com.cloud.network.NetworkManager#translateZoneIdToPhysicalNetwork(long) + * @see com.cloud.network.NetworkManager#getNetworkLockTimeout() */ @Override - public PhysicalNetwork translateZoneIdToPhysicalNetwork(long zoneId) { + public int getNetworkLockTimeout() { // TODO Auto-generated method stub - return null; + return 0; } } diff --git a/server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java b/server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java index 0a199f56eb5..cb052ed64e4 100644 --- a/server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java +++ b/server/test/com/cloud/vpc/MockResourceLimitManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc; import java.util.List; diff --git a/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java b/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java index cb200f4ef1c..4cd742ca4a3 100644 --- a/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java +++ b/server/test/com/cloud/vpc/MockSite2SiteVpnManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc; import java.util.List; diff --git a/server/test/com/cloud/vpc/MockVpcManagerImpl.java b/server/test/com/cloud/vpc/MockVpcManagerImpl.java index 575ed2b1042..fc10a466087 100644 --- a/server/test/com/cloud/vpc/MockVpcManagerImpl.java +++ b/server/test/com/cloud/vpc/MockVpcManagerImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc; import java.util.List; @@ -28,6 +32,7 @@ import com.cloud.exception.InsufficientCapacityException; import com.cloud.exception.NetworkRuleConflictException; import com.cloud.exception.ResourceAllocationException; import com.cloud.exception.ResourceUnavailableException; +import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.network.IpAddress; import com.cloud.network.Network; import com.cloud.network.Network.Provider; @@ -452,4 +457,13 @@ public class MockVpcManagerImpl implements VpcManager, Manager{ } + /* (non-Javadoc) + * @see com.cloud.network.vpc.VpcManager#getSupportedVpcHypervisors() + */ + @Override + public List getSupportedVpcHypervisors() { + // TODO Auto-generated method stub + return null; + } + } diff --git a/server/test/com/cloud/vpc/VpcApiUnitTest.java b/server/test/com/cloud/vpc/VpcApiUnitTest.java index efeee5e4222..ad323d29e5b 100644 --- a/server/test/com/cloud/vpc/VpcApiUnitTest.java +++ b/server/test/com/cloud/vpc/VpcApiUnitTest.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc; import java.util.ArrayList; diff --git a/server/test/com/cloud/vpc/dao/MockConfigurationDaoImpl.java b/server/test/com/cloud/vpc/dao/MockConfigurationDaoImpl.java index 0cac4b9dfde..87a748fe0fc 100644 --- a/server/test/com/cloud/vpc/dao/MockConfigurationDaoImpl.java +++ b/server/test/com/cloud/vpc/dao/MockConfigurationDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc.dao; import java.util.HashMap; diff --git a/server/test/com/cloud/vpc/dao/MockNetworkDaoImpl.java b/server/test/com/cloud/vpc/dao/MockNetworkDaoImpl.java index 970a5d9ba57..2a675b3a217 100644 --- a/server/test/com/cloud/vpc/dao/MockNetworkDaoImpl.java +++ b/server/test/com/cloud/vpc/dao/MockNetworkDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc.dao; import java.util.ArrayList; diff --git a/server/test/com/cloud/vpc/dao/MockNetworkOfferingDaoImpl.java b/server/test/com/cloud/vpc/dao/MockNetworkOfferingDaoImpl.java index dfeadf67a03..496864be198 100644 --- a/server/test/com/cloud/vpc/dao/MockNetworkOfferingDaoImpl.java +++ b/server/test/com/cloud/vpc/dao/MockNetworkOfferingDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc.dao; import java.lang.reflect.Field; diff --git a/server/test/com/cloud/vpc/dao/MockNetworkOfferingServiceMapDaoImpl.java b/server/test/com/cloud/vpc/dao/MockNetworkOfferingServiceMapDaoImpl.java index 2e388c2e447..178f42bdffb 100644 --- a/server/test/com/cloud/vpc/dao/MockNetworkOfferingServiceMapDaoImpl.java +++ b/server/test/com/cloud/vpc/dao/MockNetworkOfferingServiceMapDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc.dao; import javax.ejb.Local; diff --git a/server/test/com/cloud/vpc/dao/MockNetworkServiceMapDaoImpl.java b/server/test/com/cloud/vpc/dao/MockNetworkServiceMapDaoImpl.java index e66aa5b8913..51536a924f6 100644 --- a/server/test/com/cloud/vpc/dao/MockNetworkServiceMapDaoImpl.java +++ b/server/test/com/cloud/vpc/dao/MockNetworkServiceMapDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc.dao; import java.util.List; diff --git a/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java b/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java index f59277b8d7f..99bdb58e4f7 100644 --- a/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java +++ b/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc.dao; import java.lang.reflect.Field; diff --git a/server/test/com/cloud/vpc/dao/MockVpcOfferingDaoImpl.java b/server/test/com/cloud/vpc/dao/MockVpcOfferingDaoImpl.java index 2a808efa3f6..329931e1dd4 100644 --- a/server/test/com/cloud/vpc/dao/MockVpcOfferingDaoImpl.java +++ b/server/test/com/cloud/vpc/dao/MockVpcOfferingDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc.dao; import javax.ejb.Local; diff --git a/server/test/com/cloud/vpc/dao/MockVpcOfferingServiceMapDaoImpl.java b/server/test/com/cloud/vpc/dao/MockVpcOfferingServiceMapDaoImpl.java index 6ac4234fa22..3357686af87 100644 --- a/server/test/com/cloud/vpc/dao/MockVpcOfferingServiceMapDaoImpl.java +++ b/server/test/com/cloud/vpc/dao/MockVpcOfferingServiceMapDaoImpl.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc.dao; import java.util.List; diff --git a/server/test/com/cloud/vpc/dao/MockVpcVirtualRouterElement.java b/server/test/com/cloud/vpc/dao/MockVpcVirtualRouterElement.java index 91cfb9933f7..5d759b8aa3a 100644 --- a/server/test/com/cloud/vpc/dao/MockVpcVirtualRouterElement.java +++ b/server/test/com/cloud/vpc/dao/MockVpcVirtualRouterElement.java @@ -1,15 +1,19 @@ -// Copyright 2012 Citrix Systems, Inc. Licensed under the -// Apache License, Version 2.0 (the "License"); you may not use this -// file except in compliance with the License. Citrix Systems, Inc. -// reserves all rights not expressly granted by 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. -// -// Automatically generated by addcopyright.py at 04/03/2012 +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you 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 com.cloud.vpc.dao; import com.cloud.exception.ConcurrentOperationException; diff --git a/server/test/resources/cleanup.sql b/server/test/resources/cleanup.sql index ac083d722c3..c7d5d208c57 100644 --- a/server/test/resources/cleanup.sql +++ b/server/test/resources/cleanup.sql @@ -1,14 +1,18 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you 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. DROP DATABASE IF EXISTS `cloud`; DROP DATABASE IF EXISTS `cloud_usage`; diff --git a/server/test/resources/fake.sql b/server/test/resources/fake.sql index 37f96cecb27..f352f5ef44d 100644 --- a/server/test/resources/fake.sql +++ b/server/test/resources/fake.sql @@ -1,12 +1,16 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you 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. diff --git a/setup/bindir/cloud-setup-databases.in b/setup/bindir/cloud-setup-databases.in index 06d07d70f42..54c411d7f7b 100755 --- a/setup/bindir/cloud-setup-databases.in +++ b/setup/bindir/cloud-setup-databases.in @@ -69,7 +69,7 @@ class DBDeployer(object): dbDotProperties = {} dbDotPropertiesIndex = 0 encryptionKeyFile = '@MSCONF@/key' - encryptionJarPath = '@JAVADIR@/cloud-jasypt-1.8.jar' + encryptionJarPath = '@JAVADIR@/jasypt-1.9.0.jar' success = False magicString = 'This_is_a_magic_string_i_think_no_one_will_duplicate' tmpMysqlFile = os.path.join(os.path.expanduser('~/'), 'cloudstackmysql.tmp.sql') diff --git a/setup/db/create-schema.sql b/setup/db/create-schema.sql index 54b096751d8..fe66f4a7d68 100755 --- a/setup/db/create-schema.sql +++ b/setup/db/create-schema.sql @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you 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. SET foreign_key_checks = 0; use cloud; diff --git a/setup/db/db/schema-302to40.sql b/setup/db/db/schema-302to40.sql index 2b47969aff4..d1a5ea95125 100644 --- a/setup/db/db/schema-302to40.sql +++ b/setup/db/db/schema-302to40.sql @@ -237,7 +237,7 @@ ALTER TABLE physical_network_service_providers DROP FOREIGN KEY fk_pnetwork_serv SET @constraintname = (select CONCAT(CONCAT('DROP INDEX ', A.CONSTRAINT_NAME), ' ON physical_network_service_providers' ) from information_schema.key_column_usage A JOIN information_schema.key_column_usage B ON B.table_name = 'physical_network_service_providers' AND B.COLUMN_NAME = 'provider_name' AND A.COLUMN_NAME ='physical_network_id' AND B.CONSTRAINT_NAME=A.CONSTRAINT_NAME -where A.table_name = 'physical_network_service_providers'); +where A.table_name = 'physical_network_service_providers' LIMIT 1); PREPARE stmt1 FROM @constraintname; EXECUTE stmt1; @@ -466,3 +466,5 @@ UPDATE `cloud`.`configuration` SET description='Comma separated list of cidrs in INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'site2site.vpn.vpngateway.connection.limit', '4', 'The maximum number of VPN connection per VPN gateway'); INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'site2site.vpn.customergateway.subnets.limit', '10', 'The maximum number of subnets per customer gateway'); + +INSERT IGNORE INTO `cloud`.`guest_os_category` VALUES ('11','None',NULL); diff --git a/setup/db/deploy-db-dev.sh b/setup/db/deploy-db-dev.sh index f149e9efd02..29ec4db6050 100755 --- a/setup/db/deploy-db-dev.sh +++ b/setup/db/deploy-db-dev.sh @@ -104,6 +104,10 @@ CP=./ CP=${CP}$PATHSEP$CATALINA_HOME/conf +# Add mysql jar from mysql-connector-java package to CP +# for Jenkins +CP=${CP}${PATHSEP}/usr/share/java/mysql-connector-java.jar + for file in $CATALINA_HOME/webapps/client/WEB-INF/lib/*.jar do CP=${CP}$PATHSEP$file diff --git a/setup/db/templates.sql b/setup/db/templates.sql index 3034c7f187b..0c85be47a5f 100755 --- a/setup/db/templates.sql +++ b/setup/db/templates.sql @@ -48,7 +48,7 @@ INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (7, 'Other'); INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (8, 'Novel'); INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (9, 'Unix'); INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (10, 'Ubuntu'); - +INSERT INTO `cloud`.`guest_os_category` (id, name) VALUES (11, 'None'); INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (1, 1, 'CentOS 4.5 (32-bit)'); INSERT INTO `cloud`.`guest_os` (id, category_id, display_name) VALUES (2, 1, 'CentOS 4.6 (32-bit)'); diff --git a/test/conf/templates.sql b/test/conf/templates.sql index 1b31764dece..b883b17adce 100644 --- a/test/conf/templates.sql +++ b/test/conf/templates.sql @@ -1,13 +1,17 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 -INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, ready, display_text, enable_password, format, guest_os_id, create_status, cross_zones) VALUES (1, 'routing', 'DomR Template', 0, now(), 'ext3', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/routing/latest/routing.vhd.bz2', 0, 'DomR Template', 0, 'VHD', 10, 'Creating', 1);INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, ready, display_text, enable_password, format, guest_os_id, create_status, cross_zones) VALUES (2, 'centos53-x86_64', 'CentOS 5.3(x86_64) no GUI', 1, now(), 'ext3', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/ami-ccb35ea5/ami-ccb35ea5.vhd.bz2', 0, 'CentOS 5.3(x86_64) no GUI', 0, 'VHD', 10, 'Creating', 1);INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, created, type,hvm, bits, account_id, url, ready, display_text, enable_password, format, guest_os_id, create_status) VALUES (5, 'ubuntu iso', 'Ubuntu iso', 1, now(), 'cdfs', 1, 64, 1, 'http://172.16.0.220/images/sumita/iso/ubuntu-9.04-server-amd64.iso', 0, 'Ubuntu iso', 0, 'ISO', 51, 'Creating');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (1, 'CentOS');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (2, 'Citrix');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (3, 'Debian');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (4, 'Oracle');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (5, 'RedHat');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (6, 'SUSE');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (7, 'Windows');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (8, 'Other');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (1, 1, 'CentOS 4.5', 'CentOS 4.5');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (2, 1, 'CentOS 4.6', 'CentOS 4.6');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (3, 1, 'CentOS 4.7', 'CentOS 4.7');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (4, 1, 'CentOS 5.0', 'CentOS 5.0');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (5, 1, 'CentOS 5.0 x64', 'CentOS 5.0 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (6, 1, 'CentOS 5.1', 'CentOS 5.1');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (7, 1, 'CentOS 5.1 x64', 'CentOS 5.1 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (8, 1, 'CentOS 5.2', 'CentOS 5.2');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (9, 1, 'CentOS 5.2 x64', 'CentOS 5.2 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (10, 1, 'CentOS 5.3', 'CentOS 5.3');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (11, 1, 'CentOS 5.3 x64', 'CentOS 5.3 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (12, 2, 'Citrix XenApp', 'Citrix XenApp');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (13, 2, 'Citrix XenApp x64', 'Citrix XenApp x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (14, 3, 'Debian Lenny 5.0', 'Debian Lenny 5.0');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (15, 4, 'Oracle Enterprise Linux 5.0', 'Oracle Enterprise Linux 5.0');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (16, 4, 'Oracle Enterprise Linux 5.0 x64', 'Oracle Enterprise Linux 5.0 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (17, 4, 'Oracle Enterprise Linux 5.1', 'Oracle Enterprise Linux 5.1');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (18, 4, 'Oracle Enterprise Linux 5.1 x64', 'Oracle Enterprise Linux 5.1 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (19, 4, 'Oracle Enterprise Linux 5.2', 'Oracle Enterprise Linux 5.2');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (20, 4, 'Oracle Enterprise Linux 5.2 x64', 'Oracle Enterprise Linux 5.2 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (21, 5, 'Red Hat Enterprise Linux 4.5', 'Red Hat Enterprise Linux 4.5');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (22, 5, 'Red Hat Enterprise Linux 4.6', 'Red Hat Enterprise Linux 4.6');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (23, 5, 'Red Hat Enterprise Linux 4.7', 'Red Hat Enterprise Linux 4.7');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (24, 5, 'Red Hat Enterprise Linux 5.0', 'Red Hat Enterprise Linux 5.0');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (25, 5, 'Red Hat Enterprise Linux 5.0 x64', 'Red Hat Enterprise Linux 5.0 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (26, 5, 'Red Hat Enterprise Linux 5.1', 'Red Hat Enterprise Linux 5.1');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (27, 5, 'Red Hat Enterprise Linux 5.1 x64', 'Red Hat Enterprise Linux 5.1 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (28, 5, 'Red Hat Enterprise Linux 5.2', 'Red Hat Enterprise Linux 5.2');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (29, 5, 'Red Hat Enterprise Linux 5.2 x64', 'Red Hat Enterprise Linux 5.2 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (30, 5, 'Red Hat Enterprise Linux 5.3', 'Red Hat Enterprise Linux 5.3');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (31, 5, 'Red Hat Enterprise Linux 5.3 x64', 'Red Hat Enterprise Linux 5.3 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (32, 6, 'SUSE Linux Enterprise Server 9 SP4', 'SUSE Linux Enterprise Server 9 SP4');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (33, 6, 'SUSE Linux Enterprise Server 10 SP1', 'SUSE Linux Enterprise Server 10 SP1');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (34, 6, 'SUSE Linux Enterprise Server 10 SP1 x64', 'SUSE Linux Enterprise Server 10 SP1 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (35, 6, 'SUSE Linux Enterprise Server 10 SP2', 'SUSE Linux Enterprise Server 10 SP2');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (36, 6, 'SUSE Linux Enterprise Server 10 SP2 x64', 'SUSE Linux Enterprise Server 10 SP2 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (37, 6, 'SUSE Linux Enterprise Server 11', 'SUSE Linux Enterprise Server 11');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (38, 6, 'SUSE Linux Enterprise Server 11 x64', 'SUSE Linux Enterprise Server 11 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (39, 7, 'Windows 7', 'Windows 7');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (40, 7, 'Windows 7 x64', 'Windows 7 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (41, 7, 'Windows Server 2003', 'Windows Server 2003');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (42, 7, 'Windows Server 2003 x64', 'Windows Server 2003 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (43, 7, 'Windows Server 2008', 'Windows Server 2008');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (44, 7, 'Windows Server 2008 x64', 'Windows Server 2008 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (45, 7, 'Windows Server 2008 R2 x64', 'Windows Server 2008 R2 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (46, 7, 'Windows 2000 SP4', 'Windows 2000 SP4');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (47, 7, 'Windows Vista', 'Windows Vista');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (48, 7, 'Windows XP SP2', 'Windows XP SP2');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (49, 7, 'Windows XP SP3', 'Windows XP SP3');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (50, 8, 'Other install media', 'Ubuntu');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (51, 8, 'Other install media', 'Other'); \ No newline at end of file +-- Licensed to the Apache Software Foundation (ASF) under one +-- or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information +-- regarding copyright ownership. The ASF licenses this file +-- to you 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. +INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, ready, display_text, enable_password, format, guest_os_id, create_status, cross_zones) VALUES (1, 'routing', 'DomR Template', 0, now(), 'ext3', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/routing/latest/routing.vhd.bz2', 0, 'DomR Template', 0, 'VHD', 10, 'Creating', 1);INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, ready, display_text, enable_password, format, guest_os_id, create_status, cross_zones) VALUES (2, 'centos53-x86_64', 'CentOS 5.3(x86_64) no GUI', 1, now(), 'ext3', 0, 64, 1, 'http://nfs1.lab.vmops.com/templates/ami-ccb35ea5/ami-ccb35ea5.vhd.bz2', 0, 'CentOS 5.3(x86_64) no GUI', 0, 'VHD', 10, 'Creating', 1);INSERT INTO `vmops`.`vm_template` (id, unique_name, name, public, created, type,hvm, bits, account_id, url, ready, display_text, enable_password, format, guest_os_id, create_status) VALUES (5, 'ubuntu iso', 'Ubuntu iso', 1, now(), 'cdfs', 1, 64, 1, 'http://172.16.0.220/images/sumita/iso/ubuntu-9.04-server-amd64.iso', 0, 'Ubuntu iso', 0, 'ISO', 51, 'Creating');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (1, 'CentOS');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (2, 'Citrix');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (3, 'Debian');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (4, 'Oracle');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (5, 'RedHat');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (6, 'SUSE');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (7, 'Windows');INSERT INTO `vmops`.`guest_os_category` (id, name) VALUES (8, 'Other');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (1, 1, 'CentOS 4.5', 'CentOS 4.5');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (2, 1, 'CentOS 4.6', 'CentOS 4.6');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (3, 1, 'CentOS 4.7', 'CentOS 4.7');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (4, 1, 'CentOS 5.0', 'CentOS 5.0');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (5, 1, 'CentOS 5.0 x64', 'CentOS 5.0 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (6, 1, 'CentOS 5.1', 'CentOS 5.1');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (7, 1, 'CentOS 5.1 x64', 'CentOS 5.1 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (8, 1, 'CentOS 5.2', 'CentOS 5.2');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (9, 1, 'CentOS 5.2 x64', 'CentOS 5.2 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (10, 1, 'CentOS 5.3', 'CentOS 5.3');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (11, 1, 'CentOS 5.3 x64', 'CentOS 5.3 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (12, 2, 'Citrix XenApp', 'Citrix XenApp');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (13, 2, 'Citrix XenApp x64', 'Citrix XenApp x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (14, 3, 'Debian Lenny 5.0', 'Debian Lenny 5.0');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (15, 4, 'Oracle Enterprise Linux 5.0', 'Oracle Enterprise Linux 5.0');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (16, 4, 'Oracle Enterprise Linux 5.0 x64', 'Oracle Enterprise Linux 5.0 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (17, 4, 'Oracle Enterprise Linux 5.1', 'Oracle Enterprise Linux 5.1');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (18, 4, 'Oracle Enterprise Linux 5.1 x64', 'Oracle Enterprise Linux 5.1 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (19, 4, 'Oracle Enterprise Linux 5.2', 'Oracle Enterprise Linux 5.2');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (20, 4, 'Oracle Enterprise Linux 5.2 x64', 'Oracle Enterprise Linux 5.2 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (21, 5, 'Red Hat Enterprise Linux 4.5', 'Red Hat Enterprise Linux 4.5');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (22, 5, 'Red Hat Enterprise Linux 4.6', 'Red Hat Enterprise Linux 4.6');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (23, 5, 'Red Hat Enterprise Linux 4.7', 'Red Hat Enterprise Linux 4.7');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (24, 5, 'Red Hat Enterprise Linux 5.0', 'Red Hat Enterprise Linux 5.0');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (25, 5, 'Red Hat Enterprise Linux 5.0 x64', 'Red Hat Enterprise Linux 5.0 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (26, 5, 'Red Hat Enterprise Linux 5.1', 'Red Hat Enterprise Linux 5.1');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (27, 5, 'Red Hat Enterprise Linux 5.1 x64', 'Red Hat Enterprise Linux 5.1 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (28, 5, 'Red Hat Enterprise Linux 5.2', 'Red Hat Enterprise Linux 5.2');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (29, 5, 'Red Hat Enterprise Linux 5.2 x64', 'Red Hat Enterprise Linux 5.2 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (30, 5, 'Red Hat Enterprise Linux 5.3', 'Red Hat Enterprise Linux 5.3');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (31, 5, 'Red Hat Enterprise Linux 5.3 x64', 'Red Hat Enterprise Linux 5.3 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (32, 6, 'SUSE Linux Enterprise Server 9 SP4', 'SUSE Linux Enterprise Server 9 SP4');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (33, 6, 'SUSE Linux Enterprise Server 10 SP1', 'SUSE Linux Enterprise Server 10 SP1');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (34, 6, 'SUSE Linux Enterprise Server 10 SP1 x64', 'SUSE Linux Enterprise Server 10 SP1 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (35, 6, 'SUSE Linux Enterprise Server 10 SP2', 'SUSE Linux Enterprise Server 10 SP2');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (36, 6, 'SUSE Linux Enterprise Server 10 SP2 x64', 'SUSE Linux Enterprise Server 10 SP2 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (37, 6, 'SUSE Linux Enterprise Server 11', 'SUSE Linux Enterprise Server 11');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (38, 6, 'SUSE Linux Enterprise Server 11 x64', 'SUSE Linux Enterprise Server 11 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (39, 7, 'Windows 7', 'Windows 7');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (40, 7, 'Windows 7 x64', 'Windows 7 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (41, 7, 'Windows Server 2003', 'Windows Server 2003');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (42, 7, 'Windows Server 2003 x64', 'Windows Server 2003 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (43, 7, 'Windows Server 2008', 'Windows Server 2008');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (44, 7, 'Windows Server 2008 x64', 'Windows Server 2008 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (45, 7, 'Windows Server 2008 R2 x64', 'Windows Server 2008 R2 x64');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (46, 7, 'Windows 2000 SP4', 'Windows 2000 SP4');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (47, 7, 'Windows Vista', 'Windows Vista');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (48, 7, 'Windows XP SP2', 'Windows XP SP2');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (49, 7, 'Windows XP SP3', 'Windows XP SP3');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (50, 8, 'Other install media', 'Ubuntu');INSERT INTO `vmops`.`guest_os` (id, category_id, name, display_name) VALUES (51, 8, 'Other install media', 'Other'); diff --git a/tools/ant/apache-ant-1.7.1/bin/runant.py b/tools/ant/apache-ant-1.7.1/bin/runant.py index ef70325985f..0a2723de761 100755 --- a/tools/ant/apache-ant-1.7.1/bin/runant.py +++ b/tools/ant/apache-ant-1.7.1/bin/runant.py @@ -1,17 +1,20 @@ #!/usr/bin/python -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 -# http://www.apache.org/licenses/LICENSE-2.0 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. """ diff --git a/tools/build/addcopyright.py b/tools/build/addcopyright.py deleted file mode 100755 index 719ec1bb669..00000000000 --- a/tools/build/addcopyright.py +++ /dev/null @@ -1,290 +0,0 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - -from optparse import OptionParser -import sys -import os, os.path -import fnmatch -import time - -class CopyRightDetecter(object): - def isCopyRightLine(self, txt): - return False - -class KeyWordCopyRightDetecter(CopyRightDetecter): - keywords = ['Cloud.com', 'Copyright', '(C)', '2011', 'Citrix', 'Systems', 'Inc', 'All', 'rights', 'reserved', 'This', 'software', 'is', 'licensed', 'under', 'the', - 'GNU', 'General', 'Public', 'License', 'v3', 'or', 'later', 'It', 'is', 'free', 'software:', 'you', 'can', 'redistribute', 'it', 'and/or', 'modify', 'it', - 'under', 'the', 'terms', 'of', 'the', 'GNU', 'General', 'Public', 'License', 'as', 'published', 'by', 'the', 'Free', 'Software', 'Foundation', 'either', - 'version', '3', 'of', 'the', 'License', 'or', 'any', 'later', 'version', 'This', 'program', 'is', 'distributed', 'in', 'the', 'hope', 'that', 'it', 'will', - 'be', 'useful', 'but', 'WITHOUT', 'ANY', 'WARRANTY;', 'without', 'even', 'the', 'implied', 'warranty', 'of', 'MERCHANTABILITY', 'or', 'FITNESS', 'FOR', 'A', - 'PARTICULAR', 'PURPOSE', 'See', 'the', 'GNU', 'General', 'Public', 'License', 'for', 'more', 'details', 'You', 'should', 'have', 'received', 'a', 'copy', 'of', - 'the', 'GNU', 'General', 'Public', 'License', 'along', 'with', 'this', 'program', 'If', 'not', 'see', '', 'Version', '2', 'only', - '("GPL")', 'Common', 'Development', 'and', 'Distribution', 'License("CDDL")', '(collectively', 'License").', 'language', 'governing', 'permissions', 'limitations', - 'License.', '-', 'When', 'distributing', 'include', 'Header', 'Notice', 'each', 'file', 'at', 'glassfish/bootstrap/legal/LICENSE.txt.', 'Sun', 'designates', - 'particular', 'subject', 'to', 'Classpath', 'exception', 'provided', 'GPL', 'section', 'accompanied', 'code.', 'applicable', 'add', 'following', 'below', - 'fields', 'enclosed', 'brackets', 'replaced', 'your', 'own', 'identifying', 'information', 'Portions', 'Copyrighted', 'year', 'name', 'copyright', 'owner]', - 'Contributor(s)', 'indicate', 'decision', 'adding', '[Contributor', 'elects', 'distribution', 'CDDL', 'license.', "don't", 'single', 'choice', 'license', - 'recipient', 'has', 'option', 'distribute', 'extend', 'its', 'licensees', 'above.', 'However', 'if', 'code', 'therefore', 'elected', 'then', 'applies', 'new', - 'made', 'such', 'holder.'] - - def isCopyRightLine(self, txt): - words = [ c.strip().strip('.').strip('\n').strip(',').strip() for c in txt.split(" ") ] - total = len(words) - if total == 0: return False - - numKeyWord = 0 - for w in words: - if w == "": continue - if w in self.keywords: numKeyWord+=1 - - if float(numKeyWord)/float(total) >= float(1)/float(2): return True - return False - -copyRightDetectingFactory = {"KeyWord":KeyWordCopyRightDetecter.__name__} - -logfd = open("/tmp/addcopyright.log", 'w') -class Logger(object): - @staticmethod - def info(msg): - sys.stdout.write("INFO: %s"%msg) - sys.stdout.write("\n") - sys.stdout.flush() - - @staticmethod - def debug(msg): - logfd.write("DEBUG: %s"%msg) - logfd.write("\n") - - @staticmethod - def warn(msg): - sys.stdout.write("WARNNING: %s"%msg) - sys.stdout.write("\n") - sys.stdout.flush() - - @staticmethod - def error(msg): - sys.stderr.write("ERROR: %s"%msg) - sys.stderr.write("\n") - sys.stderr.flush() - - -class Adder(object): - defaultTxt = '''Copyright 2012 Citrix Systems, Inc. Licensed under the -Apache License, Version 2.0 (the "License"); you may not use this -file except in compliance with the License. Citrix Systems, Inc. -reserves all rights not expressly granted by 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. -''' - - copyRightTxt = None - targetFile = None - fileBody = None - decter = None - signature = 'Automatically generated by addcopyright.py at %s' % time.strftime("%m/%d/%Y", time.localtime()) - - COMMENT_NOTATION = "" - - def __init__(self): - self.decter = eval(copyRightDetectingFactory["KeyWord"])() - - def setTargetFile(self, fpath): - self.targetFile = fpath - if not os.path.exists(self.targetFile): - raise Exception("Cannot find %s"%self.targetFile) - - def setCopyRightTxt(self, txt): - self.copyRightTxt = txt.split("\n") - - def checkParams(self): - assert self.targetFile != None, "Target file not set" - if self.copyRightTxt == None: - self.copyRightTxt = self.defaultTxt.split("\n") - - def pasteCopyRight(self): - self.fileBody = self.copyRightTxt + self.fileBody - file(self.targetFile, 'w').write("".join(self.fileBody)) - Logger.info("Added copyright header to %s"%self.targetFile) - - def composeCopyRight(self): - l = self.copyRightTxt - l.append(self.signature) - l = [ self.COMMENT_NOTATION + " " + line + "\n" for line in l ] - self.copyRightTxt = l - - def getFileBody(self): - self.fileBody = file(self.targetFile).readlines() - - def isCommentLine(self, line): - if line.strip().startswith(self.COMMENT_NOTATION): - return True - return False - - def removeOldCopyRight(self): - newBody = [] - removed = False - for line in self.fileBody[0:50]: - if self.isCommentLine(line) and self.decter.isCopyRightLine(line): - removed = True - Logger.debug("remove old copyright: %s" % line) - continue - newBody.append(line) - - self.fileBody = newBody + self.fileBody[50:] - if removed: - Logger.info("Removed old copyright header of %s"%self.targetFile) - - def cleanBlankComment(self): - newBody = [] - for l in self.fileBody[0:50]: - if self.isCommentLine(l) and l.strip().strip(self.COMMENT_NOTATION).strip().strip('\n') == "": - Logger.debug("Blank Comment: %s" % l) - continue - newBody.append(l) - self.fileBody = newBody + self.fileBody[50:] - - def doWork(self): - self.checkParams() - self.getFileBody() - self.removeOldCopyRight() - self.composeCopyRight() - self.cleanBlankComment() - self.pasteCopyRight() - - -class SqlAdder(Adder): - def __init__(self): - super(SqlAdder, self).__init__() - self.COMMENT_NOTATION = "#" - -class InterpreterAdder(Adder): - def __init__(self): - super(InterpreterAdder, self).__init__() - self.COMMENT_NOTATION = "#" - - def pasteCopyRight(self): - if len(self.fileBody) > 0 and self.isCommentLine(self.fileBody[0]): - # Don't cover the first line of interpreter comment - self.fileBody = [self.fileBody[0]] + self.copyRightTxt + self.fileBody[1:] - else: - self.fileBody = self.copyRightTxt + self.fileBody - file(self.targetFile, 'w').write("".join(self.fileBody)) - Logger.info("Added copyright header to %s"%self.targetFile) - -class JavaAdder(Adder): - commentOn = False - - def __init__(self): - super(JavaAdder, self).__init__() - self.COMMENT_NOTATION = '//' - - def isCommentLine(self, line): - if line.strip().startswith('//'): - return True - elif line.strip().startswith('/*'): - self.commentOn = True - return True - elif self.commentOn == True and line.find('*/') != -1: - self.commentOn = False - return True - elif self.commentOn: - return True - else: - return False - - def cleanBlankComment(self): - #TODO - pass - - -copyRightAdderFactory = {".sql":SqlAdder.__name__, ".sh":InterpreterAdder.__name__, ".py":InterpreterAdder.__name__} -class CopyRightAdder(object): - parser = None - options = None - args = None - targetFiles = None - excludeFiles = None - copyRightFileTxt = None - rootDir = None - - def errAndExit(self, msg): - Logger.error(msg) - Logger.info("addcopyright -h for help") - sys.exit(1) - - def __init__(self): - usage = '''Usage: addcopyright [file_name_pattern] [--exculdes=file_name_pattern] [--file=copyright_file] [--root=root_dir_of_files_to_add_header] [--replace] -Examples: - addcopyright - addcopyright *.sql - addcopyright *.sql --excludes="*.sql~" - addcopyright *.sql --file=/root/Citrix.copyright - addcopyright *.sql --file=/root/Citrix.copyright --root=~/cloudstack-oss - ''' - self.parser = OptionParser(usage=usage) - self.parser.add_option("", "--excludes", action="store", type="string", dest="excludes", default="", - help="Exclude these files when adding copyright header") - self.parser.add_option("", "--file", action="store", type="string", dest="copyRightFile", default="", - help="Path to copyright header file. Default to Citrix copyright header") - self.parser.add_option("", "--root", action="store", type="string", dest="rootDir", default="", - help="Root folder where files being added copyright header locate. Default to current directory") - (self.options, self.args) = self.parser.parse_args() - if len(self.args) > 1: - self.errAndExit("Invalid arguments:%s" % self.args) - - if len(self.args) == 1: - self.targetFiles = self.args[0] - if self.options.excludes != "": - self.excludeFiles = self.options.excludes - if self.options.copyRightFile != "": - self.copyRightFileTxt = file(self.options.copyRightFile).read() - if self.options.rootDir != "": - self.rootDir = os.path.expanduser(self.options.rootDir) - if not os.path.isdir(self.rootDir): raise Exception("Cannot find directory %s"%self.rootDir) - else: - self.rootDir = os.getcwd() - - def createConcreteAdder(self, filename): - (x, ext) = os.path.splitext(filename) - if not copyRightAdderFactory.has_key(ext): return None - return eval(copyRightAdderFactory[ext])() - - def run(self): - for root, dirs, files in os.walk(self.rootDir): - for f in files: - fpath = os.path.join(root, f) - if self.excludeFiles != None and fnmatch.fnmatch(f, self.excludeFiles): - Logger.info("Skipping excluded file %s" % fpath) - continue - if self.targetFiles != None and not fnmatch.fnmatch(f, self.targetFiles): - Logger.info("Skipping %s not matching our file name pattern" % fpath) - continue - - adder = self.createConcreteAdder(f) - if adder == None: - Logger.warn("Cannot find a proper copyright Adder for %s, skip it" % fpath) - continue - - adder.setTargetFile(fpath) - if self.copyRightFileTxt != None: - adder.setCopyRightTxt(self.copyRightFileTxt) - adder.doWork() - - -if __name__ == '__main__': - task = CopyRightAdder() - task.run() diff --git a/tools/build/build_asf.sh b/tools/build/build_asf.sh new file mode 100755 index 00000000000..f9e05dbbf41 --- /dev/null +++ b/tools/build/build_asf.sh @@ -0,0 +1,105 @@ +#!/bin/sh +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. + +version='TESTBUILD' +sourcedir=~/incubator-cloudstack/ +outputdir=~/cs-asf-build/ +branch='master' +tag='no' +certid='X' + + +usage(){ + echo "usage: $0 -v version [-b branch] [-s source dir] [-o output dir] [-t [-u]] [-h]" + echo " -v sets the version" + echo " -b sets the branch (defaults to 'master')" + echo " -s sets the source directory (defaults to $sourcedir)" + echo " -o sets the output directory (defaults to $outputdir)" + echo " -t tags the git repo with the version" + echo " -u sets the certificate ID to sign the tag with (if not provided, the default key is attempted)" + echo " -h" +} + +while getopts v:s:o:b:tu:h opt +do + case "$opt" in + v) version="$OPTARG";; + s) sourcedir="$OPTARG";; + o) outputdir="$OPTARG";; + b) branch="$OPTARG";; + t) tag='yes';; + u) certid="$OPTARG";; + h) usage + exit 0;; + \?) # unknown flag + usage + exit 1;; + esac +done +shift `expr $OPTIND - 1` + +if [ $version == 'TESTBUILD' ]; then + echo >&2 "A version must be specified with the -v option: build_asf.sh -v 4.0.0RC1" + exit 1 +fi + +echo "Using version: $version" +echo "Using source directory: $sourcedir" +echo "Using output directory: $outputdir" +echo "Using branch: $branch" +if [ $tag == 'yes' ]; then + if [ $certid == 'X' ]; then + echo "Tagging the branch with the version number, and signing the branch with your default certificate." + else + echo "Tagging the branch with the version number, and signing the branch with certificate ID $certid." + fi +else + echo "The branch will not be tagged. You should consider doing this." +fi + +if [ -d "$outputdir" ]; then + rm $outputdir/* +else + mkdir $outputdir +fi + +cp $sourcedir/KEYS $outputdir/KEYS + +cd $sourcedir +git archive --format=tar.gz --prefix=$version/ $branch > $outputdir/cloudstack-source-$version.tar.gz +git archive --format=zip --prefix=$version/ $branch > $outputdir/cloudstack-source-$version.zip + +cd $outputdir +gpg -v --armor --output cloudstack-source-$version.tar.gz.asc --detach-sig cloudstack-source-$version.tar.gz +gpg -v --armor --output cloudstack-source-$version.zip.asc --detach-sig cloudstack-source-$version.zip +gpg -v --print-md MD5 cloudstack-source-$version.tar.gz > cloudstack-source-$version.tar.gz.md5 +gpg -v --print-md MD5 cloudstack-source-$version.zip > cloudstack-source-$version.zip.md5 +gpg -v --print-md SHA512 cloudstack-source-$version.tar.gz > cloudstack-source-$version.tar.gz.sha +gpg -v --print-md SHA512 cloudstack-source-$version.zip > cloudstack-source-$version.zip.sha + +gpg -v --verify cloudstack-source-$version.tar.gz.asc cloudstack-source-$version.tar.gz +gpg -v --verify cloudstack-source-$version.zip.asc cloudstack-source-$version.zip + +if [ $tag == 'yes' ]; then + cd $sourcedir + if [ $certid == 'X' ]; then + git tag -s $version -m "Tagging release $version on branch $branch." + else + git tag -u $certid -s $version -m "Tagging release $version on branch $branch." + fi +fi diff --git a/tools/devcloud/build_vagrant_basebox.sh b/tools/devcloud/build_vagrant_basebox.sh index 621f1418737..c90a6c9ba60 100755 --- a/tools/devcloud/build_vagrant_basebox.sh +++ b/tools/devcloud/build_vagrant_basebox.sh @@ -57,9 +57,11 @@ cd vagrant || error_exit bundle install || error_exit "could not bundle install vagrant" rake install || error_exit "could not rake vagrant" cd ~/builddevcloud/veewee || error_exit +cp -R templates/ubuntu-12.04-server-i386 templates/ubuntu-12.04.1-server-i386 +cp -R templates/ubuntu-12.04-server-i386-packages templates/ubuntu-12.04.1-server-i386-packages bundle install || error_exit rake install || error_exit -bundle exec vagrant basebox define 'devcloudbase' 'ubuntu-12.04-server-i386' || error_exit "couldn't basebox define" +bundle exec vagrant basebox define 'devcloudbase' 'ubuntu-12.04.1-server-i386' || error_exit "couldn't basebox define" wget --no-check-certificate -O ./definitions/devcloudbase/definition.rb https://git-wip-us.apache.org/repos/asf\?p\=incubator-cloudstack.git\;a\=blob_plain\;f\=tools/devcloud/veewee/definition.rb\;hb\=HEAD || error_exit "couldn't get file" wget --no-check-certificate -O ./definitions/devcloudbase/postinstall.sh https://git-wip-us.apache.org/repos/asf\?p\=incubator-cloudstack.git\;a\=blob_plain\;f\=tools/devcloud/veewee/postinstall.sh\;hb\=HEAD || error_exit "couldn't get file" wget --no-check-certificate -O ./definitions/devcloudbase/preseed.cfg https://git-wip-us.apache.org/repos/asf\?p\=incubator-cloudstack.git\;a\=blob_plain\;f\=tools/devcloud/veewee/preseed.cfg\;hb\=HEAD || error_exit "couldn't get file" diff --git a/tools/devcloud/veewee/definition.rb b/tools/devcloud/veewee/definition.rb index d025ce9a4ea..cb0a9079520 100644 --- a/tools/devcloud/veewee/definition.rb +++ b/tools/devcloud/veewee/definition.rb @@ -23,8 +23,8 @@ Veewee::Session.declare({ :disk_format => 'VMDK', :hostiocache => 'off', :os_type_id => 'Ubuntu', - :iso_file => "ubuntu-12.04-server-i386.iso", - :iso_src => "http://releases.ubuntu.com/12.04/ubuntu-12.04-server-i386.iso", + :iso_file => "ubuntu-12.04.1-server-i386.iso", + :iso_src => "http://releases.ubuntu.com/12.04/ubuntu-12.04.1-server-i386.iso", :iso_md5 => '32184a83c8b5e6031e1264e5c499bc03', :iso_download_timeout => "1000", :boot_wait => "4", diff --git a/tools/migration/XenAPI.py b/tools/migration/XenAPI.py index a4324009439..d290cf68afc 100644 --- a/tools/migration/XenAPI.py +++ b/tools/migration/XenAPI.py @@ -1,29 +1,19 @@ -#============================================================================ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#============================================================================ -#============================================================================ -# prior permission. -# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD -# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- -# ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR -# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY -# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE -# OF THIS SOFTWARE. -# -------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. import gettext import xmlrpclib diff --git a/tools/migration/share_all_lus.sh b/tools/migration/share_all_lus.sh index e5641e2cbce..fc6f12448e2 100755 --- a/tools/migration/share_all_lus.sh +++ b/tools/migration/share_all_lus.sh @@ -1,17 +1,20 @@ # !/usr/bin/env bash -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 - +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/tools/migration/upgrade.py b/tools/migration/upgrade.py index 2680518f735..bdc0d2c2810 100644 --- a/tools/migration/upgrade.py +++ b/tools/migration/upgrade.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff --git a/tools/tooljars/cloud-selenium-java-client-driver.jar b/tools/tooljars/cloud-selenium-java-client-driver.jar deleted file mode 100644 index 004d7daca25..00000000000 Binary files a/tools/tooljars/cloud-selenium-java-client-driver.jar and /dev/null differ diff --git a/tools/waf/javadir.py b/tools/waf/javadir.py index 6f9c9058163..7b0bb2b8927 100644 --- a/tools/waf/javadir.py +++ b/tools/waf/javadir.py @@ -1,16 +1,20 @@ #!/usr/bin/env python -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. import Options, Utils import os diff --git a/tools/waf/mkisofs.py b/tools/waf/mkisofs.py index 62f4dc897a3..334845f4b49 100644 --- a/tools/waf/mkisofs.py +++ b/tools/waf/mkisofs.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. import Utils from TaskGen import feature, before from Configure import ConfigurationError @@ -77,4 +81,4 @@ def apply_iso(self): Task.task_type_from_func('iso',func=iso_up) feature('iso')(apply_iso) -before('apply_core')(apply_iso) \ No newline at end of file +before('apply_core')(apply_iso) diff --git a/tools/waf/tar.py b/tools/waf/tar.py index 30ca191413c..d2d6d5d1551 100644 --- a/tools/waf/tar.py +++ b/tools/waf/tar.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. import Utils import Options import tarfile diff --git a/tools/waf/tomcat.py b/tools/waf/tomcat.py index ff8a0d0b27c..8454b45f89c 100644 --- a/tools/waf/tomcat.py +++ b/tools/waf/tomcat.py @@ -1,16 +1,20 @@ #!/usr/bin/env python -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. import Options, Utils import os @@ -50,4 +54,4 @@ def set_options(opt): inst_dir.add_option('--with-tomcat', # add javadir to the group that contains bindir help = 'Path to installed Tomcat 6 environment [Default: ${DATADIR}/tomcat6 (unless %%CATALINA_HOME%% is set)]', default = '', - dest = 'TOMCATHOME') \ No newline at end of file + dest = 'TOMCATHOME') diff --git a/tools/waf/usermgmt.py b/tools/waf/usermgmt.py index 04234b4bfe4..a231e0a86a9 100644 --- a/tools/waf/usermgmt.py +++ b/tools/waf/usermgmt.py @@ -1,15 +1,19 @@ -# Copyright 2012 Citrix Systems, Inc. Licensed under the -# Apache License, Version 2.0 (the "License"); you may not use this -# file except in compliance with the License. Citrix Systems, Inc. -# reserves all rights not expressly granted by 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. -# -# Automatically generated by addcopyright.py at 04/03/2012 +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. import Utils, Build from TaskGen import feature, before from Configure import ConfigurationError @@ -133,4 +137,4 @@ def _createuser(ctx,user,homedir,shell): ctx.add_pre_fun(lambda ctx: f(ctx,user,homedir,shell)) elif ctx.is_install < 0: ctx.add_pre_fun(lambda ctx: g(ctx,user,homedir,shell)) -Build.BuildContext.createuser = _createuser \ No newline at end of file +Build.BuildContext.createuser = _createuser diff --git a/tools/whisker/descriptor.xml b/tools/whisker/descriptor.xml index 59903377c25..58e3b24aa32 100644 --- a/tools/whisker/descriptor.xml +++ b/tools/whisker/descriptor.xml @@ -1022,6 +1022,34 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + 1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + @@ -2368,6 +2396,10 @@ this distribution. id='person:shigeru.chiba' name='Shigeru Chiba' url='http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/' /> + Copyright (c) 2012 The Apache Software Foundation @@ -2387,6 +2419,17 @@ Copyright © 2005-2010 Thomas Nagy + + + +Copyright (c) Citrix Systems, Inc. +All rights reserved. + + + + + + diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp index fffd4617ac6..c149ff3b6f7 100644 --- a/ui/dictionary.jsp +++ b/ui/dictionary.jsp @@ -1350,6 +1350,41 @@ dictionary = { 'message.delete.VPN.connection': '', 'label.add.new.tier': '', 'label.add.VM.to.tier': '', -'label.remove.tier': '' +'label.remove.tier': '', +'label.local.storage.enabled=Local Storage Enabled': '', +'label.associated.network': '', +'label.add.port.forwarding.rule': '', +'label.dns': '', +'label.vpc': '', +'label.vpc.id': '', +'label.tier': '', +'label.add.vpc': '', +'label.super.cidr.for.guest.networks': '', +'label.DNS.domain.for.guest.networks': '', +'label.configure.vpc': '', +'label.edit.vpc': '', +'label.restart.vpc': '', +'message.restart.vpc': '', +'label.remove.vpc': '', +'message.remove.vpc': '', +'label.vpn.customer.gateway': '', +'label.add.vpn.customer.gateway': '', +'label.IKE.encryption': '', +'label.IKE.hash': '', +'label.IKE.DH': '', +'label.ESP.encryption': '', +'label.ESP.hash': '', +'label.perfect.forward.secrecy': '', +'label.IKE.lifetime': '', +'label.ESP.lifetime': '', +'label.dead.peer.detection': '', +'label.delete.VPN.customer.gateway': '', +'message.delete.VPN.customer.gateway': '', +'label.configure.network.ACLs': '', +'label.network.ACLs': '', +'label.add.network.ACL': '', +'label.private.Gateway': '', +'label.VPC.router.details': '', +'label.VMs.in.tier': '' }; diff --git a/ui/index.jsp b/ui/index.jsp index 7a5489cca5b..a81dcb3c5f0 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -1,4 +1,4 @@ - +--%> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index 9762313ebe6..34a9538d89e 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -181,6 +181,8 @@ var password = args.data.password; if (md5Hashed) password = $.md5(password); + else + password = todb(password); array1.push("&password=" + password); array1.push("&email=" + todb(args.data.email)); diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 85a169bb98f..94247c43a8a 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -1269,7 +1269,28 @@ } }, - specifyVlan: { label: 'label.specify.vlan', isBoolean: true }, + specifyVlan: { label: 'label.specify.vlan', isBoolean: true }, + + useVpc: { + label: 'VPC', + isBoolean: true, + onChange: function(args) { + var $checkbox = args.$checkbox; + var $selects = $checkbox.closest('form').find('.dynamic-input select'); + var $vpcOptions = $selects.find('option[value=VpcVirtualRouter]'); + + if ($checkbox.is(':checked')) { + $vpcOptions.siblings().attr('disabled', true); + $selects.val('VpcVirtualRouter'); + } else { + $vpcOptions.siblings().attr('disabled', false); + $vpcOptions.attr('disabled', true); + $selects.each(function() { + $(this).val($(this).find('option:first')); + }); + } + } + }, supportedServices: { label: 'label.supported.services', @@ -1339,6 +1360,9 @@ args.response.success({ data: items }); + + // Disable VPC virtual router by default + args.$select.find('option[value=VpcVirtualRouter]').attr('disabled', true); args.$select.change(function() { var $thisProviderDropdown = $(this); diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 226695ac5ea..d0f65c4c3c0 100644 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -165,8 +165,9 @@ preFilter: function(args) { var havingSecurityGroupNetwork = false; var havingBasicZones = false; + var havingAdvancedZones = true; - // Get basic zones + // Get zone types $.ajax({ url: createURL('listZones'), async: false, @@ -176,9 +177,14 @@ var basicZones = $.grep(zones, function(zone) { return zone.networktype == 'Basic'; }); + var advancedZones = $.grep(zones, function(zone) { + return zone.networktype == 'Advanced'; + }); + havingBasicZones = basicZones.length ? true : false; - } + havingAdvancedZones = advancedZones.length ? true : false; + } }); $.ajax({ @@ -195,10 +201,11 @@ } }); - var sectionsToShow = ['networks', 'vpnCustomerGateway']; + var sectionsToShow = ['networks']; - if (!havingBasicZones) { + if (havingAdvancedZones) { sectionsToShow.push('vpc'); + sectionsToShow.push('vpnCustomerGateway'); } if(havingSecurityGroupNetwork == true) @@ -298,45 +305,47 @@ }); } }, - vpcid: { - label: 'VPC', - dependsOn: 'networkOfferingId', - select: function(args) { - var networkOfferingObj; - $(networkOfferingObjs).each(function(key, value) { - if(value.id == args.networkOfferingId) { - networkOfferingObj = value; - return false; //break each loop - } - }); - if(networkOfferingObj.forvpc == true) { - args.$select.closest('.form-item').css('display', 'inline-block'); - $.ajax({ - url: createURL('listVPCs'), - data: { - listAll: true - }, - success: function(json) { - var items = json.listvpcsresponse.vpc; - var data; - if(items != null && items.length > 0) { - data = $.map(items, function(item) { - return { - id: item.id, - description: item.name - } - }); - } - args.response.success({ data: data }); - } - }); - } - else { - args.$select.closest('.form-item').hide(); - args.response.success({ data: null }); - } - } - }, + + vpcid: { + label: 'label.vpc', + dependsOn: 'networkOfferingId', + select: function(args) { + var networkOfferingObj; + $(networkOfferingObjs).each(function(key, value) { + if(value.id == args.networkOfferingId) { + networkOfferingObj = value; + return false; //break each loop + } + }); + if(networkOfferingObj.forvpc == true) { + args.$select.closest('.form-item').css('display', 'inline-block'); + $.ajax({ + url: createURL('listVPCs'), + data: { + listAll: true + }, + success: function(json) { + var items = json.listvpcsresponse.vpc; + var data; + if(items != null && items.length > 0) { + data = $.map(items, function(item) { + return { + id: item.id, + description: item.name + } + }); + } + args.response.success({ data: data }); + } + }); + } + else { + args.$select.closest('.form-item').hide(); + args.response.success({ data: null }); + } + } + }, + guestGateway: { label: 'label.guest.gateway' }, guestNetmask: { label: 'label.guest.netmask' } } @@ -385,21 +394,21 @@ fields: { name: { label: 'label.name' }, account: { label: 'label.account' }, - //zonename: { label: 'Zone' }, + //zonename: { label: 'label.zone' }, type: { label: 'label.type' }, vlan: { label: 'label.vlan' }, cidr: { label: 'label.cidr' } /* - state: { - label: 'State', - indicator: { - 'Implemented': 'on', - 'Setup': 'on', - 'Allocated': 'on', - 'Destroyed': 'off' - } - } - */ + state: { + label: 'label.state', + indicator: { + 'Implemented': 'on', + 'Setup': 'on', + 'Allocated': 'on', + 'Destroyed': 'off' + } + } + */ }, dataProvider: function(args) { var array1 = []; @@ -773,7 +782,7 @@ return "No"; } }, - vlan: { label: 'VLAN ID' }, + vlan: { label: 'label.vlan.id' }, networkofferingname: { label: 'label.network.offering' }, @@ -815,8 +824,8 @@ gateway: { label: 'label.gateway' }, - //netmask: { label: 'Netmask' }, - cidr: { label: 'CIDR' }, + //netmask: { label: 'label.netmask' }, + cidr: { label: 'label.cidr' }, networkdomaintext: { label: 'label.network.domain.text' @@ -828,10 +837,10 @@ domain: { label: 'label.domain' }, account: { label: 'label.account' }, - - vpcid: { - label: 'VPC ID', - converter: function(args) { + + vpcid: { + label: 'label.vpc.id', + converter: function(args) { if(args != null) return args; else @@ -1069,10 +1078,10 @@ title: 'label.menu.ipaddresses', listView: { id: 'ipAddresses', - label: 'IPs', + label: 'label.ips', fields: { ipaddress: { - label: 'IP', + label: 'label.ips', converter: function(text, item) { if (item.issourcenat) { return text + ' [' + _l('label.source.nat') + ']'; @@ -1081,9 +1090,8 @@ return text; } }, - zonename: { label: 'label.zone' }, - //vlanname: { label: 'VLAN' }, - virtualmachinedisplayname: { label: 'label.vm.name' }, + zonename: { label: 'label.zone' }, + virtualmachinedisplayname: { label: 'label.vm.name' }, state: { converter: function(str) { // For localization @@ -1655,12 +1663,12 @@ fields: [ { - ipaddress: { label: 'IP' } + ipaddress: { label: 'label.ip' } }, { id: { label: 'label.id' }, associatednetworkid: { label: 'label.associated.network.id' }, - networkname: { label: 'Associated Network' }, + networkname: { label: 'label.associated.network' }, state: { label: 'label.state' }, networkid: { label: 'label.network.id' }, issourcenat: { label: 'label.source.nat', converter: cloudStack.converters.toBooleanText }, @@ -2221,9 +2229,9 @@ }), headerFields: { tier: { - label: 'Tier', - select: function(args) { - if('vpc' in args.context) { + label: 'label.tier', + select: function(args) { + if('vpc' in args.context) { var data = { //listAll: true, //do not pass listAll to listNetworks under VPC supportedservices: 'Lb' @@ -2624,7 +2632,7 @@ portForwarding: { headerFields: { tier: { - label: 'Tier', + label: 'label.tier', select: function(args) { if('vpc' in args.context) { var data = { @@ -2776,7 +2784,7 @@ jobId: data.createportforwardingruleresponse.jobid }, notification: { - label: 'Add port forwarding rule', + label: 'label.add.port.forwarding.rule', poll: pollAsyncJobResult } }); @@ -3121,7 +3129,7 @@ name: { label: 'label.name' } }, { - id: { label: 'ID' }, + id: { label: 'label.id' }, description: { label: 'label.description' }, domain: { label: 'label.domain' }, account: { label: 'label.account' } @@ -3201,7 +3209,7 @@ 'endport': { edit: true, label: 'label.end.port' }, 'icmptype': { edit: true, label: 'ICMP.type', isHidden: true }, 'icmpcode': { edit: true, label: 'ICMP.code', isHidden: true }, - 'cidr': { edit: true, label: 'CIDR', isHidden: true }, + 'cidr': { edit: true, label: 'label.cidr', isHidden: true }, 'accountname': { edit: true, label: 'label.account.and.security.group', @@ -3381,7 +3389,7 @@ 'endport': { edit: true, label: 'label.end.port' }, 'icmptype': { edit: true, label: 'ICMP.type', isHidden: true }, 'icmpcode': { edit: true, label: 'ICMP.code', isHidden: true }, - 'cidr': { edit: true, label: 'CIDR', isHidden: true }, + 'cidr': { edit: true, label: 'label.cidr', isHidden: true }, 'accountname': { edit: true, label: 'label.account.and.security.group', @@ -3550,17 +3558,17 @@ }, vpc: { type: 'select', - title: 'VPC', + title: 'label.vpc', id: 'vpc', listView: { id: 'vpc', - label: 'VPC', + label: 'label.vpc', fields: { - name: { label: 'label.name' }, - displaytext: { label: 'label.description' }, - zonename: { label: 'label.zone' }, - cidr: { label: 'label.cidr' }, - state: {label: 'State', indicator: { 'Enabled': 'on', 'Disabled': 'off'}} + name: { label: 'label.name' }, + displaytext: { label: 'label.description' }, + zonename: { label: 'label.zone' }, + cidr: { label: 'label.cidr' }, + state: {label: 'label.state', indicator: { 'Enabled': 'on', 'Disabled': 'off'}} }, dataProvider: function(args) { var array1 = []; @@ -3587,19 +3595,19 @@ }, actions: { add: { - label: 'Add VPC', - messages: { - notification: function(args) { - return 'Add VPC'; - } - }, + label: 'label.add.vpc', + messages: { + notification: function(args) { + return 'label.add.vpc'; + } + }, createForm: { - title: 'Add VPC', - messages: { - notification: function(args) { - return 'Add VPC'; - } - }, + title: 'label.add.vpc', + messages: { + notification: function(args) { + return 'label.add.vpc'; + } + }, fields: { name: { label: 'label.name', @@ -3607,10 +3615,10 @@ }, displaytext: { label: 'label.description', - validation: { required: true } - }, - zoneid: { - label: 'Zone', + validation: { required: true } + }, + zoneid: { + label: 'label.zone', validation: { required: true }, select: function(args) { var data = { listAll: true }; @@ -3634,13 +3642,13 @@ }); } }, - cidr: { - label: 'Super CIDR for Guest Networks', - validation: { required: true } - }, - networkdomain: { - label: 'DNS domain for Guest Networks' - } + cidr: { + label: 'label.super.cidr.for.guest.networks', + validation: { required: true } + }, + networkdomain: { + label: 'label.DNS.domain.for.guest.networks' + } } }, action: function(args) { @@ -3696,7 +3704,7 @@ }, configureVpc: { - label: 'Configure VPC', + label: 'label.configure.vpc', textLabel: 'label.configure', action: { custom: cloudStack.uiCustom.vpc(cloudStack.vpc) @@ -3708,7 +3716,7 @@ name: 'label.details', actions: { configureVpc: { - label: 'Edit VPC', + label: 'label.edit.vpc', textLabel: 'label.configure', action: { custom: cloudStack.uiCustom.vpc(cloudStack.vpc) @@ -3748,15 +3756,15 @@ poll: pollAsyncJobResult } }, - - restart: { - label: 'restart VPC', + + restart: { + label: 'label.restart.vpc', messages: { confirm: function(args) { - return 'Please confirm that you want to restart the VPC'; + return 'message.restart.vpc'; }, notification: function(args) { - return 'restart VPC'; + return 'label.restart.vpc'; } }, action: function(args) { @@ -3789,13 +3797,13 @@ }, remove: { - label: 'remove VPC', + label: 'label.remove.vpc', messages: { confirm: function(args) { - return 'Please confirm that you want to delete the VPC'; + return 'message.remove.vpc'; }, notification: function(args) { - return 'remove VPC'; + return 'label.remove.vpc'; } }, action: function(args) { @@ -3827,7 +3835,7 @@ tabFilter:function(args) { var hiddenTabs=[]; - var isRouterOwner = isAdmin() || isDomainAdmin(); + var isRouterOwner = isAdmin(); if(!isRouterOwner) hiddenTabs.push("router"); return hiddenTabs; @@ -3884,20 +3892,20 @@ title: 'VPC Router Details', fields:[ { - name: {label:'Router Name'} + name: {label:'label.name'} }, { - id:{ label:'ID'}, + id:{ label:'label.id'}, zonename: { label: 'label.zone'}, - dns1: {label: 'DNS'}, - gateway: {label:'Gateway'}, - publicip: {label: 'Public IP'}, - guestipaddress:{ label: 'Guest IP'}, - linklocalip: {label: 'Link Local IP'}, - state: { label:'State'}, - serviceofferingname: {label:'Service Offering'}, + dns1: {label: 'label.dns'}, + gateway: {label:'label.gateway'}, + publicip: {label: 'label.public.ip'}, + guestipaddress:{ label: 'label.guest.ip'}, + linklocalip: {label: 'label.linklocal.ip'}, + state: { label:'label.state'}, + serviceofferingname: {label:'label.service.offering'}, isredundantrouter:{ - label: 'Redundant Router', + label: 'label.redundant.router', converter: function(booleanValue) { if (booleanValue == true) { return "Yes"; @@ -3906,7 +3914,7 @@ } }, account: {label:'label.account'}, - domain: {label: 'label.domain'}, + domain: {label: 'label.domain'} } ], dataProvider: function(args) { @@ -3932,15 +3940,15 @@ vpnCustomerGateway: { type: 'select', - title: 'VPN Customer Gateway', + title: 'label.vpn.customer.gateway', listView: { id: 'vpnCustomerGateway', - label: 'VPN Customer Gateway', + label: 'label.vpn.customer.gateway', fields: { - name: { label: 'label.name' }, - gateway: { label: 'label.gateway' }, - cidrlist: { label: 'CIDR list' }, - ipsecpsk: { label: 'IPsec Preshared-Key' } + name: { label: 'label.name' }, + gateway: { label: 'label.gateway' }, + cidrlist: { label: 'label.CIDR.list' }, + ipsecpsk: { label: 'label.IPsec.preshared.key' } }, dataProvider: function(args) { var array1 = []; @@ -3965,19 +3973,19 @@ } }); }, - - actions: { - add: { - label: 'Add VPN Customer Gateway', - messages: { - notification: function(args) { - return 'Add VPN Customer Gateway'; - } - }, - createForm: { - title: 'Add VPN Customer Gateway', - fields: { - name: { + + actions: { + add: { + label: 'label.add.vpn.customer.gateway', + messages: { + notification: function(args) { + return 'label.add.vpn.customer.gateway'; + } + }, + createForm: { + title: 'label.add.vpn.customer.gateway', + fields: { + name: { label: 'label.name', validation: { required: true } }, @@ -3987,25 +3995,26 @@ }, cidrlist: { label: 'CIDR list', - desc: 'Please enter a comma separated list of CIDRs if more than one', - validation: { required: true } + desc: 'Please enter a comma separated list of CIDRs if more than one', + validation: { required: true } }, gateway: { label: 'label.gateway', validation: { required: true } }, cidrlist: { - label: 'CIDR list', + label: 'label.CIDR.list', + desc:'Please enter a comma separated list of CIDRs if more than one', validation: { required: true } }, ipsecpsk: { - label: 'IPsec Preshared-Key', + label: 'label.IPsec.preshared.key', validation: { required: true } }, //IKE Policy ikeEncryption: { - label: 'IKE Encryption', + label: 'label.IKE.encryption', select: function(args) { var items = []; items.push({id: '3des', description: '3des'}); @@ -4016,7 +4025,7 @@ } }, ikeHash: { - label: 'IKE Hash', + label: 'label.IKE.hash', select: function(args) { var items = []; items.push({id: 'md5', description: 'md5'}); @@ -4025,7 +4034,7 @@ } }, ikeDh: { - label: 'IKE DH', + label: 'label.IKE.DH', select: function(args) { var items = []; items.push({id: '', description: 'None'}); @@ -4037,7 +4046,7 @@ //ESP Policy espEncryption: { - label: 'ESP Encryption', + label: 'label.ESP.encryption', select: function(args) { var items = []; items.push({id: '3des', description: '3des'}); @@ -4048,7 +4057,7 @@ } }, espHash: { - label: 'ESP Hash', + label: 'label.ESP.hash', select: function(args) { var items = []; items.push({id: 'md5', description: 'md5'}); @@ -4057,7 +4066,7 @@ } }, perfectForwardSecrecy: { - label: 'Perfect Forward Secrecy', + label: 'label.perfect.forward.secrecy', select: function(args) { var items = []; items.push({id: '', description: 'None'}); @@ -4068,18 +4077,18 @@ }, ikelifetime: { - label: 'IKE lifetime (second)', + label: 'label.IKE.lifetime', defaultValue: '86400', validation: { required: false, number: true } }, esplifetime: { - label: 'ESP Lifetime (second)', + label: 'label.ESP.lifetime', defaultValue: '3600', validation: { required: false, number: true } }, dpd: { - label: 'Dead Peer Detection', + label: 'label.dead.peer.detection', isBoolean: true, isChecked: false } @@ -4195,13 +4204,13 @@ }, remove: { - label: 'delete VPN Customer Gateway', + label: 'label.delete.VPN.customer.gateway', messages: { confirm: function(args) { - return 'Please confirm that you want to delete this VPN Customer Gateway'; + return 'message.delete.VPN.customer.gateway'; }, notification: function(args) { - return 'delete VPN Customer Gateway'; + return 'label.delete.VPN.customer.gateway'; } }, action: function(args) { @@ -4246,19 +4255,19 @@ validation: { required: true } }, cidrlist: { - label: 'CIDR list', + label: 'label.CIDR.list', isEditable: true, validation: { required: true } }, ipsecpsk: { - label: 'IPsec Preshared-Key', + label: 'label.IPsec.preshared.key', isEditable: true, validation: { required: true } }, //IKE Policy ikeEncryption: { - label: 'IKE Encryption', + label: 'label.IKE.encryption', isEditable: true, select: function(args) { var items = []; @@ -4270,7 +4279,7 @@ } }, ikeHash: { - label: 'IKE Hash', + label: 'label.IKE.hash', isEditable: true, select: function(args) { var items = []; @@ -4280,7 +4289,7 @@ } }, ikeDh: { - label: 'IKE DH', + label: 'label.IKE.DH', isEditable: true, select: function(args) { var items = []; @@ -4293,7 +4302,7 @@ //ESP Policy espEncryption: { - label: 'ESP Encryption', + label: 'label.ESP.encryption', isEditable: true, select: function(args) { var items = []; @@ -4305,7 +4314,7 @@ } }, espHash: { - label: 'ESP Hash', + label: 'label.ESP.hash', isEditable: true, select: function(args) { var items = []; @@ -4315,7 +4324,7 @@ } }, perfectForwardSecrecy: { - label: 'Perfect Forward Secrecy', + label: 'label.perfect.forward.secrecy', isEditable: true, select: function(args) { var items = []; @@ -4327,18 +4336,18 @@ }, ikelifetime: { - label: 'IKE lifetime (second)', + label: 'label.IKE.lifetime', isEditable: true, validation: { required: false, number: true } }, esplifetime: { - label: 'ESP Lifetime (second)', + label: 'label.ESP.lifetime', isEditable: true, validation: { required: false, number: true } }, dpd: { - label: 'Dead Peer Detection', + label: 'label.dead.peer.detection', isBoolean: true, isEditable: true, converter:cloudStack.converters.toBooleanText diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 41c7992c856..3bf43d30f03 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -2160,7 +2160,8 @@ var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); + //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety + items.push({id: this.id, description: this.name}); }); args.response.success({data: items}); } @@ -2693,7 +2694,8 @@ var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); + //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety + items.push({id: this.id, description: this.name}); }); args.response.success({data: items}); } @@ -4333,7 +4335,8 @@ var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); + //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety + items.push({id: this.id, description: this.name}); }); args.response.success({data: items}); } @@ -5071,7 +5074,8 @@ var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); + //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety + items.push({id: this.id, description: this.name}); }); args.response.success({data: items}); } @@ -5490,7 +5494,8 @@ var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); + //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety + items.push({id: this.id, description: this.name}); }); args.response.success({data: items}); } @@ -7630,7 +7635,7 @@ var array1 = []; array1.push("&hosttags=" + todb(args.data.hosttags)); - if (args.data.oscategoryid != null && args.data.oscategoryid != 'None') + if (args.data.oscategoryid != null) array1.push("&osCategoryId=" + args.data.oscategoryid); $.ajax({ @@ -7847,11 +7852,12 @@ async: true, success: function(json) { var oscategoryObjs = json.listoscategoriesresponse.oscategory; - var items = [ - { id: null, description: _l('label.none') } - ]; + var items = []; $(oscategoryObjs).each(function() { - items.push({id: this.id, description: this.name}); + if(this.name == 'None') + items.unshift({ id: this.id, description: _l('label.none') }); + else + items.push({id: this.id, description: this.name}); }); args.response.success({data: items}); } @@ -9694,7 +9700,7 @@ if (jsonObj.state == 'Running') { allowedActions.push("stop"); - if(jsonObj.vpcid != null) + // if(jsonObj.vpcid != null) allowedActions.push("restart"); allowedActions.push("viewConsole"); diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index 6a566f55972..5ac8a22f95e 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -106,13 +106,19 @@ }) .val(id) .click(function() { - var $radio = $(this).closest('.select').find('input[type=radio]'); + var $select = $(this).closest('.select'); + var $radio = $select.find('input[type=radio]'); + var $newNetwork = $(this).closest('.content').find('.select.new-network'); + var $otherSelects = $select.siblings().filter(':visible'); + var isCheckbox = $(this).attr('type') == 'checkbox'; + var isSingleSelect = $(this).closest('.select-container').hasClass('single-select'); - if ($(this).attr('type') == 'checkbox') { - if ($(this).closest('.select-container').hasClass('single-select') || - !$(this).closest('.select').siblings().filter(':visible').size()) { - $(this).closest('.select').siblings().find('input[type=checkbox]') - .attr('checked', false); + if (isCheckbox) { + if ((isSingleSelect || !$otherSelects.size()) && + $newNetwork.find('input[type=checkbox]').is(':unchecked')) { + $otherSelects.find('input[type=checkbox]').attr('checked', false); + + // Set as default $(this).closest('.select').find('input[type=radio]').click(); } } @@ -121,9 +127,7 @@ if (!$radio.closest('.select').index()) { return false; } else { - $radio - .closest('.select') - .siblings().filter(':first') + $otherSelects.filter(':first') .find('input[type=radio]').click(); } } @@ -477,7 +481,7 @@ // Select another default if hiding field if ($newNetwork.hasClass('unselected')) { - $step.find('input[type=radio]:first').click(); + $step.find('input[type=radio]:visible:first').click(); } else { $newNetwork.find('input[type=radio]').click(); } diff --git a/ui/scripts/ui-custom/vpc.js b/ui/scripts/ui-custom/vpc.js index 03f2dbecc2d..2bd26b11f1a 100644 --- a/ui/scripts/ui-custom/vpc.js +++ b/ui/scripts/ui-custom/vpc.js @@ -29,7 +29,7 @@ // Show ACL dialog if (isDialog) { $acl.dialog({ - title: 'Configure Network ACLs', + title: _l('label.configure.network.ACLs'), dialogClass: 'configure-acl', width: 900, height: 600, @@ -53,10 +53,10 @@ var gateways = args.gateways; var siteToSiteVPN = args.siteToSiteVPN; var links = { - 'ip-addresses': 'IP Addresses', - 'gateways': 'Private Gateway', - 'site-to-site-vpn': 'Site-to-site VPN', - 'network-acls': 'Network ACLs' + 'ip-addresses': _l('label.menu.ipaddresses'), + 'gateways': _l('label.private.Gateway'), + 'site-to-site-vpn': _l('label.site.to.site.VPN'), + 'network-acls': _l('label.network.ACLs') }; var $links = $('
    ').addClass('links'); var $tooltip = $('
    ').addClass('vpc-configure-tooltip').append( @@ -77,7 +77,7 @@ switch (id) { case 'network-acls': $browser.cloudBrowser('addPanel', { - title: 'Network ACLs', + title: _l('label.network.ACLs'), maximizeIfSelected: true, complete: function($panel) { $panel.listView( @@ -85,7 +85,7 @@ listView: { actions: { add: { - label: 'Add network ACL', + label: 'label.add.network.ACL', action: { custom: function() { elems.aclDialog({ @@ -116,7 +116,7 @@ case 'ip-addresses': $browser.cloudBrowser('addPanel', { - title: 'IP Addresses', + title: _l('label.menu.ipaddresses'), maximizeIfSelected: true, complete: function($panel) { //ipAddresses.listView is a function @@ -130,7 +130,7 @@ var isGatewayPresent = addAction.preCheck({ context: gateways.context }); var showGatewayListView = function() { $browser.cloudBrowser('addPanel', { - title: 'Private Gateway', + title: _l('label.private.Gateway'), maximizeIfSelected: true, complete: function($panel) { $panel.listView(gateways.listView(), { context: gateways.context }); @@ -193,7 +193,7 @@ var isVPNPresent = addAction.preCheck({ context: siteToSiteVPN.context }); var showVPNListView = function() { $browser.cloudBrowser('addPanel', { - title: 'Site-to-site VPN', + title: _l('label.site.to.site.VPN'), maximizeIfSelected: true, complete: function($panel) { $panel.listView(siteToSiteVPN, {context: siteToSiteVPN.context}); @@ -309,7 +309,7 @@ var $browser = args.$browser; var detailView = args.detailView; var $router = $('
  • ').addClass('tier virtual-router'); - var $title = $('').addClass('title').html('Virtual Router'); + var $title = $('').addClass('title').html(_l('label.virtual.router')); $router.append($title); @@ -320,7 +320,7 @@ if ($router.hasClass('disabled')) return false; $browser.cloudBrowser('addPanel', { - title: 'VPC router details', + title: _l('label.VPC.router.details'), complete: function($panel) { $panel.detailView(detailView); } @@ -376,7 +376,7 @@ $dialog.append($listView); $dialog.dialog({ - title: 'VMs in tier: ' + name, + title: _l('label.VMs.in.tier') + ': ' + name, dialogClass: 'multi-edit-add-list panel configure-acl', width: 825, height: 600, @@ -407,7 +407,7 @@ if (isPlaceholder) { $tier.addClass('placeholder'); - $title.html('Create Tier'); + $title.html(_l('label.add.new.tier')); } else { $title.html( cloudStack.concat(name, 8) @@ -416,7 +416,7 @@ $cidr.html(cidr); $vmCount.append( $('').addClass('total').html(virtualMachines != null? virtualMachines.length: 0), - ' VMs' + _l('label.vms') ); $tier.append($actions); @@ -498,7 +498,7 @@ }) }); - if (!isAdmin() && !isDomainAdmin()) $router.addClass('disabled'); + if (!isAdmin()) $router.addClass('disabled'); var $chart = $('
    ').addClass('vpc-chart'); var $title = $('
    ').addClass('vpc-title') @@ -840,7 +840,7 @@ $browser.cloudBrowser('addPanel', { maximizeIfSelected: true, - title: 'Configure VPC: ' + vpc.name, + title: _l('label.configure.vpc') + ': ' + vpc.name, complete: function($panel) { var $loading = $('
    ').addClass('loading-overlay').appendTo($panel); diff --git a/ui/scripts/ui/widgets/tagger.js b/ui/scripts/ui/widgets/tagger.js index 1b9c9289ad3..53dd51566a2 100644 --- a/ui/scripts/ui/widgets/tagger.js +++ b/ui/scripts/ui/widgets/tagger.js @@ -33,10 +33,10 @@ inputArea: function(args) { var $form = $('
    ').addClass('tag-input'); var $keyField = $('
    ').addClass('field key'); - var $keyLabel = $('