1 package org.apache.maven.scm.provider.synergy.consumer; 2 3 /* 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 */ 21 22 import org.apache.maven.scm.log.ScmLogger; 23 import org.apache.maven.scm.util.AbstractConsumer; 24 25 /** 26 * @author <a href="julien.henry@capgemini.com">Julien Henry</a> 27 * 28 */ 29 public class SynergyCreateTaskConsumer 30 extends AbstractConsumer 31 { 32 33 private int task; 34 35 /** 36 * @return the entries 37 */ 38 public int getTask() 39 { 40 return task; 41 } 42 43 public SynergyCreateTaskConsumer( ScmLogger logger ) 44 { 45 super( logger ); 46 } 47 48 /** 49 * Task 70 created. <br/> The default task is set to: <br/> 70: Maven SCM 50 * Synergy provider: adding file(s) to project TestMaven~1 51 * 52 * {@inheritDoc} 53 */ 54 public void consumeLine( String line ) 55 { 56 if ( getLogger().isDebugEnabled() ) 57 { 58 getLogger().debug( "Consume: " + line ); 59 } 60 if ( line.startsWith( "Task " ) && line.indexOf( " created." ) > -1 ) 61 { 62 task = Integer.parseInt( line.substring( 5, line.indexOf( " created." ) ) ); 63 } 64 65 } 66 67 }