|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LoginInfoStore
An interface that represents the database of LoginInfo objects. Provides methods to access and mutate the store. The general contract of store update comprises of the following:
Method Summary | |
---|---|
boolean |
exists(String host,
int port)
Checks whether a LoginInfo for given host and port exists in this store. |
String |
getName()
Returns the name of the store. |
Collection<LoginInfo> |
list()
A convenience method that returns the Collection of LoginInfo instances stored in this store. |
LoginInfo |
read(String host,
int port)
Returns a LoginInfo corresponding to the given host and port, from this store. |
void |
remove(String host,
int port)
Removes the LoginInfo corresponding to the given host and port, from this store. |
int |
size()
A convenience method that returns the number of LoginInfo instances stored in this store. |
void |
store(LoginInfo login)
Stores the given LoginInfo in this store. |
void |
store(LoginInfo login,
boolean overwrite)
Stores the given LoginInfo in this store. |
Method Detail |
---|
LoginInfo read(String host, int port) throws StoreException
LoginInfo
corresponding to the given host and port, from this store.
The host may not be null. For a given host and port, there can be at most
one LoginInfo in this store.
host
- a non null String representing host nameport
- an integer specifying the port number
StoreException
- if there is something wrong with reading the store
IllegalArgumentException
- if the parameter host is nullvoid remove(String host, int port) throws StoreException
LoginInfo
corresponding to the given host and port, from this store.
The host may not be null. If no such LoginInfo exists, StoreException results.
The caller thus must ensure if such a LoginInfo exists before calling this method.
Upon successful return, size of this store decreases by one.
host
- a non null String representing host nameport
- an integer specifying the port number
StoreException
- if there is something wrong with reading the store or if there is
no such LoginInfo
IllegalArgumentException
- if the parameter host is nullvoid store(LoginInfo login) throws StoreException
login
- a LoginInfo that needs to be stored
StoreException
- if there's any problem or if there is already a LoginInfo
with given host and port
IllegalArgumentException
- if the given LoginInfo is nullvoid store(LoginInfo login, boolean overwrite) throws StoreException
login
- a LoginInfo that needs to be stored
StoreException
- if there's any problem in storing or if overwrite is false and
the LoginInfo with given host and port already exists
IllegalArgumentException
- if the given LoginInfo is nullboolean exists(String host, int port) throws StoreException
host
- a non null String representing host nameport
- an integer specifying the port number
StoreException
- if there's any problem reading the storeCollection<LoginInfo> list() throws StoreException
StoreException
- if there's any problem reading the storeint size() throws StoreException
StoreException
- if there's any problem reading the storeString getName()
|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2006 Sun Microsystems, Inc. All rights reserved.