ServiceDescriptor.java revision b87033953be26b0dc7dead8febd499b666a54126
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: ServiceDescriptor.java,v 1.1 2008/11/22 02:19:54 ak138937 Exp $
*
*/
/*
* Portions Copyrighted [2011] [ForgeRock AS]
*/
/**
* This class is the in-memory representation of service descriptor.
* (service.xml)
*/
public class ServiceDescriptor {
private URL serviceHome;
private URL manifestUrl;
public ServiceDescriptor() {
}
/**
* Create a new instance of <code>ServiceDescriptor</code> with
* service home, service URL and handle to service metadata.
*
* @param loc the loction of the service
* @param manifest the url of the service descriptor file
* @param s the service data object
*/
public ServiceDescriptor(
) {
serviceHome = loc;
serviceType = s;
}
/**
* Returns the path to service home.
*
* @return path to service home.
*/
public URL getServiceHome() {
return serviceHome;
}
/**
* Returns the service descriptor (service.xml) URL.
*
* @return URL representing the service descriptor file.
*/
public URL getServiceManifestURL() {
return manifestUrl;
}
/**
* Returns the service id of this descriptor.
*
* @return id of this service descriptor.
*/
return serviceType.getId();
}
/**
* Returns the class name represents this service.
*
* @return name of the class representing this service.
*/
public String getServiceClassName() {
return serviceType.getClazz();
}
/**
* Returns the name of the service.
*
* @return name of this service.
*/
public String getServiceName(){
return serviceType.getName();
}
/**
* Returns the type of this service. Either 'core'
* or 'application'.
*
* @return type of this service.
*/
public String getServiceType() {
}
/**
* Returns true if its core service, false otherwise.
*
* @return true if core service, false otherwise.
*/
public boolean isCoreService() {
return true;
}
return false;
}
/**
* Returns all the categories appplicable for this service.
*
* @return list of categories for this service.
*/
}
/**
* Returns the list of categories appplicable for this service.
*
* @return list of categories for this service.
*/
for (CategoryType c: categories) {
}
return result;
}
/**
* Returns the operation of the service for the given category.
*
* @param category for which the operation is to be found.
* @return operation of this service for the given category.
*/
for (CategoryType c: categories) {
return c.getOperation();
}
}
return null;
}
/**
* Returns the name of the service for the given category.
*
* @param category category for which the service name is requested.
* @return name of the service for the given category.
*/
for (CategoryType c: categories) {
return c.getName();
}
}
return null;
}
/**
* Returns whether this service is to be loaded on application
* start up.
* true if needs to be loaded on application start-up, false
* otherwise.
*
* @return true if this needs to be loaded on application start-up,
* false otherwise.
*/
public boolean isLoadOnStartup() {
return true;
}
return false;
}
/**
* Returns a list of libraries for this service.
*
* @return list of libraries for this service.
*/
for (LibraryType l: libs) {
}
return result;
}
/**
* Returns a list of resources for this service.
*
* @return list of resources for this service.
*/
for (ResourceType r : resources) {
}
return result;
}
}