Skip to content
Snippets Groups Projects
Commit a4ffe21e authored by gwen-soleil's avatar gwen-soleil
Browse files

update command CreateNewContext argin description

parent 8846a921
Branches
No related tags found
No related merge requests found
...@@ -194,11 +194,13 @@ public final class SnapArchiver { ...@@ -194,11 +194,13 @@ public final class SnapArchiver {
* @param argin All the informations usefull to create a context ,Snapshot * @param argin All the informations usefull to create a context ,Snapshot
* pattern). * pattern).
*/ */
@Command(name = "CreateNewContext", inTypeDesc = "All the informations usefull to create a context ,Snapshot pattern)") @Command(name = "CreateNewContext", inTypeDesc = "argin[0] = author name, argin[1] = context name, argin[2] = id (Not used, set it to 0)\n" +
"argin[3] = creation date (yyyy-[m]m-[d]d), argin[4] = reason, argin[5] = description and, the list of" +
" attributes that are included in the context", outTypeDesc = "The new assigned context ID")
public void createNewContext(String[] argin) throws DevFailed { public void createNewContext(String[] argin) throws DevFailed {
logger.info("Entering CreateNewContext - {}", Arrays.toString(argin)); logger.info("Entering CreateNewContext - {}", Arrays.toString(argin));
SnapContext snapContext = new SnapContext(argin);
try { try {
SnapContext snapContext = new SnapContext(argin);
int contextID = SnapManagerApi.createContext(snapContext); int contextID = SnapManagerApi.createContext(snapContext);
logger.debug("Context with ID {} created", contextID); logger.debug("Context with ID {} created", contextID);
} catch (SnapshotingException e) { } catch (SnapshotingException e) {
......
...@@ -172,16 +172,20 @@ public class SnapManager { ...@@ -172,16 +172,20 @@ public class SnapManager {
* pattern). * pattern).
* @return The new assigned context ID * @return The new assigned context ID
*/ */
@Command(name = "CreateNewContext", inTypeDesc = "All the informations usefull to create a context ,Snapshot pattern)", outTypeDesc = "The new assigned context ID") @Command(name = "CreateNewContext", inTyp eDesc = "argin[0] = author name, argin[1] = context name, argin[2] = id (Not used, set it to 0)\n" +
"argin[3] = creation date (yyyy-[m]m-[d]d), argin[4] = reason, argin[5] = description and, the list of" +
" attributes that are included in the context", outTypeDesc = "The new assigned context ID")
public int createNewContext(String[] argin) throws DevFailed { public int createNewContext(String[] argin) throws DevFailed {
int argout; int argout=0;
logger.info("Entering createNewContext with {}", Arrays.toString(argin)); logger.info("Entering createNewContext with {}", Arrays.toString(argin));
SnapContext snapContext = new SnapContext(argin);
try { try {
SnapContext snapContext = new SnapContext(argin);
argout = SnapManagerApi.createContext(snapContext); argout = SnapManagerApi.createContext(snapContext);
} catch (SnapshotingException e) { } catch (SnapshotingException e) {
logger.error(e.toString(), e); logger.error(e.toString(), e);
throw e.toTangoException(); throw e.toTangoException();
}catch (Throwable e){
e.printStackTrace();
} }
logger.info("Context created is {}", argout); logger.info("Context created is {}", argout);
return argout; return argout;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment