|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ICPCRepositoryProvider
An ICPCRepositoryProvider
provides a centralised remote storage service for CPC
clone data which may be access concurrently from multiple CPC installations.
A typical use for a provider of this type is to store the current cpc data for a file in a central location, whenever it is committed into a source repository and to fetch the most up to date cpc data for a file whenever it is checked out, updated or merged.
Most methods of this API are likely to require remote calls. They can thus fail and are potentially long running.
NOTE: Any implementation must guarantee that concurrent calls to the put and get methods on this and other systems do not result in invalid data.
ICPCRevision
Method Summary | |
---|---|
ICPCRevision |
createRevision()
Creates a new and empty ICPCRevision instance which can then be filled
by the client. |
ICPCRevision |
getRevision(java.lang.String revisionId,
java.lang.String cloneFileUuid)
Retrieves the cpc data revision with the given revisionId for the ICloneFile with the given cloneFileUuid. |
ICPCRevision |
getRevision(java.lang.String revisionId,
java.lang.String project,
java.lang.String filePath)
Retrieves the cpc data revision with the given revisionId for the ICloneFile with the given project and filePath location. |
void |
hintEndTransaction()
This method must only be called if hintStartTransaction() was called. |
void |
hintStartTransaction()
This method should be called by clients of this interface if it is expected that multiple repository operations will be done within a short period of time. |
boolean |
isAvailable()
Checks whether this cpc repository is currently available. |
boolean |
purgeRevision(java.lang.String revisionId,
java.lang.String cloneFileUuid)
Tells the ICPCRepositoryProvider that the specified revision is no longer needed and
can be deleted. |
boolean |
purgeRevision(java.lang.String revisionId,
java.lang.String project,
java.lang.String filePath)
Tells the ICPCRepositoryProvider that the specified revision is no longer needed and
can be deleted. |
void |
putRevision(ICPCRevision cpcRevision)
Stores the given cpc data revision in the remote repository. |
Methods inherited from interface org.electrocodeogram.cpc.core.api.provider.IProvider |
---|
getProviderName, toString |
Method Detail |
---|
boolean isAvailable()
This method will typically try to connect to a remote location and verify that there are no connectivity or version incompatibility issues which would prevent the normal use of this provider.
If this method returns false most other methods of this API
are likely to throw an exception when used.
However return value of true does not guarantee that no
exception will occur.
void putRevision(ICPCRevision cpcRevision) throws CPCRepositoryException
cpcRevision
- the cpc data revision to store, never null.
CPCRepositoryException
ICPCRevision getRevision(java.lang.String revisionId, java.lang.String cloneFileUuid) throws CPCRepositoryException
ICloneFile
with the given cloneFileUuid.
revisionId
- the revision identifier to retrieve, never null.cloneFileUuid
- the ICloneObject.getUuid()
value of the file to retrieve the data for, never null.
ICPCRevision
or NULL if no such revision was found.
CPCRepositoryException
ICPCRevision getRevision(java.lang.String revisionId, java.lang.String project, java.lang.String filePath) throws CPCRepositoryException
ICloneFile
with the given project and filePath location.
revisionId
- the revision identifier to retrieve, never null.project
- the project name of the ICloneFile
to retrieve the data for, never null.filePath
- the project relative path of the ICloneFile
to retrieve the data for, never null.
ICPCRevision
or NULL if no such revision was found.
CPCRepositoryException
boolean purgeRevision(java.lang.String revisionId, java.lang.String cloneFileUuid) throws CPCRepositoryException
ICPCRepositoryProvider
that the specified revision is no longer needed and
can be deleted.
ICPCRepositoryProvider
may not return a revision to any client
once it has been marked for purging in this way.
revisionId
- the revision identifier of the revision to purge, never null.cloneFileUuid
- cloneFileUuid the ICloneObject.getUuid()
value of the file to purge the revision for, never null.
CPCRepositoryException
boolean purgeRevision(java.lang.String revisionId, java.lang.String project, java.lang.String filePath) throws CPCRepositoryException
ICPCRepositoryProvider
that the specified revision is no longer needed and
can be deleted.
ICPCRepositoryProvider
may not return a revision to any client
once it has been marked for purging in this way.
revisionId
- the revision identifier of the revision to purge, never null.project
- the project name of the ICloneFile
to purge the data for, never null.filePath
- the project relative path of the ICloneFile
to purge the data for, never null.
CPCRepositoryException
ICPCRevision createRevision()
ICPCRevision
instance which can then be filled
by the client.
ICPCRevision
instances must not be mixed between ICPCRepositoryProvider
s and
a client may not use its own implementations.
ICPCRevision
instance, never null.void hintStartTransaction() throws CPCRepositoryException
It is up to the implementation of this interface whether to make use of this additional information. The implementation may not rely on a call to this method. The visible behaviour of the implementation must not change depending on whether this method is called or not.
While calling this method is optional, a client must call hintEndTransaction()
once
it called this method.
NOTE: this method is only meant to improve performance. No transactional properties are guaranteed by this API.
A typical use of this method is the setup of some remote network connection.
CPCRepositoryException
hintEndTransaction()
void hintEndTransaction()
hintStartTransaction()
was called. For each call to
hintStartTransaction()
there needs to be exactly one call to hintEndTransaction()
.
A typical use of this method is the shutdown of some remote network connection.
hintStartTransaction()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |