|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.caleigo.core.AbstractDataService
AbstractDataService provides an abstract implementation of the IDataService interface that uses an abstract IDataTransaction to implement its function. Descendants only need to to implement the newTransaction() and ping() methods plus the commit() method of the internal AbstractDataTransaction class.
| Nested Class Summary | |
static class |
AbstractDataService.AbstractDataTransaction
|
| Field Summary | |
static int |
DEFAULT_TIMEOUT
|
| Constructor Summary | |
AbstractDataService(java.lang.Object serviceType,
java.lang.Object serviceIdentity,
IDataSourceDescriptor dataSourceDescriptor)
Default constructor for AbstractDataService. |
|
| Method Summary | |
protected void |
checkEntityAsDeletable(IEntity entity)
Checks if the entity is deletable else an exception is thrown. |
protected void |
checkEntityAsStorable(IEntity entity)
Checks if the entity is storable else an exception is thrown. |
void |
delete(IEntity entity)
Deletes a single entity object to the database. |
void |
finalizeService()
This method is always called by the ServiceManager before the service is released. |
IProxyService |
getCustomProxyService(ITunnel tunnel)
Returns an IProxyService that is responsible for handling remote invokations of this service. |
IDataSourceDescriptor |
getDataSourceDescriptor()
This method provides access to the IDataSourceDescriptor that describes the entity meta structure of the information source that a specific data service provides access to. |
java.lang.Object |
getServiceIdentity()
Returns the URI defining the a unique individual service. |
java.lang.Object |
getServiceInterface()
Returns the service object that this service provides. |
java.lang.Class |
getServiceInterfaceClass()
Returns the class object the defines the service interface that all services with the same type provides. |
java.lang.Object |
getServiceType()
Returns a URI that defines the type of this service. |
int |
getTimeout()
|
boolean |
hasCustomProxyService()
If this method returns true then the method getCustomProxyService must not return null. |
void |
initializeService()
This method is always called by the ServiceManager before any other method in the service is called. |
boolean |
isValidating()
|
IEntity |
load(IEntityDescriptor entityDescriptor,
Qualifier identitQualifier)
The load method returnes a single entity object intentified by the provided indentity qualifier that must be able to uniquely identify a single entity instance. |
ISelection |
loadSelection(DataQuery dataQuery)
Loads a selection of entities identyfied by the provided reusable dataQuery object. |
ISelection |
loadSelection(IEntityDescriptor entityDescriptor,
Qualifier qualifier)
Loads a selection of entities identyfied by the provided qualifier. |
abstract IDataTransaction |
newTransaction()
Returns a new IDataTransaction object that can be used to batch data operations and wrap them in a transaction. |
abstract boolean |
ping()
Should return true if the service is online and reponding to calls. |
void |
refresh(IEntity entity)
Reloads a single entity object from the database. |
protected void |
setEntityData(IEntity entity,
int j,
java.lang.Object data)
Help method that sets field data with better performance. |
void |
setTimeout(int timeout)
Sets the timeout for asynchoniesly executed commits. |
void |
setValidating(boolean validating)
|
void |
store(IEntity entity)
Stores a single entity object to the database. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_TIMEOUT
| Constructor Detail |
public AbstractDataService(java.lang.Object serviceType,
java.lang.Object serviceIdentity,
IDataSourceDescriptor dataSourceDescriptor)
| Method Detail |
public abstract IDataTransaction newTransaction()
IDataService
newTransaction in interface IDataServicepublic abstract boolean ping()
ping in interface IServicepublic IDataSourceDescriptor getDataSourceDescriptor()
IDataService
getDataSourceDescriptor in interface IDataService
public IEntity load(IEntityDescriptor entityDescriptor,
Qualifier identitQualifier)
throws DataServiceException
IDataService
load in interface IDataServiceDataServiceException
public ISelection loadSelection(IEntityDescriptor entityDescriptor,
Qualifier qualifier)
throws DataServiceException
IDataService
loadSelection in interface IDataServiceDataServiceException
public ISelection loadSelection(DataQuery dataQuery)
throws DataServiceException
IDataService
loadSelection in interface IDataServiceDataServiceException
public void store(IEntity entity)
throws DataServiceException
IDataService
store in interface IDataServiceDataServiceException
public void delete(IEntity entity)
throws DataServiceException
IDataService
delete in interface IDataServiceDataServiceException
public void refresh(IEntity entity)
throws DataServiceException
IDataService
refresh in interface IDataServiceDataServiceExceptionpublic void initializeService()
initializeService in interface IServicepublic void finalizeService()
finalizeService in interface IServicepublic java.lang.Object getServiceInterface()
getServiceInterface in interface IServicepublic java.lang.Class getServiceInterfaceClass()
getServiceInterfaceClass in interface IServicepublic java.lang.Object getServiceType()
getServiceType in interface IServicepublic java.lang.Object getServiceIdentity()
getServiceIdentity in interface IServicepublic boolean hasCustomProxyService()
null.
hasCustomProxyService in interface IServicepublic IProxyService getCustomProxyService(ITunnel tunnel)
getCustomProxyService in interface IServicepublic boolean isValidating()
public void setValidating(boolean validating)
public void setTimeout(int timeout)
timeout - the timeout in seconds.public int getTimeout()
protected void checkEntityAsStorable(IEntity entity)
throws DataServiceException
DataServiceException
protected void checkEntityAsDeletable(IEntity entity)
throws DataServiceException
DataServiceException
protected void setEntityData(IEntity entity,
int j,
java.lang.Object data)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||