public abstract class EntityRestProxy extends Object implements EntityContract
| Constructor and Description |
|---|
EntityRestProxy(com.sun.jersey.api.client.Client channel,
com.sun.jersey.api.client.filter.ClientFilter[] filters)
Instantiates a new entity rest proxy.
|
| Modifier and Type | Method and Description |
|---|---|
String |
action(EntityActionOperation entityActionOperation)
Perform an action on an entity.
|
<T> T |
action(EntityTypeActionOperation<T> entityTypeActionOperation)
Action.
|
<T> T |
create(EntityCreateOperation<T> creator)
Create a new instance of an entity.
|
protected abstract EntityProxyData |
createProxyData()
Get the proxy data to pass to operations.
|
String |
delete(EntityDeleteOperation deleter)
Delete an entity.
|
<T> T |
get(EntityGetOperation<T> getter)
Retrieve an existing entity by id.
|
protected com.sun.jersey.api.client.Client |
getChannel()
Gets the channel.
|
protected ExecutorService |
getExecutorService()
Gets the executor service.
|
protected com.sun.jersey.api.client.filter.ClientFilter[] |
getFilters()
Gets the filters.
|
<T> ListResult<T> |
list(EntityListOperation<T> lister)
Retrieve a list of entities.
|
String |
update(EntityUpdateOperation updater)
Update an existing entity.
|
public EntityRestProxy(com.sun.jersey.api.client.Client channel,
com.sun.jersey.api.client.filter.ClientFilter[] filters)
channel - the channelfilters - the filtersprotected com.sun.jersey.api.client.Client getChannel()
protected ExecutorService getExecutorService()
protected com.sun.jersey.api.client.filter.ClientFilter[] getFilters()
protected abstract EntityProxyData createProxyData()
public <T> T create(EntityCreateOperation<T> creator) throws ServiceException
EntityContractcreate in interface EntityContractT - the generic typecreator - Object providing the details of the entity to be createdServiceException - the service exception The created entitypublic <T> T get(EntityGetOperation<T> getter) throws ServiceException
EntityContractget in interface EntityContractT - the generic typegetter - object providing the details of the entity to be retrievedServiceException - the service exceptionpublic <T> ListResult<T> list(EntityListOperation<T> lister) throws ServiceException
EntityContractlist in interface EntityContractT - the generic typelister - object providing details of entities to listServiceException - the service exceptionpublic String update(EntityUpdateOperation updater) throws ServiceException
EntityContractupdate in interface EntityContractupdater - Object providing details of the updateServiceException - the service exceptionpublic String delete(EntityDeleteOperation deleter) throws ServiceException
EntityContractdelete in interface EntityContractdeleter - Object providing details of the deleteServiceException - the service exceptionpublic <T> T action(EntityTypeActionOperation<T> entityTypeActionOperation) throws ServiceException
EntityContractaction in interface EntityContractT - the generic typeentityTypeActionOperation - the entity action operationServiceException - the service exceptionpublic String action(EntityActionOperation entityActionOperation) throws ServiceException
EntityContractaction in interface EntityContractentityActionOperation - Object providing details of the actionServiceException - the service exception/**
* Copyright Microsoft Corporation
*
* 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.
*/