public void setSynchronized(boolean state){ setProperty(SYNCHRONIZED, Boolean.toString(state)); } public String getArchive(){
public void setSynchronized(boolean state){ setProperty(SYNCHRONIZED, Boolean.toString(state)); } public String getArchive(){
public void setIndexName(String name){ if(name == null || name.isEmpty()){ throw new IllegalArgumentException("The Index-Name MUST NOT be NULL nor empty"); } setProperty(INDEX_NAME, name); } public String getServerName(){
public void setServerName(String name){ if(name == null || name.isEmpty()){ throw new IllegalArgumentException("The Server-Name MUST NOT be NULL nor empty"); } setProperty(SERVER_NAME, name); } public String getDirectory(){
public void setIndexName(String name){ if(name == null || name.isEmpty()){ throw new IllegalArgumentException("The Index-Name MUST NOT be NULL nor empty"); } setProperty(INDEX_NAME, name); } public String getServerName(){
public void setServerName(String name){ if(name == null || name.isEmpty()){ throw new IllegalArgumentException("The Server-Name MUST NOT be NULL nor empty"); } setProperty(SERVER_NAME, name); } public String getDirectory(){
public void setIndexArchives(List<String> archives){ StringBuilder value = new StringBuilder(); boolean first = true; for(String archive:archives){ if(archive != null && archive != null){ if(!first){ value.append(','); } else { first = false; } value.append(archive); } } setProperty(INDEX_ARCHIVES, value.toString()); } public boolean isSynchronized(){
public void setIndexArchives(List<String> archives){ StringBuilder value = new StringBuilder(); boolean first = true; for(String archive:archives){ if(archive != null){ if(!first){ value.append(','); } else { first = false; } value.append(archive); } } setProperty(INDEX_ARCHIVES, value.toString()); } public boolean isSynchronized(){
public void setArchive(String archive){ if(archive == null){ remove(ARCHIVE); } else if (archive.isEmpty()){ throw new IllegalArgumentException("The parsed archive MUST NOT be empty!"); } else { setProperty(ARCHIVE, archive); } } public String getIndexName(){
public void setArchive(String archive){ if(archive == null){ remove(ARCHIVE); } else if (archive.isEmpty()){ throw new IllegalArgumentException("The parsed archive MUST NOT be empty!"); } else { setProperty(ARCHIVE, archive); } } public String getIndexName(){
public void setDirectory(String directory){ if(directory == null){ remove(DIRECTORY); } else if (directory.isEmpty()){ throw new IllegalArgumentException("The parsed directory MUST NOT be empty!"); } else { setProperty(DIRECTORY, directory); } } public ManagedIndexState getState(){
public void setDirectory(String directory){ if(directory == null){ remove(DIRECTORY); } else if (directory.isEmpty()){ throw new IllegalArgumentException("The parsed directory MUST NOT be empty!"); } else { setProperty(DIRECTORY, directory); } } public ManagedIndexState getState(){
public void setState(ManagedIndexState state){ if(state == null){ throw new IllegalArgumentException("The parsed ManagedIndexState MUST NOT be NULL!"); } setProperty(STATE, state.name()); if(state != ManagedIndexState.ERROR){ remove(STACK_TRACE); } } /**
/** * Sets the {@link #getState()} to {@link ManagedIndexState#ERROR} and also * stores the stack trace of the parsed {@link Exception} to {@link #STACK_TRACE}. * @param e The Exception or <code>null</code> it none */ public void setError(Exception e) { setState(ManagedIndexState.ERROR); if(e != null){ ByteArrayOutputStream out = new ByteArrayOutputStream(); PrintWriter writer = new PrintWriter(out); //writer.append(e.getMessage()); //writer.append('\n'); e.printStackTrace(writer); writer.close(); //close and flush the writer setProperty(STACK_TRACE, out.toString()); IOUtils.closeQuietly(writer); out = null; } } /**
/** * Sets the {@link #getState()} to {@link ManagedIndexState#ERROR} and also * stores the stack trace of the parsed {@link Exception} to {@link #STACK_TRACE}. * @param e The Exception or <code>null</code> it none */ public void setError(Exception e) { setState(ManagedIndexState.ERROR); if(e != null){ ByteArrayOutputStream out = new ByteArrayOutputStream(); PrintWriter writer = new PrintWriter(out); //writer.append(e.getMessage()); //writer.append('\n'); e.printStackTrace(writer); writer.close(); //close and flush the writer setProperty(STACK_TRACE, out.toString()); IOUtils.closeQuietly(writer); out = null; } } /**
public void setState(ManagedIndexState state){ if(state == null){ throw new IllegalArgumentException("The parsed ManagedIndexState MUST NOT be NULL!"); } setProperty(STATE, state.name()); if(state != ManagedIndexState.ERROR){ remove(STACK_TRACE); } } /**