package Services;
import Framework.Array_Of_File;
import Framework.Constants;
import Framework.DirectoryFile;
import Framework.File;
import Framework.RuntimeProperties;
import Framework.ServiceObject;
import Framework.ServiceObjectContext;
import Framework.TextData;
import Services.interfaces.IBraService;
import entities.Array_Of_Bra;
import entities.Bra;
import java.io.Serializable;
/**
* BraService<p>
* <p>
* @author Generated from Forte
* @since 19-Nov-2008
*/
@RuntimeProperties(isDistributed=true, isAnchored=false, isShared=false, isTransactional=false)
@ServiceObject(name="BraShop", visibility=ServiceObject.Visibility.ENVIRONMENT, dialogDuration=ServiceObject.DialogDuration.MESSAGE, failover=false, loadBalanced=false)
@SuppressWarnings("serial")
public class BraService
implements Serializable, IBraService
{
// ------------
// Constructors
// ------------
public BraService() {
// Explicitly call the superclass constructor to prevent the implicit call
super();
}
/**
* A dummy constructor used to instantiate a "blank" object. This is used for anchored objects, Spring beans and their
* superclasses, but should not be expected to create a valid BraService.
*/
public BraService(ServiceObjectContext pContext) {
}
// -------
// Methods
// -------
/**
* getAll<p>
* <p>
* @return Array_Of_Bra<Bra>
*/
public Array_Of_Bra<Bra> getAll() {
Array_Of_Bra<Bra> list = new Array_Of_Bra<Bra>();
DirectoryFile d = new DirectoryFile();
Bra b = null;
d.setLocalName(new TextData("."));
Array_Of_File<File> qq_localVector = d.listFiles("*", "bra");
if (qq_localVector != null) {
for (File f : qq_localVector) {
f.open(Constants.SP_AM_READ, true);
b = (Bra)f.readSerialized();
f.close();
if (b != null) {
list.add(b);
}
}
}
return list;
}
/**
* getBra<p>
* <p>
* @param name Type: TextData
* @return Bra
*/
public Bra getBra(TextData name) {
File f = new File();
f.setLocalName(new TextData("."));
f.addToPath(name);
f.addSuffixToPath("bra");
f.open(Constants.SP_AM_READ, true);
Bra theBra = (Bra)f.readSerialized();
f.close();
return theBra;
}
/**
* putBra<p>
* <p>
* @param theBra Type: Bra
*/
public void putBra(Bra theBra) {
File f = new File();
f.setLocalName(new TextData("."));
f.addToPath(theBra.getName());
f.addSuffixToPath("bra");
f.open(Constants.SP_AM_WRITE, true);
f.writeSerialized(theBra);
f.close();
}
} // end class BraService
// c Pass 2 Conversion Time: 141 milliseconds