Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.apache.marmotta.platform.core.api.task;
public abstract class TaskInfo {
    protected final long                started;
    protected final String              uuid;
    protected long                      lastUpdate;
    protected String                    name;
    protected String                    group;
    protected String                    message;
    protected long                      progress   = 0;
    protected long                      totalSteps = 0;
    protected final Map<StringStringdetailMessages;
    public Date getStarted() {
        return new Date();
    }
    public Date getLastUpdate() {
        return new Date();
    }
    public Date getETA() {
        if ( > 0 &&  > 0) {
            long now = System.currentTimeMillis();
            long end = now +  * (now - ) / ;
            return new Date(end);
        }
        return null;
    }
    public String getName() {
        return ;
    }
    public String getGroup() {
        return ;
    }
    public String getMessage() {
        return ;
    }
    public long getProgress() {
        return ;
    }
    public long getTotalSteps() {
        return ;
    }
    public Map<StringStringgetDetailMessages() {
        return Collections.unmodifiableMap();
    }
    protected TaskInfo(String uuid) {
        this. = uuid;
        this. = new LinkedHashMap<StringString>();
        this. = this. = System.currentTimeMillis();
    }
    @Deprecated
    @JsonIgnore
    public String printStatus() {
        if ( > 0) return String.format("%s: %s [%d/%d] (%tF %<tT)");
        if ( > 0) return String.format("%s: %s [%d] (%tF %<tT)");
        return String.format("%s: %s (%tF %<tT)");
    }
New to GrepCode? Check out our FAQ X