本文整理匯總了Java中com.sun.jersey.api.client.ClientHandlerException.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java ClientHandlerException.getMessage方法的具體用法?Java ClientHandlerException.getMessage怎麽用?Java ClientHandlerException.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sun.jersey.api.client.ClientHandlerException
的用法示例。
在下文中一共展示了ClientHandlerException.getMessage方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: registerDataSets
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public List<DataSetRegistrationResult> registerDataSets( List<DataSet> datasets, NodeCredentials credentials ) throws NodeIllegalStatusException,
AuthenticationException, RestWSUnknownException {
try {
WebResource wr = getResource( "/datasetservice/register" );
ClientResponse cr = wr.post( ClientResponse.class, new SecuredRequestWrapper( credentials, new JaxbBaseList( datasets ) ) );
if ( cr.getClientResponseStatus().equals( Status.BAD_REQUEST ) ) {
throw new NodeIllegalStatusException();
}
else if ( cr.getClientResponseStatus().equals( Status.UNAUTHORIZED ) ) {
throw new AuthenticationException();
}
JaxbBaseList<DataSetRegistrationResult> list = cr.getEntity( new GenericType<JaxbBaseList<DataSetRegistrationResult>>() {
} );
return list.getList();
}
catch ( ClientHandlerException ex ) {
throw new RestWSUnknownException( ex.getMessage() );
}
}
示例2: checkStatus
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public List<DataSetRegistrationAcceptanceDecision> checkStatus( List<DataSetDTO> dataSets, NodeCredentials credentials ) throws AuthenticationException,
RestWSUnknownException {
try {
WebResource wr = getResource( "/datasetservice/checkStatus" );
ClientResponse cr = wr.post( ClientResponse.class, new SecuredRequestWrapper( credentials, new JaxbBaseList( dataSets ) ) );
if ( cr.getClientResponseStatus().equals( Status.UNAUTHORIZED ) ) {
throw new AuthenticationException();
}
JaxbBaseList<DataSetRegistrationAcceptanceDecision> list = cr.getEntity( new GenericType<JaxbBaseList<DataSetRegistrationAcceptanceDecision>>() {
} );
return list.getList();
}
catch ( ClientHandlerException ex ) {
throw new RestWSUnknownException( ex.getMessage() );
}
}
示例3: deregisterDataSets
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public List<DataSetDeregistrationResult> deregisterDataSets( List<DataSetDTO> datasets, String reason, NodeCredentials credentials )
throws AuthenticationException, RestWSUnknownException {
DataSetDeregistrationRequest dsDeregistrationReq = new DataSetDeregistrationRequest( reason, datasets );
try {
WebResource wr = getResource( "/datasetservice/deregister" );
ClientResponse cr = wr.post( ClientResponse.class, new SecuredRequestWrapper( credentials, dsDeregistrationReq ) );
if ( cr.getClientResponseStatus().equals( Status.UNAUTHORIZED ) ) {
throw new AuthenticationException();
}
JaxbBaseList<DataSetDeregistrationResult> list = cr.getEntity( new GenericType<JaxbBaseList<DataSetDeregistrationResult>>() {
} );
return list.getList();
}
catch ( ClientHandlerException ex ) {
throw new RestWSUnknownException( ex.getMessage() );
}
}
示例4: register
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public RegistryCredentials register( Node node ) throws NodeRegistrationException, RestWSUnexpectedStatusException, RestWSUnknownException,
AddressException {
try {
WebResource wr = getResource( "/nodeservice/register" );
ClientResponse cr = wr.post( ClientResponse.class, node );
if ( cr.getClientResponseStatus().equals( Status.CONFLICT ) ) {
throw new NodeRegistrationException();
}
if ( cr.getClientResponseStatus().equals( Status.NOT_ACCEPTABLE ) ) {
throw new AddressException();
}
if ( !cr.getClientResponseStatus().equals( Status.OK ) ) {
throw new RestWSUnexpectedStatusException( cr.getStatus() );
}
RegistryCredentials result = cr.getEntity( RegistryCredentials.class );
return result;
}
catch ( ClientHandlerException ex ) {
throw new RestWSUnknownException( ex.getMessage() );
}
}
示例5: checkAcceptance
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public RegistryStatus checkAcceptance( Node node ) throws RestWSUnknownException {
try {
WebResource wr = getResource( "/nodeservice/checkAcceptance" );
ClientResponse cr = wr.put( ClientResponse.class, node );
if ( cr.getStatus() == CustomStatus.ENTITY_NOT_FOUND.getCode() ) {
return RegistryStatus.NOT_REGISTERED;
}
JAXBElement<String> statusJaxbEl = cr.getEntity( new GenericType<JAXBElement<String>>() {
} );
NodeStatus status = NodeStatus.valueOf( (String) statusJaxbEl.getValue() );
if ( status == NodeStatus.NOT_APPROVED ) {
return RegistryStatus.PENDING_REGISTRATION;
}
return RegistryStatus.REGISTERED;
}
catch ( ClientHandlerException ex ) {
throw new RestWSUnknownException( ex.getMessage() );
}
}
示例6: wake
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public List<Node> wake( NodeCredentials credentials ) throws AuthenticationException, RestWSUnknownException, RestWSUnexpectedStatusException {
try {
WebResource wr = getResource( "/nodeservice/wake" );
ClientResponse cr = wr.put( ClientResponse.class, new SecuredRequestWrapper( credentials ) );
if ( cr.getClientResponseStatus().equals( Status.UNAUTHORIZED ) ) {
throw new AuthenticationException();
}
else if ( !cr.getClientResponseStatus().equals( Status.OK ) ) {
throw new RestWSUnexpectedStatusException( cr.getStatus() );
}
return cr.getEntity( new GenericType<List<Node>>() {
} );
}
catch ( ClientHandlerException ex ) {
throw new RestWSUnknownException( ex.getMessage() );
}
}
示例7: loadMapServerConnectionsData
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public static List<MapServerData> loadMapServerConnectionsData(DataserviceConnection dataserviceConnection)
throws JSONException, ClassNotFoundException, InstantiationException, IllegalAccessException,
JSONHandlerException, ConnectionException {
List<MapServerData> connections = new ArrayList<MapServerData>();
JSONArray jsonResponse = null;
try {
jsonResponse = buildWebResource(dataserviceConnection).path("/").accept(MediaType.APPLICATION_JSON)
.get(JSONArray.class);
} catch (ClientHandlerException e) {
// if not available
throw new ConnectionException(e.getMessage());
}
for (int i = 0; i < jsonResponse.length(); i++) {
JSONObject jsonConnectionData = jsonResponse.getJSONObject(i);
MapServerData connectionData = (MapServerData) DataManager.transformJSONObject(jsonConnectionData,
MapServerData.class);
connections.add(connectionData);
}
return connections;
}
示例8: getDataSetData
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public DataSet getDataSetData( DataSet dataset ) throws RestWSUnknownException {
try {
ClientResponse cr = getResponse( "/datasetservice/dataset/" + dataset.getId() );
if ( cr.getStatus() == CustomStatus.ENTITY_NOT_FOUND.getCode() ) {
return null;
}
return cr.getEntity( DataSet.class );
}
catch ( ClientHandlerException ex ) {
throw new RestWSUnknownException( ex.getMessage() );
}
}
示例9: getNodeData
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public Node getNodeData( String nodeId ) throws RestWSUnknownException {
try {
ClientResponse cr = getResponse( "/nodeservice/node/" + URLEncoder.encode( nodeId, "UTF-8" ) );
if ( cr.getStatus() == CustomStatus.ENTITY_NOT_FOUND.getCode() ) {
return null;
}
return cr.getEntity( Node.class );
}
catch ( ClientHandlerException ex ) {
throw new RestWSUnknownException( ex.getMessage() );
}
catch ( UnsupportedEncodingException e ) {
return null;
}
}
示例10: deregister
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public void deregister( NodeCredentials credentials ) throws AuthenticationException, RestWSUnknownException, RestWSUnexpectedStatusException {
try {
WebResource wr = getResource( "/nodeservice/deregister" );
ClientResponse cr = wr.put( ClientResponse.class, new SecuredRequestWrapper( credentials ) );
if ( cr.getClientResponseStatus().equals( Status.UNAUTHORIZED ) ) {
throw new AuthenticationException();
}
if ( !cr.getClientResponseStatus().equals( Status.OK ) ) {
throw new RestWSUnexpectedStatusException( cr.getStatus() );
}
}
catch ( ClientHandlerException ex ) {
throw new RestWSUnknownException( ex.getMessage() );
}
}
示例11: getPublicKey
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public RSAPublicKeySpec getPublicKey() throws RestWSUnknownException {
if ( keys.get( restServletUrl ) == null ) {
try {
ClientResponse cr = getResponse( "/key/public" );
KeyWrapper kw = cr.getEntity( KeyWrapper.class );
keys.put( restServletUrl, kw.getRSAPublicKeySpec() );
}
catch ( ClientHandlerException ex ) {
throw new RestWSUnknownException( ex.getMessage() );
}
}
return keys.get( restServletUrl );
}
示例12: informAboutChanges
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public void informAboutChanges(NodeChangeLog log) throws RestWSUnknownException {
try {
WebResource wr = getResource("/synchronization/inform/"+accessAccount);
wr.put(ClientResponse.class, log);
} catch (ClientHandlerException ex) {
throw new RestWSUnknownException(ex.getMessage());
}
}
示例13: informAboutDatasetDeregistration
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public void informAboutDatasetDeregistration(DataSet ds) throws RestWSUnknownException {
try {
WebResource wr = getResource("/synchronization/informAboutDSDeregistration/"+accessAccount);
wr.put(ClientResponse.class, ds);
} catch (ClientHandlerException ex) {
throw new RestWSUnknownException(ex.getMessage());
}
}
示例14: getPublicKey
import com.sun.jersey.api.client.ClientHandlerException; //導入方法依賴的package包/類
public RSAPublicKeySpec getPublicKey() throws RestWSUnknownException {
try {
ClientResponse cr = getResponse("/key/public");
KeyWrapper kw = cr.getEntity(KeyWrapper.class);
return kw.getRSAPublicKeySpec();
} catch (ClientHandlerException ex) {
throw new RestWSUnknownException(ex.getMessage());
}
}