Skip to content
Snippets Groups Projects
Commit c574a9fd authored by vkovtun's avatar vkovtun
Browse files

Merge branch 'master' into ssdm-13579-dss-widget

parents 7992f8ea 1ce95abb
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -39,6 +39,13 @@ import static ch.ethz.sis.afsserver.server.APIServerErrorType.MethodNotFound; ...@@ -39,6 +39,13 @@ import static ch.ethz.sis.afsserver.server.APIServerErrorType.MethodNotFound;
/* /*
* This class should be used as delegate by specific server transport classes * This class should be used as delegate by specific server transport classes
*
* The API Server allows the following modes of operation:
* | Mode | Authorization Keys | Description |
* |---------------------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
* | Non Interactive | sessionToken | Use cases: Standard mode of operation to develop command line applications and user interfaces. Batch call requests are executed on a single transaction. The system starts automatically every Batch call with a begin and ends it with a commit or rollback if exceptions happen. If the user tries to use transaction methods manually on a Batch call the server will reject the complete Batch call. |
* | Interactive | interactiveSessionKey | Use cases: Non-standard use cases that require to leave a transaction opened, attached to a particular sessionToken between Batch calls. The system will not execute the transaction control methods automatically, standard transaction methods begin and commit should be used manually. Rollback can be used manually but the server will still use it automatically if errors happen. |
* | Transaction Manager | transactionManagerKey | Use cases: Implementing a two phase transaction manager to execute transactions between two systems. Is meant to be used together in conjunction with Interactive mode. Allows the usage of the two phase transaction methods prepare and recover. |
*/ */
public class APIServer<CONNECTION, INPUT extends Request, OUTPUT extends Response, API> { public class APIServer<CONNECTION, INPUT extends Request, OUTPUT extends Response, API> {
......
...@@ -136,7 +136,7 @@ public abstract class PublicApiTest extends AbstractTest ...@@ -136,7 +136,7 @@ public abstract class PublicApiTest extends AbstractTest
@Test @Test
public void operation_state_begin_succeed() throws Exception { public void operation_state_begin_succeed() throws Exception {
UUID sessionToken = UUID.randomUUID(); UUID sessionToken = UUID.randomUUID();
PublicAPI publicAPI = getPublicAPI("1234", "5678"); PublicAPI publicAPI = getPublicAPI("1234", null);
publicAPI.begin(sessionToken); publicAPI.begin(sessionToken);
} }
...@@ -160,7 +160,7 @@ public abstract class PublicApiTest extends AbstractTest ...@@ -160,7 +160,7 @@ public abstract class PublicApiTest extends AbstractTest
@Test @Test
public void operation_state_commit_succeed() throws Exception { public void operation_state_commit_succeed() throws Exception {
UUID sessionToken = UUID.randomUUID(); UUID sessionToken = UUID.randomUUID();
PublicAPI publicAPI = getPublicAPI("1234", "5678"); PublicAPI publicAPI = getPublicAPI("1234", null);
publicAPI.begin(sessionToken); publicAPI.begin(sessionToken);
publicAPI.commit(); publicAPI.commit();
} }
...@@ -197,7 +197,7 @@ public abstract class PublicApiTest extends AbstractTest ...@@ -197,7 +197,7 @@ public abstract class PublicApiTest extends AbstractTest
@Test(expected = RuntimeException.class) @Test(expected = RuntimeException.class)
public void operation_state_begin_reuse_fails() throws Exception { public void operation_state_begin_reuse_fails() throws Exception {
UUID sessionToken = UUID.randomUUID(); UUID sessionToken = UUID.randomUUID();
PublicAPI publicAPI = getPublicAPI("1234", "5678"); PublicAPI publicAPI = getPublicAPI("1234", null);
publicAPI.begin(sessionToken); publicAPI.begin(sessionToken);
publicAPI.begin(sessionToken); publicAPI.begin(sessionToken);
} }
......
...@@ -125,6 +125,9 @@ def createPublicationSamples(parameters, sessionToken, v3): ...@@ -125,6 +125,9 @@ def createPublicationSamples(parameters, sessionToken, v3):
groupCodes = getGroupsForRelatedIdentifiers(parameters) groupCodes = getGroupsForRelatedIdentifiers(parameters)
if len(groupCodes) == 0:
groupCodes = ['GENERAL']
sampleCreations = [] sampleCreations = []
for groupCode in groupCodes: for groupCode in groupCodes:
sampleCreation = SampleCreation() sampleCreation = SampleCreation()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment