Project

General

Profile

« Previous | Next » 

Revision 7815

refactor IndexEventLog a bit to simplify type/action information. prep for serializing IndexEvent objects to Metacat. https://projects.ecoinformatics.org/ecoinfo/issues/5944

View differences:

IndexEventFileLog.java
33 33

  
34 34
import org.apache.commons.io.FileUtils;
35 35
import org.dataone.configuration.Settings;
36
import org.dataone.service.types.v1.Event;
36 37
import org.dataone.service.types.v1.Identifier;
37 38

  
38 39

  
......
83 84
            Vector<String> lines = new Vector<String>();
84 85
            StringBuffer lineBuffer = new StringBuffer();
85 86
            lineBuffer.append("\""+index+"\""+FIELDSEPERATOR);
86
            int type = event.getType();
87
            lineBuffer.append("\""+type+"\""+FIELDSEPERATOR);
87
            Event type = event.getAction();
88
            lineBuffer.append("\"" + type.xmlValue() + "\"" + FIELDSEPERATOR);
88 89
            Date date = event.getDate();
89 90
            if(date != null) {
90 91
                DateFormat formate = new SimpleDateFormat();
91 92
                lineBuffer.append("\""+formate.format(date)+"\""+FIELDSEPERATOR);
92 93
            }
93
            Identifier id = event.getPid();
94
            Identifier id = event.getIdentifier();
94 95
            if(id != null) {
95 96
                lineBuffer.append("\""+id.getValue()+"\""+FIELDSEPERATOR);
96 97
            }
......
120 121
    
121 122
    /**
122 123
     * Gets the list of IndexEvent matching the specified set of filters. The filter parameters can be null
123
     * @param type  the type of the event
124
     * @param action  the action of the event
124 125
     * @param pid   the identifier of the data object in the event
125 126
     * @param start the start time of the time range for query
126 127
     * @param end   the end time of the time range for query
127 128
     * @return
128 129
     * @throws IndexEventLogException
129 130
     */
130
    public List<IndexEvent> getEvents(int type, Identifier pid, Date start, Date end) throws IndexEventLogException {
131
    public List<IndexEvent> getEvents(Event action, Identifier pid, Date start, Date end) throws IndexEventLogException {
131 132
        List<IndexEvent> list = null;
132 133
        return list;
133 134
    }
134 135
    
135
   
136
    /**
137
     * Get the list of identifiers which were failed to build the solr index since the 
138
     * previous timed indexing (including the ones in the timed indexing).
139
     * @return the list of failure identifiers. The null will be returned if no failure. 
140
     */
141
    public List<String> getFailedPids() throws IndexEventLogException {
142
        return null;
143
    }
144 136
    
145
    
146 137
    /**
147 138
     * Get the latest SystemMetadata modification Date of the objects that were built
148 139
     * the solr index during the previous timed indexing process.
......
182 173
    }
183 174
    
184 175
	@Override
185
	public void remove(String identifier) throws IndexEventLogException {
176
	public void remove(Identifier identifier) throws IndexEventLogException {
186 177
		// TODO Auto-generated method stub
187 178
		
188 179
	}

Also available in: Unified diff