Skip to content

Commit

Permalink
Merge pull request Azure#1 from wablaur/dev
Browse files Browse the repository at this point in the history
Adding ServiceRuntime
  • Loading branch information
daniwang committed Nov 15, 2011
2 parents df0d1c0 + bb45c22 commit 72b1e56
Show file tree
Hide file tree
Showing 79 changed files with 5,756 additions and 0 deletions.
6 changes: 6 additions & 0 deletions microsoft-azure-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@
<version>4.8</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.microsoft.windowsazure.serviceruntime;

import java.math.BigInteger;
import java.util.Calendar;

/**
*
*/
class AcquireCurrentState extends CurrentState {
private final BigInteger incarnation;
private final CurrentStatus status;
private final Calendar expiration;

public AcquireCurrentState(String clientId, BigInteger incarnation,
CurrentStatus status, Calendar expiration) {
super(clientId);
this.incarnation = incarnation;
this.status = status;
this.expiration = expiration;
}

public BigInteger getIncarnation() {
return incarnation;
}

public CurrentStatus getStatus() {
return status;
}

public Calendar getExpiration() {
return expiration;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.11.14 at 04:34:45 PM PST
//


package com.microsoft.windowsazure.serviceruntime;

import java.math.BigInteger;
import java.util.Calendar;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;


/**
* <p>Java class for AcquireLeaseInfo complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="AcquireLeaseInfo">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;all>
* &lt;element name="Incarnation" type="{http://www.w3.org/2001/XMLSchema}unsignedLong"/>
* &lt;element name="Status" type="{}CurrentStatusEnum"/>
* &lt;element name="StatusDetail" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="Expiration" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
* &lt;/all>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AcquireLeaseInfo", propOrder = {

})
class AcquireLeaseInfo {

@XmlElement(name = "Incarnation", required = true)
@XmlSchemaType(name = "unsignedLong")
protected BigInteger incarnation;
@XmlElement(name = "Status", required = true)
protected CurrentStatusEnum status;
@XmlElement(name = "StatusDetail", required = true)
protected String statusDetail;
@XmlElement(name = "Expiration", required = true, type = String.class)
@XmlJavaTypeAdapter(Adapter1 .class)
@XmlSchemaType(name = "dateTime")
protected Calendar expiration;

/**
* Gets the value of the incarnation property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getIncarnation() {
return incarnation;
}

/**
* Sets the value of the incarnation property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setIncarnation(BigInteger value) {
this.incarnation = value;
}

/**
* Gets the value of the status property.
*
* @return
* possible object is
* {@link CurrentStatusEnum }
*
*/
public CurrentStatusEnum getStatus() {
return status;
}

/**
* Sets the value of the status property.
*
* @param value
* allowed object is
* {@link CurrentStatusEnum }
*
*/
public void setStatus(CurrentStatusEnum value) {
this.status = value;
}

/**
* Gets the value of the statusDetail property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getStatusDetail() {
return statusDetail;
}

/**
* Sets the value of the statusDetail property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setStatusDetail(String value) {
this.statusDetail = value;
}

/**
* Gets the value of the expiration property.
*
* @return
* possible object is
* {@link String }
*
*/
public Calendar getExpiration() {
return expiration;
}

/**
* Sets the value of the expiration property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setExpiration(Calendar value) {
this.expiration = value;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.11.14 at 04:34:45 PM PST
//


package com.microsoft.windowsazure.serviceruntime;

import java.util.Calendar;
import javax.xml.bind.annotation.adapters.XmlAdapter;

class Adapter1
extends XmlAdapter<String, Calendar>
{


public Calendar unmarshal(String value) {
return (javax.xml.bind.DatatypeConverter.parseDateTime(value));
}

public String marshal(Calendar value) {
if (value == null) {
return null;
}
return (javax.xml.bind.DatatypeConverter.printDateTime(value));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package com.microsoft.windowsazure.serviceruntime;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

class ChunkedGoalStateDeserializer implements GoalStateDeserializer {
private final XmlGoalStateDeserializer deserializer;
private BufferedReader reader;

public ChunkedGoalStateDeserializer() {
this.deserializer = new XmlGoalStateDeserializer();
}

@Override
public void initialize(InputStream inputStream) {
try {
reader = new BufferedReader(new InputStreamReader(inputStream,
"UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}

@Override
public GoalState deserialize() {
try {
String lengthString = reader.readLine();

if (lengthString == null) {
return null;
}

int length = Integer.parseInt(lengthString.toString(), 16);
char chunkData[] = new char[length];

reader.read(chunkData, 0, length);

GoalState goalState = deserializer
.deserialize(new String(chunkData));

reader.readLine();

return goalState;
} catch (IOException e) {
e.printStackTrace();

return null;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.11.14 at 04:34:45 PM PST
//


package com.microsoft.windowsazure.serviceruntime;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;


/**
* <p>Java class for ConfigurationSettingInfo complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ConfigurationSettingInfo">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ConfigurationSettingInfo")
class ConfigurationSettingInfo {

@XmlAttribute(required = true)
protected String name;
@XmlAttribute(required = true)
protected String value;

/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}

/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}

/**
* Gets the value of the value property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getValue() {
return value;
}

/**
* Sets the value of the value property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setValue(String value) {
this.value = value;
}

}
Loading

0 comments on commit 72b1e56

Please sign in to comment.