Package com.abstratt.kirra
Class SchemaManagementSnapshot
- java.lang.Object
-
- com.abstratt.kirra.SchemaManagementSnapshot
-
- All Implemented Interfaces:
SchemaManagement
public class SchemaManagementSnapshot extends Object implements SchemaManagement
An implementation ofSchemaManagement
that is based on a schema snapshot. Can work on a pre-built schema or with the help of a schema builder.
-
-
Constructor Summary
Constructors Constructor Description SchemaManagementSnapshot(Schema schema)
SchemaManagementSnapshot(SchemaBuilder builder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Entity>
getAllEntities()
List<Service>
getAllServices()
List<TupleType>
getAllTupleTypes()
String
getApplicationLabel()
The human-friendly title of the application.String
getApplicationLogo()
The logo of the application, as a base64-encoded string.String
getApplicationName()
The name of the application.String
getBuild()
The current build of the application.List<Entity>
getEntities(String namespaceName)
Returns all entities in the namespace, or across all namespaces.Entity
getEntity(TypeRef typeRef)
Entity
getEntity(String namespaceName, String name)
Returns the entity with the given name.Collection<TypeRef>
getEntityNames()
List<Operation>
getEntityOperations(String namespaceName, String name)
Returns the operations available for the given entity type.List<Property>
getEntityProperties(String namespaceName, String name)
Returns the properties available for the given entity type.List<Relationship>
getEntityRelationships(String namespaceName, String name)
Returns the relationships available for the given entity type.Namespace
getNamespace(String namespaceName)
Returns the namespace with the given name.List<String>
getNamespaces()
Relationship
getOpposite(Relationship relationship)
Schema
getSchema()
Returns the entire schema at once.Service
getService(TypeRef typeRef)
Service
getService(String namespaceName, String name)
List<Service>
getServices(String namespaceName)
List<Entity>
getTopLevelEntities(String namespace)
TupleType
getTupleType(TypeRef typeRef)
TupleType
getTupleType(String namespaceName, String name)
List<TupleType>
getTupleTypes(String namespaceName)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.abstratt.kirra.SchemaManagement
getAllEntityRefs, getRoleEntities, getRoleEntities, getSubEntities
-
-
-
-
Constructor Detail
-
SchemaManagementSnapshot
public SchemaManagementSnapshot(Schema schema)
-
SchemaManagementSnapshot
public SchemaManagementSnapshot(SchemaBuilder builder)
-
-
Method Detail
-
getAllEntities
public List<Entity> getAllEntities()
- Specified by:
getAllEntities
in interfaceSchemaManagement
-
getAllServices
public List<Service> getAllServices()
- Specified by:
getAllServices
in interfaceSchemaManagement
-
getAllTupleTypes
public List<TupleType> getAllTupleTypes()
- Specified by:
getAllTupleTypes
in interfaceSchemaManagement
-
getApplicationName
public String getApplicationName()
Description copied from interface:SchemaManagement
The name of the application.- Specified by:
getApplicationName
in interfaceSchemaManagement
-
getApplicationLogo
public String getApplicationLogo()
Description copied from interface:SchemaManagement
The logo of the application, as a base64-encoded string.- Specified by:
getApplicationLogo
in interfaceSchemaManagement
-
getApplicationLabel
public String getApplicationLabel()
Description copied from interface:SchemaManagement
The human-friendly title of the application.- Specified by:
getApplicationLabel
in interfaceSchemaManagement
-
getBuild
public String getBuild()
Description copied from interface:SchemaManagement
The current build of the application.- Specified by:
getBuild
in interfaceSchemaManagement
-
getEntities
public List<Entity> getEntities(String namespaceName)
Description copied from interface:SchemaManagement
Returns all entities in the namespace, or across all namespaces.- Specified by:
getEntities
in interfaceSchemaManagement
- Parameters:
namespaceName
- the namespace, ornull
for all- Returns:
- the list of entities found
-
getEntity
public Entity getEntity(String namespaceName, String name)
Description copied from interface:SchemaManagement
Returns the entity with the given name. Returns null a corresponding class does not exist, or if it is not an entity.- Specified by:
getEntity
in interfaceSchemaManagement
- Returns:
- the corresponding entity, or
null
-
getEntity
public Entity getEntity(TypeRef typeRef)
- Specified by:
getEntity
in interfaceSchemaManagement
-
getEntityNames
public Collection<TypeRef> getEntityNames()
- Specified by:
getEntityNames
in interfaceSchemaManagement
-
getEntityOperations
public List<Operation> getEntityOperations(String namespaceName, String name)
Description copied from interface:SchemaManagement
Returns the operations available for the given entity type.- Specified by:
getEntityOperations
in interfaceSchemaManagement
-
getEntityProperties
public List<Property> getEntityProperties(String namespaceName, String name)
Description copied from interface:SchemaManagement
Returns the properties available for the given entity type.- Specified by:
getEntityProperties
in interfaceSchemaManagement
-
getEntityRelationships
public List<Relationship> getEntityRelationships(String namespaceName, String name)
Description copied from interface:SchemaManagement
Returns the relationships available for the given entity type.- Specified by:
getEntityRelationships
in interfaceSchemaManagement
-
getNamespace
public Namespace getNamespace(String namespaceName)
Description copied from interface:SchemaManagement
Returns the namespace with the given name.- Specified by:
getNamespace
in interfaceSchemaManagement
-
getNamespaces
public List<String> getNamespaces()
- Specified by:
getNamespaces
in interfaceSchemaManagement
-
getOpposite
public Relationship getOpposite(Relationship relationship)
- Specified by:
getOpposite
in interfaceSchemaManagement
-
getSchema
public Schema getSchema()
Description copied from interface:SchemaManagement
Returns the entire schema at once.- Specified by:
getSchema
in interfaceSchemaManagement
-
getService
public Service getService(String namespaceName, String name)
- Specified by:
getService
in interfaceSchemaManagement
-
getService
public Service getService(TypeRef typeRef)
- Specified by:
getService
in interfaceSchemaManagement
-
getServices
public List<Service> getServices(String namespaceName)
- Specified by:
getServices
in interfaceSchemaManagement
-
getTopLevelEntities
public List<Entity> getTopLevelEntities(String namespace)
- Specified by:
getTopLevelEntities
in interfaceSchemaManagement
-
getTupleType
public TupleType getTupleType(String namespaceName, String name)
- Specified by:
getTupleType
in interfaceSchemaManagement
-
getTupleType
public TupleType getTupleType(TypeRef typeRef)
- Specified by:
getTupleType
in interfaceSchemaManagement
-
getTupleTypes
public List<TupleType> getTupleTypes(String namespaceName)
- Specified by:
getTupleTypes
in interfaceSchemaManagement
-
-