public class ServiceRepository
extends java.lang.Object
AutoServer getServiceMeta...
method. With appropriate passwords however, the
repository metadata can be retrieved and updated.
The retrieval process would also typically be password protected at the server level,
with this class stored on a server privately.Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.String,ServiceRepositoryInfo> |
serviceMeta
ArrayList of service details.
|
protected java.util.HashMap<java.lang.String,ServiceRepositoryInfo> |
serviceTypes
ArrayList of service types.
|
Constructor and Description |
---|
ServiceRepository()
Create a new instance of ServiceRepository.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addServiceMeta(java.lang.String adminKey,
ServiceMeta theServiceMeta)
Add new service details.
|
void |
clearServiceMetadata()
Clear all service metadata apart from the server itself.
|
void |
clearServiceMetadata(java.util.ArrayList<java.lang.String> serviceIDs)
Clear all service metadata for the specified services apart from the server itself.
|
java.util.ArrayList<java.lang.String> |
getServiceIDs()
Get a list of all of the service ids for the related metadata, of type String.
|
org.licas_xml.abs.Element |
getServiceMeta(java.lang.String serviceID)
Get the service details for the specified service.
|
org.licas_xml.abs.Element |
getServiceMeta(java.lang.String serviceID,
java.util.ArrayList<java.lang.String> toInclude,
ServiceMeta serviceObjMeta)
Retrieve just one part of the metadata, not the whole object.
|
ServiceMeta |
getServiceMeta(java.lang.String serviceID,
java.lang.String adminKey)
Get the service details for the specified service.
|
org.licas_xml.abs.Element |
getServiceMetaPart(java.lang.String serviceID,
java.lang.String toInclude,
ServiceMeta serviceObjMeta)
Retrieve just one part of the metadata, not the whole object.
|
java.util.ArrayList<java.lang.String> |
getServiceTypes()
Get an ordered list of all registered service types.
|
java.util.ArrayList<java.lang.String> |
getServiceTypes(java.lang.String category)
Get a list of all of the service types in the network for a
particular category.
|
boolean |
isStoredService(java.lang.String theServiceID)
Return true if the service id is stored for a loaded service.
|
boolean |
removeServiceMeta(java.lang.String serviceID,
java.lang.String adminKey)
Remove details about the specified service from the repository.
|
protected java.util.HashMap<java.lang.String,ServiceRepositoryInfo> serviceMeta
ServiceRepositoryInfo
objects describing the service.
The key can also be a service type, e.g. Message
or File
, if the metadata
description is a general one.protected java.util.HashMap<java.lang.String,ServiceRepositoryInfo> serviceTypes
ServiceRepositoryInfo
objects describing the service. If the
key is a service type instead, e.g. Message
or File
, the type will be removed
if the corresponding metadata object is removed.public ServiceRepository()
public boolean isStoredService(java.lang.String theServiceID)
theServiceID
- the unique service id.public void clearServiceMetadata()
public void clearServiceMetadata(java.util.ArrayList<java.lang.String> serviceIDs)
serviceIDs
- list of service IDs to remove metadata for.public java.util.ArrayList<java.lang.String> getServiceIDs()
public java.util.ArrayList<java.lang.String> getServiceTypes()
public java.util.ArrayList<java.lang.String> getServiceTypes(java.lang.String category)
category
- the category to return service types for.public org.licas_xml.abs.Element getServiceMeta(java.lang.String serviceID) throws java.lang.Exception
serviceID
- the unique id of the service.java.lang.Exception
- any error.public org.licas_xml.abs.Element getServiceMeta(java.lang.String serviceID, java.util.ArrayList<java.lang.String> toInclude, ServiceMeta serviceObjMeta) throws java.lang.Exception
serviceID
- the unique id of the service to retrieve.toInclude
- meta part to return.serviceObjMeta
- full description of the service's metadata to
retrieve from.java.lang.Exception
- any error.public org.licas_xml.abs.Element getServiceMetaPart(java.lang.String serviceID, java.lang.String toInclude, ServiceMeta serviceObjMeta) throws java.lang.Exception
serviceID
- the unique id of the service to retrieve.toInclude
- meta part to return.serviceObjMeta
- full description of the service's metadata to
retrieve from.java.lang.Exception
- any error.public ServiceMeta getServiceMeta(java.lang.String serviceID, java.lang.String adminKey)
serviceID
- the unique id of the service to retrieve.adminKey
- the unique admin key for the service.public boolean addServiceMeta(java.lang.String adminKey, ServiceMeta theServiceMeta)
adminKey
- the service key.theServiceMeta
- the service metadata.public boolean removeServiceMeta(java.lang.String serviceID, java.lang.String adminKey)
serviceID
- the unique id of the service to remove.adminKey
- the unique admin key for the service.