ORCentral

src/eu/coform/command/CreateNewUUIDCommand.java

Go to the documentation of this file.
00001 package eu.coform.command;
00002 
00003 import eu.coform.Error;
00004 import eu.coform.ORException;
00005 import eu.coform.UniqueID;
00006 import eu.coform.command.proto.Abstract;
00007 import eu.coform.database.DBException;
00008 import eu.coform.database.command.InsertUUIDDBCommand;
00009 
00013 public class CreateNewUUIDCommand implements Abstract {
00014 
00022    @Override
00023    public UniqueID execute() throws ORException {
00024       UniqueID id = UniqueID.randomUniqueID();
00025       InsertUUIDDBCommand com = new InsertUUIDDBCommand(id);
00026       try {
00027          com.exec();
00028          return id;
00029       } catch (DBException e) {
00030          // TODO check error code for correctness
00031          e.printStackTrace();
00032          throw new ORException(Error.UUIDClash);
00033       }
00034       
00035    }
00036 
00037 }
 All Classes Namespaces Files Functions Variables Enumerations