Package org.apache.uima.ducc.common.utils.id

Examples of org.apache.uima.ducc.common.utils.id.DuccId


  }
 
  public void copyTimeInit(IDuccProcess inventoryProcess, IDuccProcess process) {
    String methodName = "copyTimeInit";
    logger.trace(methodName, null, messages.fetch("enter"));
    DuccId processId = inventoryProcess.getDuccId();
    DuccId jobId = getJobId(processId);
    ITimeWindow twInit = inventoryProcess.getTimeWindowInit();
    if(twInit != null) {
      if(!compare(twInit,process.getTimeWindowInit())) {
        process.setTimeWindowInit(twInit);
        String millis;
View Full Code Here


 
  public void copyTimeRun(IDuccProcess inventoryProcess, IDuccProcess process) {
    String methodName = "copyTimeRun";
    logger.trace(methodName, null, messages.fetch("enter"));
    //validate(inventoryProcess);
    DuccId processId = inventoryProcess.getDuccId();
    DuccId jobId = getJobId(processId);
    ITimeWindow twRun = inventoryProcess.getTimeWindowRun();
    if(twRun != null) {
      if(!compare(twRun,process.getTimeWindowRun())) {
        process.setTimeWindowRun(twRun);
        String millis;
View Full Code Here

 
  public void setStatus(IDuccProcess inventoryProcess) {
    String methodName = "setStatus";
    logger.trace(methodName, null, messages.fetch("enter"));
    try {
      DuccId processId = inventoryProcess.getDuccId();
      logger.debug(methodName, null, processId, messages.fetchLabel("node")+inventoryProcess.getNodeIdentity().getName()+" "+messages.fetchLabel("PID")+inventoryProcess.getPID());
      long t0 = System.currentTimeMillis();
      synchronized(workMap) {
        if(processToJobMap.containsKey(processId)) {
          DuccId jobId = getJobId(processId);
          IDuccWork duccWork = workMap.findDuccWork(jobId);
          if(duccWork != null) {
            if(duccWork instanceof IDuccWorkExecutable) {
              IDuccWorkExecutable duccWorkExecutable = (IDuccWorkExecutable) duccWork;
              IDuccWorkJob job = null;
View Full Code Here

        }

        synchronized void putServiceByName(String n, ServiceSet s)
        {
            servicesByName.put(n, s);
            DuccId id = s.getId();
            if ( id != null ) {
                servicesByFriendly.put(id.getFriendly(), s);
            }
        }
View Full Code Here

        synchronized ServiceSet removeService(String n)
        {
            ServiceSet s = servicesByName.remove(n);
            if ( s != null ) {
                DuccId id = s.getId();
                if ( id != null ) {
                    servicesByFriendly.remove(id.getFriendly());
                }
            }
            return s;
        }
View Full Code Here

            // Ugly, but shouldn't have to be fatal
            logger.error(methodName, null, "Cannot restore DuccId for", d, "Friendly id:", friendly, "uuid:", uuid);
            continue;
          }
                   
                    DuccId id = new DuccId(friendly);
                    id.setUUID(UUID.fromString(uuid));
                    logger.debug(methodName, id, "Unique:", id.getUnique());
                   
                    try {
                        handler.register(id, props_filename, meta_filename, props, metaprops);
                    } catch (IllegalStateException e ) {                 // happens on duplicate service
                        logger.error(methodName, id, e.getMessage())// message has all I need.
View Full Code Here

        Trinary autostart = ev.getAutostart();
        String user = ev.getUser();       
       
        if ( ! validate_user("Register", ev) ) return;   // necessary messages emitted in here

        DuccId id = null;
        try {
            id = newId();
        } catch ( Exception e ) {
            logger.error(methodName, null, e);
            ev.setReply(new ServiceReplyEvent(false, "Internal error; unable to generate id", endpoint, -1));
            return;
        }
        logger.debug(methodName, id, "Unique:", id.getUnique());
                   
        String logdir = props.getProperty(UiOption.LogDirectory.pname());
        if ( !logdir.endsWith("/") ) {
            logdir = logdir + "/";
        }
        logdir = logdir + "S-" + id.toString();
        props.put(UiOption.LogDirectory.pname(), logdir);

        DuccProperties meta = new DuccProperties();
        meta.setProperty("user", user);
        meta.setProperty("instances", ""+instances);
        meta.setProperty("endpoint", endpoint);
        meta.setProperty("numeric_id", id.toString());
        meta.setProperty("uuid", id.getUnique());
        if ( autostart == Trinary.True ) {           
            meta.setProperty("autostart", "true");
        } else {
            meta.setProperty("autostart", "false");
        }
View Full Code Here

    Object idSync = new Object();
    public DuccId newId()
        throws Exception
    {
      DuccId id = null;
        synchronized(idSync) {
            id = idFactory.next();
            sm_props.setProperty(service_seqno, id.toString());
            FileOutputStream fos = new FileOutputStream(state_file);
            sm_props.store(fos, "Service Manager Properties");
            fos.close();
        }
        return id;
View Full Code Here

    mapDiff.put(id, pDiff);
  }
 
  public void put(IDuccWorkJob job) {
    if(job != null) {
      DuccId id = job.getDuccId();
      if(id != null) {
        PagingInfo pCurr = new PagingInfo(job);
        PagingInfo pPrev = mapData.get(id);
        if(pPrev == null) {
          update(id, pCurr, pCurr);
View Full Code Here

  }
 
  public boolean isPaging(IDuccWorkJob job) {
    boolean retVal = false;
    if(job != null) {
      DuccId duccId = job.getDuccId();
      retVal = isPaging(duccId);
    }
    return retVal;
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.ducc.common.utils.id.DuccId

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.