Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a new data migration layer - when importing data from an older …
…version of apiman, we now first migrate the data to the newest data model
- Loading branch information
1 parent
a33125e
commit 0026ff4
Showing
78 changed files
with
9,910 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
105 changes: 105 additions & 0 deletions
105
manager/api/core/src/main/java/io/apiman/manager/api/core/logging/StringBuilderLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
/* | ||
* Copyright 2016 JBoss Inc | ||
* | ||
* Licensed 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 io.apiman.manager.api.core.logging; | ||
|
||
/** | ||
* Logs to a string builder. | ||
* @author eric.wittmann@gmail.com | ||
*/ | ||
@SuppressWarnings("nls") | ||
public class StringBuilderLogger implements IApimanLogger { | ||
|
||
private StringBuilder builder = new StringBuilder(); | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
public StringBuilderLogger() { | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#info(java.lang.String) | ||
*/ | ||
@Override | ||
public void info(String message) { | ||
append("INFO: " + message); | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#warn(java.lang.String) | ||
*/ | ||
@Override | ||
public void warn(String message) { | ||
append("WARN: " + message); | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#debug(java.lang.String) | ||
*/ | ||
@Override | ||
public void debug(String message) { | ||
append("DEBUG: " + message); | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#trace(java.lang.String) | ||
*/ | ||
@Override | ||
public void trace(String message) { | ||
append("TRACE: " + message); | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#error(java.lang.Throwable) | ||
*/ | ||
@Override | ||
public void error(Throwable error) { | ||
append("ERROR: " + error.getMessage()); | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#error(java.lang.String, java.lang.Throwable) | ||
*/ | ||
@Override | ||
public void error(String message, Throwable error) { | ||
append("ERROR: " + message); | ||
} | ||
|
||
/** | ||
* Append to the builder. | ||
* @param message | ||
*/ | ||
private void append(String message) { | ||
builder.append(message); | ||
builder.append("\n"); | ||
} | ||
|
||
/** | ||
* @return the log data | ||
*/ | ||
public String string() { | ||
return builder.toString(); | ||
} | ||
|
||
/** | ||
* Reset the builder to empty. | ||
*/ | ||
public void reset() { | ||
builder = new StringBuilder(); | ||
} | ||
|
||
} |
80 changes: 80 additions & 0 deletions
80
manager/api/core/src/main/java/io/apiman/manager/api/core/logging/SystemOutLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright 2016 JBoss Inc | ||
* | ||
* Licensed 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 io.apiman.manager.api.core.logging; | ||
|
||
/** | ||
* @author eric.wittmann@gmail.com | ||
*/ | ||
public class SystemOutLogger implements IApimanLogger { | ||
|
||
/** | ||
* Constructor. | ||
*/ | ||
public SystemOutLogger() { | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#info(java.lang.String) | ||
*/ | ||
@Override | ||
public void info(String message) { | ||
System.out.println("INFO: " + message); //$NON-NLS-1$ | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#warn(java.lang.String) | ||
*/ | ||
@Override | ||
public void warn(String message) { | ||
System.out.println("WARN: " + message); //$NON-NLS-1$ | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#debug(java.lang.String) | ||
*/ | ||
@Override | ||
public void debug(String message) { | ||
System.out.println("DEBUG: " + message); //$NON-NLS-1$ | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#trace(java.lang.String) | ||
*/ | ||
@Override | ||
public void trace(String message) { | ||
System.out.println("TRACE: " + message); //$NON-NLS-1$ | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#error(java.lang.Throwable) | ||
*/ | ||
@Override | ||
public void error(Throwable error) { | ||
System.out.println("** ERROR **"); //$NON-NLS-1$ | ||
error.printStackTrace(); | ||
} | ||
|
||
/** | ||
* @see io.apiman.manager.api.core.logging.IApimanLogger#error(java.lang.String, java.lang.Throwable) | ||
*/ | ||
@Override | ||
public void error(String message, Throwable error) { | ||
System.out.println("** ERROR: " + message + " **"); //$NON-NLS-1$ //$NON-NLS-2$ | ||
error.printStackTrace(); | ||
} | ||
|
||
} |
Oops, something went wrong.