ServiceImpl.java revision 18
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// The MIT License
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// Copyright (c) 2004 Evren Sirin
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// Permission is hereby granted, free of charge, to any person obtaining a copy
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// of this software and associated documentation files (the "Software"), to
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// deal in the Software without restriction, including without limitation the
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// sell copies of the Software, and to permit persons to whom the Software is
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// furnished to do so, subject to the following conditions:
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// The above copyright notice and this permission notice shall be included in
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// all copies or substantial portions of the Software.
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
250b1eec71b074acdff1c5f6b5a1f0d7d2c20b77Stéphane Graber// IN THE SOFTWARE.
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberimport org.mindswap.owls.grounding.Grounding;
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graberpublic class ServiceImpl extends WrappedIndividual implements Service {
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber return (Process) getPropertyAs(OWLS.Service.describedBy, Process.class);
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber return (Profile) getPropertyAs(OWLS.Service.presents, Profile.class);
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber * @param process
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber if(hasProperty(OWLS.Service.describedBy, process))
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber setProperty(OWLS.Service.describedBy, process);
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber * @param profile
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber if(hasProperty(OWLS.Service.presents, profile))
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber setProperty(OWLS.Service.presents, profile);
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber /* (non-Javadoc)
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber * @see org.mindswap.owls.service.Service#getGrounding()
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber return (Grounding) getPropertyAs(OWLS.Service.supports, Grounding.class);
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber * @param grounding
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber public void setGrounding(Grounding grounding) {
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber if(hasProperty(OWLS.Service.supports, grounding))
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber setProperty(OWLS.Service.supports, grounding);
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber String str = "Service " + getLabel() + " " + getURI() + "\n";
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber str += "Profile " + getProfile().debugString() + "\n";
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber str += "Process " + getProcess().debugString() + "\n";
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber /* (non-Javadoc)
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber * @see org.mindswap.owls.service.Service#getName()
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber return profile == null ? null : profile.getServiceName();
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber /* (non-Javadoc)
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber * @see org.mindswap.owls.service.Service#getName(java.lang.String)
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber return profile == null ? null : profile.getServiceName(lang);
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber /* (non-Javadoc)
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber * @see org.mindswap.owls.service.Service#getNames()
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber return profile == null ? null : profile.getServiceNames();
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber public void removeGrounding(Grounding grounding) {
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber if (hasProperty(OWLS.Service.supports, grounding))
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber removeProperty(OWLS.Service.supports, grounding);
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber public void removeProcess() {
8128cf421081b683bca4610aa2db3e3ed851ab92KATOH Yasufumi if (hasProperty(OWLS.Service.presents, profile))
8128cf421081b683bca4610aa2db3e3ed851ab92KATOH Yasufumi removeProperty(OWLS.Service.presents, profile);
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber public void deleteGrounding(Grounding grounding) {
4019712d198a7d50b08b326ade17f5ff1666efbbStéphane Graber public void deleteProcess() {