Last active
August 29, 2015 14:18
-
-
Save Nava2/4f1172d647437a1cf5ca to your computer and use it in GitHub Desktop.
Umpr Repository Tutorial
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
/** | |
* | |
*/ | |
package cruise.umple.umpr.core.repositories; | |
import java.util.ArrayList; | |
import java.util.stream.Stream; | |
import com.google.inject.Inject; | |
import cruise.umple.umpr.core.DiagramType; | |
import cruise.umple.umpr.core.Repository; | |
import cruise.umple.umpr.core.entities.ImportEntity; | |
import cruise.umple.umpr.core.entities.ImportEntityFactory; | |
import cruise.umple.umpr.core.util.Networks; | |
/** | |
* @author kevin | |
* | |
*/ | |
class ISO20022EcoreRepository implements Repository { | |
private static final String URL = "https://gist.github.com/Nava2/4ca3335224d51c185c0b"; | |
//Creates ImportEntity instances | |
private final ImportEntityFactory factory; | |
@Inject | |
ISO20022EcoreRepository(ImportEntityFactory importEntityFactory) { | |
this.factory = importEntityFactory; | |
} | |
/* (non-Javadoc) | |
* @see cruise.umple.umpr.core.Repository#getName() | |
*/ | |
@Override | |
public String getName() { | |
return "ISO20022"; | |
} | |
/* (non-Javadoc) | |
* @see cruise.umple.umpr.core.Repository#getDescription() | |
*/ | |
@Override | |
public String getDescription() { | |
return "ISO20022 ECore model from http://www.iso20022.org/e_dictionary.page, " | |
+ "stored statically at: " + URL; | |
} | |
/* (non-Javadoc) | |
* @see cruise.umple.umpr.core.Repository#getDiagramType() | |
*/ | |
@Override | |
public DiagramType getDiagramType() { | |
return DiagramType.CLASS; | |
} | |
/* (non-Javadoc) | |
* @see cruise.umple.umpr.core.Repository#getImports() | |
*/ | |
@Override | |
public Stream<ImportEntity> getImports() { | |
return null; | |
} | |
/* (non-Javadoc) | |
* @see cruise.umple.umpr.core.Repository#isAccessible() | |
*/ | |
@Override | |
public boolean isAccessible() { | |
return Networks.ping(URL, 200); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment