forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Azure#59 from daniwang/dev
Great!
- Loading branch information
Showing
80 changed files
with
5,560 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...zure-api/src/main/java/com/microsoft/windowsazure/serviceruntime/AcquireCurrentState.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
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; | ||
} | ||
} |
157 changes: 157 additions & 0 deletions
157
...t-azure-api/src/main/java/com/microsoft/windowsazure/serviceruntime/AcquireLeaseInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
* <complexType name="AcquireLeaseInfo"> | ||
* <complexContent> | ||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> | ||
* <all> | ||
* <element name="Incarnation" type="{http://www.w3.org/2001/XMLSchema}unsignedLong"/> | ||
* <element name="Status" type="{}CurrentStatusEnum"/> | ||
* <element name="StatusDetail" type="{http://www.w3.org/2001/XMLSchema}string"/> | ||
* <element name="Expiration" type="{http://www.w3.org/2001/XMLSchema}dateTime"/> | ||
* </all> | ||
* </restriction> | ||
* </complexContent> | ||
* </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; | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
microsoft-azure-api/src/main/java/com/microsoft/windowsazure/serviceruntime/Adapter1.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
|
||
} |
53 changes: 53 additions & 0 deletions
53
...src/main/java/com/microsoft/windowsazure/serviceruntime/ChunkedGoalStateDeserializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
92 changes: 92 additions & 0 deletions
92
...api/src/main/java/com/microsoft/windowsazure/serviceruntime/ConfigurationSettingInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
* <complexType name="ConfigurationSettingInfo"> | ||
* <complexContent> | ||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> | ||
* <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> | ||
* <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> | ||
* </restriction> | ||
* </complexContent> | ||
* </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; | ||
} | ||
|
||
} |
Oops, something went wrong.