Class LocationManager
- java.lang.Object
-
- org.odpi.openmetadata.accessservices.digitalarchitecture.client.LocationManager
-
- All Implemented Interfaces:
ManageLocations
public class LocationManager extends Object implements ManageLocations
LocationManager provides the API operations to create and maintain location definitions.
-
-
Constructor Summary
Constructors Constructor Description LocationManager(String serverName, String serverPlatformURLRoot)Create a new client with no authentication embedded in the HTTP request.LocationManager(String serverName, String serverPlatformURLRoot, String userId, String password)Create a new client that passes userId and password in each HTTP request.LocationManager(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog)Create a new client that passes userId and password in each HTTP request.LocationManager(String serverName, String serverPlatformURLRoot, DigitalArchitectureRESTClient restClient, int maxPageSize, AuditLog auditLog)Create a new client that is going to be used in an OMAG Server (view service or integration service typically).LocationManager(String serverName, String serverPlatformURLRoot, AuditLog auditLog)Create a new client with no authentication embedded in the HTTP request and an audit log.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearAdjacentLocation(String userId, String locationOneGUID, String locationTwoGUID)Remove a peer-to-peer relationship between two locations.voidclearLocationAsDigital(String userId, String locationGUID)Remove the digital/cyber location designation from the location.voidclearLocationAsFixedPhysical(String userId, String locationGUID)Remove the fixed physical location designation from the location.voidclearLocationAsSecure(String userId, String locationGUID)Remove the secure location designation from the location.voidclearNestedLocation(String userId, String parentLocationGUID, String childLocationGUID)Remove a parent-child relationship between two locations.StringcreateLocation(String userId, LocationProperties locationProperties)Create a new metadata element to represent a location.StringcreateLocationFromTemplate(String userId, String templateGUID, TemplateProperties templateProperties)Create a new metadata element to represent a location using an existing metadata element as a template.List<LocationElement>findLocations(String userId, String searchString, int startFrom, int pageSize)Retrieve the list of location metadata elements that contain the search string.LocationElementgetLocationByGUID(String userId, String locationGUID)Retrieve the location metadata element with the supplied unique identifier.List<LocationElement>getLocationsByName(String userId, String name, int startFrom, int pageSize)Retrieve the list of location metadata elements with a matching qualified or display name.voidremoveLocation(String userId, String locationGUID)Remove the metadata element representing a location.voidsetLocationAsDigital(String userId, String locationGUID, String networkAddress)Classify the location to indicate that it represents a digital/cyber location.voidsetLocationAsFixedPhysical(String userId, String locationGUID, String coordinates, String mapProjection, String postalAddress, String timeZone)Classify the location to indicate that it represents a fixed physical location.voidsetLocationAsSecure(String userId, String locationGUID, String description, String level)Classify the location to indicate that it represents a secure location.voidsetupAdjacentLocation(String userId, String locationOneGUID, String locationTwoGUID)Create a peer-to-peer relationship between two locations.voidsetupNestedLocation(String userId, String parentLocationGUID, String childLocationGUID)Create a parent-child relationship between two locations.voidupdateLocation(String userId, boolean isMergeUpdate, String locationGUID, LocationProperties locationProperties)Update the metadata element representing a location.
-
-
-
Constructor Detail
-
LocationManager
public LocationManager(String serverName, String serverPlatformURLRoot, AuditLog auditLog) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request and an audit log.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversauditLog- logging destination- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
LocationManager
public LocationManager(String serverName, String serverPlatformURLRoot) throws InvalidParameterException
Create a new client with no authentication embedded in the HTTP request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST servers- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
LocationManager
public LocationManager(String serverName, String serverPlatformURLRoot, String userId, String password, AuditLog auditLog) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request. There is also an audit log destination.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requestsauditLog- logging destination- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
LocationManager
public LocationManager(String serverName, String serverPlatformURLRoot, String userId, String password) throws InvalidParameterException
Create a new client that passes userId and password in each HTTP request. This is the userId/password of the calling server. The end user's userId is sent on each request.- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversuserId- caller's userId embedded in all HTTP requestspassword- caller's userId embedded in all HTTP requests- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
LocationManager
public LocationManager(String serverName, String serverPlatformURLRoot, DigitalArchitectureRESTClient restClient, int maxPageSize, AuditLog auditLog) throws InvalidParameterException
Create a new client that is going to be used in an OMAG Server (view service or integration service typically).- Parameters:
serverName- name of the server to connect toserverPlatformURLRoot- the network address of the server running the OMAS REST serversrestClient- client that issues the REST API callsmaxPageSize- maximum number of results supported by this serverauditLog- logging destination- Throws:
InvalidParameterException- there is a problem creating the client-side components to issue any REST API calls.
-
-
Method Detail
-
createLocation
public String createLocation(String userId, LocationProperties locationProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a new metadata element to represent a location. Classifications can be added later to define the type of location.- Specified by:
createLocationin interfaceManageLocations- Parameters:
userId- calling userlocationProperties- properties to store- Returns:
- unique identifier of the new metadata element
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
createLocationFromTemplate
public String createLocationFromTemplate(String userId, String templateGUID, TemplateProperties templateProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a new metadata element to represent a location using an existing metadata element as a template. The template defines additional classifications and relationships that should be added to the new location.- Specified by:
createLocationFromTemplatein interfaceManageLocations- Parameters:
userId- calling usertemplateGUID- unique identifier of the metadata element to copytemplateProperties- properties that override the template- Returns:
- unique identifier of the new metadata element
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
updateLocation
public void updateLocation(String userId, boolean isMergeUpdate, String locationGUID, LocationProperties locationProperties) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Update the metadata element representing a location.- Specified by:
updateLocationin interfaceManageLocations- Parameters:
userId- calling userisMergeUpdate- should the new properties be merged with existing properties (true) or completely replace them (false)?locationGUID- unique identifier of the metadata element to updatelocationProperties- new properties for this element- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
setLocationAsFixedPhysical
public void setLocationAsFixedPhysical(String userId, String locationGUID, String coordinates, String mapProjection, String postalAddress, String timeZone) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Classify the location to indicate that it represents a fixed physical location.- Specified by:
setLocationAsFixedPhysicalin interfaceManageLocations- Parameters:
userId- calling userlocationGUID- unique identifier of the metadata element to classifycoordinates- position of the locationmapProjection- map projection used to define the coordinatespostalAddress- postal address of the location (if appropriate)timeZone- time zone for the location- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
clearLocationAsFixedPhysical
public void clearLocationAsFixedPhysical(String userId, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the fixed physical location designation from the location.- Specified by:
clearLocationAsFixedPhysicalin interfaceManageLocations- Parameters:
userId- calling userlocationGUID- unique identifier of the metadata element to unclassify- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
setLocationAsSecure
public void setLocationAsSecure(String userId, String locationGUID, String description, String level) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Classify the location to indicate that it represents a secure location.- Specified by:
setLocationAsSecurein interfaceManageLocations- Parameters:
userId- calling userlocationGUID- unique identifier of the metadata element to classifydescription- description of security at the sitelevel- level of security- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
clearLocationAsSecure
public void clearLocationAsSecure(String userId, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the secure location designation from the location.- Specified by:
clearLocationAsSecurein interfaceManageLocations- Parameters:
userId- calling userlocationGUID- unique identifier of the metadata element to unclassify- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
setLocationAsDigital
public void setLocationAsDigital(String userId, String locationGUID, String networkAddress) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Classify the location to indicate that it represents a digital/cyber location.- Specified by:
setLocationAsDigitalin interfaceManageLocations- Parameters:
userId- calling userlocationGUID- unique identifier of the metadata element to classifynetworkAddress- position of the location- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
clearLocationAsDigital
public void clearLocationAsDigital(String userId, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the digital/cyber location designation from the location.- Specified by:
clearLocationAsDigitalin interfaceManageLocations- Parameters:
userId- calling userlocationGUID- unique identifier of the metadata element to unclassify- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
removeLocation
public void removeLocation(String userId, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove the metadata element representing a location.- Specified by:
removeLocationin interfaceManageLocations- Parameters:
userId- calling userlocationGUID- unique identifier of the metadata element to remove- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
setupNestedLocation
public void setupNestedLocation(String userId, String parentLocationGUID, String childLocationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a parent-child relationship between two locations.- Specified by:
setupNestedLocationin interfaceManageLocations- Parameters:
userId- calling userparentLocationGUID- unique identifier of the location that is the broader locationchildLocationGUID- unique identifier of the location that is the smaller, nested location- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
clearNestedLocation
public void clearNestedLocation(String userId, String parentLocationGUID, String childLocationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove a parent-child relationship between two locations.- Specified by:
clearNestedLocationin interfaceManageLocations- Parameters:
userId- calling userparentLocationGUID- unique identifier of the location that is the broader locationchildLocationGUID- unique identifier of the location that is the smaller, nested location- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
setupAdjacentLocation
public void setupAdjacentLocation(String userId, String locationOneGUID, String locationTwoGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Create a peer-to-peer relationship between two locations.- Specified by:
setupAdjacentLocationin interfaceManageLocations- Parameters:
userId- calling userlocationOneGUID- unique identifier of the first locationlocationTwoGUID- unique identifier of the second location- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
clearAdjacentLocation
public void clearAdjacentLocation(String userId, String locationOneGUID, String locationTwoGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Remove a peer-to-peer relationship between two locations.- Specified by:
clearAdjacentLocationin interfaceManageLocations- Parameters:
userId- calling userlocationOneGUID- unique identifier of the first locationlocationTwoGUID- unique identifier of the second location- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
findLocations
public List<LocationElement> findLocations(String userId, String searchString, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the list of location metadata elements that contain the search string. The search string is treated as a regular expression.- Specified by:
findLocationsin interfaceManageLocations- Parameters:
userId- calling usersearchString- string to find in the propertiesstartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getLocationsByName
public List<LocationElement> getLocationsByName(String userId, String name, int startFrom, int pageSize) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the list of location metadata elements with a matching qualified or display name. There are no wildcards supported on this request.- Specified by:
getLocationsByNamein interfaceManageLocations- Parameters:
userId- calling username- name to search forstartFrom- paging start pointpageSize- maximum results that can be returned- Returns:
- list of matching metadata elements
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
getLocationByGUID
public LocationElement getLocationByGUID(String userId, String locationGUID) throws InvalidParameterException, UserNotAuthorizedException, PropertyServerException
Retrieve the location metadata element with the supplied unique identifier.- Specified by:
getLocationByGUIDin interfaceManageLocations- Parameters:
userId- calling userlocationGUID- unique identifier of the requested metadata element- Returns:
- matching metadata element
- Throws:
InvalidParameterException- one of the parameters is invalidUserNotAuthorizedException- the user is not authorized to issue this requestPropertyServerException- there is a problem reported in the open metadata server(s)
-
-