id
stringlengths
7
14
text
stringlengths
1
106k
206418_44
public List<String> getDefaultJavaVersionInfo() throws InstallationException { try { Properties systemEnvVars = shellCommandHelper.getSystemEnvVars(); String javaHome = (String) systemEnvVars.get( "JAVA_HOME" ); // olamy : JAVA_HOME may not exist for mac users if ( StringUtil...
206418_45
public List<String> getJavaVersionInfo( Installation installation ) throws InstallationException { if ( installation == null ) { return getDefaultJavaVersionInfo(); } if ( StringUtils.isEmpty( installation.getVarValue() ) ) { return getDefaultJavaVersionInfo(); } try ...
206418_46
public Installation add( Installation installation ) throws InstallationException, AlreadyExistsInstallationException { try { return this.add( installation, false ); } catch ( AlreadyExistsProfileException e ) { // normally cannot happend here but anyway we throw the exception ...
206418_47
public Profile addProfile( Profile profile ) throws ProfileException, AlreadyExistsProfileException { // already exists check should be done in the same transaction // but we assume we don't have a huge load and a lot of concurrent access ;-) if ( alreadyExistsProfileName( profile ) ) { thro...
206418_48
public void deleteProfile( int profileId ) throws ProfileException { try { profileDao.removeProfile( getProfile( profileId ) ); } catch ( Exception e ) { throw new ProfileException( "Cannot remove the profile", e ); } }
206418_49
public List<Profile> getAllProfiles() throws ProfileException { return profileDao.getAllProfilesByName(); }
206418_50
public void updateProfile( Profile profile ) throws ProfileException, AlreadyExistsProfileException { // already exists check should be done in the same transaction // but we assume we don't have a huge load and a lot of concurrent access ;-) if ( alreadyExistsProfileName( profile ) ) { thro...
206418_51
public void setJdkInProfile( Profile profile, Installation jdk ) throws ProfileException { Profile stored = getProfile( profile.getId() ); stored.setJdk( jdk ); try { profileDao.updateProfile( stored ); } catch ( ContinuumStoreException e ) { throw new ProfileException( e...
206418_52
public void setBuilderInProfile( Profile profile, Installation builder ) throws ProfileException { Profile stored = getProfile( profile.getId() ); stored.setBuilder( builder ); try { profileDao.updateProfile( stored ); } catch ( ContinuumStoreException e ) { throw new Pro...
206418_53
public void addEnvVarInProfile( Profile profile, Installation envVar ) throws ProfileException { Profile stored = getProfile( profile.getId() ); stored.addEnvironmentVariable( envVar ); try { profileDao.updateProfile( stored ); } catch ( ContinuumStoreException e ) { thro...
206418_54
public static String throwableMessagesToString( Throwable error ) { if ( error == null ) { return ""; } StringBuffer buffer = new StringBuffer(); buffer.append( error.getMessage() ); error = error.getCause(); while ( error != null ) { buffer.append( EOL ); buffer....
206418_55
protected boolean shouldBuild( BuildContext context ) throws TaskExecutionException { BuildDefinition buildDefinition = context.getBuildDefinition(); if ( buildDefinition.isAlwaysBuild() ) { log.info( "AlwaysBuild configured, building" ); return true; } if ( context.getOldBuildRe...
206418_56
@SuppressWarnings( "unchecked" ) protected BuildContext initializeBuildContext( int projectId, int buildDefinitionId, BuildTrigger buildTrigger, ScmResult scmResult ) throws TaskExecutionException { BuildContext context = new BuildContext(); context.setStartTim...
206418_57
protected void executeAction( String actionName, Map<String, Object> context ) throws ContinuumException { try { Action action = actionManager.lookup( actionName ); action.execute( context ); } catch ( ActionNotFoundException e ) { e.printStackTrace(); throw new C...
206418_58
public void addTemplateInProject( int buildDefinitionTemplateId, Project project ) throws BuildDefinitionServiceException { try { BuildDefinitionTemplate template = getBuildDefinitionTemplate( buildDefinitionTemplateId ); if ( template.getBuildDefinitions().isEmpty() ) { ...
206418_59
public BuildDefinitionTemplate addBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate ) throws BuildDefinitionServiceException { try { if ( !hasDuplicateTemplateName( buildDefinitionTemplate ) ) { return buildDefinitionTemplateDao.addBuildDefinitionTemplate( ...
206418_60
public BuildDefinitionTemplate addBuildDefinitionTemplate( BuildDefinitionTemplate buildDefinitionTemplate ) throws BuildDefinitionServiceException { try { if ( !hasDuplicateTemplateName( buildDefinitionTemplate ) ) { return buildDefinitionTemplateDao.addBuildDefinitionTemplate( ...
206418_61
public boolean isBuildDefinitionInUse( BuildDefinition buildDefinition ) throws BuildDefinitionServiceException { boolean inUse = false; List<BuildDefinitionTemplate> buildDefinitionTemplates = getAllBuildDefinitionTemplate(); for ( BuildDefinitionTemplate template : buildDefinitionTemplates ) { ...
206418_62
public void execute( Map context ) throws Exception { Project project = projectDao.getProject( getProjectId( context ) ); List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context ); String projectScmRootUrl = getProjectScmRootUrl( context, project.getScmUrl() ); F...
206418_63
public void execute( Map context ) throws Exception { Project project = projectDao.getProject( getProjectId( context ) ); List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context ); String projectScmRootUrl = getProjectScmRootUrl( context, project.getScmUrl() ); F...
206418_64
public void execute( Map context ) throws Exception { Project project = projectDao.getProject( getProjectId( context ) ); List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context ); String projectScmRootUrl = getProjectScmRootUrl( context, project.getScmUrl() ); F...
206418_65
public String formatInterval( long start, long end ) { long diff = end - start; long interval = diff / 1000L; long hours = interval / 3600L; interval -= hours * 3600; long minutes = interval / 60; interval -= minutes * 60; long seconds = interval; if ( hours > 0 ) { return Lo...
206418_66
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password ) throws ContinuumProjectBuilderException { return buildProjectsFromMetadata( url, username, password, true, false ); }
206418_67
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password ) throws ContinuumProjectBuilderException { return buildProjectsFromMetadata( url, username, password, true, false ); }
206418_68
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password ) throws ContinuumProjectBuilderException { return buildProjectsFromMetadata( url, username, password, true, false ); }
206418_69
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password ) throws ContinuumProjectBuilderException { return buildProjectsFromMetadata( url, username, password, true, false ); }
206418_70
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password ) throws ContinuumProjectBuilderException { return buildProjectsFromMetadata( url, username, password, true, false ); }
206418_71
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password ) throws ContinuumProjectBuilderException { return buildProjectsFromMetadata( url, username, password, true, false ); }
206418_72
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password ) throws ContinuumProjectBuilderException { return buildProjectsFromMetadata( url, username, password, true, false ); }
206418_73
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password ) throws ContinuumProjectBuilderException { return buildProjectsFromMetadata( url, username, password, true, false ); }
206418_74
public ContinuumProjectBuildingResult buildProjectsFromMetadata( URL url, String username, String password ) throws ContinuumProjectBuilderException { return buildProjectsFromMetadata( url, username, password, true, false ); }
206418_75
protected File createMetadataFile( File importRoot, URL metadata, String username, String password, ContinuumProjectBuildingResult result ) throws IOException, URISyntaxException, HttpException { DefaultHttpClient httpClient = new DefaultHttpClient( cm, params ); String ur...
206418_76
public ContinuumBuildExecutor getBuildExecutor( String builderType ) throws ContinuumException { ContinuumBuildExecutor executor = executors.get( builderType ); if ( executor == null ) { throw new ContinuumException( "No such executor: '" + builderType + "'." ); } return executor; }
206418_77
public ContinuumBuildExecutor getBuildExecutor( String builderType ) throws ContinuumException { ContinuumBuildExecutor executor = executors.get( builderType ); if ( executor == null ) { throw new ContinuumException( "No such executor: '" + builderType + "'." ); } return executor; }
206418_78
public ContinuumBuildExecutor getBuildExecutor( String builderType ) throws ContinuumException { ContinuumBuildExecutor executor = executors.get( builderType ); if ( executor == null ) { throw new ContinuumException( "No such executor: '" + builderType + "'." ); } return executor; }
206418_79
public ContinuumBuildExecutor getBuildExecutor( String builderType ) throws ContinuumException { ContinuumBuildExecutor executor = executors.get( builderType ); if ( executor == null ) { throw new ContinuumException( "No such executor: '" + builderType + "'." ); } return executor; }
206418_80
@Override public boolean shouldBuild( List<ChangeSet> changes, Project continuumProject, File workingDirectory, BuildDefinition buildDefinition ) throws ContinuumBuildExecutorException { //Check if it's a recursive build boolean isRecursive = false; if ( StringUtils.isNotEmpt...
206418_81
@Override public boolean shouldBuild( List<ChangeSet> changes, Project continuumProject, File workingDirectory, BuildDefinition buildDefinition ) throws ContinuumBuildExecutorException { //Check if it's a recursive build boolean isRecursive = false; if ( StringUtils.isNotEmpt...
206418_82
@Override public boolean shouldBuild( List<ChangeSet> changes, Project continuumProject, File workingDirectory, BuildDefinition buildDefinition ) throws ContinuumBuildExecutorException { //Check if it's a recursive build boolean isRecursive = false; if ( StringUtils.isNotEmpt...
206418_83
public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition, ScmResult scmResult ) throws ContinuumBuildExecutorException { File projectXmlFile = null; if ( buildDefinition != null ) { String buildFile = St...
206418_84
public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition, ScmResult scmResult ) throws ContinuumBuildExecutorException { File projectXmlFile = null; if ( buildDefinition != null ) { String buildFile = St...
206418_85
public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition, ScmResult scmResult ) throws ContinuumBuildExecutorException { File projectXmlFile = null; if ( buildDefinition != null ) { String buildFile = St...
206418_86
public void updateProjectFromCheckOut( File workingDirectory, Project project, BuildDefinition buildDefinition, ScmResult scmResult ) throws ContinuumBuildExecutorException { File projectXmlFile = null; if ( buildDefinition != null ) { String buildFile = St...
206418_87
public void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, BuildTrigger buildTrigger, ScmResult scmResult, int projectGroupId ) throws BuildManagerException { try { if ( isInQueue( projectId, BUILD_QUEUE, -1 ) ) { log.w...
206418_88
public void buildProject( int projectId, BuildDefinition buildDefinition, String projectName, BuildTrigger buildTrigger, ScmResult scmResult, int projectGroupId ) throws BuildManagerException { try { if ( isInQueue( projectId, BUILD_QUEUE, -1 ) ) { log.w...
206418_89
public void removeProjectFromBuildQueue( int projectId ) throws BuildManagerException { try { OverallBuildQueue overallBuildQueue = getOverallBuildQueueWhereProjectIsQueued( projectId, BUILD_QUEUE ); if ( overallBuildQueue != null ) { overallBuildQueue.removeProjectFromBu...
206418_90
public void removeProjectsFromBuildQueue( int[] projectIds ) { for ( int projectId : projectIds ) { try { OverallBuildQueue overallBuildQueue = getOverallBuildQueueWhereProjectIsQueued( projectId, ...
206418_91
public void checkoutProject( int projectId, String projectName, File workingDirectory, String scmRootUrl, String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition, List<Project> subProjects ) throws BuildManagerException { try {...
206418_92
public void checkoutProject( int projectId, String projectName, File workingDirectory, String scmRootUrl, String scmUsername, String scmPassword, BuildDefinition defaultBuildDefinition, List<Project> subProjects ) throws BuildManagerException { try {...
206418_93
public void removeProjectFromCheckoutQueue( int projectId ) throws BuildManagerException { try { OverallBuildQueue overallBuildQueue = getOverallBuildQueueWhereProjectIsQueued( projectId, CHECKOUT_QUEUE ); if ( overallBuildQueue != null ) { overallBuildQueue.removeProject...
206418_94
public void removeProjectsFromCheckoutQueue( int[] projectIds ) { for ( int projectId : projectIds ) { try { OverallBuildQueue overallBuildQueue = getOverallBuildQueueWhereProjectIsQueued( projectId, ...
206418_95
public void removeProjectFromCheckoutQueue( int projectId ) throws BuildManagerException { try { OverallBuildQueue overallBuildQueue = getOverallBuildQueueWhereProjectIsQueued( projectId, CHECKOUT_QUEUE ); if ( overallBuildQueue != null ) { overallBuildQueue.removeProject...
206418_96
public void removeOverallBuildQueue( int overallBuildQueueId ) throws BuildManagerException { List<BuildProjectTask> tasks; List<CheckOutTask> checkoutTasks; List<PrepareBuildProjectsTask> prepareBuildTasks; synchronized ( overallBuildQueues ) { OverallBuildQueue overallBuildQueue = over...
206418_97
public void removeOverallBuildQueue( int overallBuildQueueId ) throws BuildManagerException { List<BuildProjectTask> tasks; List<CheckOutTask> checkoutTasks; List<PrepareBuildProjectsTask> prepareBuildTasks; synchronized ( overallBuildQueues ) { OverallBuildQueue overallBuildQueue = over...
206418_98
public Map<String, List<BuildProjectTask>> getProjectsInBuildQueues() throws BuildManagerException { synchronized ( overallBuildQueues ) { Map<String, List<BuildProjectTask>> queuedBuilds = new HashMap<String, List<BuildProjectTask>>(); Set<Integer> keySet = overallBuildQueues.keySet(); ...
206418_99
public Map<String, List<CheckOutTask>> getProjectsInCheckoutQueues() throws BuildManagerException { synchronized ( overallBuildQueues ) { Map<String, List<CheckOutTask>> queuedCheckouts = new HashMap<String, List<CheckOutTask>>(); Set<Integer> keySet = overallBuildQueues.keySet(); fo...
206437_10
public static List<Interceptor> createInterceptors( List<InterceptorBean> interceptorBeans ) throws LdapException { List<Interceptor> interceptors = new ArrayList<>( interceptorBeans.size() ); // First order the interceptorBeans Set<InterceptorBean> orderedInterceptorBeans = new TreeSet<>(); for ( Inter...
206437_11
@Override public void close() throws IOException { if ( IS_DEBUG ) { LOG_CURSOR.debug( "Closing EmptyIndexCursor {}", this ); } super.close(); }
206437_12
public IndexEntry<K, String> get() throws CursorException { checkNotClosed(); throw new InvalidCursorPositionException( I18n.err( I18n.ERR_703 ) ); }
206437_13
public void beforeFirst() throws LdapException, CursorException { checkNotClosed(); }
206437_14
public void afterLast() throws LdapException, CursorException { checkNotClosed(); }
206437_15
public boolean first() throws LdapException, CursorException { checkNotClosed(); return false; }
206437_16
public boolean last() throws LdapException, CursorException { checkNotClosed(); return false; }
206437_17
@Override public boolean next() throws LdapException, CursorException { checkNotClosed(); return false; }
206437_18
@Override public boolean previous() throws LdapException, CursorException { checkNotClosed(); return false; }
206437_19
@Override public void before( IndexEntry<K, String> element ) throws LdapException, CursorException { checkNotClosed(); }
206437_20
public void beforeValue( String id, K indexValue ) throws Exception { checkNotClosed(); }
206437_21
@Override public void after( IndexEntry<K, String> element ) throws LdapException, CursorException { checkNotClosed(); }
206437_22
public void afterValue( String id, K indexValue ) throws Exception { checkNotClosed(); }
206437_23
@Override public void close() throws IOException { if ( IS_DEBUG ) { LOG_CURSOR.debug( "Closing EmptyIndexCursor {}", this ); } super.close(); }
206437_24
@Override public int compareTo( ParentIdAndRdn that ) { // Special case when that.rdns = null : we are searching for oneLevel or subLevel scope if ( that.rdns == null ) { int val = parentId.compareTo( that.parentId ); if ( val != 0 ) { return val; } else ...
206437_25
public String getIndexName() { return indexName; }
206437_26
public String getIndexName() { return indexName; }
206437_27
public String getIndexName() { return indexName; }
206437_28
@Override public void close() throws IOException { if ( IS_DEBUG ) { LOG_CURSOR.debug( "Closing SingletonIndexCursor {}", this ); } super.close(); }
206437_29
public IndexEntry<V, String> get() throws CursorException { checkNotClosed(); if ( onSingleton ) { return singleton; } if ( beforeFirst ) { throw new InvalidCursorPositionException( I18n.err( I18n.ERR_705 ) ); } else { throw new InvalidCursorPositionException(...
206437_30
public IndexEntry<V, String> get() throws CursorException { checkNotClosed(); if ( onSingleton ) { return singleton; } if ( beforeFirst ) { throw new InvalidCursorPositionException( I18n.err( I18n.ERR_705 ) ); } else { throw new InvalidCursorPositionException(...
206437_31
@Override public void beforeFirst() throws LdapException, CursorException { checkNotClosed(); beforeFirst = true; afterLast = false; onSingleton = false; }
206437_32
@Override public void afterLast() throws LdapException, CursorException { checkNotClosed(); beforeFirst = false; afterLast = true; onSingleton = false; }
206437_33
@Override public boolean first() throws LdapException, CursorException { checkNotClosed(); beforeFirst = false; onSingleton = true; afterLast = false; return true; }
206437_34
@Override public boolean last() throws LdapException, CursorException { checkNotClosed(); beforeFirst = false; onSingleton = true; afterLast = false; return true; }
206437_35
@Override public boolean available() { return onSingleton; }
206437_36
@Override public boolean next() throws LdapException, CursorException { checkNotClosed(); if ( beforeFirst ) { beforeFirst = false; onSingleton = true; afterLast = false; return true; } if ( afterLast ) { return false; } // must be on the sing...
206437_37
@Override public boolean previous() throws LdapException, CursorException { checkNotClosed(); if ( beforeFirst ) { return false; } if ( afterLast ) { beforeFirst = false; onSingleton = true; afterLast = false; return true; } // must be on the singl...
206437_38
@Override public Cursor<Tuple<K, V>> cursor() { if ( !allowsDuplicates ) { return new AvlTreeMapNoDupsWrapperCursor<>( new AvlSingletonOrOrderedSetCursor<K, V>( avl ) ); } return new AvlTableDupsCursor<>( this ); }
206437_39
public void clear() { entry = null; tuple.setKey( null ); tuple.setValue( null ); }
206437_40
public void copy( IndexEntry<K, I> entry ) { this.entry = entry.getEntry(); tuple.setKey( entry.getKey() ); tuple.setValue( entry.getId() ); }
206437_41
public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "IndexEntry[ " ); buf.append( tuple.getKey() ); buf.append( ", " ); buf.append( tuple.getValue() ); buf.append( " ]" ); return buf.toString(); }
206437_42
public TgTicket getTgt( String principal, String password ) throws KerberosException { TgtRequest clientTgtReq = new TgtRequest(); clientTgtReq.setClientPrincipal( principal ); clientTgtReq.setPassword( password ); return getTgt( clientTgtReq ); }
206437_43
public TgTicket getTgt( String principal, String password ) throws KerberosException { TgtRequest clientTgtReq = new TgtRequest(); clientTgtReq.setClientPrincipal( principal ); clientTgtReq.setPassword( password ); return getTgt( clientTgtReq ); }
206437_44
public TgTicket getTgt( String principal, String password ) throws KerberosException { TgtRequest clientTgtReq = new TgtRequest(); clientTgtReq.setClientPrincipal( principal ); clientTgtReq.setPassword( password ); return getTgt( clientTgtReq ); }
206437_45
public ServiceTicket getServiceTicket( String clientPrincipal, String password, String serverPrincipal ) throws KerberosException { TgtRequest clientTgtReq = new TgtRequest(); clientTgtReq.setClientPrincipal( clientPrincipal ); clientTgtReq.setPassword( password ); TgTicket tgt = getTgt( clientTgtRe...
206437_46
public ChangePasswordResult changePassword( String clientPrincipal, String oldPassword, String newPassword ) throws ChangePasswordException { KerberosChannel channel = null; try { TgtRequest clientTgtReq = new TgtRequest(); clientTgtReq.setClientPrincipal( clientPrincipal ); clie...
206437_47
public void start( String instanceDirectory ) { InstanceLayout layout = new InstanceLayout( instanceDirectory ); // Creating ApacheDS service service = new ApacheDsService(); // Initializing the service try { LOG.info( "Starting the service." ); service.start( layout ); ...
206437_48
public void repair( String instanceDirectory ) { InstanceLayout layout = new InstanceLayout( instanceDirectory ); // Creating ApacheDS service service = new ApacheDsService(); try { System.out.println( "Starting the service." ); // must start servers otherwise stop() won't ...
206437_49
@Override public boolean equals( Object other ) { if ( other instanceof Tag ) { Tag ot = ( Tag ) other; if ( description != null && ot.getDescription() != null ) { return revision == ot.getRevision() && description.equals( ot.getDescription() ); } else if ( de...
206437_50
@Override public int hashCode() { int hash = 37; if ( description != null ) { hash = hash * 17 + description.hashCode(); } hash = hash * 17 + Long.valueOf( revision ).hashCode(); return hash; }
206437_51
@Override public int hashCode() { int hash = 37; if ( description != null ) { hash = hash * 17 + description.hashCode(); } hash = hash * 17 + Long.valueOf( revision ).hashCode(); return hash; }
206437_52
@Override public int hashCode() { int hash = 37; if ( description != null ) { hash = hash * 17 + description.hashCode(); } hash = hash * 17 + Long.valueOf( revision ).hashCode(); return hash; }
206437_53
@Override public boolean equals( Object other ) { if ( other instanceof Tag ) { Tag ot = ( Tag ) other; if ( description != null && ot.getDescription() != null ) { return revision == ot.getRevision() && description.equals( ot.getDescription() ); } else if ( de...