public interface PersistenceController
Each unique repository type must have a custom persistence controller which enforces any required rules for that repository type for the various XML persistence access.
| Modifier and Type | Method and Description |
|---|---|
org.opendof.tools.repository.interfaces.da.InterfaceData |
addInterface(AuthenticatedUser user,
org.opendof.tools.repository.interfaces.da.InterfaceData iface,
java.lang.String subRepoRdn)
Add a Working Interface.
|
void |
addInterfaceSharePermission(AuthenticatedUser user,
java.lang.String iid,
java.lang.String version,
java.lang.String email,
org.opendof.tools.repository.interfaces.da.SubmitterPermissions.PermissionLevel permissionLevel)
Update a working interface definition to shared.
|
void |
addSubRepositoryNode(AuthenticatedUser user,
java.lang.String parentRdn,
org.opendof.tools.repository.interfaces.da.SubRepositoryNode child)
Add a Sub-Repository Node.
|
void |
deleteInterface(AuthenticatedUser user,
java.lang.String iid,
java.lang.String version)
Delete a working or published interface definition.
|
void |
deleteSubRepositoryNode(AuthenticatedUser user,
java.lang.String parentRdn,
org.opendof.tools.repository.interfaces.da.SubRepositoryNode node)
Delete a Sub-Repository Node.
|
void |
destroy()
Destroy yourself method.
|
java.lang.String |
getIidFromXml(java.lang.String xml)
Return the Interface ID of the XML.
|
org.opendof.tools.repository.interfaces.da.InterfaceData |
getInterface(AuthenticatedUser user,
java.lang.String iid,
java.lang.String version)
Get the requested Interface.
|
java.lang.String |
getStandardIdentifier(java.lang.String urlInterfaceID)
Get a standard interface identifier from the URL interface identifier format.
|
org.opendof.tools.repository.interfaces.da.SubRepositoryNode |
getSubRepositoryNode(java.lang.String repoType,
java.lang.String rdn)
Get Sub-Repository Node.
|
java.util.List<java.lang.String> |
getTranslations()
Get a list of interface definition translations supported by this repository.
|
XMLTranslator |
getTranslator(java.lang.String translation)
Get an XML translator for the requested translation format.
|
java.lang.String |
getURLIdentifier(java.lang.String standardInterfaceID)
Get a URL friendly version of an interface identifier from the standard interface identifier format.
|
boolean |
hasAllocateSupport()
Reports if the Repository supports IID allocation.
|
void |
init(CoreController core,
java.lang.String repoType,
org.opendof.tools.repository.interfaces.da.DataAccessor da,
boolean userGroupOnly)
Initialize method.
|
boolean |
isSupportingRepository(java.lang.String iid)
Is iid one I support.
|
java.util.List<org.opendof.tools.repository.interfaces.da.InterfaceData> |
listInterfaces(AuthenticatedUser user,
java.lang.String submitter,
java.lang.String accessGroup,
java.lang.Boolean published)
List Interfaces method.
|
java.util.List<org.opendof.tools.repository.interfaces.da.InterfaceData> |
listSharedInterfaces(AuthenticatedUser user,
java.lang.String userEmail,
java.lang.Boolean published)
List Shared Interfaces method.
|
void |
publishInterface(AuthenticatedUser user,
java.lang.String iid,
java.lang.String version)
Update a working or published interface definition.
|
void |
updateInterface(AuthenticatedUser user,
java.lang.String iid,
java.lang.String xml,
java.lang.String version,
org.opendof.tools.repository.interfaces.da.SubmitterData submitter,
org.opendof.tools.repository.interfaces.da.SubmitterData accessGroup,
java.lang.Boolean published)
Update a working or published interface definition.
|
void |
updateSubRepositoryNode(AuthenticatedUser user,
java.lang.String rdn,
org.opendof.tools.repository.interfaces.da.SubRepositoryNode node)
Update a Sub-Repository Node's Label.
|
boolean |
versionSupported()
Whether or not the controller supports versions.
|
void init(CoreController core, java.lang.String repoType, org.opendof.tools.repository.interfaces.da.DataAccessor da, boolean userGroupOnly) throws java.lang.Exception
The controller implementation should be ready to accept calls on any of the other interface methods upon returning from this call.
core - The CoreController that is calling you. Will never be null.repoType - this controllers repository type.da - The persistence DataAccessor that you should use.userGroupOnly - if true do not allow anonymous users to do anything.java.lang.Exception - if unable to initialize the controller.boolean isSupportingRepository(java.lang.String iid)
iid - the iid in questionjava.lang.String getIidFromXml(java.lang.String xml)
xml - the interface definition XML.void destroy()
The controller implementation should release all its resources.
The CoreController will not call any methods on this interface
again upon returning from this call.
java.util.List<org.opendof.tools.repository.interfaces.da.InterfaceData> listInterfaces(AuthenticatedUser user, java.lang.String submitter, java.lang.String accessGroup, java.lang.Boolean published) throws java.lang.Exception
The list is affected by the RequestData.AutenticatedUser
which is used in conjunction with the following groups:
CoreController.UserGroupOnlyKey
set to true.
If the interface is in the user group it will only be added to the list if
RequestData.AutenticatedUser is non-null.
If the interface is in a submitter created custom group it will only be added
to the list if the request RequestData.AutenticatedUser is a member
of that custom group.
if the interface is not one of the two constant groups or a custom group then
the interface will only be added to the list if the request submitter matches
the RequestData.AutenticatedUser.
user - the user. Maybe null for anonymous.submitter - Filter the list based on the submitter. If null don't filter on submitter.accessGroup - Filter the list based on the accessGroup. If null don't filter on accessGroup.published - Filter the list based on the published flag. If null don't filter on published.java.lang.Exception - if the list could not be obtainedjava.util.List<org.opendof.tools.repository.interfaces.da.InterfaceData> listSharedInterfaces(AuthenticatedUser user, java.lang.String userEmail, java.lang.Boolean published) throws java.lang.Exception
The list is all the interfaces the user has at least read access. This method will not list interfaces in which the user is the owner.
user - the user. May be null for anonymous.userEmail - Filter the list based on the submitter. May not be null.published - Filter the list based on the published flag. If null don't filter on published.java.lang.Exception - thrown if the list of shared interfaces could not be found.org.opendof.tools.repository.interfaces.da.InterfaceData getInterface(AuthenticatedUser user, java.lang.String iid, java.lang.String version) throws java.lang.Exception
user - the user. Maybe null for anonymous.iid - the iid of the interface to return. Must not be null.version - the version of the iid to return. If null version "1" is used.java.lang.Exception - if the interface data could not be obtained.org.opendof.tools.repository.interfaces.da.InterfaceData addInterface(AuthenticatedUser user, org.opendof.tools.repository.interfaces.da.InterfaceData iface, java.lang.String subRepoRdn) throws java.lang.Exception
user - the user. Maybe null for anonymous.iface - data for the interface to be added.subRepoRdn - the relative distinguished name of the sub-repository allocation pool.org.opendof.tools.repository.interfaces.da.SubmitterException - if the given submitter of the interface is not setup properly.org.opendof.tools.repository.interfaces.da.AlreadyExistsException - if trying to add a working interface ID/version that already exists.org.opendof.tools.repository.interfaces.da.InterfaceIdMatchException - if iid and xml are both supplied and they don't match.org.opendof.tools.repository.interfaces.da.NotFoundException - given submitter is not known.java.lang.Exception - if the interface could not be added.void updateInterface(AuthenticatedUser user, java.lang.String iid, java.lang.String xml, java.lang.String version, org.opendof.tools.repository.interfaces.da.SubmitterData submitter, org.opendof.tools.repository.interfaces.da.SubmitterData accessGroup, java.lang.Boolean published) throws java.lang.Exception
The iid and xml arguments have the following rules:
user - the user. Maybe null for anonymous.iid - the ID being updated. If null, the iid is obtained from the xmlxml - the xml to push. if null no change otherwise set the given xml.version - the version of the xml to push;submitter - new submitter. If null, no change otherwise set the given submitter.accessGroup - new accessGroup. If null, no change otherwise set the given accessGroup.published - new published value. If null, no change otherwise set the given flag.org.opendof.tools.repository.interfaces.da.SubmitterException - if the given submitter of the interface is setup properly.org.opendof.tools.repository.interfaces.da.NotFoundException - if the requested InterfaceID is not in the repository.org.opendof.tools.repository.interfaces.da.InterfaceIdMatchException - if iid and xml are both supplied and they don't match.org.opendof.tools.repository.interfaces.da.ImmutableException - if the update is for a published interface and invalid
portions of that interface would be modified.java.lang.Exception - if the interface could not be updated.void publishInterface(AuthenticatedUser user, java.lang.String iid, java.lang.String version) throws java.lang.Exception
user - the user. Maybe null for anonymous.iid - the interface ID to publish;version - the version of the iid to publish;org.opendof.tools.repository.interfaces.da.NotFoundException - if the requested InterfaceID is not in the repository.org.opendof.tools.repository.interfaces.da.ImmutableException - if the update is for a published interface and invalid
portions of that interface would be modified.java.lang.Exception - if the interface could not be updated.void addInterfaceSharePermission(AuthenticatedUser user, java.lang.String iid, java.lang.String version, java.lang.String email, org.opendof.tools.repository.interfaces.da.SubmitterPermissions.PermissionLevel permissionLevel) throws org.opendof.tools.repository.interfaces.da.NotFoundException, org.opendof.tools.repository.interfaces.da.ImmutableException
user - the user. Maybe null for anonymous.iid - the interface ID to publish.version - the version of the iid to publish.permissionLevel - the permission to add.email - the email address of the user that the InterfaceID should be shared with.org.opendof.tools.repository.interfaces.da.NotFoundException - if the requested InterfaceID is not in the repository.org.opendof.tools.repository.interfaces.da.ImmutableException - if the update is for a published interface and invalid
portions of that interface would be modified.void deleteInterface(AuthenticatedUser user, java.lang.String iid, java.lang.String version) throws java.lang.Exception
user - the user. Maybe null for anonymous.iid - the interface ID to delete;version - the version of the iid to delete;org.opendof.tools.repository.interfaces.da.NotFoundException - if the requested InterfaceID is not in the repository.java.lang.Exception - if the interface could not be updated.boolean hasAllocateSupport()
org.opendof.tools.repository.interfaces.da.SubRepositoryNode getSubRepositoryNode(java.lang.String repoType,
java.lang.String rdn)
throws java.lang.Exception
repoType - the repository type to apply the RDN against.rdn - the relative distinguished name (RDN). May be null.org.opendof.tools.repository.interfaces.da.NotFoundException - given repoType/name is not known.java.lang.Exception - if the node could not be obtained.void addSubRepositoryNode(AuthenticatedUser user, java.lang.String parentRdn, org.opendof.tools.repository.interfaces.da.SubRepositoryNode child) throws java.lang.Exception
user - the user. Maybe null for anonymous.parentRdn - the relative distinguished name (RDN) to the parent. May be null (depth 0 node).child - the node to be added to the given parent. Must not be null.org.opendof.tools.repository.interfaces.da.AlreadyExistsException - if the parent/child node already exists.org.opendof.tools.repository.interfaces.da.NotFoundException - given repoType/name is not known.java.lang.Exception - if the node could not be obtained.void deleteSubRepositoryNode(AuthenticatedUser user, java.lang.String parentRdn, org.opendof.tools.repository.interfaces.da.SubRepositoryNode node) throws java.lang.Exception
user - the user. Maybe null for anonymous.parentRdn - the rdn to the parent node holding the child to be deleted.node - the child information needed to delete the node.org.opendof.tools.repository.interfaces.da.AlreadyExistsException - if the parent/child node already exists.org.opendof.tools.repository.interfaces.da.NotFoundException - given repoType/name is not known.java.lang.Exception - if the node could not be obtained.void updateSubRepositoryNode(AuthenticatedUser user, java.lang.String rdn, org.opendof.tools.repository.interfaces.da.SubRepositoryNode node) throws java.lang.Exception
user - the user. Maybe null for anonymous.rdn - the rdn to update. Must not be null.node - the update data. Must not be null.org.opendof.tools.repository.interfaces.da.NotFoundException - given repoType/name is not known.java.lang.Exception - if the node could not be obtained.java.lang.String getURLIdentifier(java.lang.String standardInterfaceID)
standardInterfaceID - The URL interface identifier.java.lang.String getStandardIdentifier(java.lang.String urlInterfaceID)
urlInterfaceID - The standard interface identifier.boolean versionSupported()
java.util.List<java.lang.String> getTranslations()
XMLTranslator getTranslator(java.lang.String translation) throws java.lang.Exception
translation - The requested translation format.java.lang.Exception - if the translator could not be obtained.