check ids returned from resources are not null

This commit is contained in:
adriancole 2013-03-08 12:30:12 -08:00
parent f994fdfc17
commit a3250011aa
3 changed files with 5 additions and 3 deletions

View File

@ -18,6 +18,7 @@
*/ */
package org.jclouds.ultradns.ws.xml; package org.jclouds.ultradns.ws.xml;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.util.SaxUtils.currentOrNull; import static org.jclouds.util.SaxUtils.currentOrNull;
import static org.jclouds.util.SaxUtils.equalsOrSuffix; import static org.jclouds.util.SaxUtils.equalsOrSuffix;
@ -35,7 +36,7 @@ public class GuidHandler extends ParseSax.HandlerForGeneratedRequestWithResult<S
@Override @Override
public String getResult() { public String getResult() {
try { try {
return guid; return checkNotNull(guid, "guid not present in the response");
} finally { } finally {
guid = null; guid = null;
} }

View File

@ -18,6 +18,7 @@
*/ */
package org.jclouds.ultradns.ws.xml; package org.jclouds.ultradns.ws.xml;
import static com.google.common.base.Preconditions.checkNotNull;
import static org.jclouds.util.SaxUtils.currentOrNull; import static org.jclouds.util.SaxUtils.currentOrNull;
import static org.jclouds.util.SaxUtils.equalsOrSuffix; import static org.jclouds.util.SaxUtils.equalsOrSuffix;
@ -35,7 +36,7 @@ public class RRPoolIDHandler extends ParseSax.HandlerForGeneratedRequestWithResu
@Override @Override
public String getResult() { public String getResult() {
try { try {
return rrPoolID; return checkNotNull(rrPoolID, "RRPoolId not present in the response");
} finally { } finally {
rrPoolID = null; rrPoolID = null;
} }

View File

@ -1 +1 @@
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v01="http://webservice.api.ultra.neustar.com/v01/"><soapenv:Header><wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"><wsse:UsernameToken><wsse:Username>identity</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">credential</wsse:Password></wsse:UsernameToken></wsse:Security></soapenv:Header><soapenv:Body><v01:createResourceRecord><transactionID /><resourceRecord ZoneName="jclouds.org." Type="15" DName="mail.jclouds.org." TTL="1800"><InfoValues Info1Value="10" Info2Value="maileast.jclouds.org." /></resourceRecord></v01:createResourceRecord></soapenv:Body></soapenv:Envelope> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><ns1:createResourceRecordResponse xmlns:ns1="http://webservice.api.ultra.neustar.com/v01/"><guid xmlns:ns2="http://schema.ultraservice.neustar.com/v01/">04063D9D54C6A01F</guid></ns1:createResourceRecordResponse></soap:Body></soap:Envelope>